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: 531
Committed: Thu Mar 13 19:08:47 2014 UTC (12 years ago) by nino.borges
Content type: text/x-python
File size: 46247 byte(s)
Log Message:
Finished adding the manager reporting and the expanded cost updating.

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