Changeset 13484 for main/waeup.kofa/trunk
- Timestamp:
- 19 Nov 2015, 11:34:48 (9 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r13471 r13484 4 4 1.3.4.dev0 (unreleased) 5 5 ======================= 6 7 * Add bed statistics components. 6 8 7 9 * Add option which allows students to select a desired hostel before -
main/waeup.kofa/trunk/docs/source/userdocs/students/workflow.rst
r13098 r13484 6 6 Studying at a higher education institution means following 7 7 orchestrated and repeatable patterns of activities or, in other 8 words, following a workflow prescribed by the school regulations.9 This process starts with application for studying a programme 10 offered by the school, and may end with de-registration of a 11 student. But even after de-registration, former students can be kept 12 in the system as alumni so that they can still access their records 13 or can apply for official transcripts.8 words, following a process workflow prescribed by the school 9 regulations. This process starts with application for studying a 10 programme offered by the school, and may end with de-registration of 11 a student. But even after de-registration, former students can be 12 kept in the system as alumni so that they can still access their 13 records or can apply for official transcripts. 14 14 15 15 Kofa divides these 'repeatable patterns of activities' into two 16 different and strictly seperated workflows: an application and a17 student registration workflow. The latter, which presupposes the 18 admission of the student, will be described here.16 different and strictly seperated process workflows: an application 17 and a student registration workflow. The latter, which presupposes 18 the admission of the student, will be described here. 19 19 20 20 A worflow defines states and transitions between the states. The -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
r13476 r13484 115 115 text = _('Manage accommodation section') 116 116 117 class HostelsStatisticsActionButton(ManageActionButton): 118 grok.order(2) 119 grok.context(IHostelsContainer) 120 grok.view(HostelsContainerPage) 121 grok.require('waeup.manageHostels') 122 icon = 'actionicon_statistics.png' 123 text = _('Bed statistics') 124 target = 'statistics' 125 117 126 class HostelsContainerManagePage(KofaEditFormPage): 118 127 """The manage page for hostel containers. … … 196 205 def render(self): 197 206 return 207 208 class HostelsStatisticsPage(KofaDisplayFormPage): 209 """Some statistics about beds in hostels. 210 """ 211 grok.context(IHostelsContainer) 212 grok.name('statistics') 213 grok.require('waeup.manageHostels') 214 grok.template('containerstatistics') 215 label = _('Bed Statistics') 198 216 199 217 class HostelAddFormPage(KofaAddFormPage): -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
r13483 r13484 238 238 stats = utils.getBedStatistics() 239 239 self.assertEqual(stats, 240 {'regular_male_fr': (1, 1), 241 'regular_female_fi': (0, 0), 242 'regular_male_re': (0, 0), 243 'regular_female_fr': (0, 0), 244 'regular_female_all': (0, 0), 245 'regular_female_re': (0, 0), 246 'regular_male_fi': (0, 0), 247 'regular_male_all': (0, 0)} 240 {'regular_male_fr': (0, 1, 1), 241 'regular_female_fi': (0, 0, 0), 242 'regular_male_re': (0, 0, 0), 243 'regular_female_fr': (0, 0, 0), 244 'regular_female_all': (0, 0, 0), 245 'regular_female_re': (0, 0, 0), 246 'regular_female_reserved': (0, 0, 0), 247 'regular_male_reserved': (0, 0, 0), 248 'regular_male_fi': (0, 0, 0), 249 'regular_male_all': (0, 0, 0)} 248 250 ) 249 251 self.app[ … … 253 255 stats = utils.getBedStatistics() 254 256 self.assertEqual(stats, 255 {'regular_male_fr': (0, 1), 256 'regular_female_fi': (0, 0), 257 'regular_male_re': (0, 0), 258 'regular_female_fr': (0, 0), 259 'regular_female_all': (0, 0), 260 'regular_female_re': (0, 0), 261 'regular_male_fi': (0, 0), 262 'regular_male_all': (0, 0)} 257 {'regular_male_fr': (1, 0, 1), 258 'regular_female_fi': (0, 0, 0), 259 'regular_male_re': (0, 0, 0), 260 'regular_female_fr': (0, 0, 0), 261 'regular_female_all': (0, 0, 0), 262 'regular_female_re': (0, 0, 0), 263 'regular_female_reserved': (0, 0, 0), 264 'regular_male_reserved': (0, 0, 0), 265 'regular_male_fi': (0, 0, 0), 266 'regular_male_all': (0, 0, 0)} 263 267 ) 264 268 … … 478 482 self.assertTrue('2 of 10' in self.browser.contents) 479 483 bedticket.bed = self.app['hostels']['hall-1']['hall-1_A_101_A'] 484 # Managers can open the bed statistics page 485 self.browser.getLink("Bed statistics").click() 486 self.assertTrue('Bed Statistics</h1>' in self.browser.contents) 480 487 # Remove entire hostel. 481 488 self.browser.open(self.manage_container_path) -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/utils.py
r13483 r13484 39 39 'regular_female_fi', 40 40 'regular_female_all', 41 'regular_female_reserved', 41 42 'regular_male_fr', 42 43 'regular_male_re', 43 44 'regular_male_fi', 44 'regular_male_all',) 45 'regular_male_all', 46 'regular_male_reserved',) 45 47 for bed_type in bed_types: 46 no= cat.searchResults(48 free = cat.searchResults( 47 49 bed_type=(bed_type, bed_type), 48 50 owner=(NOT_OCCUPIED, NOT_OCCUPIED)) 49 51 all = cat.searchResults( 50 52 bed_type=(bed_type, bed_type)) 51 stats[bed_type] = (len(no), len(all)) 53 free = len(free) 54 total = len(all) 55 occ = total - free 56 stats[bed_type] = (occ, free, total) 52 57 return stats
Note: See TracChangeset for help on using the changeset viewer.