ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/MCP/Trunk/MCP_ViewEdit_UI.py
Revision: 578
Committed: Thu Mar 26 13:49:38 2015 UTC (11 years ago) by nino.borges
Content type: text/x-python
File size: 46848 byte(s)
Log Message:
update before leaving

File Contents

# User Rev Content
1 ninoborges 8 """
2    
3     MCP_ViewEdit_UI
4    
5     Created by
6     Emanuel Borges
7     03.17.2011
8    
9     This is the UI for viewing or editing case info
10    
11     """
12    
13    
14 nino.borges 531 import wx, MCP_Lib, MCP_Console,os,CurrentProductionsDialog,CaseUploadsDialog,AddDocumentProductionDialog,CasePathsDialog,NinoGenTools,EditVendorFolderDialog,StorageUploadCostsDialog,DisclosureLetterDialog,AddEditCaseNameDialog,AddNewCaseDialog,ManagerReportsDialog
15 nino.borges 461 import wx.lib.agw.pybusyinfo as PBI
16 ninoborges 8 class MyFrame(wx.Frame):
17     def __init__(self, parent, ID, title, pos=wx.DefaultPosition):
18     self.console = MCP_Console.MainConsole()
19    
20     wx.Frame.__init__(self, parent, ID, title, pos, size =(550,580))
21     self.panel = wx.Panel(self,-1)
22    
23     #self.panel.SetBackgroundColour("yellow green")
24     casesListStaticText = wx.StaticText(self.panel, -1, "Select Case: ",wx.DefaultPosition)
25 nino.borges 189 #casesList,casesDir = MCP_Lib.GetCaseList()
26 nino.borges 459 ## TODO: Why are we calling MCP_lib here. self.console already did that and got this.
27 nino.borges 487 self.myCases, self.myActiveCases, self.officeCases, self.allCases, casesDir,self.casePathStyleMatrix = MCP_Lib.GetCaseList(accessConnectionObj=self.console.accessDB)
28 nino.borges 189 self.casesListChoice = wx.Choice(self.panel, -1, wx.DefaultPosition, choices=self.myCases)
29 ninoborges 8 self.casesListChoice.SetSelection(0)
30 nino.borges 303
31     self.uploadCostStaticText = wx.StaticText(self.panel, -1, "", (300, 70), (60, -1), wx.ALIGN_RIGHT)#"Upload:$20", (300, 70), (60, -1), wx.ALIGN_RIGHT)
32     self.storageCostStaticText = wx.StaticText(self.panel, -1, "", (300, 70), (65, -1), wx.ALIGN_RIGHT)#"Storage:$30", (300, 70), (65, -1), wx.ALIGN_RIGHT)
33     self.uploadCostStaticText.SetBackgroundColour('Dark Green')
34     self.uploadCostStaticText.SetForegroundColour('White')
35     self.storageCostStaticText.SetBackgroundColour('Dark Green')
36     self.storageCostStaticText.SetForegroundColour('White')
37    
38 nino.borges 321 self.disclosureLetterReminderText = wx.StaticText(self.panel, -1, "", (50, 55), (65, -1), wx.ALIGN_LEFT)
39     self.disclosureLetterReminderText.SetForegroundColour('Red')
40    
41 ninoborges 8 self.chargeableCheckBox = wx.CheckBox(self.panel,-1,"Chargeable?")
42     responsibleAttnyStaticText = wx.StaticText(self.panel, -1, "Responsible Attorney: ",wx.DefaultPosition)
43     self.responsibleAttnyTextCtrl = wx.TextCtrl(self.panel, -1, "", wx.DefaultPosition, (110,-1))
44     responsibleParalegalStaticText = wx.StaticText(self.panel, -1, "Responsible Paralegal: ",wx.DefaultPosition)
45     self.responsibleParalegalTextCtrl = wx.TextCtrl(self.panel, -1, "", wx.DefaultPosition, (110,-1))
46     platformChoicesList = ["",'Concordance DIS','Concordance LN','Relativity']
47     reviewPlatformStaticText = wx.StaticText(self.panel, -1, "Platform: ",wx.DefaultPosition)
48     self.reviewPlatformChoice = wx.Choice(self.panel, -1, wx.DefaultPosition, choices=platformChoicesList)
49     responsibleProcessingVendorStaticText = wx.StaticText(self.panel, -1, "Processing Vendor: ",wx.DefaultPosition)
50     self.responsibleProcessingVendorTextCtrl = wx.TextCtrl(self.panel, -1, "", wx.DefaultPosition, (150,-1))
51     responsibleScanningVendorStaticText = wx.StaticText(self.panel, -1, "Scanning Vendor: ",wx.DefaultPosition)
52     self.responsibleScanningVendorTextCtrl = wx.TextCtrl(self.panel, -1, "", wx.DefaultPosition, (150,-1))
53     responsibleHostingVendorStaticText = wx.StaticText(self.panel, -1, "Hosting Vendor: ",wx.DefaultPosition)
54     self.responsibleHostingVendorTextCtrl = wx.TextCtrl(self.panel, -1, "", wx.DefaultPosition, (150,-1))
55     responsibleTPMStaticText = wx.StaticText(self.panel, -1, "TPM: ",wx.DefaultPosition)
56 nino.borges 459 #self.responsibleTPMTextCtrl = wx.TextCtrl(self.panel, -1, "", wx.DefaultPosition, (110,-1))
57 nino.borges 578 ## Remove this 'gone' list once every case has been reassigned.
58     #goneList = ['Metter, Ben', 'Skowron, Dave','Rogers, Katheryn', 'Gardner, Daryl', 'Arzan, Gio','Garcia, Kenneth']
59     self.responsibleTPMComboBox = wx.ComboBox(self.panel,-1,"",wx.DefaultPosition, (140,-1),self.console.fullTPMMatrix.keys(),wx.CB_DROPDOWN|wx.CB_SORT)
60 ninoborges 8 responsibleOfficeStaticText = wx.StaticText(self.panel, -1, "Office: ",wx.DefaultPosition)
61 nino.borges 459 self.responsibleOfficeTextCtrl = wx.TextCtrl(self.panel, -1, "", wx.DefaultPosition, (140,-1))
62 ninoborges 8 caseStatusStaticText = wx.StaticText(self.panel, -1, "Case Status: ",wx.DefaultPosition)
63     statusChoicesList = ['Active','Dormant','Closed','Archived']## Selecting archived automatically unchecks chareable.
64     self.caseStatusChoice = wx.Choice(self.panel, -1, wx.DefaultPosition, choices=statusChoicesList)
65 nino.borges 462 casePathStyleStaticText = wx.StaticText(self.panel, -1, "Path Style: ",wx.DefaultPosition)
66     casePathStyleChoiceList = ['','NEW','OLD']
67     self.casePathStyleChoice = wx.Choice(self.panel, -1, wx.DefaultPosition, choices=casePathStyleChoiceList)
68 ninoborges 8
69    
70 nino.borges 189 self.SetFields(self.myCases[0])
71 ninoborges 8
72     self.CreateBoxesSection()
73    
74 nino.borges 303 costSizer = wx.BoxSizer(wx.HORIZONTAL)
75     costSizer.Add(self.uploadCostStaticText,0,wx.ALL,5)
76     costSizer.Add(self.storageCostStaticText,0,wx.ALL,5)
77    
78 ninoborges 8 casesSizer = wx.BoxSizer(wx.HORIZONTAL)
79     casesSizer.Add(casesListStaticText,0,wx.ALL,5)
80     casesSizer.Add(self.casesListChoice,0,wx.ALL,5)
81 nino.borges 303 #casesSizer.Add(costSizer,0,wx.ALL,5)
82 ninoborges 8
83     secondHalfSizer = wx.GridBagSizer(5,5)
84     secondHalfSizer.Add(reviewPlatformStaticText, pos=(0,0))
85     secondHalfSizer.Add(self.reviewPlatformChoice, pos=(0,1))
86     secondHalfSizer.Add(self.chargeableCheckBox,pos=(0,3))
87     #secondHalfSizer.Add(self.chargeableCheckBox,pos=(0,2), span=(1,2), flag = wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL)
88     secondHalfSizer.Add(responsibleAttnyStaticText, pos=(1,0))
89     secondHalfSizer.Add(self.responsibleAttnyTextCtrl, pos=(1,1))
90 nino.borges 462 secondHalfSizer.Add(responsibleTPMStaticText, pos = (1,2),flag=wx.ALIGN_RIGHT)
91 nino.borges 459 #secondHalfSizer.Add(self.responsibleTPMTextCtrl, pos = (1,3))
92     secondHalfSizer.Add(self.responsibleTPMComboBox, pos = (1,3))
93 ninoborges 8 secondHalfSizer.Add(responsibleParalegalStaticText, pos=(2,0))
94     secondHalfSizer.Add(self.responsibleParalegalTextCtrl, pos=(2,1))
95 nino.borges 462 secondHalfSizer.Add(responsibleOfficeStaticText, pos=(2,2),flag=wx.ALIGN_RIGHT)
96 ninoborges 8 secondHalfSizer.Add(self.responsibleOfficeTextCtrl, pos=(2,3))
97     secondHalfSizer.Add(caseStatusStaticText, pos=(3,0))
98     secondHalfSizer.Add(self.caseStatusChoice, pos=(3,1))
99 nino.borges 462 secondHalfSizer.Add(casePathStyleStaticText, pos=(3,2),flag=wx.ALIGN_RIGHT)
100     secondHalfSizer.Add(self.casePathStyleChoice, pos=(3,3))
101 ninoborges 8
102     respVendorsStaticBox = wx.StaticBox(self.panel, -1, 'Responsible Vendors:')
103     respVendorsStaticBoxSizer = wx.StaticBoxSizer(respVendorsStaticBox, wx.VERTICAL)
104     respVendorsFlexGridSizer = wx.FlexGridSizer(3,2,10,10)
105     respVendorsFlexGridSizer.Add(responsibleProcessingVendorStaticText,5)
106     respVendorsFlexGridSizer.Add(self.responsibleProcessingVendorTextCtrl,5)
107     respVendorsFlexGridSizer.Add(responsibleScanningVendorStaticText,5)
108     respVendorsFlexGridSizer.Add(self.responsibleScanningVendorTextCtrl,5)
109     respVendorsFlexGridSizer.Add(responsibleHostingVendorStaticText,5)
110     respVendorsFlexGridSizer.Add(self.responsibleHostingVendorTextCtrl,5)
111     respVendorsStaticBoxSizer.Add(respVendorsFlexGridSizer,0,wx.ALL,20)
112    
113     mainSizer = wx.BoxSizer(wx.VERTICAL)
114 nino.borges 303 mainSizer.Add(costSizer,0,wx.RIGHT|wx.ALIGN_RIGHT,10)
115     mainSizer.Add(casesSizer,0,wx.BOTTOM|wx.LEFT|wx.RIGHT, 20)
116 ninoborges 8 mainSizer.Add(secondHalfSizer,0,wx.ALL,20)
117     mainSizer.Add(respVendorsStaticBoxSizer,0,wx.ALL,20)
118     #mainSizer.Add(self.chargeableCheckBox,0,wx.ALL,5)
119     #mainSizer.Add(self.reviewPlatformChoice,0,wx.ALL,5)
120     #mainSizer.Add(self.responsibleAttnyTextCtrl,0,wx.ALL,5)
121     #mainSizer.Add(self.responsibleParalegalTextCtrl,0,wx.ALL,5)
122     #mainSizer.Add(self.responsibleProcessingVendorTextCtrl,0,wx.ALL,5)
123     #mainSizer.Add(self.responsibleScanningVendorTextCtrl,0,wx.ALL,5)
124     #mainSizer.Add(self.responsibleHostingVendorTextCtrl,0,wx.ALL,5)
125     #mainSizer.Add(workDirSizer,0,wx.ALL, 10)
126     #mainSizer.Add(copyUpTypeStaticBoxSizer, 0, wx.ALL, 10)
127     mainSizer.Add(self.buttonSizer,0, wx.ALL|wx.ALIGN_BOTTOM|wx.ALIGN_CENTER, 10)
128    
129     self.oKButton.Disable()
130    
131     #self.chargeableCheckBox.Disable() ## Remove me.
132    
133     self.panel.SetSizer(mainSizer)
134    
135     self.CreateStatusBar()
136     self.SetStatusText("Ready.")
137     self.CreateMenuBar()
138    
139     self.Bind(wx.EVT_CHOICE, self.OnSetFields, self.casesListChoice)
140 nino.borges 464 self.Bind(wx.EVT_CHOICE, self.OnPlatformChosen, self.casePathStyleChoice)
141 nino.borges 462 self.Bind(wx.EVT_CHOICE, self.OnPlatformChosen, self.reviewPlatformChoice)
142 ninoborges 8 self.Bind(wx.EVT_CHOICE, self.OnFormChanged, self.caseStatusChoice)
143     self.Bind(wx.EVT_CHECKBOX, self.OnFormChanged, self.chargeableCheckBox)
144     self.Bind(wx.EVT_TEXT, self.OnFormChanged, self.responsibleAttnyTextCtrl)
145 nino.borges 459 #self.Bind(wx.EVT_TEXT, self.OnFormChanged, self.responsibleTPMTextCtrl)
146 nino.borges 541 self.Bind(wx.EVT_COMBOBOX, self.OnTransferConfirm, self.responsibleTPMComboBox)
147 ninoborges 8 self.Bind(wx.EVT_TEXT, self.OnFormChanged, self.responsibleParalegalTextCtrl)
148     self.Bind(wx.EVT_TEXT, self.OnFormChanged, self.responsibleOfficeTextCtrl)
149     self.Bind(wx.EVT_TEXT, self.OnFormChanged, self.responsibleProcessingVendorTextCtrl)
150     self.Bind(wx.EVT_TEXT, self.OnFormChanged, self.responsibleScanningVendorTextCtrl)
151     self.Bind(wx.EVT_TEXT, self.OnFormChanged, self.responsibleHostingVendorTextCtrl)
152    
153     self.Bind(wx.EVT_BUTTON, self.OnProcess, self.oKButton)
154     self.Bind(wx.EVT_BUTTON, self.CloseWindow, self.cancelButton)
155    
156     def NothingYet(self,event):
157     """ A simple place holder function that is used to be a PASS statment when I'm creating controls"""
158     diag = wx.MessageDialog(self,"Nothing here yet!", "Disabled...",wx.OK | wx.ICON_INFORMATION)
159     diag.ShowModal()
160     diag.Destroy()
161    
162     def MenuData(self):
163 nino.borges 303 return(("Case",
164 nino.borges 343 ("Edit Case &Name","Allows you to edit the case name.",self.OnEditCaseName,""),
165 nino.borges 303 ("Change Negotiated &Price","Allows you to edit the negotiated prices for hosting and uploading.",self.OnChangePricing,""),
166 nino.borges 321 ("Disclosure &Letter ...","Allows you to load and link your disclosure letter to this case.",self.OnChangeDisclosureLetter,""),
167 nino.borges 303 ("","","",""),
168     ("&Transfer Case","Allows you to transfer a case to another TPM.",self.NothingYet,"DISABLED"),
169     ("","","",""),
170 nino.borges 489 ("&Add New Case","Adds a new case to the system.",self.OnAddNewCase,"")),
171 nino.borges 303 ("View",
172 nino.borges 174 ("My Cases", "Chooses from your assigned cases.",self.OnChangeCaseView,"RADIO"),
173 nino.borges 454 ("My Active Cases", "Chooses from your assigned cases, filtered by Active Cases.",self.OnChangeCaseView,"RADIO"),
174 nino.borges 174 ("My Office Cases", "Chooses from cases assigned to everyone in your office.",self.OnChangeCaseView,"RADIO"),
175     ("All Cases", "Chooses from all cases.",self.OnChangeCaseView,"RADIO"),
176     ("","","",""),
177     ("Case &Uploads", "Displays the Case Uploads for this case.",self.OnViewCaseUploads,""),
178     ("&Production History", "Displays the Production History for this case.",self.OnViewDocProduction,""),
179     ("","","",""),
180 nino.borges 258 ("My Case &Notes","Opens the case notes file for the current selected case.",self.OnViewCaseNotes,""),
181     ("My Production &Spec","Opens the production specifications file for the current selected case.",self.OnViewProdSpec,""),
182 nino.borges 261 ("&Alternate Media Folder","Opens the alternate media path for the current selected case.",self.OnOpenAlternateMediaFolder,""),
183 nino.borges 174 ("Open Case &Folder","Opens the case folder for the current selected case.",self.OnOpenCaseFolder,"")),
184 ninoborges 8 ("Production",
185 nino.borges 174 ("&Add Production Entry","Adds a new production to the matter database.",self.OnAddDocProduction,"")),
186 nino.borges 258 ("Settings",
187 nino.borges 268 ("Linked &Vendor Folders","Allows you to link vendor folders to this case for copy ups.",self.OnEditVendorFolders,""),
188 nino.borges 262 ("&Case Paths","Allows you to set or change the alternate media path.",self.OnCasePathsSettings,"")),
189 nino.borges 321 ("Reporting",
190     ("Create &Produciton Report","Creates or updates the Production Report Page.",self.OnCreateProductionReport,""),
191 nino.borges 531 ("&Managerial","Managerial reports.",self.OnCreateManageReport,"")),
192 ninoborges 8 ("&Help",
193 nino.borges 174 ("&About", "Displays the About Window.", self.OnAbout,"")))
194 ninoborges 8
195     def CreateMenuBar(self):
196     menuBar = wx.MenuBar()
197 nino.borges 158 count = 1
198 ninoborges 8 for eachMenuData in self.MenuData():
199     menuLabel = eachMenuData[0]
200     menuItems = eachMenuData[1:]
201     menuBar.Append(self.CreateMenu(menuItems), menuLabel)
202 nino.borges 158 count = count + 1
203 ninoborges 8 self.SetMenuBar(menuBar)
204    
205    
206     def CreateMenu(self, menuData):
207     menu = wx.Menu()
208 nino.borges 174 for eachLabel, eachStatus, eachHandler, eachType in menuData:
209 ninoborges 8 if not eachLabel:
210     menu.AppendSeparator()
211     continue
212 nino.borges 174 if eachType == "RADIO":
213     menuItem = menu.AppendRadioItem(-1,eachLabel,eachStatus)
214     else:
215     menuItem = menu.Append(-1, eachLabel, eachStatus)
216 nino.borges 303 if eachType == 'DISABLED':
217     menuItem.Enable(False)
218 ninoborges 8 self.Bind(wx.EVT_MENU, eachHandler, menuItem)
219     return menu
220    
221    
222     def OnFormChanged(self,event):
223     self.oKButton.Enable()
224 nino.borges 459
225 nino.borges 462 def OnPlatformChosen(self,event):
226     """Captures the platform selection and also asks if this case will use the new case path style"""
227     ## Ask about usign new vs old case path style. Dont do this if the selection is dis.
228    
229     caseName = self.casesListChoice.GetStringSelection()
230     CLM = caseName.split("_(")[1]
231     CLM = CLM[:-1]
232     CLM = CLM.replace('-','.')
233    
234     currentRevPlatform = self.reviewPlatformChoice.GetStringSelection()
235     if currentRevPlatform == "Concordance DIS":
236     self.casePathStyleChoice.SetStringSelection("")
237     elif currentRevPlatform == "":
238     self.casePathStyleChoice.SetStringSelection("")
239     else:
240     dlg = wx.SingleChoiceDialog(
241     self, """Please choose between using the old case path style\nor the new case path style below.\n\nIf you select the New case path style,\nyour folders on IDS will be created automatically.""", 'Case Path Style',
242     ['New Case Path Style', 'Old Case Path Style'],
243     wx.CHOICEDLG_STYLE
244     )
245     #dlg.SetSize(wx.Size(10,10))
246     if dlg.ShowModal() == wx.ID_OK:
247     #print "DEBUG: you chose %s"%dlg.GetStringSelection()
248     if dlg.GetStringSelection()[:3] == "New":
249     self.casePathStyleChoice.SetStringSelection("NEW")
250     if currentRevPlatform == "Concordance LN":
251     currentRevPlatform = "Concordance"
252     print "new selected, making folders..."
253     message = "Please wait while the standard folder structure is created on IDS..."
254     busy = PBI.PyBusyInfo(message, parent=self, title="MCP: System Busy.")
255 nino.borges 464 MCP_Lib.CreateCasePathStyleFolders(currentRevPlatform,CLM)
256 nino.borges 462 print "folders made."
257     del busy
258     doneDlg = wx.MessageDialog(self, "MCP: The standard case folders have been created.\nRemember to hit save to save your case changes to the mater database.", "MCP: Process Complete",wx.OK, wx.DefaultPosition)
259     doneDlg.ShowModal()
260     doneDlg.Destroy()
261     elif dlg.GetStringSelection()[:3] == "Old":
262     self.casePathStyleChoice.SetStringSelection("OLD")
263    
264     dlg.Destroy()
265     ## If they select new, create new folder structure.
266     ## Then set the path style choice to what htey selected.
267     self.OnFormChanged(event)
268    
269    
270 nino.borges 459 def OnTransferConfirm(self,event):
271     tpmTargetName = self.responsibleTPMComboBox.GetValue()
272     tpmTargetFirstName = tpmTargetName.split(", ")[1]
273 nino.borges 486 currentChargeableBool,currentRespAttorney,currentRespParalegal,currentRespVendorTpl,currentRevPlatform,respTPM,respOffice,caseStatus,uploadCost,storageCost,disclosureLetterBool,casePathStyle = self.console.GetCaseData(self.casesListChoice.GetStringSelection())
274 nino.borges 459 diag = wx.MessageDialog(self,"Please confirm that you do want to transfer this case to %s. " %tpmTargetFirstName, "Case Transfer Request",wx.OK |wx.CANCEL| wx.ICON_INFORMATION)
275     if diag.ShowModal() == wx.ID_OK:
276     #diag.ShowModal()
277 nino.borges 461 message = "Please wait while your case file is moved and your case is reassigned. Working..."
278     busy = PBI.PyBusyInfo(message, parent=self, title="MCP: System busy.")
279 nino.borges 459 transferStatusError = self.console.TransferCase(self.casesListChoice.GetStringSelection(),respTPM,tpmTargetName)
280     #print "Would have been transfered to %s. " %tpmTargetName
281 nino.borges 461 del busy
282 nino.borges 459 self.OnSetFields(event)
283     self.ResetCasesLists()
284 nino.borges 541
285     if transferStatusError:
286     dlg =wx.MessageDialog(self, "MCP: An error occurred and this case was not transferred.", "MCP: ERROR",wx.OK|wx.ICON_ERROR, wx.DefaultPosition)
287     else:
288     dlg = wx.MessageDialog(self, "MCP: This case has been transferred sucessfully to %s."% tpmTargetFirstName, "MCP: Process Complete",wx.OK, wx.DefaultPosition)
289     dlg.ShowModal()
290     dlg.Destroy()
291     else:
292 nino.borges 578 print respTPM
293 nino.borges 541 self.responsibleTPMComboBox.SetValue(respTPM)
294 nino.borges 459 diag.Destroy()
295    
296     def ResetCasesLists(self):
297     """This resets the various cases lists i.e. when you move or mark as dormant, etc"""
298 nino.borges 487 self.myCases, self.myActiveCases, self.officeCases, self.allCases, casesDir, self.casePathStyleMatrix = MCP_Lib.GetCaseList(accessConnectionObj=self.console.accessDB)
299 nino.borges 459
300    
301 ninoborges 8 def OnSetFields(self,event):
302     #print self.casesListChoice.GetStringSelection()
303     self.SetFields(self.casesListChoice.GetStringSelection())
304     self.oKButton.Disable()
305    
306     def SetFields(self, case):
307 nino.borges 464 currentChargeableBool,currentRespAttorney,currentRespParalegal,currentRespVendorTpl,currentRevPlatform,respTPM,respOffice,caseStatus,uploadCost,storageCost,disclosureLetterBool,casePathStyle = self.console.GetCaseData(case)
308 ninoborges 8 if currentChargeableBool:
309     self.chargeableCheckBox.SetValue(True)
310     else:
311     self.chargeableCheckBox.SetValue(False)
312     if currentRevPlatform == 'Concordance':
313     ## Make an assumption
314     currentRevPlatform = "Concordance DIS"
315     if currentRevPlatform:
316     #print currentRevPlatform
317     self.reviewPlatformChoice.SetStringSelection(currentRevPlatform)
318     else:
319     self.reviewPlatformChoice.SetStringSelection('')
320     if currentRespAttorney:
321     self.responsibleAttnyTextCtrl.SetValue(currentRespAttorney)
322     else:
323     self.responsibleAttnyTextCtrl.SetValue('')
324     if currentRespParalegal:
325     self.responsibleParalegalTextCtrl.SetValue(currentRespParalegal)
326     else:
327     self.responsibleParalegalTextCtrl.SetValue('')
328     if currentRespVendorTpl[0]:
329     self.responsibleProcessingVendorTextCtrl.SetValue(currentRespVendorTpl[0])
330     else:
331     self.responsibleProcessingVendorTextCtrl.SetValue("")
332     if currentRespVendorTpl[1]:
333     self.responsibleScanningVendorTextCtrl.SetValue(currentRespVendorTpl[1])
334     else:
335     self.responsibleScanningVendorTextCtrl.SetValue('')
336     if currentRespVendorTpl[2]:
337     self.responsibleHostingVendorTextCtrl.SetValue(currentRespVendorTpl[2])
338     else:
339     self.responsibleHostingVendorTextCtrl.SetValue('')
340     if respTPM:
341 nino.borges 459 #self.responsibleTPMTextCtrl.SetValue(respTPM)
342     self.responsibleTPMComboBox.SetValue(respTPM)
343    
344 ninoborges 8 else:
345 nino.borges 459 #self.responsibleTPMTextCtrl.SetValue('')
346     self.responsibleTPMComboBox.SetValue('')
347    
348 ninoborges 8 if respOffice:
349     self.responsibleOfficeTextCtrl.SetValue(respOffice)
350     else:
351     self.responsibleOfficeTextCtrl.SetValue('')
352 nino.borges 464 if currentRevPlatform != "Concordance DIS":
353     self.casePathStyleChoice.Enable(True)
354     if casePathStyle:
355     self.casePathStyleChoice.SetStringSelection(casePathStyle)
356     else:
357     self.casePathStyleChoice.SetStringSelection('')
358     else:
359     self.casePathStyleChoice.SetStringSelection('')
360     self.casePathStyleChoice.Enable(False)
361 ninoborges 8 if caseStatus:
362     self.caseStatusChoice.SetStringSelection(caseStatus)
363     else:
364     self.caseStatusChoice.SetStringSelection('')
365 nino.borges 303 if storageCost:
366     self.storageCostStaticText.SetLabel(" Storage:$%s "%str(storageCost))
367     else:
368 nino.borges 321 self.storageCostStaticText.SetLabel(' Storage:$0 ')
369 nino.borges 303 if uploadCost:
370     self.uploadCostStaticText.SetLabel(" Upload:$%s "%str(uploadCost))
371     else:
372 nino.borges 321 self.uploadCostStaticText.SetLabel(' Upload:$0 ')
373     if currentChargeableBool:
374     if currentRevPlatform:
375     if disclosureLetterBool:
376     self.disclosureLetterReminderText.SetLabel('')
377     else:
378     self.disclosureLetterReminderText.SetLabel('WARNING: There is no disclosure letter for this case on file!')
379     else:
380     self.disclosureLetterReminderText.SetLabel('')
381     else:
382     self.disclosureLetterReminderText.SetLabel('')
383 ninoborges 8
384     def OnProcess(self, event):
385     caseName = self.casesListChoice.GetStringSelection()
386     if self.chargeableCheckBox.GetValue():
387     chargeableBool = True
388     else:
389     chargeableBool = False
390     currentRevPlatform = self.reviewPlatformChoice.GetStringSelection()
391     caseStatus = self.caseStatusChoice.GetStringSelection()
392     currentRespAttorney = self.responsibleAttnyTextCtrl.GetValue()
393     currentRespParalegal = self.responsibleParalegalTextCtrl.GetValue()
394     currentRespVendorTpl = (self.responsibleProcessingVendorTextCtrl.GetValue(),self.responsibleScanningVendorTextCtrl.GetValue(),
395     self.responsibleHostingVendorTextCtrl.GetValue())
396 nino.borges 459 #respTPM = self.responsibleTPMTextCtrl.GetValue()
397     respTPM = self.responsibleTPMComboBox.GetValue()
398 ninoborges 8 respOffice = self.responsibleOfficeTextCtrl.GetValue()
399 nino.borges 464 casePathStyle = self.casePathStyleChoice.GetStringSelection()
400 ninoborges 8 print "Updating Access DB..."
401     self.console.EditCaseData(caseName,chargeableBool,currentRespAttorney,currentRespParalegal,currentRespVendorTpl,currentRevPlatform,
402 nino.borges 464 respTPM,respOffice, caseStatus, casePathStyle)
403 ninoborges 8 print "Complete!"
404     finishedDlg = wx.MessageDialog(self, "MCP: Your settings have been saved to the Matter Management database.", "MCP: Process Complete",wx.OK, wx.DefaultPosition)
405     finishedDlg.ShowModal()
406     finishedDlg.Destroy()
407     self.oKButton.Disable()
408    
409     def CreateBoxesSection(self):
410     self.oKButton = wx.Button(self.panel, wx.ID_OK,'Save')
411     self.oKButton.SetDefault()
412     self.oKButton.SetSize(self.oKButton.GetBestSize())
413     self.cancelButton = wx.Button(self.panel, wx.ID_CANCEL,'Close')
414     self.cancelButton.SetSize(self.cancelButton.GetBestSize())
415     self.buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
416     self.buttonSizer.Add(self.oKButton,0,wx.ALL,10)
417     self.buttonSizer.Add(self.cancelButton,0,wx.ALL,10)
418    
419     def CloseWindow(self, event):
420     self.Close(True)
421 nino.borges 158
422 nino.borges 174 def OnChangeCaseView(self,event):
423     self.casesListChoice.Clear()
424 nino.borges 540 labID = event.GetEventObject().GetLabel(event.GetId())
425     #eventID = event.GetId()
426     #print eventID
427     ## Never use event ids again.
428    
429     if labID == 'My Cases':
430     #if eventID == 105:
431 nino.borges 174 #change it to my cases
432 nino.borges 189 self.casesListChoice.SetItems(self.myCases)
433     self.casesListChoice.SetSelection(0)
434     self.SetFields(self.myCases[0])
435 nino.borges 578 if labID == 'My Active Cases':
436 nino.borges 540 #if eventID == 106:
437 nino.borges 462 #change it to my active cases
438 nino.borges 454 self.casesListChoice.SetItems(self.myActiveCases)
439     self.casesListChoice.SetSelection(0)
440 nino.borges 456 self.SetFields(self.myActiveCases[0])
441 nino.borges 540 if labID == 'My Office Cases':
442     #if eventID == 107:
443 nino.borges 454 #change it to office cases
444 nino.borges 189 self.casesListChoice.SetItems(self.officeCases)
445     self.casesListChoice.SetSelection(0)
446     self.SetFields(self.officeCases[0])
447 nino.borges 578 if labID == 'All Cases':
448 nino.borges 540 #if eventID == 108:
449 nino.borges 174 #change it to all cases
450 nino.borges 189 self.casesListChoice.SetItems(self.allCases)
451     self.casesListChoice.SetSelection(0)
452     self.SetFields(self.allCases[0])
453 nino.borges 174
454    
455 nino.borges 487 def OnAddNewCase(self,event):
456     """Main callback for adding a new case in view/edit"""
457 nino.borges 489 #caseName = self.casesListChoice.GetStringSelection()
458 nino.borges 487 office = self.responsibleOfficeTextCtrl.GetValue()
459 nino.borges 489 #CLM = caseName.split("_(")[1]
460     #CLM = CLM[:-1]
461     #CLM = CLM.replace('-','.')
462 nino.borges 487 dlg = AddNewCaseDialog.AddNewCaseDialog(self)
463     if dlg.ShowModal() == wx.ID_OK:
464     ## test to see if the case already exists and if it's assigned to somone else, or none.
465     caseName, clientNumb,matterNumb = dlg.GetValues()
466 nino.borges 489 fullList = self.console.GetFullCLMList()
467     if "%s.%s"%(clientNumb,matterNumb) in fullList:
468     print "Case already exists, take over?"
469     respTPM = self.console.accessDB.GetResponsibleTPM("%s.%s"%(clientNumb,matterNumb))
470     if respTPM:
471     respTPMFirstName = respTPM.split(", ")[1]
472     warningMessage = wx.MessageDialog(self,"This case already exists in the database and is assigned to %s. Would you like to take over this case?"% respTPMFirstName, "Transfer Case?",wx.OK |wx.CANCEL| wx.ICON_INFORMATION)
473     if warningMessage.ShowModal()==wx.ID_OK:
474     print "Transfering case..."
475     message = "Please wait while your case file is moved and your case is reassigned. Working..."
476     busy = PBI.PyBusyInfo(message, parent=self, title="MCP: System busy.")
477     transferStatusError = self.console.TransferCase("%s_(%s)"%(self.console.accessDB.GetCaseName("%s.%s"%(clientNumb,matterNumb)),"%s-%s"%(clientNumb,matterNumb)),respTPM,self.console.tPMName)
478     del busy
479     self.OnSetFields(event)
480     self.ResetCasesLists()
481     ## Use some list comprehension to edit all three case lists in place to update UI.
482     #print "you changed it so new value is %s_(%s)"%(newCaseName,newCLM)
483     #self.myCases = [cse.replace(caseName,"%s_(%s)"%(newCaseName,newCLM.replace(".","-")))for cse in self.myCases]
484     #self.officeCases = [cse.replace(caseName,"%s_(%s)"%(newCaseName,newCLM.replace(".","-")))for cse in self.officeCases]
485     #self.allCases = [cse.replace(caseName,"%s_(%s)"%(newCaseName,newCLM.replace(".","-")))for cse in self.allCases]
486     #
487     #self.casesListChoice.SetItems(self.myCases)
488     #self.casesListChoice.SetSelection(0)
489     #self.SetFields(self.myCases[0])
490     else:
491     print "adding case..."
492     self.console.AddNewCase(caseName,"%s-%s"%(clientNumb,matterNumb))
493 nino.borges 495 finishedDlg = wx.MessageDialog(self, "A new case been added to the MCP. \n\nOnce you receive the subpoena, complaint, or other operative document, remember to send this document and a new case template form to the discovery counsel email group. This form can be found on the YourSource DDSC portal.\n\nEnd Of Line...", "MCP: Process Complete",wx.OK, wx.DefaultPosition)
494 nino.borges 489 ## Use some list comprehension to edit all three case lists in place to update UI.
495     print "New case is %s_(%s)"%(caseName,"%s-%s"%(clientNumb,matterNumb))
496     self.myCases.append("%s_(%s)"%(caseName,"%s-%s"%(clientNumb,matterNumb)))
497     self.myCases.sort()
498     self.myActiveCases.append("%s_(%s)"%(caseName,"%s-%s"%(clientNumb,matterNumb)))
499     self.myActiveCases.sort()
500     self.officeCases.append("%s_(%s)"%(caseName,"%s-%s"%(clientNumb,matterNumb)))
501     self.officeCases.sort()
502     self.allCases.append("%s_(%s)"%(caseName,"%s-%s"%(clientNumb,matterNumb)))
503     #self.allCases.sort()
504    
505     self.casesListChoice.SetItems(self.myCases)
506     self.casesListChoice.SetSelection(0)
507     self.SetFields(self.myCases[0])
508     finishedDlg.ShowModal()
509 nino.borges 487
510 nino.borges 343 def OnEditCaseName(self,event):
511     caseName = self.casesListChoice.GetStringSelection()
512     office = self.responsibleOfficeTextCtrl.GetValue()
513     CLM = caseName.split("_(")[1]
514     CLM = CLM[:-1]
515     CLM = CLM.replace('-','.')
516     dlg = AddEditCaseNameDialog.AddEditCaseNameDialog(self, CLM,caseName)
517     if dlg.ShowModal() == wx.ID_OK:
518     changed = False
519     newCaseName, clientNumb,matterNumb = dlg.GetValues()
520     newCLM = clientNumb + '.' + matterNumb
521     if caseName.split('_(')[0] != newCaseName:
522     changed = True
523     if newCLM != CLM:
524     changed = True
525     if changed:
526     self.console.ChangeCaseName(caseName,newCaseName,newCLM)
527     doneDlg = wx.MessageDialog(self, "MCP: Case name has been changed to %s_(%s)"%(newCaseName,newCLM), "MCP: Success",wx.OK, wx.DefaultPosition)
528     doneDlg.ShowModal()
529     doneDlg.Destroy()
530 nino.borges 421 ## Use some list comprehension to edit all three case lists in place to update UI.
531 nino.borges 343 print "you changed it so new value is %s_(%s)"%(newCaseName,newCLM)
532 nino.borges 421 self.myCases = [cse.replace(caseName,"%s_(%s)"%(newCaseName,newCLM.replace(".","-")))for cse in self.myCases]
533     self.officeCases = [cse.replace(caseName,"%s_(%s)"%(newCaseName,newCLM.replace(".","-")))for cse in self.officeCases]
534     self.allCases = [cse.replace(caseName,"%s_(%s)"%(newCaseName,newCLM.replace(".","-")))for cse in self.allCases]
535 nino.borges 343
536     self.casesListChoice.SetItems(self.myCases)
537     self.casesListChoice.SetSelection(0)
538     self.SetFields(self.myCases[0])
539     dlg.Destroy()
540     #err = self.console.ViewCaseNotes(caseName,office)
541    
542 nino.borges 158 def OnViewCaseNotes(self,event):
543     caseName = self.casesListChoice.GetStringSelection()
544     office = self.responsibleOfficeTextCtrl.GetValue()
545     err = self.console.ViewCaseNotes(caseName,office)
546     if err:
547     errDlg = wx.MessageDialog(self, "MCP: The path to this case file could not be found.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
548     errDlg.ShowModal()
549     errDlg.Destroy()
550    
551     def OnViewProdSpec(self,event):
552     caseName = self.casesListChoice.GetStringSelection()
553     office = self.responsibleOfficeTextCtrl.GetValue()
554     err = self.console.ViewProdSpec(caseName,office)
555     if err:
556     errDlg = wx.MessageDialog(self, "MCP: The path to this case file could not be found.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
557     errDlg.ShowModal()
558     errDlg.Destroy()
559 ninoborges 8
560 nino.borges 261 def OnOpenAlternateMediaFolder(self,event):
561     caseName = self.casesListChoice.GetStringSelection()
562     office = self.responsibleOfficeTextCtrl.GetValue()
563     err = self.console.OpenAlternateMediaFolder(caseName,office)
564     if err:
565     errDlg = wx.MessageDialog(self, "MCP: There is no current alternate media folder for this case.\nYou can set this in Settings.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
566     errDlg.ShowModal()
567     errDlg.Destroy()
568    
569 ninoborges 8 def OnOpenCaseFolder(self,event):
570     caseName = self.casesListChoice.GetStringSelection()
571     office = self.responsibleOfficeTextCtrl.GetValue()
572     err = self.console.OpenCaseFolder(caseName,office)
573     if err:
574     errDlg = wx.MessageDialog(self, "MCP: The path to this case file could not be found.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
575     errDlg.ShowModal()
576     errDlg.Destroy()
577    
578     def OnViewCaseUploads(self, event):
579     uploadList = self.console.GetUploadData(self.casesListChoice.GetStringSelection())
580     numberOfRows = len(uploadList)
581     uploadTotal = self.console.GetUploadTotal(uploadList)
582     caseName = self.casesListChoice.GetStringSelection()
583     CLM = caseName.split("_(")[1]
584     CLM = CLM[:-1]
585     CLM = CLM.replace('-','.')
586     #print CLM
587     if numberOfRows == 0:
588     dlg = wx.MessageDialog(self, "MCP: There are no case uploads for this case.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
589     else:
590     dlg = CaseUploadsDialog.CaseUploadsDialog(self,numberOfRows, uploadList, uploadTotal,CLM)
591     #dlg.Show(True)
592     dlg.ShowModal()
593     dlg.Destroy()
594    
595     def OnViewDocProduction(self,event):
596 nino.borges 321 prodMatrix = self.console.GetProductionData(self.casesListChoice.GetStringSelection())
597     prodList = []
598     for key in prodMatrix.keys():
599     prodList.extend(prodMatrix[key])
600 ninoborges 8 numberOfRows = len(prodList)
601     prodTotals = self.console.GetProductionTotal(prodList)
602     caseName = self.casesListChoice.GetStringSelection()
603     CLM = caseName.split("_(")[1]
604     CLM = CLM[:-1]
605     CLM = CLM.replace('-','.')
606     #print CLM
607     if numberOfRows == 0:
608     dlg = wx.MessageDialog(self, "MCP: There are no current productions for this case.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
609     else:
610     dlg = CurrentProductionsDialog.CaseUploadsDialog(self,numberOfRows, prodList,CLM, prodTotals)
611     #dlg.Show(True)
612     dlg.ShowModal()
613     dlg.Destroy()
614    
615     def OnAddDocProduction(self, event):
616     caseName = self.casesListChoice.GetStringSelection()
617 nino.borges 321 caseDatabaseList = self.console.GetDatabaseList(caseName)
618     possibleProducedToEntities = self.console.GetPossibleProducedToEntities(caseName)
619     possibleProdReqByNames = self.console.GetPossibleProdReqByNames(caseName)
620 ninoborges 8 CLM = caseName.split("_(")[1]
621     CLM = CLM[:-1]
622     CLM = CLM.replace('-','.')
623     #print CLM
624 nino.borges 321 dlg = AddDocumentProductionDialog.AddDocumentProductionDialog(self,CLM, caseDatabaseList, possibleProducedToEntities,possibleProdReqByNames)
625 ninoborges 8 if dlg.ShowModal() == wx.ID_OK:
626 nino.borges 321 prodProcessedDate, begBates, endBates, prodDocCount, prodPageCount, prodNotes, prodTo, prodMedia,prodSource,prodReqBy,prodSentDate,prodMediaPassword = dlg.GetValues()
627 ninoborges 8 #print prodDate
628     dateConverter = NinoGenTools.DateUtilities()
629 nino.borges 321 prodID = 'prod_' + str(dateConverter.ConvertDateFormat(prodProcessedDate, convertToFormat='computer'))
630     errRpt = self.console.AddProductionEntry(CLM,prodID,prodProcessedDate,begBates,endBates,prodDocCount, prodPageCount, prodNotes, prodTo, prodMedia,prodSource,prodReqBy,prodSentDate,prodMediaPassword)
631 ninoborges 8 if errRpt:
632     doneDlg = wx.MessageDialog(self, "MCP: All fields need to be filled out.\nPlease try again.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
633     else:
634     doneDlg = wx.MessageDialog(self, "MCP: Production detail added successfully.", "MCP: Success",wx.OK, wx.DefaultPosition)
635     doneDlg.ShowModal()
636     doneDlg.Destroy()
637    
638 nino.borges 321 def OnChangeDisclosureLetter(self,event):
639     office = self.responsibleOfficeTextCtrl.GetValue()
640     altMediaPath, casePath = self.console.GetCasePathsData(self.casesListChoice.GetStringSelection(),office)
641     disclosureLetterSet,disclosureLetterPath = self.console.GetDisclosureLetterData(self.casesListChoice.GetStringSelection())
642     if disclosureLetterPath:
643     disclosureLetterPath = str(disclosureLetterPath)
644     else:
645     disclosureLetterPath = ""
646     dlg = DisclosureLetterDialog.DisclosureLetterDialog(self, disclosureLetterSet, disclosureLetterPath, casePath)
647     if dlg.ShowModal() == wx.ID_OK:
648     newdisclosureLetterPath,errRpt = dlg.GetValues()
649     dlg.Destroy()
650     if errRpt:
651     doneDlg = wx.MessageDialog(self, "MCP: The Disclosure letter could NOT be loaded.\nPlease try again.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
652     else:
653     if newdisclosureLetterPath == disclosureLetterPath:
654     doneDlg = False
655     else:
656     self.console.SetDisclosureLetterData(self.casesListChoice.GetStringSelection(),newdisclosureLetterPath)
657     doneDlg = wx.MessageDialog(self, "MCP: Disclosure letter loaded successfully.", "MCP: Success",wx.OK, wx.DefaultPosition)
658     self.disclosureLetterReminderText.SetLabel('')
659     if doneDlg:
660     doneDlg.ShowModal()
661     doneDlg.Destroy()
662    
663 nino.borges 262 def OnCasePathsSettings(self, event):
664     office = self.responsibleOfficeTextCtrl.GetValue()
665     altMediaPath, casePath = self.console.GetCasePathsData(self.casesListChoice.GetStringSelection(),office)
666     if altMediaPath:
667     pass
668     else:
669     altMediaPath = ""
670     dlg = CasePathsDialog.CasePathsDialog(self, altMediaPath, casePath)
671     if dlg.ShowModal() == wx.ID_OK:
672 nino.borges 265 newAltMediaPath,errRpt = dlg.GetValues()
673 nino.borges 262 dlg.Destroy()
674 nino.borges 265 if errRpt:
675     doneDlg = wx.MessageDialog(self, "MCP: The media path either does not exist, is local or references a drive letter, which is not allowed.\nPlease try again.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
676     else:
677     if newAltMediaPath == altMediaPath:
678     pass
679     else:
680     self.console.SetAlternateMediaFolder(self.casesListChoice.GetStringSelection(),newAltMediaPath)
681     doneDlg = wx.MessageDialog(self, "MCP: Alternate Media Path updated successfully.", "MCP: Success",wx.OK, wx.DefaultPosition)
682     if doneDlg:
683     doneDlg.ShowModal()
684     doneDlg.Destroy()
685 nino.borges 303
686     def OnChangePricing(self,event):
687 nino.borges 321 #StorageUploadCostsDialog
688 nino.borges 531 defaultStorageCosts,defaultUploadCost,defaultOcrCost,defaultAnalyticsCost,defaultMweProcessingCost,defaultTiffingCost = self.console.GetDefaultPricingData()
689     currentOcrCost,currentAnalyticsCost,currentMweProcessingCost, currentTiffingCost = self.console.GetCurrentPrices(self.casesListChoice.GetStringSelection())
690 nino.borges 303 office = self.responsibleOfficeTextCtrl.GetValue()
691     currentStorageCosts = self.storageCostStaticText.Label
692     if currentStorageCosts:
693     currentStorageCosts = float(currentStorageCosts.replace(" Storage:$",""))
694     currentUploadCosts = self.uploadCostStaticText.Label
695     if currentUploadCosts:
696     currentUploadCosts = float(currentUploadCosts.replace(" Upload:$",""))
697 nino.borges 531 dlg = StorageUploadCostsDialog.StorageUploadCostsDialog(self, currentStorageCosts,currentUploadCosts,currentOcrCost,currentAnalyticsCost,currentMweProcessingCost, currentTiffingCost,defaultStorageCosts,defaultUploadCost,defaultOcrCost,defaultAnalyticsCost,defaultMweProcessingCost,defaultTiffingCost)
698 nino.borges 303 if dlg.ShowModal() == wx.ID_OK:
699 nino.borges 531 newStorageCosts,newUploadCosts,newOcrCost,newAnalyticsCost,newMweProcessingCost,newTiffingCost = dlg.GetValues()
700 nino.borges 303 dlg.Destroy()
701     self.console.SetUploadAndStorageCosts(self.casesListChoice.GetStringSelection(),str(newUploadCosts),str(newStorageCosts))
702 nino.borges 531 self.console.SetOtherCosts(self.casesListChoice.GetStringSelection(),newOcrCost,newAnalyticsCost,newMweProcessingCost,newTiffingCost)
703 nino.borges 303 doneDlg = wx.MessageDialog(self, "MCP: Upload and Storage Pricing updated successfully.", "MCP: Success",wx.OK, wx.DefaultPosition)
704     doneDlg.ShowModal()
705 nino.borges 467 self.SetFields(self.casesListChoice.GetStringSelection())
706 nino.borges 303 doneDlg.Destroy()
707 ninoborges 8
708 nino.borges 268 def OnEditVendorFolders(self,event):
709     office = self.responsibleOfficeTextCtrl.GetValue()
710 nino.borges 271 currentVendorFolder = self.console.GetVendorFolders(self.casesListChoice.GetStringSelection())
711     if currentVendorFolder:
712     pass
713     else:
714     currentVendorFolder = "None"
715     vendorFolderList = self.console.GetVendorFoldersList()
716     dlg = EditVendorFolderDialog.EditVendorFolderDialog(self, currentVendorFolder,vendorFolderList)
717     if dlg.ShowModal() == wx.ID_OK:
718     newCurrentVendorFolder = dlg.GetValues()
719     if newCurrentVendorFolder == currentVendorFolder:
720     pass
721     else:
722     self.console.SetVendorFolders(self.casesListChoice.GetStringSelection(), newCurrentVendorFolder)
723     doneDlg = wx.MessageDialog(self, "MCP: Vendor Folder updated successfully.", "MCP: Success",wx.OK, wx.DefaultPosition)
724     doneDlg.ShowModal()
725     doneDlg.Destroy()
726 nino.borges 321
727     def OnCreateProductionReport(self,event):
728     """This method creates or updates the Produciton Reporting page."""
729     ## Check to see if a alternate media folder exists
730     caseName = self.casesListChoice.GetStringSelection()
731     office = self.responsibleOfficeTextCtrl.GetValue()
732     err = self.console.OpenAlternateMediaFolder(caseName,office,testOnly=True)
733     if err:
734     errDlg = wx.MessageDialog(self, "MCP: There is no current alternate media folder for this case. A media folder is necesary for this option.\nYou can set this in Settings.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
735     errDlg.ShowModal()
736     errDlg.Destroy()
737     else:
738     err2 = self.console.CreateProductionReport(caseName,office)
739     if err2:
740     err2Dlg = wx.MessageDialog(self, "MCP: There are no productions for this case..", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
741     err2Dlg.ShowModal()
742     err2Dlg.Destroy()
743     else:
744     sucessDlg = wx.MessageDialog(self, "MCP: The production report has been saved to the __MCP_data folder, in the alternate media folder.", "MCP: Process Complete",wx.OK, wx.DefaultPosition)
745     sucessDlg.ShowModal()
746     sucessDlg.Destroy()
747 nino.borges 531
748     def OnCreateManageReport(self,event):
749     """ launches the dialog that creates the manager reports"""
750     tpmList = self.console.fullTPMMatrix.keys()
751     dlg = ManagerReportsDialog.ManagerReportsDialog(self, tpmList)
752     if dlg.ShowModal() == wx.ID_OK:
753     report,tpm = dlg.GetValues()
754     err = self.console.CreateManagerReport(report,tpm)
755     if err:
756     errDlg = wx.MessageDialog(self, "MCP: That report could no be run.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
757     errDlg.ShowModal()
758     errDlg.Destroy()
759     else:
760     sucessDlg = wx.MessageDialog(self, "MCP: Report created sucessfully. Launching...", "MCP: Process Complete",wx.OK, wx.DefaultPosition)
761     sucessDlg.ShowModal()
762     sucessDlg.Destroy()
763    
764 ninoborges 8 def OnAbout(self, event):
765     """
766     OnAbout(self,event) Displays an about dialog with developer and bug reporting info
767     """
768     dlg = wx.MessageDialog(self, "MCP is a case organization program.\n"
769     "\n\n"
770     "For questions or comments about this program\n"
771     "or to report a bug, please email the program\n"
772     "creator at Nino.Borges@gmail.com\n\n"
773     "MCP is\n"
774 nino.borges 540 "Copyright (c) 2009 - 2014 Emanuel Borges.\n"
775 ninoborges 8 "All rights reserved.\n"
776     "(Nino.Borges@gmail.com)\n",
777     "About MCP", wx.OK | wx.ICON_INFORMATION)
778     dlg.ShowModal()
779     dlg.Destroy()
780    
781    
782     class MyApp(wx.App):
783     def OnInit(self):
784 nino.borges 466 image = wx.Image("DDSC-LTsmall_2.jpg", wx.BITMAP_TYPE_JPEG)
785     bmp = image.ConvertToBitmap()
786     wx.SplashScreen(bmp, wx.SPLASH_CENTRE_ON_PARENT |wx.SPLASH_TIMEOUT, 2000, None, -1)
787     wx.Yield()
788 ninoborges 8 prgVersion = MCP_Lib.GetMCPVersion()
789 nino.borges 492 self.frame = MyFrame(None, -1, "MCP Case Information Console %s"%prgVersion)
790 ninoborges 8 self.frame.Show(True)
791     self.SetTopWindow(self.frame)
792     return True
793    
794    
795     if __name__ == '__main__':
796     app = MyApp(0)
797     app.MainLoop()