Changeset 1412 for WAeUP_SRP


Ignore:
Timestamp:
13 Feb 2007, 14:14:44 (18 years ago)
Author:
joachim
Message:

more documentation

M profiles/default/schemas/acco_hall.xml
M profiles/default/schemas/schema.xsl
M profiles/default/workflows/waeup_student_wf/definition.xml
M profiles/default/layouts/layout.xsl
M profiles/default/layouts/acco_bed_booking.xml
M profiles/default/layouts/acco_hall.xml
M profiles/default/types/Student.xml
M profiles/default/types/AccoFolder.xml
M profiles/default/types/AccoHall.xml
M doc/srp_documentation.mm

reserved bed functionallity,
pay hostel-fee for reserved bed

D skins/waeup_student/reserve_accommodation.py
M skins/waeup_accommodation/book_reserved_bed.py
A skins/waeup_accommodation/reserve_accommodation.py

Location:
WAeUP_SRP/trunk
Files:
11 edited
1 moved

Legend:

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

    r1405 r1412  
    3434<node CREATED="1171014630747" ID="Freemind_Link_21788009" MODIFIED="1171014635284" TEXT="Imports"/>
    3535</node>
    36 <node CREATED="1170082138244" ID="Freemind_Link_1354366927" MODIFIED="1170082146391" TEXT="Students">
     36<node CREATED="1170082138244" FOLDED="true" ID="Freemind_Link_1354366927" MODIFIED="1170082146391" TEXT="Students">
    3737<node CREATED="1170082147831" ID="Freemind_Link_115332414" MODIFIED="1170082160733" TEXT="n * Student">
    38 <node CREATED="1170082164451" FOLDED="true" ID="Freemind_Link_1627718074" MODIFIED="1170082180091" TEXT="Application">
     38<node CREATED="1171114205479" ID="Freemind_Link_1051911128" LINK="../profiles/default/types/Student.xml" MODIFIED="1171353141707" TEXT="Type: Student"/>
     39<node CREATED="1171124926993" ID="Freemind_Link_1838352082" LINK="../profiles/default/schemas/student.xml" MODIFIED="1171353152905" TEXT="Schema: student"/>
     40<node CREATED="1171124982312" ID="Freemind_Link_1037588671" LINK="../profiles/default/layouts/student.xml" MODIFIED="1171353165422" TEXT="Layout: student"/>
     41<node CREATED="1171353188624" ID="Freemind_Link_1032185087" LINK="../profiles/default/workflows/waeup_student_wf/definition.xml" MODIFIED="1171353319663" TEXT="Workflow: waeup_student_wf"/>
     42<node CREATED="1170082164451" ID="Freemind_Link_1627718074" MODIFIED="1170082180091" TEXT="Application">
    3943<node CREATED="1170083733194" ID="Freemind_Link_1398132513" MODIFIED="1170862024807" TEXT="Id: application"/>
    4044<node CREATED="1170083603042" ID="Freemind_Link_4951906" LINK="../profiles/default/types/StudentApplication.xml" MODIFIED="1171009517689" TEXT="Type: StudentApplication"/>
     
    7074<node CREATED="1171014603296" ID="Freemind_Link_592162547" MODIFIED="1171014611096" TEXT="Imports"/>
    7175</node>
    72 <node CREATED="1170082502675" FOLDED="true" ID="Freemind_Link_1051871348" MODIFIED="1170082511430" TEXT="Accommodation">
    73 <node CREATED="1170082513362" ID="Freemind_Link_579142716" MODIFIED="1170082530016" TEXT="n * Hall"/>
     76<node CREATED="1170082502675" ID="Freemind_Link_1051871348" MODIFIED="1170082511430" TEXT="Accommodation">
     77<node CREATED="1171114205479" ID="Freemind_Link_685193459" LINK="../profiles/default/types/AccoFolder.xml" MODIFIED="1171360542032" TEXT="Type: AccoFolder"/>
     78<node CREATED="1170082513362" ID="Freemind_Link_579142716" MODIFIED="1170082530016" TEXT="n * Hall">
     79<node CREATED="1171114205479" ID="Freemind_Link_913388948" LINK="../profiles/default/types/AccoHall.xml" MODIFIED="1171360892599" TEXT="Type: AccoHall"/>
     80<node CREATED="1171124926993" ID="Freemind_Link_108322260" LINK="../profiles/default/schemas/acco_hall.xml" MODIFIED="1171361085015" TEXT="Schema: acco_hall"/>
     81<node CREATED="1171124982312" ID="Freemind_Link_378355401" LINK="../profiles/default/layouts/acco_hall.xml" MODIFIED="1171361118597" TEXT="Layout: acco_hall"/>
     82<node CREATED="1171362437684" ID="Freemind_Link_1642729597" MODIFIED="1171362486789" TEXT="UserInterface">
     83<node CREATED="1171362489012" ID="Freemind_Link_550352037" MODIFIED="1171362509942" TEXT="book_reserved_bed">
     84<node CREATED="1171362515581" ID="Freemind_Link_213666573" LINK="../skins/waeup_accommodation/book_reserved_bed.py" MODIFIED="1171362598179" TEXT="Script: book_reserved_bed"/>
     85<node CREATED="1171362924343" ID="Freemind_Link_1340566317" LINK="../skins/waeup_accommodation/book_reserved_bed_form.pt" MODIFIED="1171363012800" TEXT="PT: book_reserved_bed_form"/>
     86<node CREATED="1171124926993" ID="Freemind_Link_320666824" LINK="../profiles/default/schemas/acco_bed_booking.xml" MODIFIED="1171362834619" TEXT="Schema: acco_bed_booking"/>
     87<node CREATED="1171124982312" ID="Freemind_Link_1520138434" LINK="../profiles/default/layouts/acco_bed_booking.xml" MODIFIED="1171362901153" TEXT="Layout: acco_bed_booking"/>
     88</node>
     89</node>
     90</node>
    7491</node>
    7592<node CREATED="1170082542534" ID="Freemind_Link_243354429" MODIFIED="1170082550976" TEXT="Pins">
  • WAeUP_SRP/trunk/profiles/default/layouts/acco_bed_booking.xml

    r1393 r1412  
    11<?xml version="1.0"?>
     2<?xml-stylesheet type="text/xsl" href="layout.xsl"?>
    23<object name="acco_bed_reservation" meta_type="CPS Layout">
    34 <property name="layout_create_method"></property>
    45 <property name="layout_edit_method"></property>
    56 <property name="layout_view_method"></property>
    6  <property name="style_prefix">layout_wo_object</property>
     7 <property name="style_prefix">layout_waeup_</property>
    78 <property name="flexible_widgets"/>
    89 <property name="validate_values_expr"></property>
    9  <widget name="bed" meta_type="Select Widget">
    10   <property name="title">Bed</property>
     10 <widget name="bed_letter" meta_type="Select Widget">
     11  <property name="title">Bed Letter</property>
    1112  <property name="fields">
    12    <element value="bed"/>
     13   <element value="bed_letter"/>
    1314  </property>
    1415  <property name="is_required">True</property>
    15   <property name="label">Bed</property>
    16   <property name="label_edit">Bed</property>
     16  <property name="label">Bed Letter</property>
     17  <property name="label_edit">Bed Letter</property>
    1718  <property name="readonly_layout_modes"/>
    1819  <property name="hidden_layout_modes"/>
     
    4950 <table>
    5051  <row>
    51    <cell name="block_floor_room"/>
     52   <cell name="block_room"/>
    5253  </row>
    5354  <row>
    54    <cell name="bed"/>
     55   <cell name="bed_letter"/>
    5556  </row>
    5657  <row>
  • WAeUP_SRP/trunk/profiles/default/layouts/acco_hall.xml

    r1041 r1412  
    11<?xml version="1.0"?>
    2 <object name="accommodation" meta_type="CPS Layout">
     2<?xml-stylesheet type="text/xsl" href="layout.xsl"?>
     3<object name="acco_hall" meta_type="CPS Layout">
    34 <property name="layout_create_method"></property>
    45 <property name="layout_edit_method"></property>
  • WAeUP_SRP/trunk/profiles/default/layouts/layout.xsl

    r1403 r1412  
    1313      <body>
    1414        <xsl:for-each select="object">
    15           <h1><xsl:value-of select="@name"/></h1>
     15          <h1>Layout: <xsl:value-of select="@name"/></h1>
    1616        </xsl:for-each>
    1717        <h1>Layout</h1>
     
    3939        <h1>Properties</h1>
    4040        <table>
     41          <tr>
     42            <th>Id</th>
     43            <th>Text</th>
     44          </tr>
    4145          <xsl:for-each select="object/property">
    4246            <xsl:variable name="color">
     
    6165        </table>
    6266        <h1>Widgets</h1>
    63         <table>
    64           <xsl:for-each select="object/widget">
    65             <xsl:variable name="color">
    66               <xsl:choose>
    67                 <xsl:when test="position() mod 2 = 0">
    68                   <xsl:text>#ffffff</xsl:text>
    69                 </xsl:when>
    70                 <xsl:otherwise>
    71                   <xsl:text>#eeeeee</xsl:text>
    72                 </xsl:otherwise>
    73               </xsl:choose>
    74             </xsl:variable>
    75             <tr style="background-color:{$color}">
    76               <th>
    77                 <xsl:value-of select="@name"/>
    78               </th>
    79               <td colspan="2">
    80                 <xsl:value-of select="@meta_type"/>
    81               </td>
    82             </tr>
     67        <xsl:for-each select="object/widget">
     68          <xsl:variable name="color">
     69            <xsl:choose>
     70              <xsl:when test="position() mod 2 = 0">
     71                <xsl:text>#ffffff</xsl:text>
     72              </xsl:when>
     73              <xsl:otherwise>
     74                <xsl:text>#eeeeee</xsl:text>
     75              </xsl:otherwise>
     76            </xsl:choose>
     77          </xsl:variable>
     78          <h3><xsl:value-of select="@name"/> Meta Type: <xsl:value-of select="@meta_type"/></h3>
     79          <table>
    8380            <tr style="background-color:{$color}">
    8481              <th colspan="3">
     
    10198              </tr>
    10299            </xsl:for-each>
    103           </xsl:for-each>
    104         </table>
     100          </table>
     101        </xsl:for-each>
    105102      </body>
    106103    </html>
  • WAeUP_SRP/trunk/profiles/default/schemas/acco_hall.xml

    r1399 r1412  
    11<?xml version="1.0"?>
    22<?xml-stylesheet type="text/xsl" href="schema.xsl"?>
    3 <object name="accommodation" meta_type="CPS Schema">
     3<object name="acco_hall" meta_type="CPS Schema">
    44  <field name="beds_for_final" meta_type="CPS String List Field"/>
    55  <field name="beds_for_fresh" meta_type="CPS String List Field"/>
  • WAeUP_SRP/trunk/profiles/default/schemas/schema.xsl

    r1404 r1412  
    1414        <xsl:for-each select="object">
    1515          <h2>
    16             <xsl:value-of select="@name"/>
     16            Schema: <xsl:value-of select="@name"/>
    1717          </h2>
    1818        </xsl:for-each>
    1919        <h1>Fields</h1>
    2020        <table>
     21          <tr>
     22            <th>Id</th>
     23            <th>Type</th>
     24            <th>default</th>
     25          </tr>
    2126          <xsl:for-each select="object/field">
    2227            <xsl:sort select="@name"
  • WAeUP_SRP/trunk/profiles/default/types/AccoFolder.xml

    r941 r1412  
    11<?xml version="1.0"?>
     2<?xml-stylesheet type="text/xsl" href="types.xsl"?>
    23<object name="AccoFolder" meta_type="CPS Flexible Type Information"
    34   xmlns:i18n="http://xml.zope.org/namespaces/i18n">
     
    1213 <property name="filter_content_types">True</property>
    1314 <property name="allowed_content_types">
    14   <element value="Accommodation"/>
     15  <element value="AccoHall"/>
    1516 </property>
    1617 <property name="allow_discussion">False</property>
     
    1920 <property name="cps_display_as_document_in_listing">True</property>
    2021 <property name="schemas">
    21   <element value="metadata"/>
    22   <element value="common"/>
    2322 </property>
    2423 <property name="layouts"/>
    2524 <property name="layout_clusters">
    26   <element value="metadata:metadata"/>
    2725 </property>
    2826 <property name="flexible_layouts"/>
  • WAeUP_SRP/trunk/profiles/default/types/AccoHall.xml

    r873 r1412  
    11<?xml version="1.0"?>
     2<?xml-stylesheet type="text/xsl" href="types.xsl"?>
    23<object name="AccoHall" meta_type="CPS Flexible Type Information"
    34   xmlns:i18n="http://xml.zope.org/namespaces/i18n">
  • WAeUP_SRP/trunk/profiles/default/types/Student.xml

    r1225 r1412  
    11<?xml version="1.0"?>
     2<?xml-stylesheet type="text/xsl" href="types.xsl"?>
    23<object name="Student" meta_type="CPS Flexible Type Information"
    34   xmlns:i18n="http://xml.zope.org/namespaces/i18n">
  • WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml

    r1286 r1412  
    11<?xml version="1.0"?>
     2<?xml-stylesheet type="text/xsl" href="../definition.xsl"?>
    23<cps-workflow workflow_id="waeup_student_wf"
    34              title="CPS Workflow Definition"
  • WAeUP_SRP/trunk/skins/waeup_accommodation/book_reserved_bed.py

    r1410 r1412  
    1616
    1717mode = 'create'
    18 validate = REQUEST.has_key("cpsdocument_edit_button")
     18validate = REQUEST.has_key("cpsdocument_edit_button") and\
     19           REQUEST.get("cpsdocument_edit_button").startswith('reserve')
    1920d = {}
    20 res,psm,ds = lt.renderLayout(layout_id= 'acco_bed_booking',
     21rendered,psm,ds = lt.renderLayout(layout_id= 'acco_bed_booking',
    2122                      schema_id= 'acco_bed_booking',
    2223                      context=context,
     
    2829if psm == 'invalid':
    2930    psm = "Please correct your input."
    30     return context.book_reserved_bed_form(rendered = res,
     31    return context.book_reserved_bed_form(rendered = rendered,
    3132                                 psm = psm,
    3233                                 #psm = "%s, %s" % (psm,ds),
     
    3738                                 )
    3839elif psm == '':
    39     return context.book_reserved_bed_form(rendered = res,
     40    return context.book_reserved_bed_form(rendered = rendered,
    4041                                 psm = psm,
    4142                                 mode = mode,
     
    4647elif psm == 'valid':
    4748    pass
     49#from Products.zdb import set_trace;set_trace()
    4850hall_id = context.getId()
    4951doc = context.getContent()
     
    6163        break
    6264    bed_brain = res[0]
     65    already = acco_cat(student=sid)
     66    if already:
     67        psm = "Student %s already reserved bed %s" % (sid, already[0].bed)
     68        break
    6369    if not bed_brain.bed_type.endswith("reserved"):
    6470        psm = "Not a reserved bed %s" % bid
     
    7278    break
    7379if psm != '':
    74     return context.book_reserved_bed_form(rendered = res,
     80    return context.book_reserved_bed_form(rendered = rendered,
    7581                                 psm = psm,
    7682                                 mode = mode,
     
    8086                                 )
    8187acco_cat.modifyRecord(bed = bid, student = sid)
    82 logger.info('"%s","booked reserved bed %s for","%s"' % (member,bed,sid))
    83 return context.book_reserved_bed_form(rendered = res,
     88logger.info('"%s","booked reserved bed %s for","%s"' % (member,bid,sid))
     89return context.book_reserved_bed_form(rendered = "",
    8490                                 psm = "Bed reserved for %s %s" % (sid,student.name),
    8591                                 mode = mode,
    8692                                 formaction = "book_reserved_bed",
    87                                  button = "reserve bed",
     93                                 button = "next reservation",
    8894                                 ds = ds,
    8995                                 )
  • WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_accommodation.py

    r1411 r1412  
    7777        pin = str(ds.get('acco_res_sc_pin'))
    7878        pa = context.portal_accommodation
    79         code,bed = pa.searchAndReserveBed(s_id,"%s" % (info['student_status']))
    80         #code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
    81         if code == -1:
    82             return context.accommodation_pin_edit_form(rendered = res,
    83                                  psm = "%s" % bed,
    84                                  mode = mode,
    85                                  ds = ds,
    86                                  )
    87         elif code == -2:
    88             return context.accommodation_pin_edit_form(rendered = res,
    89                                  psm = "No bed available. Your category is already fully booked.",
    90                                  mode = mode,
    91                                  ds = ds,
    92                                  )
     79        already = pa(student=s_id)
     80        if not already:
     81            code,bed = pa.searchAndReserveBed(s_id,"%s" % (info['student_status']))
     82            #code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
     83            if code == -1:
     84                return context.accommodation_pin_edit_form(rendered = res,
     85                                     psm = "%s" % bed,
     86                                     mode = mode,
     87                                     ds = ds,
     88                                     )
     89            elif code == -2:
     90                return context.accommodation_pin_edit_form(rendered = res,
     91                                     psm = "No bed available. Your category is already fully booked.",
     92                                     mode = mode,
     93                                     ds = ds,
     94                                     )
     95        else:
     96            bed = already[0].bed
    9397        student.invokeFactory('StudentAccommodation',acco_id)
    9498        acco = getattr(student,acco_id)
Note: See TracChangeset for help on using the changeset viewer.