1 | ## $Id: contracts.py 12601 2015-02-11 21:38:41Z 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 | ) |
---|
51 | |
---|
52 | |
---|
53 | class RONContract(ContractBase): |
---|
54 | """This is a sample contract. |
---|
55 | """ |
---|
56 | |
---|
57 | grok.implements( |
---|
58 | IRONContractProcess, |
---|
59 | IRONContract, |
---|
60 | IRONContractEdit, |
---|
61 | ICustomerNavigation) |
---|
62 | |
---|
63 | contract_category = 'ron' |
---|
64 | |
---|
65 | form_fields_interface = IRONContract |
---|
66 | |
---|
67 | edit_form_fields_interface = IRONContractEdit |
---|
68 | |
---|
69 | ou_form_fields_interface = IRONContractOfficialUse |
---|
70 | |
---|
71 | check_docs_interface = IRONContract |
---|
72 | |
---|
73 | RONContract = attrs_to_fields(RONContract) |
---|
74 | |
---|
75 | |
---|
76 | class RONContractFactory(grok.GlobalUtility): |
---|
77 | """A factory for contracts. |
---|
78 | """ |
---|
79 | grok.implements(IFactory) |
---|
80 | grok.name(u'waeup.RONContract') |
---|
81 | title = u"Create a new license contract.", |
---|
82 | description = u"This factory instantiates new contract instances." |
---|
83 | |
---|
84 | def __call__(self, *args, **kw): |
---|
85 | return RONContract(*args, **kw) |
---|
86 | |
---|
87 | def getInterfaces(self): |
---|
88 | return implementedBy(RONContract) |
---|
89 | |
---|
90 | |
---|
91 | class ROPContract(ContractBase): |
---|
92 | """This is a sample contract. |
---|
93 | """ |
---|
94 | |
---|
95 | grok.implements( |
---|
96 | IROPContractProcess, |
---|
97 | IROPContract, |
---|
98 | IROPContractEdit, |
---|
99 | ICustomerNavigation) |
---|
100 | |
---|
101 | contract_category = 'rop' |
---|
102 | |
---|
103 | form_fields_interface = IROPContract |
---|
104 | |
---|
105 | edit_form_fields_interface = IROPContractEdit |
---|
106 | |
---|
107 | ou_form_fields_interface = IROPContractOfficialUse |
---|
108 | |
---|
109 | check_docs_interface = IROPContract |
---|
110 | |
---|
111 | ROPContract = attrs_to_fields(ROPContract) |
---|
112 | |
---|
113 | |
---|
114 | class ROPContractFactory(grok.GlobalUtility): |
---|
115 | """A factory for contracts. |
---|
116 | """ |
---|
117 | grok.implements(IFactory) |
---|
118 | grok.name(u'waeup.ROPContract') |
---|
119 | title = u"Create a new license contract.", |
---|
120 | description = u"This factory instantiates new contract instances." |
---|
121 | |
---|
122 | def __call__(self, *args, **kw): |
---|
123 | return ROPContract(*args, **kw) |
---|
124 | |
---|
125 | def getInterfaces(self): |
---|
126 | return implementedBy(ROPContract) |
---|
127 | |
---|
128 | |
---|
129 | class RPRContract(ContractBase): |
---|
130 | """Registration in the Provisional Register contract. |
---|
131 | """ |
---|
132 | |
---|
133 | grok.implements( |
---|
134 | IRPRContractProcess, |
---|
135 | IRPRContract, |
---|
136 | IRPRContractEdit, |
---|
137 | ICustomerNavigation) |
---|
138 | |
---|
139 | contract_category = 'rpr' |
---|
140 | |
---|
141 | form_fields_interface = IRPRContract |
---|
142 | |
---|
143 | edit_form_fields_interface = IRPRContractEdit |
---|
144 | |
---|
145 | ou_form_fields_interface = IRPRContractOfficialUse |
---|
146 | |
---|
147 | check_docs_interface = IRPRContract |
---|
148 | |
---|
149 | RPRContract = attrs_to_fields(RPRContract) |
---|
150 | |
---|
151 | |
---|
152 | class RPRContractFactory(grok.GlobalUtility): |
---|
153 | """A factory for contracts. |
---|
154 | """ |
---|
155 | grok.implements(IFactory) |
---|
156 | grok.name(u'waeup.RPRContract') |
---|
157 | title = u"Create a new license contract.", |
---|
158 | description = u"This factory instantiates new contract instances." |
---|
159 | |
---|
160 | def __call__(self, *args, **kw): |
---|
161 | return RPRContract(*args, **kw) |
---|
162 | |
---|
163 | def getInterfaces(self): |
---|
164 | return implementedBy(RPRContract) |
---|
165 | |
---|
166 | |
---|
167 | class RPCContract(ContractBase): |
---|
168 | """Registration as Pharmaceutical Chemist contract. |
---|
169 | """ |
---|
170 | |
---|
171 | grok.implements( |
---|
172 | IRPCContractProcess, |
---|
173 | IRPCContract, |
---|
174 | IRPCContractEdit, |
---|
175 | ICustomerNavigation) |
---|
176 | |
---|
177 | contract_category = 'rpc' |
---|
178 | |
---|
179 | form_fields_interface = IRPCContract |
---|
180 | |
---|
181 | edit_form_fields_interface = IRPCContractEdit |
---|
182 | |
---|
183 | ou_form_fields_interface = IRPCContractOfficialUse |
---|
184 | |
---|
185 | check_docs_interface = IRPCContract |
---|
186 | |
---|
187 | RPCContract = attrs_to_fields(RPCContract) |
---|
188 | |
---|
189 | |
---|
190 | class RPCContractFactory(grok.GlobalUtility): |
---|
191 | """A factory for contracts. |
---|
192 | """ |
---|
193 | grok.implements(IFactory) |
---|
194 | grok.name(u'waeup.RPCContract') |
---|
195 | title = u"Create a new license contract.", |
---|
196 | description = u"This factory instantiates new contract instances." |
---|
197 | |
---|
198 | def __call__(self, *args, **kw): |
---|
199 | return RPCContract(*args, **kw) |
---|
200 | |
---|
201 | def getInterfaces(self): |
---|
202 | return implementedBy(RPCContract) |
---|
203 | |
---|
204 | |
---|
205 | class IPPMVLContract(ContractBase): |
---|
206 | """Issuance of Patent and Proprietary Medicines Vendors License contract. |
---|
207 | """ |
---|
208 | |
---|
209 | grok.implements( |
---|
210 | IIPPMVLContractProcess, |
---|
211 | IIPPMVLContract, |
---|
212 | IIPPMVLContractEdit, |
---|
213 | ICustomerNavigation) |
---|
214 | |
---|
215 | contract_category = 'ippmvl' |
---|
216 | |
---|
217 | form_fields_interface = IIPPMVLContract |
---|
218 | |
---|
219 | edit_form_fields_interface = IIPPMVLContractEdit |
---|
220 | |
---|
221 | ou_form_fields_interface = IIPPMVLContractOfficialUse |
---|
222 | |
---|
223 | check_docs_interface = IIPPMVLContract |
---|
224 | |
---|
225 | IPPMVLContract = attrs_to_fields(IPPMVLContract) |
---|
226 | |
---|
227 | |
---|
228 | class IPPMVLContractFactory(grok.GlobalUtility): |
---|
229 | """A factory for contracts. |
---|
230 | """ |
---|
231 | grok.implements(IFactory) |
---|
232 | grok.name(u'waeup.IPPMVLContract') |
---|
233 | title = u"Create a new license contract.", |
---|
234 | description = u"This factory instantiates new contract instances." |
---|
235 | |
---|
236 | def __call__(self, *args, **kw): |
---|
237 | return IPPMVLContract(*args, **kw) |
---|
238 | |
---|
239 | def getInterfaces(self): |
---|
240 | return implementedBy(IPPMVLContract) |
---|
241 | |
---|