ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/MCP/MCP_ViewEdit_UI.py
Revision: 467
Committed: Tue Oct 8 14:30:44 2013 UTC (12 years, 5 months ago) by nino.borges
Content type: text/x-python
File size: 40368 byte(s)
Log Message:
Updated so that update pricing now refereshes the case settings window. updated version to build 002.

File Contents

# Content
1 """
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 import wx, MCP_Lib, MCP_Console,os,CurrentProductionsDialog,CaseUploadsDialog,AddDocumentProductionDialog,CasePathsDialog,NinoGenTools,EditVendorFolderDialog,StorageUploadCostsDialog,DisclosureLetterDialog,AddEditCaseNameDialog
15 import wx.lib.agw.pybusyinfo as PBI
16 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 #casesList,casesDir = MCP_Lib.GetCaseList()
26 ## TODO: Why are we calling MCP_lib here. self.console already did that and got this.
27 self.myCases, self.myActiveCases, self.officeCases, self.allCases, casesDir,self.casePathStyleMatrix = MCP_Lib.GetCaseList()
28 self.casesListChoice = wx.Choice(self.panel, -1, wx.DefaultPosition, choices=self.myCases)
29 self.casesListChoice.SetSelection(0)
30
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 self.disclosureLetterReminderText = wx.StaticText(self.panel, -1, "", (50, 55), (65, -1), wx.ALIGN_LEFT)
39 self.disclosureLetterReminderText.SetForegroundColour('Red')
40
41 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 #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 responsibleOfficeStaticText = wx.StaticText(self.panel, -1, "Office: ",wx.DefaultPosition)
59 self.responsibleOfficeTextCtrl = wx.TextCtrl(self.panel, -1, "", wx.DefaultPosition, (140,-1))
60 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 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
67
68 self.SetFields(self.myCases[0])
69
70 self.CreateBoxesSection()
71
72 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 casesSizer = wx.BoxSizer(wx.HORIZONTAL)
77 casesSizer.Add(casesListStaticText,0,wx.ALL,5)
78 casesSizer.Add(self.casesListChoice,0,wx.ALL,5)
79 #casesSizer.Add(costSizer,0,wx.ALL,5)
80
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 secondHalfSizer.Add(responsibleTPMStaticText, pos = (1,2),flag=wx.ALIGN_RIGHT)
89 #secondHalfSizer.Add(self.responsibleTPMTextCtrl, pos = (1,3))
90 secondHalfSizer.Add(self.responsibleTPMComboBox, pos = (1,3))
91 secondHalfSizer.Add(responsibleParalegalStaticText, pos=(2,0))
92 secondHalfSizer.Add(self.responsibleParalegalTextCtrl, pos=(2,1))
93 secondHalfSizer.Add(responsibleOfficeStaticText, pos=(2,2),flag=wx.ALIGN_RIGHT)
94 secondHalfSizer.Add(self.responsibleOfficeTextCtrl, pos=(2,3))
95 secondHalfSizer.Add(caseStatusStaticText, pos=(3,0))
96 secondHalfSizer.Add(self.caseStatusChoice, pos=(3,1))
97 secondHalfSizer.Add(casePathStyleStaticText, pos=(3,2),flag=wx.ALIGN_RIGHT)
98 secondHalfSizer.Add(self.casePathStyleChoice, pos=(3,3))
99
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 mainSizer.Add(costSizer,0,wx.RIGHT|wx.ALIGN_RIGHT,10)
113 mainSizer.Add(casesSizer,0,wx.BOTTOM|wx.LEFT|wx.RIGHT, 20)
114 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 self.Bind(wx.EVT_CHOICE, self.OnPlatformChosen, self.casePathStyleChoice)
139 self.Bind(wx.EVT_CHOICE, self.OnPlatformChosen, self.reviewPlatformChoice)
140 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 #self.Bind(wx.EVT_TEXT, self.OnFormChanged, self.responsibleTPMTextCtrl)
144 self.Bind(wx.EVT_TEXT, self.OnTransferConfirm, self.responsibleTPMComboBox)
145 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 return(("Case",
162 ("Edit Case &Name","Allows you to edit the case name.",self.OnEditCaseName,""),
163 ("Change Negotiated &Price","Allows you to edit the negotiated prices for hosting and uploading.",self.OnChangePricing,""),
164 ("Disclosure &Letter ...","Allows you to load and link your disclosure letter to this case.",self.OnChangeDisclosureLetter,""),
165 ("","","",""),
166 ("&Transfer Case","Allows you to transfer a case to another TPM.",self.NothingYet,"DISABLED"),
167 ("","","",""),
168 ("&Add New Case","Adds a new case to the system.",self.NothingYet,"DISABLED")),
169 ("View",
170 ("My Cases", "Chooses from your assigned cases.",self.OnChangeCaseView,"RADIO"),
171 ("My Active Cases", "Chooses from your assigned cases, filtered by Active Cases.",self.OnChangeCaseView,"RADIO"),
172 ("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 ("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 ("&Alternate Media Folder","Opens the alternate media path for the current selected case.",self.OnOpenAlternateMediaFolder,""),
181 ("Open Case &Folder","Opens the case folder for the current selected case.",self.OnOpenCaseFolder,"")),
182 ("Production",
183 ("&Add Production Entry","Adds a new production to the matter database.",self.OnAddDocProduction,"")),
184 ("Settings",
185 ("Linked &Vendor Folders","Allows you to link vendor folders to this case for copy ups.",self.OnEditVendorFolders,""),
186 ("&Case Paths","Allows you to set or change the alternate media path.",self.OnCasePathsSettings,"")),
187 ("Reporting",
188 ("Create &Produciton Report","Creates or updates the Production Report Page.",self.OnCreateProductionReport,""),
189 ("&Managerial","Managerial reports.",self.NothingYet,"DISABLED")),
190 ("&Help",
191 ("&About", "Displays the About Window.", self.OnAbout,"")))
192
193 def CreateMenuBar(self):
194 menuBar = wx.MenuBar()
195 count = 1
196 for eachMenuData in self.MenuData():
197 menuLabel = eachMenuData[0]
198 menuItems = eachMenuData[1:]
199 menuBar.Append(self.CreateMenu(menuItems), menuLabel)
200 count = count + 1
201 self.SetMenuBar(menuBar)
202
203
204 def CreateMenu(self, menuData):
205 menu = wx.Menu()
206 for eachLabel, eachStatus, eachHandler, eachType in menuData:
207 if not eachLabel:
208 menu.AppendSeparator()
209 continue
210 if eachType == "RADIO":
211 menuItem = menu.AppendRadioItem(-1,eachLabel,eachStatus)
212 else:
213 menuItem = menu.Append(-1, eachLabel, eachStatus)
214 if eachType == 'DISABLED':
215 menuItem.Enable(False)
216 self.Bind(wx.EVT_MENU, eachHandler, menuItem)
217 return menu
218
219
220 def OnFormChanged(self,event):
221 self.oKButton.Enable()
222
223 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 MCP_Lib.CreateCasePathStyleFolders(currentRevPlatform,CLM)
254 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 def OnTransferConfirm(self,event):
269 tpmTargetName = self.responsibleTPMComboBox.GetValue()
270 tpmTargetFirstName = tpmTargetName.split(", ")[1]
271 currentChargeableBool,currentRespAttorney,currentRespParalegal,currentRespVendorTpl,currentRevPlatform,respTPM,respOffice,caseStatus,uploadCost,storageCost,disclosureLetterBool = self.console.GetCaseData(self.casesListChoice.GetStringSelection())
272 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 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 transferStatusError = self.console.TransferCase(self.casesListChoice.GetStringSelection(),respTPM,tpmTargetName)
278 #print "Would have been transfered to %s. " %tpmTargetName
279 del busy
280 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 self.myCases, self.myActiveCases, self.officeCases, self.allCases, casesDir, self.casePathStyleMatrix = MCP_Lib.GetCaseList()
293
294
295 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 currentChargeableBool,currentRespAttorney,currentRespParalegal,currentRespVendorTpl,currentRevPlatform,respTPM,respOffice,caseStatus,uploadCost,storageCost,disclosureLetterBool,casePathStyle = self.console.GetCaseData(case)
302 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 #self.responsibleTPMTextCtrl.SetValue(respTPM)
336 self.responsibleTPMComboBox.SetValue(respTPM)
337
338 else:
339 #self.responsibleTPMTextCtrl.SetValue('')
340 self.responsibleTPMComboBox.SetValue('')
341
342 if respOffice:
343 self.responsibleOfficeTextCtrl.SetValue(respOffice)
344 else:
345 self.responsibleOfficeTextCtrl.SetValue('')
346 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 if caseStatus:
356 self.caseStatusChoice.SetStringSelection(caseStatus)
357 else:
358 self.caseStatusChoice.SetStringSelection('')
359 if storageCost:
360 self.storageCostStaticText.SetLabel(" Storage:$%s "%str(storageCost))
361 else:
362 self.storageCostStaticText.SetLabel(' Storage:$0 ')
363 if uploadCost:
364 self.uploadCostStaticText.SetLabel(" Upload:$%s "%str(uploadCost))
365 else:
366 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
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 #respTPM = self.responsibleTPMTextCtrl.GetValue()
391 respTPM = self.responsibleTPMComboBox.GetValue()
392 respOffice = self.responsibleOfficeTextCtrl.GetValue()
393 casePathStyle = self.casePathStyleChoice.GetStringSelection()
394 print "Updating Access DB..."
395 self.console.EditCaseData(caseName,chargeableBool,currentRespAttorney,currentRespParalegal,currentRespVendorTpl,currentRevPlatform,
396 respTPM,respOffice, caseStatus, casePathStyle)
397 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
416 def OnChangeCaseView(self,event):
417 self.casesListChoice.Clear()
418 eventID = event.GetId()
419 print eventID
420 if eventID == 105:
421 #change it to my cases
422 self.casesListChoice.SetItems(self.myCases)
423 self.casesListChoice.SetSelection(0)
424 self.SetFields(self.myCases[0])
425 if eventID == 106:
426 #change it to my active cases
427 self.casesListChoice.SetItems(self.myActiveCases)
428 self.casesListChoice.SetSelection(0)
429 self.SetFields(self.myActiveCases[0])
430 if eventID == 107:
431 #change it to office cases
432 self.casesListChoice.SetItems(self.officeCases)
433 self.casesListChoice.SetSelection(0)
434 self.SetFields(self.officeCases[0])
435 if eventID == 108:
436 #change it to all cases
437 self.casesListChoice.SetItems(self.allCases)
438 self.casesListChoice.SetSelection(0)
439 self.SetFields(self.allCases[0])
440
441
442 def OnEditCaseName(self,event):
443 caseName = self.casesListChoice.GetStringSelection()
444 office = self.responsibleOfficeTextCtrl.GetValue()
445 CLM = caseName.split("_(")[1]
446 CLM = CLM[:-1]
447 CLM = CLM.replace('-','.')
448 dlg = AddEditCaseNameDialog.AddEditCaseNameDialog(self, CLM,caseName)
449 if dlg.ShowModal() == wx.ID_OK:
450 changed = False
451 newCaseName, clientNumb,matterNumb = dlg.GetValues()
452 newCLM = clientNumb + '.' + matterNumb
453 if caseName.split('_(')[0] != newCaseName:
454 changed = True
455 if newCLM != CLM:
456 changed = True
457 if changed:
458 self.console.ChangeCaseName(caseName,newCaseName,newCLM)
459 doneDlg = wx.MessageDialog(self, "MCP: Case name has been changed to %s_(%s)"%(newCaseName,newCLM), "MCP: Success",wx.OK, wx.DefaultPosition)
460 doneDlg.ShowModal()
461 doneDlg.Destroy()
462 ## Use some list comprehension to edit all three case lists in place to update UI.
463 print "you changed it so new value is %s_(%s)"%(newCaseName,newCLM)
464 self.myCases = [cse.replace(caseName,"%s_(%s)"%(newCaseName,newCLM.replace(".","-")))for cse in self.myCases]
465 self.officeCases = [cse.replace(caseName,"%s_(%s)"%(newCaseName,newCLM.replace(".","-")))for cse in self.officeCases]
466 self.allCases = [cse.replace(caseName,"%s_(%s)"%(newCaseName,newCLM.replace(".","-")))for cse in self.allCases]
467
468 self.casesListChoice.SetItems(self.myCases)
469 self.casesListChoice.SetSelection(0)
470 self.SetFields(self.myCases[0])
471 dlg.Destroy()
472 #err = self.console.ViewCaseNotes(caseName,office)
473
474 def OnViewCaseNotes(self,event):
475 caseName = self.casesListChoice.GetStringSelection()
476 office = self.responsibleOfficeTextCtrl.GetValue()
477 err = self.console.ViewCaseNotes(caseName,office)
478 if err:
479 errDlg = wx.MessageDialog(self, "MCP: The path to this case file could not be found.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
480 errDlg.ShowModal()
481 errDlg.Destroy()
482
483 def OnViewProdSpec(self,event):
484 caseName = self.casesListChoice.GetStringSelection()
485 office = self.responsibleOfficeTextCtrl.GetValue()
486 err = self.console.ViewProdSpec(caseName,office)
487 if err:
488 errDlg = wx.MessageDialog(self, "MCP: The path to this case file could not be found.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
489 errDlg.ShowModal()
490 errDlg.Destroy()
491
492 def OnOpenAlternateMediaFolder(self,event):
493 caseName = self.casesListChoice.GetStringSelection()
494 office = self.responsibleOfficeTextCtrl.GetValue()
495 err = self.console.OpenAlternateMediaFolder(caseName,office)
496 if err:
497 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)
498 errDlg.ShowModal()
499 errDlg.Destroy()
500
501 def OnOpenCaseFolder(self,event):
502 caseName = self.casesListChoice.GetStringSelection()
503 office = self.responsibleOfficeTextCtrl.GetValue()
504 err = self.console.OpenCaseFolder(caseName,office)
505 if err:
506 errDlg = wx.MessageDialog(self, "MCP: The path to this case file could not be found.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
507 errDlg.ShowModal()
508 errDlg.Destroy()
509
510 def OnViewCaseUploads(self, event):
511 uploadList = self.console.GetUploadData(self.casesListChoice.GetStringSelection())
512 numberOfRows = len(uploadList)
513 uploadTotal = self.console.GetUploadTotal(uploadList)
514 caseName = self.casesListChoice.GetStringSelection()
515 CLM = caseName.split("_(")[1]
516 CLM = CLM[:-1]
517 CLM = CLM.replace('-','.')
518 #print CLM
519 if numberOfRows == 0:
520 dlg = wx.MessageDialog(self, "MCP: There are no case uploads for this case.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
521 else:
522 dlg = CaseUploadsDialog.CaseUploadsDialog(self,numberOfRows, uploadList, uploadTotal,CLM)
523 #dlg.Show(True)
524 dlg.ShowModal()
525 dlg.Destroy()
526
527 def OnViewDocProduction(self,event):
528 prodMatrix = self.console.GetProductionData(self.casesListChoice.GetStringSelection())
529 prodList = []
530 for key in prodMatrix.keys():
531 prodList.extend(prodMatrix[key])
532 numberOfRows = len(prodList)
533 prodTotals = self.console.GetProductionTotal(prodList)
534 caseName = self.casesListChoice.GetStringSelection()
535 CLM = caseName.split("_(")[1]
536 CLM = CLM[:-1]
537 CLM = CLM.replace('-','.')
538 #print CLM
539 if numberOfRows == 0:
540 dlg = wx.MessageDialog(self, "MCP: There are no current productions for this case.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
541 else:
542 dlg = CurrentProductionsDialog.CaseUploadsDialog(self,numberOfRows, prodList,CLM, prodTotals)
543 #dlg.Show(True)
544 dlg.ShowModal()
545 dlg.Destroy()
546
547 def OnAddDocProduction(self, event):
548 caseName = self.casesListChoice.GetStringSelection()
549 caseDatabaseList = self.console.GetDatabaseList(caseName)
550 possibleProducedToEntities = self.console.GetPossibleProducedToEntities(caseName)
551 possibleProdReqByNames = self.console.GetPossibleProdReqByNames(caseName)
552 CLM = caseName.split("_(")[1]
553 CLM = CLM[:-1]
554 CLM = CLM.replace('-','.')
555 #print CLM
556 dlg = AddDocumentProductionDialog.AddDocumentProductionDialog(self,CLM, caseDatabaseList, possibleProducedToEntities,possibleProdReqByNames)
557 if dlg.ShowModal() == wx.ID_OK:
558 prodProcessedDate, begBates, endBates, prodDocCount, prodPageCount, prodNotes, prodTo, prodMedia,prodSource,prodReqBy,prodSentDate,prodMediaPassword = dlg.GetValues()
559 #print prodDate
560 dateConverter = NinoGenTools.DateUtilities()
561 prodID = 'prod_' + str(dateConverter.ConvertDateFormat(prodProcessedDate, convertToFormat='computer'))
562 errRpt = self.console.AddProductionEntry(CLM,prodID,prodProcessedDate,begBates,endBates,prodDocCount, prodPageCount, prodNotes, prodTo, prodMedia,prodSource,prodReqBy,prodSentDate,prodMediaPassword)
563 if errRpt:
564 doneDlg = wx.MessageDialog(self, "MCP: All fields need to be filled out.\nPlease try again.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
565 else:
566 doneDlg = wx.MessageDialog(self, "MCP: Production detail added successfully.", "MCP: Success",wx.OK, wx.DefaultPosition)
567 doneDlg.ShowModal()
568 doneDlg.Destroy()
569
570 def OnChangeDisclosureLetter(self,event):
571 office = self.responsibleOfficeTextCtrl.GetValue()
572 altMediaPath, casePath = self.console.GetCasePathsData(self.casesListChoice.GetStringSelection(),office)
573 disclosureLetterSet,disclosureLetterPath = self.console.GetDisclosureLetterData(self.casesListChoice.GetStringSelection())
574 if disclosureLetterPath:
575 disclosureLetterPath = str(disclosureLetterPath)
576 else:
577 disclosureLetterPath = ""
578 dlg = DisclosureLetterDialog.DisclosureLetterDialog(self, disclosureLetterSet, disclosureLetterPath, casePath)
579 if dlg.ShowModal() == wx.ID_OK:
580 newdisclosureLetterPath,errRpt = dlg.GetValues()
581 dlg.Destroy()
582 if errRpt:
583 doneDlg = wx.MessageDialog(self, "MCP: The Disclosure letter could NOT be loaded.\nPlease try again.", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
584 else:
585 if newdisclosureLetterPath == disclosureLetterPath:
586 doneDlg = False
587 else:
588 self.console.SetDisclosureLetterData(self.casesListChoice.GetStringSelection(),newdisclosureLetterPath)
589 doneDlg = wx.MessageDialog(self, "MCP: Disclosure letter loaded successfully.", "MCP: Success",wx.OK, wx.DefaultPosition)
590 self.disclosureLetterReminderText.SetLabel('')
591 if doneDlg:
592 doneDlg.ShowModal()
593 doneDlg.Destroy()
594
595 def OnCasePathsSettings(self, event):
596 office = self.responsibleOfficeTextCtrl.GetValue()
597 altMediaPath, casePath = self.console.GetCasePathsData(self.casesListChoice.GetStringSelection(),office)
598 if altMediaPath:
599 pass
600 else:
601 altMediaPath = ""
602 dlg = CasePathsDialog.CasePathsDialog(self, altMediaPath, casePath)
603 if dlg.ShowModal() == wx.ID_OK:
604 newAltMediaPath,errRpt = dlg.GetValues()
605 dlg.Destroy()
606 if errRpt:
607 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)
608 else:
609 if newAltMediaPath == altMediaPath:
610 pass
611 else:
612 self.console.SetAlternateMediaFolder(self.casesListChoice.GetStringSelection(),newAltMediaPath)
613 doneDlg = wx.MessageDialog(self, "MCP: Alternate Media Path updated successfully.", "MCP: Success",wx.OK, wx.DefaultPosition)
614 if doneDlg:
615 doneDlg.ShowModal()
616 doneDlg.Destroy()
617
618 def OnChangePricing(self,event):
619 #StorageUploadCostsDialog
620 office = self.responsibleOfficeTextCtrl.GetValue()
621 currentStorageCosts = self.storageCostStaticText.Label
622 if currentStorageCosts:
623 currentStorageCosts = float(currentStorageCosts.replace(" Storage:$",""))
624 currentUploadCosts = self.uploadCostStaticText.Label
625 if currentUploadCosts:
626 currentUploadCosts = float(currentUploadCosts.replace(" Upload:$",""))
627 dlg = StorageUploadCostsDialog.StorageUploadCostsDialog(self, currentStorageCosts,currentUploadCosts)
628 if dlg.ShowModal() == wx.ID_OK:
629 newStorageCosts,newUploadCosts = dlg.GetValues()
630 dlg.Destroy()
631 self.console.SetUploadAndStorageCosts(self.casesListChoice.GetStringSelection(),str(newUploadCosts),str(newStorageCosts))
632 doneDlg = wx.MessageDialog(self, "MCP: Upload and Storage Pricing updated successfully.", "MCP: Success",wx.OK, wx.DefaultPosition)
633 doneDlg.ShowModal()
634 self.SetFields(self.casesListChoice.GetStringSelection())
635 doneDlg.Destroy()
636
637 def OnEditVendorFolders(self,event):
638 office = self.responsibleOfficeTextCtrl.GetValue()
639 currentVendorFolder = self.console.GetVendorFolders(self.casesListChoice.GetStringSelection())
640 if currentVendorFolder:
641 pass
642 else:
643 currentVendorFolder = "None"
644 vendorFolderList = self.console.GetVendorFoldersList()
645 dlg = EditVendorFolderDialog.EditVendorFolderDialog(self, currentVendorFolder,vendorFolderList)
646 if dlg.ShowModal() == wx.ID_OK:
647 newCurrentVendorFolder = dlg.GetValues()
648 if newCurrentVendorFolder == currentVendorFolder:
649 pass
650 else:
651 self.console.SetVendorFolders(self.casesListChoice.GetStringSelection(), newCurrentVendorFolder)
652 doneDlg = wx.MessageDialog(self, "MCP: Vendor Folder updated successfully.", "MCP: Success",wx.OK, wx.DefaultPosition)
653 doneDlg.ShowModal()
654 doneDlg.Destroy()
655
656 def OnCreateProductionReport(self,event):
657 """This method creates or updates the Produciton Reporting page."""
658 ## Check to see if a alternate media folder exists
659 caseName = self.casesListChoice.GetStringSelection()
660 office = self.responsibleOfficeTextCtrl.GetValue()
661 err = self.console.OpenAlternateMediaFolder(caseName,office,testOnly=True)
662 if err:
663 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)
664 errDlg.ShowModal()
665 errDlg.Destroy()
666 else:
667 err2 = self.console.CreateProductionReport(caseName,office)
668 if err2:
669 err2Dlg = wx.MessageDialog(self, "MCP: There are no productions for this case..", "MCP: Does Not Compute",wx.OK, wx.DefaultPosition)
670 err2Dlg.ShowModal()
671 err2Dlg.Destroy()
672 else:
673 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)
674 sucessDlg.ShowModal()
675 sucessDlg.Destroy()
676
677 def OnAbout(self, event):
678 """
679 OnAbout(self,event) Displays an about dialog with developer and bug reporting info
680 """
681 dlg = wx.MessageDialog(self, "MCP is a case organization program.\n"
682 "\n\n"
683 "For questions or comments about this program\n"
684 "or to report a bug, please email the program\n"
685 "creator at Nino.Borges@gmail.com\n\n"
686 "MCP is\n"
687 "Copyright (c) 2009 - 2013 Emanuel Borges.\n"
688 "All rights reserved.\n"
689 "(Nino.Borges@gmail.com)\n",
690 "About MCP", wx.OK | wx.ICON_INFORMATION)
691 dlg.ShowModal()
692 dlg.Destroy()
693
694
695 class MyApp(wx.App):
696 def OnInit(self):
697 image = wx.Image("DDSC-LTsmall_2.jpg", wx.BITMAP_TYPE_JPEG)
698 bmp = image.ConvertToBitmap()
699 wx.SplashScreen(bmp, wx.SPLASH_CENTRE_ON_PARENT |wx.SPLASH_TIMEOUT, 2000, None, -1)
700 wx.Yield()
701 prgVersion = MCP_Lib.GetMCPVersion()
702 self.frame = MyFrame(None, -1, "View/Edit Case Information %s"%prgVersion)
703 self.frame.Show(True)
704 self.SetTopWindow(self.frame)
705 return True
706
707
708 if __name__ == '__main__':
709 app = MyApp(0)
710 app.MainLoop()