Changeset 12351 for main/waeup.ikoba/trunk
- Timestamp:
- 31 Dec 2014, 12:53:13 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12349 r12351 61 61 grok.context(IIkobaObject) 62 62 63 WARNING = _('You can not edit your document after final submission.' 63 WARNING_CUST = _('You can not edit some data after final submission.' 64 ' You really want to submit?') 65 66 WARNING_DOC = _('You can not edit your document after final submission.' 67 ' You really want to submit?') 68 69 WARNING_CON = _('You can not edit your contract after final submission.' 64 70 ' You really want to submit?') 65 71 … … 310 316 return _('unset') 311 317 318 @property 319 def is_requestable(self): 320 if self.context.state in (REQUESTED, APPROVED): 321 return False 322 return True 323 312 324 313 325 class ContactCustomerForm(ContactAdminForm): … … 678 690 grok.name('edit_base') 679 691 grok.require('waeup.handleCustomer') 680 label = _('Edit base data') 681 pnav = 4 692 pnav = 4 693 694 @property 695 def label(self): 696 if self.is_requestable(): 697 return _('Edit base data and request registration') 698 return _('Edit base data') 682 699 683 700 @property … … 693 710 return 694 711 695 def is_ editable(self, action):712 def is_requestable(self, action=None): 696 713 if self.context.state in (REQUESTED, APPROVED): 697 714 return False 698 715 return True 699 716 700 @action(_('Request registration now'), warning=WARNING, condition=is_editable) 717 @action(_('Request registration now'), 718 warning=WARNING_CUST, condition=is_requestable) 701 719 def finalsubmit(self, **data): 702 720 msave(self, **data) … … 773 791 @property 774 792 def title(self): 775 return self.context.document_id793 return "%s..." % self.context.document_id[:6] 776 794 777 795 … … 941 959 return 942 960 943 @action(_('Final Submit'), warning=WARNING )961 @action(_('Final Submit'), warning=WARNING_DOC) 944 962 def finalsubmit(self, **data): 945 963 msave(self, **data) … … 1119 1137 @property 1120 1138 def title(self): 1121 return self.context.contract_id1139 return "%s..." % self.context.contract_id[:6] 1122 1140 1123 1141 … … 1325 1343 return 1326 1344 1327 @action(_('Final Submit'), warning=WARNING)1328 def finalsubmit(self, **data):1329 msave(self, **data)1330 IWorkflowInfo(self.context).fireTransition('submit')1331 self.flash(_('Form has been submitted.'))1332 self.redirect(self.url(self.context))1333 return1334 1335 1345 1336 1346 class ContractEditFormPage(ContractManageFormPage): … … 1350 1360 return 1351 1361 1352 @action(_('Apply now (final submit)'), warning=WARNING )1362 @action(_('Apply now (final submit)'), warning=WARNING_CON) 1353 1363 def finalsubmit(self, **data): 1354 1364 msave(self, **data) -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12348 r12351 1178 1178 1179 1179 # Contract can be edited 1180 self.browser.getLink(conid ).click()1180 self.browser.getLink(conid[:6]).click() 1181 1181 self.browser.getLink("Manage").click() 1182 1182 self.browser.getControl(name="form.product_object").value = ['SAM'] -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_interfaces.py
r12336 r12351 107 107 source = CustomerDocumentSource() 108 108 result = source.factory.getTitle(object(), self.document) 109 self.assertEqual(result, u'DOC1 - My Sample Document')109 self.assertEqual(result, u'DOC1... - My Sample Document') 110 110 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/utils.py
r12339 r12351 290 290 CUSTMANAGE_CUSTOMER_STATES = (STARTED,) 291 291 292 DOCMANAGE_CUSTOMER_STATES = ( APPROVED,)292 DOCMANAGE_CUSTOMER_STATES = (REQUESTED, APPROVED,) 293 293 294 294 DOCMANAGE_DOCUMENT_STATES = (CREATED,) -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/viewlets.py
r12346 r12351 275 275 grok.view(CustomerBaseDisplayFormPage) 276 276 grok.require('waeup.handleCustomer') 277 text = _('Edit')278 277 target = 'edit_base' 278 279 @property 280 def text(self): 281 if self.view.is_requestable: 282 return _('Edit and request registration') 283 return _('Edit') 279 284 280 285 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py
r12343 r12351 162 162 163 163 def getTitle(self, context, value): 164 return "%s - %s" % (value.document_id, value.title)164 return "%s... - %s" % (value.document_id[:6], value.title) 165 165 166 166
Note: See TracChangeset for help on using the changeset viewer.