ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/MCP/Trunk/CurrentProductionsDialog.py
Revision: 496
Committed: Fri Dec 20 15:52:59 2013 UTC (12 years, 3 months ago) by nino.borges
Content type: text/x-python
File size: 7491 byte(s)
Log Message:
Moved the main mcp code to the trunk, for easier versioning.

File Contents

# User Rev Content
1 ninoborges 8 """
2    
3     CurrentProductionsDialog
4    
5     Created by
6     Emanuel Borges
7     02.06.2012
8    
9     This dialog will show the user the current productions for that case.
10    
11     """
12    
13     import wx, wx.grid
14    
15     class CaseUploadsDialog(wx.Dialog):
16     #class CaseUploadsDialog(wx.Frame):
17 nino.borges 321 colLabels = ['Production ID','Processed Date','Sent Date','Start Bates', 'End Bates', 'Document Count', 'Page Count','Produced To','Requested By','Production Media','Media Password','Production Sources','Notes']
18 ninoborges 8
19     def __init__(self, parent,numberOfRows,prodList,CLM, prodTotals):
20     self.CLM = CLM
21     pgCountTotal, docCountTotal = prodTotals
22     print len(prodList)
23     self.parent = parent
24     wx.Dialog.__init__(self, parent, -1, "Document Productions for %s"% self.CLM, style = wx.DEFAULT_DIALOG_STYLE, size = (960,600))
25     #wx.Frame.__init__(self, parent, -1, 'test', size =(435,500))
26     #panel = wx.Panel(self,-1)
27     if numberOfRows > 24:
28     self.grid = wx.grid.Grid(self,-1,size = (955,500))
29     else:
30     self.grid = wx.grid.Grid(self,-1, )#size = (435,500))
31     self.grid.CreateGrid(numberOfRows,7)
32     for row in range (7):
33     self.grid.SetColLabelValue(row, self.colLabels[row])
34     for col in range(numberOfRows):
35    
36     self.grid.SetCellValue(col,row,prodList[col][row])
37    
38    
39    
40     self.grid.AutoSize()
41    
42    
43     addButton = wx.Button(self, -1, "+", size=(30,20), style=wx.NO_BORDER)
44     addButton.Disable()
45     minusButton = wx.Button(self, -1, "-", size=(30,20), style=wx.NO_BORDER)
46     minusButton.Disable()
47     docTotal_Lbl = wx.StaticText(self, -1, "Total Documents Produced For This Case: ")
48     docTotal_textCtrl = wx.TextCtrl(self, -1, str(docCountTotal), wx.DefaultPosition, (150,-1))
49     docTotal_textCtrl.Disable()
50     pgTotal_Lbl = wx.StaticText(self, -1, "Total pages Produced For This Case: ")
51     pgTotal_textCtrl = wx.TextCtrl(self, -1, str(pgCountTotal), wx.DefaultPosition, (150,-1))
52     pgTotal_textCtrl.Disable()
53     #totalSizer = wx.BoxSizer(wx.HORIZONTAL)
54     totalSizer =wx.GridBagSizer(1,14)
55     totalSizer.Add(docTotal_Lbl,pos=(0,0),flag = wx.ALIGN_RIGHT)
56     totalSizer.Add(docTotal_textCtrl,flag = wx.ALIGN_LEFT, pos=(0,1))
57     totalSizer.Add(pgTotal_Lbl,pos=(0,2),flag = wx.ALIGN_RIGHT)
58     totalSizer.Add(pgTotal_textCtrl,flag = wx.ALIGN_LEFT,pos=(0,3))
59     addRemoveButtonSizer = wx.BoxSizer(wx.HORIZONTAL)
60     addRemoveButtonSizer.Add(addButton, 0, wx.LEFT,3)
61     addRemoveButtonSizer.Add(minusButton, 0, wx.LEFT,0)
62    
63    
64     mainSizer = wx.BoxSizer(wx.VERTICAL)
65     mainSizer.Add(self.grid, 0)
66     mainSizer.Add(addRemoveButtonSizer, 0, wx.LEFT,10)
67     mainSizer.Add(totalSizer, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 20)
68     self.SetSizer(mainSizer)
69     self.grid.EnableEditing(False)
70    
71     # self.Bind(wx.EVT_BUTTON, self.OnPopupOne, addButton)
72     # self.Bind(wx.EVT_BUTTON, self.OnPopupTwo, minusButton)
73     #
74     # def OnPopupTwo(self, event):
75     # selectionList = self.grid.GetSelectedRows()
76     # ## if there is only one value selected, go
77     # if len(selectionList) == 1:
78     # UEPOCHValue = self.grid.GetCellValue(selectionList[0],0)
79     # if UEPOCHValue.isalpha():
80     # canNotProcessDiag = wx.MessageDialog(self,"This record can not be deleted by the MCP. Please delete it manually from the access database.", "Selection",wx.OK | wx.ICON_INFORMATION)
81     # canNotProcessDiag.ShowModal()
82     # canNotProcessDiag.Destroy()
83     # else:
84     # confirmDiag = wx.MessageDialog(self,"This one case upload record will be deleted from the database.\nClick OK to delete.", "WARNING.",wx.OK |wx.CANCEL| wx.ICON_INFORMATION)
85     # if confirmDiag.ShowModal() == wx.ID_OK:
86     # self.grid.DeleteRows(selectionList[0],1)
87     # self.parent.console.RemoveDataUpload(self.CLM,UEPOCHValue)
88     #
89     # #print "%s Removed"% UEPOCHValue
90     # else:
91     # diag = wx.MessageDialog(self,"Please select just one record to delete and try again.", "Selection",wx.OK | wx.ICON_INFORMATION)
92     # diag.ShowModal()
93     # diag.Destroy()
94     # ## if more than one value selelcted, tell them to only select one.
95     # #print selectionList
96     #
97     # def OnPopupOne(self, event):
98     # dlg = AddCaseUploadDialog(self)
99     # if dlg.ShowModal() == wx.ID_OK:
100     # platform, sizeFormat, sizeValue = dlg.GetValues()
101     # reportSize = sizeValue + sizeFormat
102     # #epoch = str(int(time.time()))
103     # self.parent.console.AddDataUpload(self.CLM, platform, reportSize)
104     # finishedDlg = wx.MessageDialog(self, "MCP: The new record has been added to the matter database.\nPlease close this window and reopen to see your changes.", "Process Complete",wx.OK, wx.DefaultPosition)
105     # finishedDlg.ShowModal()
106     # #nextIndexNumb = self.tagListBox.GetItemCount()
107     # #self.tagListBox.InsertStringItem(nextIndexNumb,"Reviewer_%s"% str(nextIndexNumb+1))
108     # #self.tagListBox.SetItemState(nextIndexNumb, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
109     # #print "one"
110     #
111     #class AddCaseUploadDialog(wx.Dialog):
112     #
113     # def __init__(self, parent):
114     # #self.CLM = CLM
115     # #self.parent = parent
116     # platformChoices = ["Concordance DIS","Concordance LN","Relativity"]
117     # sizeFormatChoices = [" GB"," MB"," KB"]
118     # wx.Dialog.__init__(self, parent, -1, "Add Single Case Upload for %s"%parent.CLM, style = wx.DEFAULT_DIALOG_STYLE, size = (300,300))
119     # #wx.Frame.__init__(self, parent, -1, 'test', size =(435,500))
120     # platform_lbl = wx.StaticText(self, -1, "Platform: ")
121     # size_lbl = wx.StaticText(self, -1, "Size: ")
122     # self.platform_SelectBox = wx.Choice(self, -1,(100, 50), choices = platformChoices)
123     # self.size_TextBox = wx.TextCtrl(self, size=(90,-1))
124     # self.sizeFormat_SelectBox = wx.Choice(self, -1,(100, 50), choices = sizeFormatChoices)
125     # mainSizer = wx.BoxSizer(wx.VERTICAL)
126     #
127     # sizeBoxSizer = wx.BoxSizer(wx.HORIZONTAL)
128     # sizeBoxSizer.Add(self.size_TextBox)
129     # sizeBoxSizer.Add(self.sizeFormat_SelectBox)
130     # fGSizer = wx.FlexGridSizer(2, 2, 5,5)
131     # fGSizer.Add(platform_lbl, 0, wx.ALIGN_RIGHT)
132     # fGSizer.Add(self.platform_SelectBox, 0, wx.EXPAND)
133     # fGSizer.Add(size_lbl, 0, wx.ALIGN_RIGHT)
134     # fGSizer.Add(sizeBoxSizer, 0, wx.EXPAND)
135     # mainSizer.Add(fGSizer, 0, wx.EXPAND|wx.ALL, 5)
136     #
137     # oKButton = wx.Button(self, wx.ID_OK)
138     # oKButton.SetDefault()
139     # cancelButton = wx.Button(self, wx.ID_CANCEL)
140     # buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
141     # buttonSizer.Add(oKButton,0,wx.ALL,5)
142     # buttonSizer.Add(cancelButton,0,wx.ALL,5)
143     # mainSizer.Add(buttonSizer)
144     # self.SetSizer(mainSizer)
145     #
146     # def GetValues(self):
147     # platform = self.platform_SelectBox.GetStringSelection()
148     # sizeFormat = self.sizeFormat_SelectBox.GetStringSelection()
149     # sizeValue = self.size_TextBox.GetValue()
150     # return platform, sizeFormat, sizeValue
151     #