SHARE
TWEET

Untitled

a guest May 19th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mob/verb/Make_A_Ticket()
  2.     var/Title = input("Label","Ticket","None") as text
  3.     if(!Title||Title == "None"||Title in Ticket_Names) return
  4.     var/Ticket = input("Description","Ticket","None") as message
  5.     if(!Ticket||Ticket == "None") return
  6.     Ticketer_System.Submit_Ticket(src,Ticket,Title)
  7.     return
  8.  
  9. mob/verb/Look_At_Ticket(var/obj/Ticket/T in Ticket_Book)
  10.     Ticketer_System.Read_Ticket(src,T)
  11.     return
  12.  
  13. mob/verb/Update_A_Ticket(var/obj/Ticket/T in Ticket_Book)
  14.     Ticketer_System.Update_Ticket(src,T)
  15.     return
  16.  
  17. mob/verb/Delete_A_Ticket(var/obj/Ticket/T in Ticket_Book)
  18.     Ticketer_System.Delete_Ticket(src,T)
  19.     return
  20.  
  21. var/Tickets/Ticketer_System = new()
  22. var/Ticket_Book = list()
  23. var/Ticket_Names = list()
  24. obj/Ticket
  25.     var/Message
  26.     var/Updated_Message
  27.     var/Creator
  28.     var/Status
  29.  
  30. Tickets
  31.     proc/Delete_Ticket(mob/M,obj/Ticket/T)
  32.         world << "[M] removed [T.Creator]'s [T.name]([T.Status])"
  33.         Ticket_Names -= T.name
  34.         del T
  35.  
  36.     proc/Update_Ticket_Continue(var/X,obj/Ticket/T,mob/M)
  37.         if(!X) return
  38.         if(X == "Review")
  39.             T.Status = "<font color = blue>Reviewing...</font>"
  40.             var/Feedback = input("Any Comments?","FeedBack","None") as message
  41.             if(!Feedback||Feedback == "None") Feedback = "<font color = blue>[M.key] : No Additional Comments.</font>"
  42.             T.Updated_Message = "[T.Message]<br><font color = blue>[Feedback]</font>"
  43.         if(X == "Flag")
  44.             T.Status = "<font color = red>Flagged!</font>"
  45.             _EXPLAIN_
  46.             var/Feedback = input("Explain why this Ticket was flagged:","FeedBack","None") as text
  47.             if(!Feedback||Feedback == "None") goto _EXPLAIN_
  48.             T.Updated_Message = "[T.Message]<br><font color = red>[M.key] : [Feedback]</font>"
  49.         if(X == "Solve")
  50.             T.Status = "<font color = green>Solved!</font>"
  51.             _SOLVED_
  52.             var/Feedback = input("Explain how this Ticket was solved:","FeedBack","None") as text
  53.             if(!Feedback||Feedback == "None") goto _SOLVED_
  54.             T.Updated_Message = "[T.Message]<br><font color = green>[M.key] : [Feedback]</font>"
  55.  
  56.     proc/Update_Ticket(mob/Updater,obj/Ticket/T)
  57.         switch(alert(Updater,"Command?","Update","Review","Flag","Solve"))
  58.             if("Review") Ticketer_System.Update_Ticket_Continue("Review",T,Updater)
  59.             if("Flag") Ticketer_System.Update_Ticket_Continue("Flag",T,Updater)
  60.             if("Solve") Ticketer_System.Update_Ticket_Continue("Solve",T,Updater)
  61.  
  62.     proc/Submit_Ticket(mob/Ticketer,Ticket,Title)
  63.         var/obj/Ticket/T = new /obj/Ticket
  64.         T.Creator = "[Ticketer]"
  65.         T.Message = Ticket
  66.         T.Status = "Submitted"
  67.         T.name = Title
  68.         Ticket_Book += T
  69.         Ticket_Names += T.name
  70.         return
  71.  
  72.     proc/Read_Ticket(mob/M,obj/Ticket/T)
  73.         M << "[T.name]([T.Status]) by [T.Creator]"
  74.         M << "<br>"
  75.         if(T.Updated_Message) M << T.Updated_Message
  76.         else M << T.Message
  77.         return
RAW Paste Data
Top