Changeset 1440


Ignore:
Timestamp:
19 Feb 2007, 15:06:06 (18 years ago)
Author:
joachim
Message:

book_reserverved_bed enhanced:

  • reserve and change button added

1.) all beds which are reserved for this student are unreserved.
2.) the selected bed is reserved for this student.
3.) The new bed-koordinate is reflected in the accommodation object.

The reserve functionallity is unchanged.

Location:
WAeUP_SRP/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/doc/srp_documentation.mm

    r1430 r1440  
    1 <map version="0.8.0">
     1<map version="0.9.0_Beta_8">
    22<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
    33<node CREATED="1170079518946" ID="Freemind_Link_650524897" MODIFIED="1171711313968" TEXT="WAeUP SRP Architecture">
     
    1010<node CREATED="1170079621592" ID="Freemind_Link_1297017754" MODIFIED="1170079640872" POSITION="right" TEXT="Campus">
    1111<node CREATED="1171710559043" ID="Freemind_Link_1592396213" MODIFIED="1171710565212" TEXT="Id: campus"/>
    12 <node CREATED="1170079643589" ID="Freemind_Link_1231068129" MODIFIED="1171710686426" TEXT="Academic Section">
     12<node CREATED="1170079643589" FOLDED="true" ID="Freemind_Link_1231068129" MODIFIED="1171710686426" TEXT="Academic Section">
    1313<node CREATED="1171710577379" ID="Freemind_Link_1444831124" MODIFIED="1171710589887" TEXT="Id: academics"/>
    1414<node CREATED="1170080366716" ID="Freemind_Link_415048819" MODIFIED="1171709591652" TEXT="{Faculties}">
     
    5454<node CREATED="1171124982312" ID="Freemind_Link_1037588671" LINK="../profiles/default/layouts/student.xml" MODIFIED="1171353165422" TEXT="Layout: student"/>
    5555<node CREATED="1171353188624" ID="Freemind_Link_1032185087" LINK="../profiles/default/workflows/waeup_student_wf/definition.xml" MODIFIED="1171353319663" TEXT="Workflow: waeup_student_wf"/>
    56 <node CREATED="1170082164451" ID="Freemind_Link_1627718074" MODIFIED="1171711160327" TEXT="Application Data">
    57 <node CREATED="1170083733194" ID="Freemind_Link_1398132513" MODIFIED="1170862024807" TEXT="Id: application"/>
    58 <node CREATED="1170083603042" ID="Freemind_Link_4951906" LINK="../profiles/default/types/StudentApplication.xml" MODIFIED="1171009517689" TEXT="Type: StudentApplication"/>
    59 <node CREATED="1170083649773" ID="Freemind_Link_1139787187" LINK="../profiles/default/schemas/student_application.xml" MODIFIED="1171009482163" TEXT="Schema: student_application"/>
     56<node CREATED="1170082164451" ID="Freemind_Link_1627718074" MODIFIED="1171894825978" TEXT="Accommodation Data">
     57<node CREATED="1170083733194" ID="Freemind_Link_1398132513" MODIFIED="1171894857194" TEXT="Id: accommodation06"/>
     58<node CREATED="1170083603042" ID="Freemind_Link_4951906" LINK="../profiles/default/types/StudentAccommodation.xml" MODIFIED="1171894888465" TEXT="Type: StudentAccommodation"/>
     59<node CREATED="1170083649773" ID="Freemind_Link_1139787187" LINK="../profiles/default/schemas/student_accommodation.xml" MODIFIED="1171895045243" TEXT="Schema: student_accommodation"/>
    6060<node CREATED="1170883343230" ID="Freemind_Link_158025710" MODIFIED="1170883350237" TEXT="Forms">
    6161<node CREATED="1170883352226" ID="Freemind_Link_847687960" MODIFIED="1170883352226" TEXT=""/>
    6262</node>
    6363</node>
    64 <node CREATED="1170082180802" ID="Freemind_Link_812719734" MODIFIED="1171711167338" TEXT="Clearance Data">
     64<node CREATED="1170082164451" FOLDED="true" ID="Freemind_Link_1808367236" MODIFIED="1171711160327" TEXT="Application Data">
     65<node CREATED="1170083733194" ID="Freemind_Link_1603566745" MODIFIED="1170862024807" TEXT="Id: application"/>
     66<node CREATED="1170083603042" ID="Freemind_Link_1501749959" LINK="../profiles/default/types/StudentApplication.xml" MODIFIED="1171009517689" TEXT="Type: StudentApplication"/>
     67<node CREATED="1170083649773" ID="Freemind_Link_743980261" LINK="../profiles/default/schemas/student_application.xml" MODIFIED="1171009482163" TEXT="Schema: student_application"/>
     68<node CREATED="1170883343230" ID="Freemind_Link_1992366565" MODIFIED="1170883350237" TEXT="Forms">
     69<node CREATED="1170883352226" ID="Freemind_Link_1836030474" MODIFIED="1170883352226" TEXT=""/>
     70</node>
     71</node>
     72<node CREATED="1170082180802" FOLDED="true" ID="Freemind_Link_812719734" MODIFIED="1171711167338" TEXT="Clearance Data">
    6573<node CREATED="1170083733194" ID="Freemind_Link_1823044370" MODIFIED="1170862044390" TEXT="Id: clearance"/>
    6674<node CREATED="1170083603042" ID="Freemind_Link_1641808385" LINK="../profiles/default/types/StudentClearance.xml" MODIFIED="1171009882288" TEXT="Type: StudentClearance"/>
     
    7280<node CREATED="1170083649773" ID="Freemind_Link_329050457" LINK="../profiles/default/schemas/student_personal.xml" MODIFIED="1170959011444" TEXT="Schema: student_personal"/>
    7381</node>
    74 <node CREATED="1170082392807" ID="Freemind_Link_1979443941" MODIFIED="1171711179966" TEXT="Study Course">
     82<node CREATED="1170082392807" FOLDED="true" ID="Freemind_Link_1979443941" MODIFIED="1171711179966" TEXT="Study Course">
    7583<node CREATED="1170930140692" ID="Freemind_Link_607082969" MODIFIED="1171009488850" TEXT="Id: study_course"/>
    7684<node CREATED="1170930264337" ID="Freemind_Link_1384807180" LINK="../profiles/default/types/StudentStudyCourse.xml" MODIFIED="1171009934935" TEXT="Type: StudentStudyCourse"/>
     
    8896</node>
    8997</node>
    90 <node CREATED="1170082200667" ID="Freemind_Link_140160478" MODIFIED="1170082364784" TEXT="Payments">
     98<node CREATED="1170082200667" FOLDED="true" ID="Freemind_Link_140160478" MODIFIED="1170082364784" TEXT="Payments">
    9199<node CREATED="1171711430276" ID="Freemind_Link_86727434" MODIFIED="1171711435834" TEXT="Id: payments"/>
    92100<node CREATED="1171711367726" ID="Freemind_Link_1873791240" MODIFIED="1171711381666" TEXT="Type: PaymentsFolder"/>
     
    98106</node>
    99107</node>
    100 <node CREATED="1171379675232" ID="Freemind_Link_41196870" MODIFIED="1171379685192" TEXT="Userinterface">
     108<node CREATED="1171379675232" FOLDED="true" ID="Freemind_Link_41196870" MODIFIED="1171379685192" TEXT="Userinterface">
    101109<node CREATED="1171379691280" ID="Freemind_Link_24219" MODIFIED="1171379703554" TEXT="Officers">
    102110<node CREATED="1171379710053" ID="Freemind_Link_1668598079" MODIFIED="1171379734695" TEXT="add_student">
     
    140148<node CREATED="1171710956294" ID="Freemind_Link_1564638284" MODIFIED="1171710960600" TEXT="Type: ScratchCardBatchesFolder"/>
    141149<node CREATED="1171710648131" ID="Freemind_Link_1115846656" MODIFIED="1171710654941" TEXT="Id: pins"/>
    142 <node CREATED="1170082553111" ID="Freemind_Link_1225342224" MODIFIED="1171710994940" TEXT="{ScratchCardBatches}">
     150<node CREATED="1170082553111" ID="Freemind_Link_1225342224" MODIFIED="1171884067639" TEXT="ScratchCardBatches">
    143151<node CREATED="1171711021738" ID="Freemind_Link_1373462759" MODIFIED="1171711030451" TEXT="Type: ScratchCardBatch"/>
    144152<node CREATED="1171711043239" ID="Freemind_Link_215893748" MODIFIED="1171711075966" TEXT="Schema: scratch_card_batch"/>
  • WAeUP_SRP/trunk/profiles/default/types/StudentAccommodation.xml

    r1139 r1440  
    11<?xml version="1.0"?>
     2<?xml-stylesheet type="text/xsl" href="types.xsl"?>
    23<object name="StudentAccommodation" meta_type="CPS Flexible Type Information"
    34   xmlns:i18n="http://xml.zope.org/namespaces/i18n">
  • WAeUP_SRP/trunk/skins/waeup_accommodation/book_reserved_bed.py

    r1426 r1440  
    1515logger = logging.getLogger('Accommodation.BookReservedBed')
    1616
     17change_bed = REQUEST.has_key("reserve_and_change")
     18validate = change_bed or (REQUEST.has_key("reserve") and
     19           REQUEST.get("reserve").startswith('Reserve'))
    1720mode = 'create'
    18 validate = REQUEST.has_key("cpsdocument_edit_button") and\
    19            REQUEST.get("cpsdocument_edit_button").startswith('Reserve')
     21
    2022d = {}
    2123rendered,psm,ds = lt.renderLayout(layout_id= 'acco_bed_booking',
     
    6466    bed_brain = res[0]
    6567    already = acco_cat(student=sid)
    66     if already:
     68    if already and not change_bed:
    6769        psm = "Student %s already reserved bed %s" % (sid, already[0].bed)
    6870        break
     
    7072        psm = "Not a reserved bed %s" % bid
    7173        break
    72     if bed_brain.student:
     74    if bed_brain.student and not change_bed:
    7375        psm = "Bed %s already reserved for %s" % (bid,bed_brain.student)
    7476        break
     
    8587                                 button = "Reserve Bed",
    8688                                 )
     89if change_bed:
     90    for bed in already:
     91        acco_cat.modifyRecord(bed=bed.bed,student='')
     92       
    8793acco_cat.modifyRecord(bed = bid, student = sid)
     94students = context.portal_url.getPortalObject().campus.students
     95student_obj = getattr(students,sid)
     96acco_id = "accommodation_%s" % context.getSessionId()
     97if acco_id in student_obj.objectIds():
     98    acco_doc = getattr(student_obj, acco_id).getContent()
     99    acco_doc.edit(mapping={'bed': bid})
    88100logger.info('"%s","booked reserved bed %s for","%s"' % (member,bid,sid))
     101mode = 'view'
    89102return context.book_reserved_bed_form(rendered = "",
    90103                                 psm = "Bed reserved for %s %s" % (sid,student.name),
  • WAeUP_SRP/trunk/skins/waeup_accommodation/book_reserved_bed_form.pt

    r1393 r1440  
    1919          <div tal:replace="structure rendered_main" />
    2020          <br />
    21           <input type="submit" class="standalone" name="cpsdocument_edit_button"
    22                  value="Save"
    23                  id="cpsdocument_edit_button"
     21          <input type="submit" class="standalone"
     22                 name="reserve"
    2423                 tal:attributes="value options/button"
    2524                 tal:condition="not:creation" />
    26           <input type="submit"
     25          <input type="submit" tal:condition="python:mode !='view'"
    2726                 class="standalone"
    28                  name="cpsdocument_create_button"
    29                  value="apply"
    30                  tal:attributes="value options/button"
    31                  tal:condition="creation" />
    32          
     27                 name="reserve_and_change"
     28                 value="Reserve and Change Bed"
     29                 />
    3330        </form>
    3431      </metal:block>
Note: See TracChangeset for help on using the changeset viewer.