Changeset 11971 for main/waeup.ikoba/trunk/src
- Timestamp:
- 16 Nov 2014, 17:50:55 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 7 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/app.txt
r11954 r11971 1 1 :mod:`waeup.ikoba.app` -- central components for Ikoba 2 **************************************************** 2 ****************************************************** 3 3 4 4 .. :doctest: … … 25 25 26 26 Creating `Company` instances 27 ============================ ===27 ============================ 28 28 29 29 As :class:`Company` instances make use of the Zope Component … … 69 69 70 70 Ikoba plugins 71 ============ 71 ============= 72 72 73 73 waeup.ikoba provides an API to 'plugin' components. Things that should -
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/templates/default_waeup_edit_form.pt
r11947 r11971 5 5 <tbody> 6 6 <tal:widgets content="structure provider:widgets" /> 7 <tal:files content="structure provider:files" /> 7 8 </tbody> 8 9 </table> -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r11967 r11971 33 33 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 34 34 from waeup.ikoba.interfaces import MessageFactory as _ 35 from waeup.ikoba.interfaces import IContactForm, IObjectHistory, IIkobaObject 35 from waeup.ikoba.interfaces import ( 36 IContactForm, IObjectHistory, IIkobaObject, IIkobaUtils, 37 IPasswordValidator, IUserAccount) 36 38 from waeup.ikoba.browser.layout import ( 37 39 IkobaPage, IkobaEditFormPage, IkobaAddFormPage, IkobaDisplayFormPage, … … 39 41 from waeup.ikoba.browser.pages import ContactAdminForm 40 42 from waeup.ikoba.browser.breadcrumbs import Breadcrumb 43 from waeup.ikoba.browser.interfaces import ICaptchaManager 41 44 from waeup.ikoba.utils.helpers import get_current_principal, to_timezone, now 42 45 from waeup.ikoba.customers.interfaces import ( … … 485 488 return 486 489 487 kofa_utils = getUtility(I KofaUtils)490 kofa_utils = getUtility(IIkobaUtils) 488 491 password = kofa_utils.genPassword() 489 492 mandate = PasswordMandate() … … 523 526 self.customer_id = customer_id 524 527 return 528 529 class CustomerFilesUploadPage(IkobaPage): 530 """ View to upload files by customer 531 """ 532 grok.context(ICustomer) 533 grok.name('change_portrait') 534 grok.require('waeup.uploadCustomerFile') 535 grok.template('filesuploadpage') 536 label = _('Upload files') 537 pnav = 4 538 539 def update(self): 540 PWCHANGE_STATES = getUtility(ICustomersUtils).PWCHANGE_STATES 541 if self.context.customer.state not in PWCHANGE_STATES: 542 emit_lock_message(self) 543 return 544 super(CustomerFilesUploadPage, self).update() 545 return 546 547 # Pages for customers only 548 549 class CustomerBaseEditFormPage(IkobaEditFormPage): 550 """ View to edit customer base data 551 """ 552 grok.context(ICustomer) 553 grok.name('edit_base') 554 grok.require('waeup.handleCustomer') 555 form_fields = grok.AutoFields(ICustomer).select( 556 'email', 'phone') 557 label = _('Edit base data') 558 pnav = 4 559 560 @action(_('Save'), style='primary') 561 def save(self, **data): 562 msave(self, **data) 563 return 564 565 class CustomerChangePasswordPage(IkobaEditFormPage): 566 """ View to edit customer passords 567 """ 568 grok.context(ICustomer) 569 grok.name('change_password') 570 grok.require('waeup.handleCustomer') 571 grok.template('change_password') 572 label = _('Change password') 573 pnav = 4 574 575 @action(_('Save'), style='primary') 576 def save(self, **data): 577 form = self.request.form 578 password = form.get('change_password', None) 579 password_ctl = form.get('change_password_repeat', None) 580 if password: 581 validator = getUtility(IPasswordValidator) 582 errors = validator.validate_password(password, password_ctl) 583 if not errors: 584 IUserAccount(self.context).setPassword(password) 585 self.context.writeLogMessage(self, 'saved: password') 586 self.flash(_('Password changed.')) 587 else: 588 self.flash( ' '.join(errors), type="warning") 589 return 590 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/basepage.pt
r11967 r11971 19 19 </td> 20 20 </tr> 21 <tal:files content="structure provider:files" /> 21 22 </tbody> 22 23 <tfoot> -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/utils.py
r11956 r11971 19 19 """ 20 20 import grok 21 from waeup.ikoba.interfaces import STARTED 21 22 from waeup.ikoba.customers.interfaces import ICustomersUtils 22 23 … … 34 35 #: start with this string. The default is 'K'. 35 36 CUSTOMER_ID_PREFIX = u'K' 37 38 PWCHANGE_STATES = (STARTED,) -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/workflow.py
r11967 r11971 66 66 67 67 Transition( 68 transition_id = 'reject', 69 title = _('Reject customer'), 70 msg = _('Customer registration rejected'), 71 source = REQUESTED, 72 destination = STARTED), 73 74 Transition( 68 75 transition_id = 'reset1', 69 76 title = _('Reset customer'),
Note: See TracChangeset for help on using the changeset viewer.