#ESD helper app
#python 3.6
lang = ""
def language():
    global lang
    lang = input("language? f or e : ")
    #return lang
    print("language = " + str(lang))
language()

agent = ""
def agentName():
    global lang
    if lang == "f":
        agentName = input("Nom de l'agent? : ")
        print("Bonjour " + str(agentName.capitalize()) + "!")
    else:
        agentName = input("Name of Agent? : ")
        print("Hi " + str(agentName.capitalize()) + "!")
agentName()


#Default values
agent = "Luc T"
reftik = "IR 03899999"
#Default values Service Request
srD = ""
who4l = ""
who4f = ""
who4d = ""
who4t = ""
who4e = ""
who4id = ""
#Default values Incident
inD = ""
out = ""
s = ""
nua = ""
asac = ""
ioos = ""
bi = ""
err = ""
#Default TC
tcuid = ""
tci = ""
#Default values Reporter
rl = ""
rf = ""
rt = ""
rd = ""
re = ""
peo = ""
#Default values End User
eud = ""
eul = ""
euf = ""
eut = ""
euid = ""
eue = ""


class Esd:
    def fork(self):
        global lang, inD
        pfork = ''
        while pfork != "os" and "sel"  and "r" and "eu" and "qi" and "dr" and "deu" and "dsr" and "din" and "da" and "cs" and "end" and "tc" and "az" and "telus" and "bell" and "pw" and "mobi" and "sr" and "in" and "up"  and "dtci" and "prompt" and "lang":
            if lang == "f":
                pfork = input("Qu'est-ce qu'on fait " + str(agentName.capitalize()) + "?:")
            else:
                pfork = input("What are we doing " + str(agentName.capitalize()) + "?:")
            if pfork == "os":
                e.openScript()
                e.fork()
            elif pfork == "sel":
                e.callTypeSelection()
                e.fork()
            elif pfork == "r":
                e.reporterQuestions()
                e.fork()
            elif pfork == "sr":
                e.serviceRequestQuestions()
                e.fork()
            elif pfork == "in":
                e.incidentQuestions()
                e.fork()
            elif pfork == "up":
                e.callReqUpdate()
                e.fork()
            elif pfork == "pw":
                e.callPw()
                e.fork()
            elif pfork == "mobi":
                e.callMobi()
                e.fork()
            elif pfork == "tc":
                e.tcReporterQuestions()
            elif pfork == "az":
                e.callFromAllstreamZayo()
                e.fork()
            elif pfork == "telus":
                e.callFromTelus()
                e.fork()
            elif pfork == "bell":
                e.callFromBell()
                e.fork()
            elif pfork == "eu":
                e.endUserQuestions()
                e.fork()
            elif pfork == "qi":
                e.incidentQuestions()
                e.fork()
            elif pfork == "dr":
                e.displayReporter()
                e.fork()
            elif pfork == "dtci":
                e.displayTci()
                e.fork()
            elif pfork == "deu":
                e.displayEndUser()
                e.fork()
            elif pfork == "dsr":
                e.displayReporter()
                e.displayServiceRequest()
                e.fork()
            elif pfork == "din":
                e.displayIncident()
                e.fork()
            elif pfork == "da":
                e.displayAll()
                e.fork()
            elif pfork == "cs":
                e.closeScript()
                e.fork()
            elif pfork == "prompt":
                prompt()
            elif pfork == "end":
                e.stop()
            elif pfork == "cl":
                language()
    def openScript(self):
        global lang, rl, rf, rt, rd, re, peo, t
        if lang == "f":
            print("Bonjour, Merci d'appeler le Bureau de Soutien Technique (d'Entreprise).\nMon nom est " + str(agent) + ".\nPuis-je commencer avec votre Nom (de famille) svp?\n")
            e.reporterQuestions()
        else:
            print("Hi, Thank you for calling the (Enterprise) Service Desk.\nMy name is " + str(agent) + ".\nMay I start with your last name please?\n")
            e.reporterQuestions()
    def reporterQuestions(self):
        global lang, rl, rf, rt, rd, re, peo, t, agentSelection
        if lang == "f":
            print("##################################################\nNous surnommons la personne qui appelle comme étant 'l'AVISEUR'\n##################################################")
            rl = input("Nom (Famille)?: ")
            if rl == "esc":
                e.fork()
            rf = input("Prénom?: ")
            rt = input("Un numéro de téléphone pour vous joindre\n(ou en cas que la connection soit interrompue,\nNous allons pouvoir vous rappeller à ce numéro)?: ")
            rd = input("Quel est votre ministère?: ")
            re = input("Un courriel pour vous joindre?: ")
            peo = input("Appelez-vous d'un bureau de soutien technique (PSD or EU ou Autre?): ")
            t = input("Avez-vous un numéro de référence?: ")

        else:
            print("##################################################\nWe are considering the caller as the REPORTER\n##################################################")
            rl = input("Last Name?: ")
            if rl == "esc":
                e.fork()
            rf = input("What is your First Name?: ")
            rt = input("Phone number to reach you at?\n(we may need this number\nshould we lose the connection for any reason)?: ")
            rd = input("What is your department?: ")
            re = input("Email to reach you at?: ")
            peo = input("Are you calling from a SD? (PSD or EU or Other?): ")
            t = input("Do you have a reference ticket number?: ")
    def tcReporterQuestions(self):
        global lang, rl, rf, rt, tcuid, tci, rd, re, peo
        if lang == "f":
            print("##################################################\nCollecte d'info: TC-Assist (Transport Canada)\n##################################################")
            rl = input("Nom (Famille)?: ")
            if rl == "quit":
                e.fork()
            rf = input("Prénom?: ")
            rt = input("Un numéro de téléphone pour vous joindre?: ")
            tcuid = input("Nom d'utilisateur TC?:")
            re = (rf + rl + "@tc.gc.ca")
            eok = input("Pouvez vous confirmer l'adresse courriel?  Est-ce bien; " + str(re.lower()) + " o ou n ?:")
            if eok == "o":
                tci = input("\nComment pouvons-nous vous aider?: ")
            else:
                re = input("Quelle est votre adresse courriel?: ")
                tci = input("\nComment pouvons-nous vous aider?: ")

        else:
            print("##################################################\nData Collection: TC-Assist (Transport Canada)\n##################################################")
            rl = input("Last Name?: ")
            if rl == "quit":
                e.fork()
            rf = input("What is your First Name?: ")
            rt = input("Phone number to reach you at?: ")
            tcuid = input("TC user ID?: ")
            re = (rf + rl + "@tc.gc.ca")
            eok = input("Can you confirm your email address? Is this correct; " + str(re.lower()) + " y or n ?:")
            if eok == "y":
                tci = input("\nHow may we help you?: ")
            else:
                re = input("What is your email address?: ")
                tci = input("\nHow may we help you?: ")
        rd = "TC"
        peo = "EU"

        e.displayTci()
    def endUserQuestions(self):
        global lang, eud, eul, euf, eut, euid, eue
        print("##################################################\n##################################################\nEND USER\n##################################################\n##################################################")
        if lang == ("f"):
            #ref de l'utilisation du terme 'utilisateur affecté' :  https://www.usherbrooke.ca/immeubles/fileadmin/sites/immeubles/documents/entretien/Capsule_d_information_utilisateur_affecte.pdf
            eud = input("Quel est le Ministère de l'utilisateur affecté?: ")
            if eud == "quit":
                e.fork()
            eul = input("Nom de l'utilisateur affecté?: ")
            euf = input("Prénom de l'utilisateur affecté?: ")
            euid = input("Identifiant (ID) de l'utilisateur affecté?: ")
            eut = input("Meilleur numéro de téléphone pour rejoindre l'utilisateur affecté?: ")
            eue = input("Adresse courriel pour rejoindre l'utilisateur affecté?: ")
        else:
            eud = input("What is the End User's department?: ")
            if eud == "quit":
                e.fork()
            eul = input("End User's Last Name?: ")
            euf = input("End User's First Name?: ")
            euid = input("End User ID?: ")
            eut = input("Best phone number to reach the End User: ")
            eue = input("Email to reach End User?: ")
    def incidentQuestions(self):
        global lang, rl, rf, rt, rd, re, peo, t, inD, out, s, nua, asac, ioos, bi, err
        print("##################################################\n##################################################\nREPORTING AN INCIDENT / AVIS D'INCIDENT\n##################################################\n##################################################")
        e.reporterQuestions()
        print("\n")
        if lang == ("f"):
            inD = input("Description de l'Incident: ")
            out = input("Y-a-t-il une panne? (oui ou non): ")
            if out == "quit":
                e.fork()
            s = input("Quel est l'étendue de la panne ou de l'incident?: ")
            nua = input("Combien d'utilisateurs affectés?: ")
            asac = input("Quel système-application-ci affecté?: ")
            ioos = input("Quel impact sur les autres systèmes?: ")
            bi = input("Quel impact sur les affaires?: ")
            err = input("Quel est le message d'erreur?: ")
        else:
            inD = input("Incident Description: ")
            out = input("Is there an outage? (yes or no): ")
            if out == "quit":
                e.fork()
            s = input("What is the scope of the outage/incident?: ")
            nua = input("How many users affected?: ")
            asac = input("Which affected system-application-ci?: ")
            ioos = input("What impact,if any, on other systems?: ")
            bi = input("What is the business impact?: ")
            err = input("What does the error message say?: ")
        print("\n")
        e.endUserQuestions()
        e.fork()
    def serviceRequestQuestions(self):
        global lang, srD, who4l, who4f, who4d, who4t, who4e, who4id
        if lang == ("f"):
            print("##################################################\nSERVICE REQUEST\n##################################################")
            srD = input("Veuillez expliquer la nature de la demande de Service (SR): ")
            print("\ndéfinition: >>>Récipiendaire de service<<<Celui ou celle qui reçoit le service demandé\n")
            who4l = input("Nom (famille) du Récipiendaire de service?: ")
            who4f = input("Prénom du Récipiendaire de service?: ")
            who4d = input("Ministère du Récipiendaire de service?: ")
            who4t = input("Numéro de téléphone du Récipiendaire de service?: ")
            who4e = input("Adresse courriel du Récipiendaire de service?: ")
            who4id = input("Identifiant (ID) du Récipiendaire de service?: ")

        else:
            print("##################################################\nSERVICE REQUEST\n##################################################")
            srD = input("Please describe what is the Service Request: ")
            print("\ndefinition: >>>Service recipient<<<Person for which the service is requested\n")
            who4l = input("(Last) NAME of the Service recipient?: ")
            who4f = input("(First) name of the Service recipient?: ")
            who4d = input("Department of the Service recipient?: ")
            who4t = input("Telephone number to reach the Service recipient?: ")
            who4e = input("Email address to reach the Service recipient?: ")
            who4id = input("User ID of the Service recipient?: ")
    def callReqUpdate(self):

        global lang, t, chktik, rl, rf, rt, rd, re
        e.reporterQuestions()
        if lang == ("f"):
            print("##################################################\nDemande de Mise-à-jour au billet\n##################################################")
            if t != "":
                print("Veuillez patienter quelques moments pendant que je recherche le billet " + str(t) + ".")
            else:
                chktik = input("Quel billet souhaitez-vous vérifier?: ")
                print("Veuillez patienter quelques moments pendant que je recherche le billet " + str(chktik) + ".")
        else:
            print("##################################################\nREQUEST FOR UPDATE ON TICKET\n##################################################")
            if t != "":
                print("Please wait for me for a few moments while I pull up ticket " + str(t) + ".")
            else:
                chktik = input("Which ticket should I lookup for you?")
                print("Please wait for me for a few moments while I pull up ticket " + str(chktik) + ".")
    def callPw(self):
        global lang, euid, pwuid
        if lang == "f":
            print("##################################################\nRequête pour un Nouveau Mot-de-passe (pw)\n##################################################")
        else:
            print("##################################################\nPassword (pw) Reset Request\n##################################################")
        e.reporterQuestions()
        app = ""
        while app != "mf" and "sb":
            if lang == ("f"):
                app = input("Pour quelle application?: \nMainframe==> mf\nSiebel==> sb\nECD==> ecd\n>>>")
                if app == "mf":
                    print("\nURI='#http://mainframe.gc.ca'")
                    print("Voici les commandes pour Infoweb")
                    print("TSS LIS(" + str(pwuid) + ") DATA(a)")
                    print("TSS REM(" + str(pwuid) + ") SUS")
                    print("TSS REP(" + str(pwuid) + ") PASS(canada1,,exp)")
                    e.fork()
                elif app == "sb":
                    print("L'Agent doit ouvrir son Siebel...\nURI='#http://siebel.gc.ca'")
                    print("ID de l'utilisateur: " + str(pwuid))
                    e.fork()
                elif app == "ecd":
                    print("ID de l'utilisateur: " + str(pwuid))
                    print("L'Agent doit ouvrir ECD...\nURI='#http://ecd.ca'")
                    e.fork()
                else:
                    e.fork()
                pwuid = input("Identifiant (ID) de l'utilisateur?: ")
            else:
                app = input("For which application?: \nMainframe==> mf\nSiebel==> sb\nECD==> ecd\n>>>")
                if app == "mf":
                    print("\nURI='#http://mainframe.gc.ca'")
                    print("Here are the commands for Infoweb")
                    print("TSS LIS(" + str(pwuid) + ") DATA(a)")
                    print("TSS REM(" + str(pwuid) + ") SUS")
                    print("TSS REP(" + str(pwuid) + ") PASS(canada1,,exp)")
                    e.fork()
                elif app == "sb":
                    print("Agent will perform pw reset in Siebel...\nURI='#http://siebel.gc.ca'")
                    print("user ID: " + str(pwuid))
                    e.fork()
                elif app == "ecd":
                    print("Agent will perform pw reset in ECD...\nURI='#http://ecd.ca'")
                    print("ID de l'utilisateur: " + str(pwuid))
                    e.fork()
                else:
                    e.fork()
                pwuid = input("User ID?: ")

    def callMobi(self):
        print("##################################################\n##################################################\nMOBILE DEVICE / APPAREIL MOBILE\n##################################################\n##################################################")
        e.reporterQuestions()
        print("\n")
        e.endUserQuestions()
        global lang
        if lang == ("f"):
            print("\npour Blackberry ou autre Mobile")

        else:
            print("\nfor a Blackberry or other Mobile device")
    def callTC(self):
        global lang, rd
        e.tcReporterQuestions()
        rd = "TC"
    def callFromAllstreamZayo(self):
        global lang
        if lang == "f":
            print("##################################################\nAllstream / Zayo\n##################################################")
        else:
            print("##################################################\nAllstream / Zayo\n##################################################")
        print("Allstream Zayo Advising ESD")
    def callFromTelus(self):
        global lang
        if lang == "f":
            print("##################################################\nTelus)\n##################################################")
        else:
            print("##################################################\nTelus\n##################################################")
        print("Telus Advising ESD")
    def callFromBell(self):
        global lang
        if lang == "f":
            print("##################################################\nBELL (Service Gestion de Sécurité)\n##################################################")
        else:
            print("##################################################\nBELL (Managed Security Service)\n##################################################")
        print("Bell Advising ESD")
    def callTypeSelection(self):
        global lang
        agentSelection = ""
        while agentSelection != "sr" and "in"  and "up" and "pw" and "mobi" and "tc" and "az" and "telus" and "bell" and "prompt":
            if lang == ("f"):
                print("##################################################\nFaire un choix pour le type d'appel\n##################################################")
                agentSelection = input("Quel type d'assistance est requise par la personne au téléphone?: \npassword==> pw\nMobile (BB)==>mobi\nNouvelle Demande SR==> sr\nRapporter un Incident==> in\nMise-à-jour==> up\nTC-Assist==> tc\nAllstream/Zayo==> az\nTelus==> telus\nBell==> bell\n>>>")
            else:
                agentSelection = input("What type of help is required by the Caller?: \nPassword reset? ==> pw\nMobile (BB)==> mobi\nOpening a New Service Request? ==> sr\nReporting an Incident? ==> in\nCaller wants an Update==> up\nTC-Assist caller==> tc\nAllstream/Zayo==> az\nTelus==> telus\nBell==> bell\n>>>")
                print("##################################################\nMake your selection for the appropriate type of call\n##################################################")
            if agentSelection == "sr":
                e.serviceRequestQuestions()
                e.fork()
            elif agentSelection == "in":
                e.incidentQuestions()
                e.fork()
            elif agentSelection == "up":
                e.callReqUpdate()
                e.fork()
            elif agentSelection == "pw":
                e.callPw()
                e.fork()
            elif agentSelection == "mobi":
                e.callMobi()
                e.fork()
            elif agentSelection == "tc":
                e.calltc()
                e.fork()
            elif agentSelection == "az":
                e.callFromAllstreamZayo()
                e.fork()
            elif agentSelection == "telus":
                e.callFromTelus()
                e.fork()
            elif agentSelection == "bell":
                e.callFromBell()
                e.fork()
            else:
                e.fork()
    def displayReporter(self):
        global lang, rl, rf, rt, rd, re, peo, t
        if lang == ("f"):
            print("##################################################\nAffichage:  Information de l'AVISEUR\n##################################################")
            print("\nNom de l'AVISEUR: " + str(rl.upper()))
            print("Prénom de l'AVISEUR: " + str(rf.capitalize()))
            print("Numéro pour rejoindre l'AVISEUR: " + str(rt))
            print("Ministère de l'AVISEUR: " + str(rd.upper()))
            print("Adresse courriel pour rejoindre l'AVISEUR: " + str(re))
            print("L'AVISEUR est un PSD?: " + str(peo.upper()))
        else:
            print("##################################################\nDisplaying: REPORTER Info\n##################################################")
            print("\nREPORTER`s (caller`s) Last Name: " + str(rl.upper()))
            print("REPORTER`s (caller`s) First Name: " + str(rf.capitalize()))
            print("Telephone to be able to reach the REPORTER (caller): " + str(rt))
            print("REPORTER's (caller's) Department: " + str(rd.upper()))
            print("REPORTER's (caller's) email address: " + str(re))
            print("Is REPORTER (caller) from a PSD?: " + str(peo.upper()))
    def displayEndUser(self):
        global lang, eud, eul, euf, eut, euid, eue
        if lang == ("f"):
            print("##################################################\nAffichage: Utilisateur Affecté\n##################################################")
            print("Ministère de l'UTILISATEUR AFFECTÉ: " + str(eud.upper()))
            print("Nom de l'UTILISATEUR AFFECTÉ: " + str(eul.upper()))
            print("Prénom de l'UTILISATEUR AFFECTÉ: " + str(euf.capitalize()))
            print("Identifiant (ID) de l'UTILISATEUR AFFECTÉ: " + str(euid.upper()))
            print("Meilleur numéro de téléphone pour rejoindre l'UTILISATEUR AFFECTÉ: " + str(eut))
            print("Adresse courriel pour rejoindre l'UTILISATEUR AFFECTÉ: " + str(eue))
        else:
            print("##################################################\nDisplaying:  END USER\n##################################################")
            print("Affected END USER Department: " + str(eud.upper()))
            print("Affected END USER Last Name: " + str(eul.upper()))
            print("Affected END USER First Name: " + str(euf.capitalize()))
            print("Affected END USER ID: " + str(euid.upper()))
            print("Affected END USER Telephone: " + str(eut))
            print("Affected END USER Email: " + str(eue))
    def displayIncident(self):
        global lang, inD, out, s, nua, asac, ioos, bi, err
        if lang == ("f"):
            print("##################################################\nAffichage: Incident\n##################################################")
            print("\nDescription de l'INCIDENT: " + str(inD) + "\n")
            print("\nIl y a une panne: " + str(out))
            print("Étendue de la panne/incident: " + str(s))
            print("Nombre d'utilisateurs affectés: " + str(nua))
            print("System ou CI affecté: " + str(asac))
            print("Impact sur d'autres systèmes: " + str(ioos))
            print("Impact sur les affaires: " + str(bi))
            print("Message d'erreur: " + str(err))
        else:
            print("##################################################\nDisplaying: Incident\n##################################################")
            print("\nINCIDENT Description: " + str(inD) + "\n")
            print("\nIs this an outage: " + str(out))
            print("What is the scope of the outage: " + str(s))
            print("Number of users affected: " + str(nua))
            print("This is affected: " + str(asac))
            print("Impact on other systems: " + str(ioos))
            print("Business impact: " + str(bi))
            print("Error message: " + str(err))
        print("\n")
    def displayServiceRequest(self):
        global lang, srD, who4l, who4f, who4d, who4t, who4e, who4id
        if lang == ("f"):
            print("##################################################\nAffichage: Requête d'assistance\n##################################################")
            print("\n\nDescription de la REQUÊTE de SERVICE: " + str(srD) + "\n")
            print("##################################################\nDÉFINITION: >>>Récipiendaire de service<<<Celui ou celle qui reçoit le service demandé\n##################################################")
            print("Nom (famille) du Récipiendaire de service - ?: " + str(who4l))
            print("Prénom du Récipiendaire de service?: " + str(who4f))
            print("Ministère du Récipiendaire de service?: " + str(who4d))
            print("Numéro de téléphone du Récipiendaire de service?: " + str(who4t))
            print("Adresse courriel du Récipiendaire de service?: " + str(who4e))
            print("Identifiant (ID) du Récipiendaire de service?: " + str(who4id))

        else:
            print("##################################################\nDisplaying: Service Request\n##################################################")
            print("\n\nSERVICE REQUEST description: " + str(srD) + "\n")
            print("##################################################\nDEFINITION: >>>Service recipient<<<Person for which the service is requested\n##################################################")
            print("(Last) NAME of the Service recipient?: " + str(who4l))
            print("(First) name of the Service recipient?: " + str(who4f))
            print("Department of the Service recipient?: " + str(who4d))
            print("Telephone number to reach the Service recipient?: " + str(who4t))
            print("Email address to reach the Service recipient?: " + str(who4e))
            print("User ID of the Service recipient?: " + str(who4id))
    def displayIRinfoweb(self):
        global lang
        if lang == ("f"):
            print("##################################################\nAffichage: Infoweb\n##################################################")
        else:
            print("##################################################\nDisplaying: Infoweb\n##################################################")
    def displayTci(self):
        global lang, rl, rf, rt, tcuid, tci, rd
        if lang == ("f"):
            print("##################################################\nAffichage: TC-Assist (Transport Canada)\n##################################################")
            print("\nNom du rapporteur: " + str(rl.upper()))
            print("Prénom du rapporteur: " + str(rf.capitalize()))
            print("Numéro pour rejoindre par téléphone le rapporteur: " + str(rt))
            print("Identifiant de d'utilisateur TC?: " + str(tcuid.upper()))
            print("\nDescription du problème/demande?: " + str(tci))
            e.fork()
        else:
            print("##################################################\nDisplaying: TC-ASSIST (Transport Canada)\n##################################################")
            print("\nReporter (caller) Last Name: " + str(rl.upper()))
            print("Reporter (caller) First Name: " + str(rf.capitalize()))
            print("Telephone to be able to reach the Reporter (caller): " + str(rt))
            print("Identifiant de d'utilisateur TC?: " + str(tcuid.upper()))
            print("\nDescription of problem/request?: " + str(tci))
            e.fork()
    def displayAll(self):
        global lang, srD, inD
        if lang == "f":
            print("##################################################\nAffichage: Information Complète\n##################################################")
        else:
            print("##################################################\nDisplaying: All Collected Data\n##################################################")
        print("\n")
        if srD != "":
            print("Printing feedback: Service Request exists!")
            e.displayReporter()
            print("\n")
            e.displayServiceRequest()

        if inD != "":
            e.displayReporter()
            print("\n")
            e.displayIncident()
            print("\n")
            e.displayEndUser()

        else:
            e.displayReporter()
            print("\n")
            e.displayEndUser()
    def stop(self):
        global lang
        if lang == ("f"):
            print("Allez, on prend une petite pause?")
        else:
            print("Ok, let's take a break, shall we?")
    def closeScript(self):
        global lang, rl, rf, rt, rd, re, peo, t
        if lang == "f":
            print ("\nVotre billet de référence est " + str(reftik) + ".")
            print ("\nEst-ce qu'il y a autre chose avec laquelle je puisse vous aider aujourd'hui?")
            print ("\nMerci d'avoir appelé le Bureau de Soutien Technique d'Entreprise")
            e.fork()
        else:
            print ("\nYour reference number for this call is " + str(reftik) + ".")
            print ("\nIs there anything else that I may assist you with today?")
            print ("\nThank you for calling the Servide Desk")
            e.fork()
#we are creating a variable which calls the class 'Esd'
e = Esd()
####
#Functions (not classes nor methods)
def prompt():
    p = ""
    while p != "esd" and "other":
        p = input("ESD? ")
        if p == "y":
            e.fork()
#we are instanciating the method 'fork' from within the class 'ESD'
e.fork()
fork = e.fork()
prompt()
