1 | ## $Id: contracts.py 12615 2015-02-14 08:55:35Z henrik $ |
---|
2 | ## |
---|
3 | ## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann |
---|
4 | ## This program is free software; you can redistribute it and/or modify |
---|
5 | ## it under the terms of the GNU General Public License as published by |
---|
6 | ## the Free Software Foundation; either version 2 of the License, or |
---|
7 | ## (at your option) any later version. |
---|
8 | ## |
---|
9 | ## This program is distributed in the hope that it will be useful, |
---|
10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | ## GNU General Public License for more details. |
---|
13 | ## |
---|
14 | ## You should have received a copy of the GNU General Public License |
---|
15 | ## along with this program; if not, write to the Free Software |
---|
16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
17 | ## |
---|
18 | """ |
---|
19 | Customer contract components. |
---|
20 | """ |
---|
21 | |
---|
22 | import grok |
---|
23 | from zope.component.interfaces import IFactory |
---|
24 | from zope.interface import implementedBy |
---|
25 | from waeup.ikoba.utils.helpers import attrs_to_fields |
---|
26 | from waeup.ikoba.customers.interfaces import ICustomerNavigation |
---|
27 | from waeup.ikoba.customers.contracts import ContractBase |
---|
28 | from ikobacustom.pcn.interfaces import MessageFactory as _ |
---|
29 | from ikobacustom.pcn.customers.interfaces import ( |
---|
30 | IRONContract, |
---|
31 | IRONContractEdit, |
---|
32 | IRONContractProcess, |
---|
33 | IRONContractOfficialUse, |
---|
34 | IROPContract, |
---|
35 | IROPContractEdit, |
---|
36 | IROPContractProcess, |
---|
37 | IROPContractOfficialUse, |
---|
38 | IRPRContract, |
---|
39 | IRPRContractEdit, |
---|
40 | IRPRContractProcess, |
---|
41 | IRPRContractOfficialUse, |
---|
42 | IRPCContract, |
---|
43 | IRPCContractEdit, |
---|
44 | IRPCContractProcess, |
---|
45 | IRPCContractOfficialUse, |
---|
46 | IIPPMVLContract, |
---|
47 | IIPPMVLContractEdit, |
---|
48 | IIPPMVLContractProcess, |
---|
49 | IIPPMVLContractOfficialUse, |
---|
50 | IRPPMVLContract, |
---|
51 | IRPPMVLContractEdit, |
---|
52 | IRPPMVLContractProcess, |
---|
53 | IRPPMVLContractOfficialUse, |
---|
54 | IAPPITContract, |
---|
55 | IAPPITContractEdit, |
---|
56 | IAPPITContractProcess, |
---|
57 | IAPPITContractOfficialUse, |
---|
58 | IRPTContract, |
---|
59 | IRPTContractEdit, |
---|
60 | IRPTContractProcess, |
---|
61 | IRPTContractOfficialUse, |
---|
62 | ) |
---|
63 | |
---|
64 | |
---|
65 | class RONContract(ContractBase): |
---|
66 | """This is a sample contract. |
---|
67 | """ |
---|
68 | |
---|
69 | grok.implements( |
---|
70 | IRONContractProcess, |
---|
71 | IRONContract, |
---|
72 | IRONContractEdit, |
---|
73 | ICustomerNavigation) |
---|
74 | |
---|
75 | contract_category = 'ron' |
---|
76 | |
---|
77 | form_fields_interface = IRONContract |
---|
78 | |
---|
79 | edit_form_fields_interface = IRONContractEdit |
---|
80 | |
---|
81 | ou_form_fields_interface = IRONContractOfficialUse |
---|
82 | |
---|
83 | check_docs_interface = IRONContract |
---|
84 | |
---|
85 | RONContract = attrs_to_fields(RONContract) |
---|
86 | |
---|
87 | |
---|
88 | class RONContractFactory(grok.GlobalUtility): |
---|
89 | """A factory for contracts. |
---|
90 | """ |
---|
91 | grok.implements(IFactory) |
---|
92 | grok.name(u'waeup.RONContract') |
---|
93 | title = u"Create a new license contract.", |
---|
94 | description = u"This factory instantiates new contract instances." |
---|
95 | |
---|
96 | def __call__(self, *args, **kw): |
---|
97 | return RONContract(*args, **kw) |
---|
98 | |
---|
99 | def getInterfaces(self): |
---|
100 | return implementedBy(RONContract) |
---|
101 | |
---|
102 | |
---|
103 | class ROPContract(ContractBase): |
---|
104 | """This is a sample contract. |
---|
105 | """ |
---|
106 | |
---|
107 | grok.implements( |
---|
108 | IROPContractProcess, |
---|
109 | IROPContract, |
---|
110 | IROPContractEdit, |
---|
111 | ICustomerNavigation) |
---|
112 | |
---|
113 | contract_category = 'rop' |
---|
114 | |
---|
115 | form_fields_interface = IROPContract |
---|
116 | |
---|
117 | edit_form_fields_interface = IROPContractEdit |
---|
118 | |
---|
119 | ou_form_fields_interface = IROPContractOfficialUse |
---|
120 | |
---|
121 | check_docs_interface = IROPContract |
---|
122 | |
---|
123 | ROPContract = attrs_to_fields(ROPContract) |
---|
124 | |
---|
125 | |
---|
126 | class ROPContractFactory(grok.GlobalUtility): |
---|
127 | """A factory for contracts. |
---|
128 | """ |
---|
129 | grok.implements(IFactory) |
---|
130 | grok.name(u'waeup.ROPContract') |
---|
131 | title = u"Create a new license contract.", |
---|
132 | description = u"This factory instantiates new contract instances." |
---|
133 | |
---|
134 | def __call__(self, *args, **kw): |
---|
135 | return ROPContract(*args, **kw) |
---|
136 | |
---|
137 | def getInterfaces(self): |
---|
138 | return implementedBy(ROPContract) |
---|
139 | |
---|
140 | |
---|
141 | class RPRContract(ContractBase): |
---|
142 | """Registration in the Provisional Register contract. |
---|
143 | """ |
---|
144 | |
---|
145 | grok.implements( |
---|
146 | IRPRContractProcess, |
---|
147 | IRPRContract, |
---|
148 | IRPRContractEdit, |
---|
149 | ICustomerNavigation) |
---|
150 | |
---|
151 | contract_category = 'rpr' |
---|
152 | |
---|
153 | form_fields_interface = IRPRContract |
---|
154 | |
---|
155 | edit_form_fields_interface = IRPRContractEdit |
---|
156 | |
---|
157 | ou_form_fields_interface = IRPRContractOfficialUse |
---|
158 | |
---|
159 | check_docs_interface = IRPRContract |
---|
160 | |
---|
161 | RPRContract = attrs_to_fields(RPRContract) |
---|
162 | |
---|
163 | |
---|
164 | class RPRContractFactory(grok.GlobalUtility): |
---|
165 | """A factory for contracts. |
---|
166 | """ |
---|
167 | grok.implements(IFactory) |
---|
168 | grok.name(u'waeup.RPRContract') |
---|
169 | title = u"Create a new license contract.", |
---|
170 | description = u"This factory instantiates new contract instances." |
---|
171 | |
---|
172 | def __call__(self, *args, **kw): |
---|
173 | return RPRContract(*args, **kw) |
---|
174 | |
---|
175 | def getInterfaces(self): |
---|
176 | return implementedBy(RPRContract) |
---|
177 | |
---|
178 | |
---|
179 | class RPCContract(ContractBase): |
---|
180 | """Registration as Pharmaceutical Chemist contract. |
---|
181 | """ |
---|
182 | |
---|
183 | grok.implements( |
---|
184 | IRPCContractProcess, |
---|
185 | IRPCContract, |
---|
186 | IRPCContractEdit, |
---|
187 | ICustomerNavigation) |
---|
188 | |
---|
189 | contract_category = 'rpc' |
---|
190 | |
---|
191 | form_fields_interface = IRPCContract |
---|
192 | |
---|
193 | edit_form_fields_interface = IRPCContractEdit |
---|
194 | |
---|
195 | ou_form_fields_interface = IRPCContractOfficialUse |
---|
196 | |
---|
197 | check_docs_interface = IRPCContract |
---|
198 | |
---|
199 | RPCContract = attrs_to_fields(RPCContract) |
---|
200 | |
---|
201 | |
---|
202 | class RPCContractFactory(grok.GlobalUtility): |
---|
203 | """A factory for contracts. |
---|
204 | """ |
---|
205 | grok.implements(IFactory) |
---|
206 | grok.name(u'waeup.RPCContract') |
---|
207 | title = u"Create a new license contract.", |
---|
208 | description = u"This factory instantiates new contract instances." |
---|
209 | |
---|
210 | def __call__(self, *args, **kw): |
---|
211 | return RPCContract(*args, **kw) |
---|
212 | |
---|
213 | def getInterfaces(self): |
---|
214 | return implementedBy(RPCContract) |
---|
215 | |
---|
216 | |
---|
217 | class IPPMVLContract(ContractBase): |
---|
218 | """Issuance of Patent and Proprietary Medicines Vendors License contract. |
---|
219 | """ |
---|
220 | |
---|
221 | grok.implements( |
---|
222 | IIPPMVLContractProcess, |
---|
223 | IIPPMVLContract, |
---|
224 | IIPPMVLContractEdit, |
---|
225 | ICustomerNavigation) |
---|
226 | |
---|
227 | contract_category = 'ippmvl' |
---|
228 | |
---|
229 | form_fields_interface = IIPPMVLContract |
---|
230 | |
---|
231 | edit_form_fields_interface = IIPPMVLContractEdit |
---|
232 | |
---|
233 | ou_form_fields_interface = IIPPMVLContractOfficialUse |
---|
234 | |
---|
235 | check_docs_interface = IIPPMVLContract |
---|
236 | |
---|
237 | IPPMVLContract = attrs_to_fields(IPPMVLContract) |
---|
238 | |
---|
239 | |
---|
240 | class IPPMVLContractFactory(grok.GlobalUtility): |
---|
241 | """A factory for contracts. |
---|
242 | """ |
---|
243 | grok.implements(IFactory) |
---|
244 | grok.name(u'waeup.IPPMVLContract') |
---|
245 | title = u"Create a new license contract.", |
---|
246 | description = u"This factory instantiates new contract instances." |
---|
247 | |
---|
248 | def __call__(self, *args, **kw): |
---|
249 | return IPPMVLContract(*args, **kw) |
---|
250 | |
---|
251 | def getInterfaces(self): |
---|
252 | return implementedBy(IPPMVLContract) |
---|
253 | |
---|
254 | |
---|
255 | class RPPMVLContract(ContractBase): |
---|
256 | """Renewal of Patent and Proprietary Medicines Vendors License contract. |
---|
257 | """ |
---|
258 | |
---|
259 | grok.implements( |
---|
260 | IRPPMVLContractProcess, |
---|
261 | IRPPMVLContract, |
---|
262 | IRPPMVLContractEdit, |
---|
263 | ICustomerNavigation) |
---|
264 | |
---|
265 | contract_category = 'rppmvl' |
---|
266 | |
---|
267 | form_fields_interface = IRPPMVLContract |
---|
268 | |
---|
269 | edit_form_fields_interface = IRPPMVLContractEdit |
---|
270 | |
---|
271 | ou_form_fields_interface = IRPPMVLContractOfficialUse |
---|
272 | |
---|
273 | check_docs_interface = IRPPMVLContract |
---|
274 | |
---|
275 | RPPMVLContract = attrs_to_fields(RPPMVLContract) |
---|
276 | |
---|
277 | |
---|
278 | class RPPMVLContractFactory(grok.GlobalUtility): |
---|
279 | """A factory for contracts. |
---|
280 | """ |
---|
281 | grok.implements(IFactory) |
---|
282 | grok.name(u'waeup.RPPMVLContract') |
---|
283 | title = u"Create a new license contract.", |
---|
284 | description = u"This factory instantiates new contract instances." |
---|
285 | |
---|
286 | def __call__(self, *args, **kw): |
---|
287 | return RPPMVLContract(*args, **kw) |
---|
288 | |
---|
289 | def getInterfaces(self): |
---|
290 | return implementedBy(RPPMVLContract) |
---|
291 | |
---|
292 | |
---|
293 | class APPITContract(ContractBase): |
---|
294 | """Accepting Pupil Pharmacist for Internship Training contract. |
---|
295 | """ |
---|
296 | |
---|
297 | grok.implements( |
---|
298 | IAPPITContractProcess, |
---|
299 | IAPPITContract, |
---|
300 | IAPPITContractEdit, |
---|
301 | ICustomerNavigation) |
---|
302 | |
---|
303 | contract_category = 'appit' |
---|
304 | |
---|
305 | form_fields_interface = IAPPITContract |
---|
306 | |
---|
307 | edit_form_fields_interface = IAPPITContractEdit |
---|
308 | |
---|
309 | ou_form_fields_interface = IAPPITContractOfficialUse |
---|
310 | |
---|
311 | check_docs_interface = IAPPITContract |
---|
312 | |
---|
313 | APPITContract = attrs_to_fields(APPITContract) |
---|
314 | |
---|
315 | |
---|
316 | class APPITContractFactory(grok.GlobalUtility): |
---|
317 | """A factory for contracts. |
---|
318 | """ |
---|
319 | grok.implements(IFactory) |
---|
320 | grok.name(u'waeup.APPITContract') |
---|
321 | title = u"Create a new license contract.", |
---|
322 | description = u"This factory instantiates new contract instances." |
---|
323 | |
---|
324 | def __call__(self, *args, **kw): |
---|
325 | return APPITContract(*args, **kw) |
---|
326 | |
---|
327 | def getInterfaces(self): |
---|
328 | return implementedBy(APPITContract) |
---|
329 | |
---|
330 | |
---|
331 | class RPTContract(ContractBase): |
---|
332 | """Registration as a Pharmacy Technician contract. |
---|
333 | """ |
---|
334 | |
---|
335 | grok.implements( |
---|
336 | IRPTContractProcess, |
---|
337 | IRPTContract, |
---|
338 | IRPTContractEdit, |
---|
339 | ICustomerNavigation) |
---|
340 | |
---|
341 | contract_category = 'rpt' |
---|
342 | |
---|
343 | form_fields_interface = IRPTContract |
---|
344 | |
---|
345 | edit_form_fields_interface = IRPTContractEdit |
---|
346 | |
---|
347 | ou_form_fields_interface = IRPTContractOfficialUse |
---|
348 | |
---|
349 | check_docs_interface = IRPTContract |
---|
350 | |
---|
351 | RPTContract = attrs_to_fields(RPTContract) |
---|
352 | |
---|
353 | |
---|
354 | class RPTContractFactory(grok.GlobalUtility): |
---|
355 | """A factory for contracts. |
---|
356 | """ |
---|
357 | grok.implements(IFactory) |
---|
358 | grok.name(u'waeup.RPTContract') |
---|
359 | title = u"Create a new license contract.", |
---|
360 | description = u"This factory instantiates new contract instances." |
---|
361 | |
---|
362 | def __call__(self, *args, **kw): |
---|
363 | return RPTContract(*args, **kw) |
---|
364 | |
---|
365 | def getInterfaces(self): |
---|
366 | return implementedBy(RPTContract) |
---|
367 | |
---|