Changeset 11964 for main/waeup.ikoba/trunk/src/waeup/ikoba
- Timestamp:
- 15 Nov 2014, 06:11:20 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/templates/customersitelayout.pt
r11952 r11964 30 30 <ul class="nav ikoba-navbar-left"> 31 31 <tal:primary_nav content="structure provider:primary_nav" /> 32 <tal:primary_nav content="structure provider:primary_nav_customer" /> 32 33 </ul> 33 34 <!-- /Diazo element--> … … 71 72 72 73 <!-- Diazo element--> 74 <span tal:condition="layout/getCustomerName"> 75 <div class="wfstatus"> 76 <span tal:replace="python:context.customer.customer_id"> 77 Id 78 </span> 79 • 80 <span tal:replace="python:context.customer.translated_state"> 81 State 82 </span> 83 </div> 84 </span> 85 <!-- /Diazo element--> 86 87 <!-- Diazo element--> 73 88 <div class="ikoba-content"> 74 89 <div class="actionbar" tal:condition="provider:actionbar"> -
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/templates/staffsitelayout.pt
r11952 r11964 30 30 31 31 <!-- Diazo element--> 32 <ul class="nav ikoba-navbar-left"> 32 <ul class="nav ikoba-navbar-left"> 33 33 <tal:primary_nav content="structure provider:primary_nav" /> 34 34 </ul> … … 73 73 74 74 <!-- Diazo element--> 75 <span tal:condition="layout/getCustomerName"> 76 <div class="wfstatus"> 77 <span tal:replace="python:context.customer.customer_id"> 78 Id 79 </span> 80 • 81 <span tal:replace="python:context.customer.translated_state"> 82 State 83 </span> 84 </div> 85 </span> 86 <!-- /Diazo element--> 87 88 <!-- Diazo element--> 75 89 <div class="sidebar well"> 90 <div tal:condition="layout/getCustomerName"> 91 <div class="ikoba-sidebar-title" tal:content="layout/getCustomerName">STUDENTNAME</div> 92 <ul class="nav"> 93 <tal:left content="structure provider:left_customermanage" /> 94 </ul> 95 </div> 76 96 <div tal:condition="layout/isAuthenticated"> 77 97 <div class="ikoba-sidebar-title" tal:content="layout/getUserTitle">USERNAME</div> -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/batching.py
r11958 r11964 37 37 from waeup.ikoba.interfaces import ( 38 38 IBatchProcessor, FatalCSVError, IObjectConverter, IUserAccount, 39 IObjectHistory, VALIDATED, REGISTERED,IGNORE_MARKER)39 IObjectHistory, IGNORE_MARKER) 40 40 from waeup.ikoba.interfaces import IIkobaUtils 41 41 from waeup.ikoba.interfaces import MessageFactory as _ -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/customer.py
r11958 r11964 37 37 IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler, 38 38 IIkobaUtils, registration_states_vocab, IExtFileStore, 39 CREATED, ADMITTED, CLEARANCE, PAID, REGISTERED, VALIDATED, RETURNING)39 CREATED, REQUESTED, APPROVED) 40 40 from waeup.ikoba.customers.export import EXPORTER_NAMES 41 41 from waeup.ikoba.customers.interfaces import ( -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/sample_customer_data.csv
r11958 r11964 1 1 customer_id,firstname,lastname,reg_number,date_of_birth,,phone,sex,state 2 X666666,Aaren,Pieri,1,1990-01-02,aa@aa.ng,1234,M, courses validated3 Y777777,Claus,Finau,2,1990-01-03,aa@aa.ng,1234,m, courses validated4 ,Susann,Berson,3,1990-01-04,aa@aa.ng,1234,F, courses validated5 ,Else,Mueller,4,1990-01-05,aa@aa.ng,1234,f, school fee paid6 X888888,Alfons,Meier,5,1990-01-02,aa@aa.ng,1234,m, courses validated7 X999999,Herbert,Mueller,6,1990-01-02,aa@aa.ng,1234,m, courses registered8 X111111,Fabian,Riester,7,1990-01-02,aa@aa.ng,1234,m, courses validated9 X222222,Thomas,Kinderman,8,1990-01-02,aa@aa.ng,1234,m, courses validated10 X333333,Paula,Schall,9,1990-01-02,aa@aa.ng,1234,m, courses registered2 X666666,Aaren,Pieri,1,1990-01-02,aa@aa.ng,1234,M,requested 3 Y777777,Claus,Finau,2,1990-01-03,aa@aa.ng,1234,m,requested 4 ,Susann,Berson,3,1990-01-04,aa@aa.ng,1234,F,requested 5 ,Else,Mueller,4,1990-01-05,aa@aa.ng,1234,f,approved 6 X888888,Alfons,Meier,5,1990-01-02,aa@aa.ng,1234,m,requested 7 X999999,Herbert,Mueller,6,1990-01-02,aa@aa.ng,1234,m,approved 8 X111111,Fabian,Riester,7,1990-01-02,aa@aa.ng,1234,m,requested 9 X222222,Thomas,Kinderman,8,1990-01-02,aa@aa.ng,1234,m,requested 10 X333333,Paula,Schall,9,1990-01-02,aa@aa.ng,1234,m,approved -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/sample_customer_data_duplicates.csv
r11958 r11964 1 1 customer_id,firstname,lastname,reg_number,date_of_birth,email,phone,password,sex,state 2 A123456,Aaren,Pieri,1,1990-01-02#,aa@aa.ng,1234,mypw1,m, clearance started3 C123456,Aaren,Berson,2,1990-01-04,aa@aa.ng,1234,mypw1,m,a dmitted2 A123456,Aaren,Pieri,1,1990-01-02#,aa@aa.ng,1234,mypw1,m,requested 3 C123456,Aaren,Berson,2,1990-01-04,aa@aa.ng,1234,mypw1,m,approved 4 4 F123456,Frank,Meyer,1,1990-01-06,aa@aa.ng,1234,,m, 5 5 A123456,Uli,Schulz,3,1990-01-07,aa@aa.ng,1234,,m, -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/sample_customer_data_update.csv
r11958 r11964 1 1 reg_number,date_of_birth,state 2 1,1980-01-02,a dmitted2 1,1980-01-02,approved 3 3 2,1980-01-03, 4 4 3,1980-01-04, -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py
r11958 r11964 171 171 initial_cust_id = self.app['customers']._curr_cust_id 172 172 errs, inv_errs, conv_dict = self.processor.checkConversion( 173 dict(reg_number='1', state='a dmitted'))173 dict(reg_number='1', state='approved')) 174 174 self.assertEqual(len(errs),0) 175 175 # Empty state is allowed … … 206 206 self.assertEqual(self.app['customers']['X666666'].reg_number,'1') 207 207 self.assertEqual( 208 self.app['customers']['X666666'].state, ' courses validated')208 self.app['customers']['X666666'].state, 'requested') 209 209 # Two new customer_ids have been created. 210 210 self.assertEqual(self.app['customers']._curr_cust_id, 1000003) … … 219 219 self.assertEqual(num_warns,0) 220 220 # state has changed 221 self.assertEqual(self.app['customers']['X666666'].state,'a dmitted')221 self.assertEqual(self.app['customers']['X666666'].state,'approved') 222 222 # state has not changed 223 self.assertEqual(self.app['customers']['Y777777'].state, 224 'courses validated') 223 self.assertEqual(self.app['customers']['Y777777'].state, 'requested') 225 224 shutil.rmtree(os.path.dirname(fin_file)) 226 225 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/viewlets.py
r11958 r11964 26 26 default_fileupload_template) 27 27 28 grok.context(IIkobaObject) # Make IKofaObject the default context 29 grok.templatedir('browser_templates') 30 28 31 class CustomersTab(PrimaryNavTab): 29 32 """Customers tab in primary navigation. … … 41 44 def link_target(self): 42 45 return self.view.application_url('customers') 46 47 class PrimaryCustomerNavManager(grok.ViewletManager): 48 """Viewlet manager for the primary navigation tab. 49 """ 50 grok.name('primary_nav_customer') 51 52 class PrimaryCustomerNavTab(grok.Viewlet): 53 """Base for primary customer nav tabs. 54 """ 55 grok.baseclass() 56 grok.viewletmanager(PrimaryCustomerNavManager) 57 template = default_primary_nav_template 58 grok.order(1) 59 grok.require('waeup.Authenticated') 60 pnav = 0 61 tab_title = u'Some Text' 62 63 @property 64 def link_target(self): 65 return self.view.application_url() 66 67 @property 68 def active(self): 69 view_pnav = getattr(self.view, 'pnav', 0) 70 if view_pnav == self.pnav: 71 return 'active' 72 return '' 73 74 class MyCustomerDataTab(PrimaryCustomerNavTab): 75 """MyData dropdown tab in primary navigation. 76 """ 77 grok.order(3) 78 grok.require('waeup.viewMyCustomerDataTab') 79 grok.template('mydatadropdowntabs') 80 grok.name('mycustomerdatatab') 81 pnav = 4 82 tab_title = _(u'My Data') 83 84 @property 85 def active(self): 86 view_pnav = getattr(self.view, 'pnav', 0) 87 if view_pnav == self.pnav: 88 return 'active dropdown' 89 return 'dropdown' 90 91 @property 92 def targets(self): 93 customer = grok.getSite()['customers'][self.request.principal.id] 94 customer_url = self.view.url(customer) 95 targets = [] 96 targets += [ 97 {'url':customer_url, 'title':'Base Data'}, 98 {'url':customer_url + '/history', 'title':_('History')}, 99 ] 100 return targets -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/workflow.py
r11958 r11964 25 25 from waeup.ikoba.interfaces import ( 26 26 IObjectHistory, IIkobaWorkflowInfo, IIkobaUtils, 27 CREATED, ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING, 28 REGISTERED, VALIDATED, GRADUATED, TRANSCRIPT) 27 CREATED, REQUESTED, APPROVED) 29 28 from waeup.ikoba.interfaces import MessageFactory as _ 30 29 from waeup.ikoba.workflow import IkobaWorkflow, IkobaWorkflowInfo … … 33 32 34 33 35 IMPORTABLE_STATES = (ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING, 36 REGISTERED, VALIDATED, GRADUATED) 34 IMPORTABLE_STATES = (REQUESTED, APPROVED) 37 35 38 36 REGISTRATION_TRANSITIONS = ( … … 42 40 source = None, 43 41 condition = NullCondition, 44 msg = _(' Record created'),42 msg = _('Customer record created'), 45 43 destination = CREATED), 46 44 47 45 Transition( 48 transition_id = 'admit', 49 title = _('Admit customer'), 50 msg = _('Admitted'), 51 source = CREATED, 52 destination = ADMITTED), 46 transition_id = 'request', 47 title = _('Request registration'), 48 msg = _('Customer registration requested'), 49 source = REQUESTED, 50 destination = APPROVED), 51 52 Transition( 53 transition_id = 'approve', 54 title = _('Approve customer'), 55 msg = _('Customer registration approved'), 56 source = REQUESTED, 57 destination = APPROVED), 53 58 54 59 Transition( 55 60 transition_id = 'reset1', 56 61 title = _('Reset customer'), 57 msg = _('Reset to initial state'),58 source = A DMITTED,62 msg = _('Reset to initial customer state'), 63 source = APPROVED, 59 64 destination = CREATED), 60 65 61 66 Transition( 62 transition_id = 'start_clearance',63 title = _('Start clearance'),64 msg = _('Clearance started'),65 source = ADMITTED,66 destination = CLEARANCE),67 68 Transition(69 67 transition_id = 'reset2', 70 title = _('Reset to admitted'), 71 msg = _("Reset to 'admitted'"), 72 source = CLEARANCE, 73 destination = ADMITTED), 74 75 Transition( 76 transition_id = 'request_clearance', 77 title = _('Request clearance'), 78 msg = _('Clearance requested'), 79 source = CLEARANCE, 68 title = _('Reset to requested'), 69 msg = _("Reset to 'requested'"), 70 source = APPROVED, 80 71 destination = REQUESTED), 81 72 82 73 Transition( 83 74 transition_id = 'reset3', 84 title = _('Reset to clearance started'),85 msg = _("Reset to 'clearance started'"),75 title = _('Reset customer'), 76 msg = _("Reset to initial state"), 86 77 source = REQUESTED, 87 destination = C LEARANCE),78 destination = CREATED), 88 79 89 Transition(90 transition_id = 'clear',91 title = _('Clear customer'),92 msg = _('Cleared'),93 source = REQUESTED,94 destination = CLEARED),95 96 Transition(97 transition_id = 'reset4',98 title = _('Reset to clearance started'),99 msg = _("Reset to 'clearance started'"),100 source = CLEARED,101 destination = CLEARANCE),102 103 Transition(104 transition_id = 'pay_first_school_fee',105 title = _('Pay school fee'),106 msg = _('First school fee payment made'),107 source = CLEARED,108 destination = PAID),109 110 Transition(111 transition_id = 'approve_first_school_fee',112 title = _('Approve payment'),113 msg = _('First school fee payment approved'),114 source = CLEARED,115 destination = PAID),116 117 Transition(118 transition_id = 'reset5',119 title = _('Reset to cleared'),120 msg = _("Reset to 'cleared'"),121 source = PAID,122 destination = CLEARED),123 124 Transition(125 transition_id = 'pay_school_fee',126 title = _('Pay school fee'),127 msg = _('School fee payment made'),128 source = RETURNING,129 destination = PAID),130 131 Transition(132 transition_id = 'pay_pg_fee',133 title = _('Pay PG school fee'),134 msg = _('PG school fee payment made'),135 source = PAID,136 destination = PAID),137 138 Transition(139 transition_id = 'approve_school_fee',140 title = _('Approve school fee payment'),141 msg = _('School fee payment approved'),142 source = RETURNING,143 destination = PAID),144 145 Transition(146 transition_id = 'approve_pg_fee',147 title = _('Approve PG school fee payment'),148 msg = _('PG school fee payment approved'),149 source = PAID,150 destination = PAID),151 152 Transition(153 transition_id = 'reset6',154 title = _('Reset to returning'),155 msg = _("Reset to 'returning'"),156 source = PAID,157 destination = RETURNING),158 159 Transition(160 transition_id = 'register_courses',161 title = _('Register courses'),162 msg = _('Courses registered'),163 source = PAID,164 destination = REGISTERED),165 166 Transition(167 transition_id = 'reset7',168 title = _('Reset to school fee paid'),169 msg = _("Reset to 'school fee paid'"),170 source = REGISTERED,171 destination = PAID),172 173 Transition(174 transition_id = 'validate_courses',175 title = _('Validate courses'),176 msg = _('Courses validated'),177 source = REGISTERED,178 destination = VALIDATED),179 180 Transition(181 transition_id = 'bypass_validation',182 title = _('Return and bypass validation'),183 msg = _("Course validation bypassed"),184 source = REGISTERED,185 destination = RETURNING),186 187 Transition(188 transition_id = 'reset8',189 title = _('Reset to school fee paid'),190 msg = _("Reset to 'school fee paid'"),191 source = VALIDATED,192 destination = PAID),193 194 Transition(195 transition_id = 'return',196 title = _('Return'),197 msg = _("Returned"),198 source = VALIDATED,199 destination = RETURNING),200 201 Transition(202 transition_id = 'reset9',203 title = _('Reset to courses validated'),204 msg = _("Reset to 'courses validated'"),205 source = RETURNING,206 destination = VALIDATED),207 80 ) 208 81 -
main/waeup.ikoba/trunk/src/waeup/ikoba/interfaces.py
r11958 r11964 46 46 47 47 CREATED = 'created' 48 ADMITTED = 'admitted' 49 CLEARANCE = 'clearance started' 50 REQUESTED = 'clearance requested' 51 CLEARED = 'cleared' 52 PAID = 'school fee paid' 53 RETURNING = 'returning' 54 REGISTERED = 'courses registered' 55 VALIDATED = 'courses validated' 56 GRADUATED = 'graduated' 57 TRANSCRIPT = 'transcript requested' 58 48 REQUESTED = 'requested' 49 APPROVED = 'approved' 59 50 60 51 #: A dict giving job status as tuple (<STRING>, <TRANSLATED_STRING>), … … 93 84 registration_states_vocab = SimpleIkobaVocabulary( 94 85 (_('created'), CREATED), 95 (_('admitted'), ADMITTED), 96 (_('clearance started'), CLEARANCE), 97 (_('clearance requested'), REQUESTED), 98 (_('cleared'), CLEARED), 99 (_('school fee paid'), PAID), 100 (_('courses registered'), REGISTERED), 101 (_('courses validated'), VALIDATED), 102 (_('returning'), RETURNING), 86 (_('requested'), REQUESTED), 87 (_('approved'), APPROVED), 103 88 ) 104 89
Note: See TracChangeset for help on using the changeset viewer.