ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/MCP/Trunk/AddDocumentProductionDialog.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: 6439 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     AddDocumentProductionDialog
4    
5     Created by
6     Emanuel Borges
7     08.03.2011
8    
9     This is the main dialog for adding document productions to the database.
10    
11     """
12    
13     import wx, NinoGenTools
14    
15     class AddDocumentProductionDialog(wx.Dialog):
16    
17 nino.borges 321 def __init__(self, parent,CLM,sourceDatabaseList,possibleProducedToEntities,possibleProdReqByNames):
18 ninoborges 8 self.CLM = CLM
19    
20     self.parent = parent
21 nino.borges 321 mediaTypeList = ['CD','DVD','Hard Drive','Thumb Drive','Other']
22     wx.Dialog.__init__(self, parent, -1, "Add Document Production for %s"% self.CLM, style = wx.DEFAULT_DIALOG_STYLE, size = (600,420))
23     prodProcessedDate_Lbl = wx.StaticText(self, -1, "Production Processed Date: ")
24     prodSentDate_Lbl = wx.StaticText(self, -1, "Production Sent Date: ")
25     self.prodProcessedDate_PickerBox = wx.DatePickerCtrl(self, size=(120,-1),style = wx.DP_DROPDOWN|wx.DP_SHOWCENTURY)
26     self.prodSentDate_PickerBox = wx.DatePickerCtrl(self, size=(120,-1),style = wx.DP_DROPDOWN|wx.DP_SHOWCENTURY)
27 ninoborges 8 begBates_Lbl = wx.StaticText(self, -1, "Begining Bates: ")
28     self.begBates_TextBox = wx.TextCtrl(self, size=(90,-1))
29     endBates_Lbl = wx.StaticText(self, -1, "Ending Bates: ")
30     self.endBates_TextBox = wx.TextCtrl(self, size=(90,-1))
31     prodDocCount_Lbl = wx.StaticText(self, -1, "Production Document Count: ")
32     self.prodDocCount_TextBox = wx.TextCtrl(self, size=(90,-1))
33     prodPageCount_Lbl = wx.StaticText(self, -1, "Production Page Count: ")
34     self.prodPageCount_TextBox = wx.TextCtrl(self, size=(90,-1))
35 nino.borges 321 prodTo_Lbl = wx.StaticText(self, -1, "Produced To: ")
36     self.prodTo_TextBox = wx.ComboBox(self, -1, '', size=(90,-1),choices=possibleProducedToEntities, style=wx.CB_DROPDOWN)
37     prodMedia_Lbl = wx.StaticText(self, -1, "Production Media: ")
38     self.prodMedia_Choice = wx.Choice(self, -1, wx.DefaultPosition, choices=mediaTypeList)
39     prodSource_Lbl = wx.StaticText(self, -1, "Production Source Databases: ")
40     self.prodSource_Choice = wx.Choice(self, -1, wx.DefaultPosition, choices=sourceDatabaseList)
41     prodReqBy_Lbl = wx.StaticText(self, -1, "Production Requested By: ")
42     self.prodReqBy_TextBox = wx.ComboBox(self, -1, '', size=(90,-1),choices=possibleProdReqByNames, style=wx.CB_DROPDOWN)
43     prodMediaPassword_Lbl = wx.StaticText(self, -1, "Media Password: ")
44     self.prodMediaPassword_TextBox = wx.TextCtrl(self, size=(90,-1))
45 ninoborges 8
46     self.CreateNotesSection()
47    
48     mainSizer = wx.BoxSizer(wx.VERTICAL)
49     batesSizer = wx.BoxSizer(wx.HORIZONTAL)
50     batesSizer.Add(begBates_Lbl,0,wx.ALL,5)
51     batesSizer.Add(self.begBates_TextBox,0,wx.ALL,5)
52     batesSizer.Add(endBates_Lbl,0,wx.ALL,5)
53     batesSizer.Add(self.endBates_TextBox,0,wx.ALL,5)
54 nino.borges 321 mainSizer.Add(batesSizer,0,wx.ALL,15)
55     prodGridSizer = wx.FlexGridSizer(5, 4, 5,5)
56     prodGridSizer.Add(prodProcessedDate_Lbl, 0, wx.ALIGN_RIGHT)
57     prodGridSizer.Add(self.prodProcessedDate_PickerBox, 0, wx.EXPAND)
58     prodGridSizer.Add(prodSentDate_Lbl, 0, wx.ALIGN_RIGHT)
59     prodGridSizer.Add(self.prodSentDate_PickerBox, 0, wx.EXPAND)
60 ninoborges 8 prodGridSizer.Add(prodDocCount_Lbl, 0, wx.ALIGN_RIGHT)
61     prodGridSizer.Add(self.prodDocCount_TextBox , 0, wx.EXPAND)
62 nino.borges 321 prodGridSizer.Add(prodTo_Lbl, 0, wx.ALIGN_RIGHT)
63     prodGridSizer.Add(self.prodTo_TextBox , 0, wx.EXPAND)
64 ninoborges 8 prodGridSizer.Add(prodPageCount_Lbl, 0, wx.ALIGN_RIGHT)
65     prodGridSizer.Add(self.prodPageCount_TextBox, 0, wx.EXPAND)
66 nino.borges 321 prodGridSizer.Add(prodMedia_Lbl, 0, wx.ALIGN_RIGHT)
67     prodGridSizer.Add(self.prodMedia_Choice , 0, wx.EXPAND)
68     prodGridSizer.Add(prodSource_Lbl, 0, wx.ALIGN_RIGHT)
69     prodGridSizer.Add(self.prodSource_Choice , 0, wx.EXPAND)
70     prodGridSizer.Add(prodReqBy_Lbl, 0, wx.ALIGN_RIGHT)
71     prodGridSizer.Add(self.prodReqBy_TextBox , 0, wx.EXPAND)
72     prodGridSizer.Add(prodMediaPassword_Lbl, 0, wx.ALIGN_RIGHT)
73     prodGridSizer.Add(self.prodMediaPassword_TextBox , 0, wx.EXPAND)
74    
75 ninoborges 8 mainSizer.Add(prodGridSizer,0,wx.ALL,20)
76 nino.borges 321 mainSizer.Add(self.productionNotesStaticBoxSixer,0,wx.ALL|wx.ALIGN_CENTER_HORIZONTAL,25)
77 ninoborges 8 oKButton = wx.Button(self, wx.ID_OK)
78     oKButton.SetDefault()
79     cancelButton = wx.Button(self, wx.ID_CANCEL)
80     buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
81     buttonSizer.Add(oKButton,0,wx.ALL,5)
82     buttonSizer.Add(cancelButton,0,wx.ALL,5)
83     mainSizer.Add(buttonSizer,0,wx.ALIGN_CENTER_HORIZONTAL)
84     self.SetSizer(mainSizer)
85    
86     def CreateNotesSection(self):
87 nino.borges 321 self.productionNotesTextBox = wx.TextCtrl(self, -1, "", size=(500,50), style=wx.TE_MULTILINE)
88 ninoborges 8 productionNotesStaticBox = wx.StaticBox(self, -1, "Production Notes")
89     self.productionNotesStaticBoxSixer = wx.StaticBoxSizer(productionNotesStaticBox, wx.VERTICAL)
90     self.productionNotesStaticBoxSixer.Add(self.productionNotesTextBox, 0, wx.ALL, 5)
91    
92     def GetValues(self):
93 nino.borges 321 prodProcessedDate = self.prodProcessedDate_PickerBox.GetValue()
94     year = prodProcessedDate.Year
95     month = prodProcessedDate.Month + 1
96     day = prodProcessedDate.Day
97     prodProcessedDate = "%02d/%02d/%4d" % (month, day, year)
98     prodSentDate = self.prodSentDate_PickerBox.GetValue()
99     year = prodSentDate.Year
100     month = prodSentDate.Month + 1
101     day = prodSentDate.Day
102     prodSentDate = "%02d/%02d/%4d" % (month, day, year)
103 ninoborges 8 #prodDate = prodDate.FormatISODate()
104     begBates = self.begBates_TextBox.GetValue()
105     endBates = self.endBates_TextBox.GetValue()
106     prodDocCount = self.prodDocCount_TextBox.GetValue()
107     prodPageCount = self.prodPageCount_TextBox.GetValue()
108     prodNotes = self.productionNotesTextBox.GetValue()
109 nino.borges 321 prodTo = self.prodTo_TextBox.GetValue()
110     prodMedia = self.prodMedia_Choice.GetStringSelection()
111     prodSource = self.prodSource_Choice.GetStringSelection()
112     prodReqBy = self.prodReqBy_TextBox.GetValue()
113     prodMediaPassword = self.prodMediaPassword_TextBox.GetValue()
114     return prodProcessedDate, begBates, endBates, prodDocCount, prodPageCount, prodNotes, prodTo, prodMedia,prodSource,prodReqBy,prodSentDate,prodMediaPassword
115 ninoborges 8