#Using a class to create sections of Q & A interaction with caller/reporter
lang = "fra"
chLang = lang
agent = "Luc T."
reftik = "IR03899999"


class EsdCaller:


    def whichMethod(self):
        global rl, rf, rt, rd, re, peo, t, chLang
        if chLang == "fra":
            wm = ''
            while wm != "os" and "cs" and "qar" and "qaeu" and "qain" and "disr" and "disfd" and "end":
                wm = input("\nAgent: quelle tâche?: ")
            
                if wm == "os":
                    esdCaller.openScript()
                    esdCaller.whichMethod()
                elif wm == "cs":
                    esdCaller.closeScript()
                    esdCaller.whichMethod()
                elif wm == "qar":
                    esdCaller.callerQs()
                    esdCaller.whichMethod()
                elif wm == "qaeu":
                    esdCaller.euQs()
                    esdCaller.whichMethod()
                elif wm == "qain":
                    esdCaller.inQs()
                    esdCaller.whichMethod()
                elif wm == "disr":
                    esdCaller.disR()
                    esdCaller.whichMethod()
                elif wm == "diseu":
                    esdCaller.disEU()
                    esdCaller.whichMethod()
                elif wm == "disfd":
                    esdCaller.disFD()
                    esdCaller.whichMethod()
                elif wm == "end":
                    esdCaller.stop()
                    break
            
        else:
            wm = ''
            while wm != "os" and "cs" and "qar" and "qaeu" and "qain" and "disr" and "diseu" and "disfd" and "end":
                wm = input("\nAgent: which task?: ")
                if wm == "os":
                    esdCaller.openScript()
                    esdCaller.whichMethod()
                elif wm == "cs":
                    esdCaller.closeScript()
                    esdCaller.whichMethod()
                elif wm == "qar":
                    esdCaller.callerQs()
                    esdCaller.whichMethod()
                elif wm == "qaeu":
                    esdCaller.euQs()
                    esdCaller.whichMethod()
                elif wm == "qain":
                    esdCaller.inQs()
                    esdCaller.whichMethod()
                elif wm == "disr":
                    esdCaller.disR()
                    esdCaller.whichMethod()
                elif wm == "diseu":
                    esdCaller.disEU()
                    esdCaller.whichMethod()
                elif wm == "disfd":
                    esdCaller.disFD()
                    esdCaller.whichMethod()
                elif wm == "end":
                    esdCaller.stop()
                    break
            
            
        
    
    def openScript(self):
        global rl, rf, rt, rd, re, peo, t, chLang
        if chLang == "fra":
            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")
            esdCaller.callerQs()
            
        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")
            esdCaller.callerQs()
            
            
    def closeScript(self):
        global rl, rf, rt, rd, re, peo, t, chLang
        if chLang == "fra":
            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")
            esdCaller.whichMethod()

        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")
            esdCaller.whichMethod()

    def callerQs(self):
        global rl, rf, rt, rd, re, peo, t, chLang
        if chLang == "fra":
            rl = input("Nom (Famille)?: ")
            if rl == "quit":
                esdCaller.whichMethod()    
        else:
            rl = input("Last Name?: ")
            if rl == "quit":
                esdCaller.whichMethod()                           
            
        if chLang == "fra":
            rf = input("Prénom?: ")
        else:
            rf = input("What is your First Name?: ")

        
        if chLang == "fra":
            rt = input("Un numéro de téléphone pour vous joindre?: ")
        else:
            rt = input("Phone number to reach you at?: ")
                

        if chLang == "fra":
            rd = input("Quel est votre ministère?: ")
        else:
            rd = input("What is your department?: ")

        if chLang == "fra":
            re = input("Un courriel pour vous joindre?: ")
        else:
            re = input("Email to reach you at?: ")

        if chLang == "fra":
            peo = input("Appelez-vous d'un bureau de soutien technique (PSD or EU ou Autre?): ")
        else:
            peo = input("Are you calling from a SD? (PSD or EU or Other?): ")
        
        if chLang == "fra":
            t = input("Avez-vous un numéro de billet de référence?: ")
        else:
            t = input("Do you have a ticket number reference?: ")


        if chLang == "fra":
            rin = input("Rapportez-vous un Incident? (oui ou non):")
            if rin == "yes" or "y" or "YES" or "Y" or "oui" or "o" or "OUI" or "O":
                print("\n" + str(rf) + ", Permettez moi de vous poser quelques questions relatives à l'incident.\n")
                esdCaller.inQs()
            else:
                print("\nComment puis-je vous aider aujourd'hui? ")
                esdCaller.whichMethod()
                
        else:
            rin = input("\nAre you reporting an Incident? (yes or no):")
            if rin == ("yes" or "y" or "YES" or "Y" or "oui" or "o" or "OUI" or "O"):
                print("\n" + str(rf) + ", Allow me to ask you a few questions regarding this Incident.\n")
                esdCaller.inQs()
            else:
                print("\nHow may I help you? ")
                esdCaller.whichMethod()
                   
        

    def euQs(self):
        global chLang, eud, eul, euf, eut, euid, eue
        
        if lang == ("FRA" or "fra" or "Fra" or "fr" or "FR"):
            #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":
                esdCaller.whichMethod()
        else:
            eud = input("What is the End User's department?: ")
            if eud == "quit":
                esdCaller.whichMethod()

        if lang == ("FRA" or "fra" or "Fra" or "fr" or "FR"):
            eul = input("Nom de l'utilisateur affecté?: ")
        else:
            eul = input("End User's Last Name?: ")

        if lang == ("FRA" or "fra" or "Fra" or "fr" or "FR"):
            euf = input("Prénom de l'utilisateur affecté?: ")
        else:
            euf = input("End User's First Name?: ")

        if lang == ("FRA" or "fra" or "Fra" or "fr" or "FR"):
            euid = input("Identifiant de l'utilisateur affecté?: ")
        else:
            euid = input("End User ID?: ")

        if lang == ("FRA" or "fra" or "Fra" or "fr" or "FR"):
            eut = input("Meilleur numéro de téléphone pour rejoindre l'utilisateur affecté?: ")
        else:
            eut = input("Best phone number to reach the End User: ")

        if lang == ("FRA" or "fra" or "Fra" or "fr" or "FR"):
            eue = input("Adresse courriel pour rejoindre l'utilisateur affecté?: ")
        else:
            eue = input("Email to reach End User?: ")

    def inQs(self):
        global rl, rf, rt, rd, re, peo, t, chLang
        if chLang == "fra":
            out = input("Y-a-t-il une panne? (oui ou non): ")
            if out == "quit":
                esdCaller.whichMethod()
        else:
            out = input("Is there an outage? (yes or no): ")
            if out == "quit":
                esdCaller.whichMethod()
            

        if chLang == "fra":
            s = input("Quel est l'étendue de la panne ou de l'incident?: ")
        else:
            s = input("What is the scope of the outage/incident?: ")
          
        if chLang == "fra":
            nua = input("Combien d'utilisateurs affectés?: ")        
        else:
            nua = input("How many users affected?: ")        
			
			
        if chLang == "fra":
            asac = input("Quel système-application-ci affecté?: ")        
        else:
            asac = input("Which affected system-application-ci?: ")        
			
			
        if chLang == "fra":
            ioos = input("Quel impact sur les autres systèmes?: ")        
        else:
            ioos = input("What impact,if any, on other systems?: ")


        if chLang == "fra":
            bi = input("Quel impact sur les affaires?: ")        
        else:
            bi = input("What is the business impact?: ")  

        if chLang == "fra":
            e = input("Quel est le message d'erreur?: ")        
        else:
            e = input("What does the error message say?: ")
        esdCaller.whichMethod()
        

    def disR(self):
        global rl, rf, rt, rd, re, peo, t, chLang
        if lang == ("FRA" or "fra" or "Fra" or "fr" or "FR"):
            print("\nNom du rapporteur: " + str(rl))
            print("Prénom du rapporteur: " + str(rf))
            print("Numéro pour rejoindre par téléphone le rapporteur: " + str(rt))
            print("Ministère du rapporteur: " + str(rd))
            print("Adresse courriel pour rejoindre le rapporteur: " + str(re))
            print("Le rapporteur est un PSD?: " + str(peo))
        else:
            print("\nReporter (caller) Last Name: " + str(rl))
            print("Reporter (caller) First Name: " + str(rf))
            print("Telephone to be able to reach the Reporter (caller): " + str(rt))
            print("Reporter's (caller's) Department: " + str(rd))
            print("Reporter's (caller's) email address: " + str(re))
            print("Is Caller from a PSD?: " + str(peo))

    def disEU(self):
        global chLang, eud, eul, euf, eut, euid, eue
        if lang == ("FRA" or "fra" or "Fra" or "fr" or "FR"):
            print("Affected End User Department: " + eud)
            print("Affected End User ID: " + euid)
            print("Affected End User Last Name: " + eul)
            print("Affected End User First Name: " + euf)
            print("Affected End User ID: " + euid)
            print("Affected End User Telephone: " + eut)
            print("Affected End User Email: " + eue)
        else:
            print("Affected End User Department: " + eud)
            print("Affected End User ID: " + euid)
            print("Affected End User Last Name: " + eul)
            print("Affected End User First Name: " + euf)
            print("Affected End User ID: " + euid)
            print("Affected End User Telephone: " + eut)
            print("Affected End User Email: " + eue)

    def disFD(self):
        global rl, rf, rt, rd, re, peo, t, chLang
        esdCaller.disR()
        print("\n")
        esdCaller.disEU()
            

    def stop(self):
        global chLang
        if chLang == "fra":
            print("Allez, on prend une petite pause?")
        else:
            print("Ok, let's take a break, shall we?")
            
        

        


#we are creating a variable which calls the 'class EsdCaller'
esdCaller = EsdCaller()
####

####
#we are instanciating the method 'callerQs' from within the class
esdCaller.openScript()



