Changeset 551 for WAeUP_SRP


Ignore:
Timestamp:
25 Sep 2006, 10:40:18 (18 years ago)
Author:
joachim
Message:

added CourseId? widget
made adding in Academics Section work again

Location:
WAeUP_SRP/trunk
Files:
6 added
8 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Widgets.py

    r537 r551  
    139139
    140140widgetRegistry.register(CertificateCourseIdWidget)
     141###)
     142
     143
     144class CourseIdWidget(CPSStringWidget): ###(
     145    """ CourseId Widget"""
     146    meta_type = "CourseId Widget"
     147
     148    def validate(self, datastructure, **kw):
     149        """Validate datastructure and update datamodel."""
     150
     151        valid = CPSStringWidget.validate(self, datastructure, **kw)
     152        if not valid:
     153            return 0
     154        else:
     155            widget_id = self.getWidgetId()
     156            value = datastructure[widget_id].upper()
     157            err = 0
     158            res = self.portal_catalog(meta_type= "Course",id = value)
     159            if len(res) > 0:
     160                err = 'Course %s already exists' % (value)
     161            if err:
     162                datastructure.setError(widget_id, err)
     163            else:
     164                datamodel = datastructure.getDataModel()
     165                datamodel[self.fields[0]] = value
     166
     167            return not err
     168
     169InitializeClass(CourseIdWidget)
     170
     171widgetRegistry.register(CourseIdWidget)
    141172
    142173
  • WAeUP_SRP/trunk/profiles/default/layouts/certificate.xml

    r486 r551  
    77 <property name="flexible_widgets"/>
    88 <property name="validate_values_expr"></property>
     9 <widget name="Description" meta_type="Text Widget">
     10  <property name="fields">
     11   <element value="Description"/>
     12  </property>
     13  <property name="label">Description</property>
     14  <property name="label_edit">Description</property>
     15  <property name="is_i18n">True</property>
     16  <property name="hidden_layout_modes"/>
     17  <property name="css_class">description</property>
     18  <property name="width">72</property>
     19 </widget>
     20 <widget name="Title" meta_type="String Widget">
     21  <property name="fields">
     22   <element value="Title"/>
     23  </property>
     24  <property name="is_required">True</property>
     25  <property name="label">Title</property>
     26  <property name="label_edit">Title</property>
     27  <property name="display_width">40</property>
     28  <property name="size_max">200</property>
     29 </widget>
     30 <widget name="code" meta_type="WAeUPId Widget">
     31  <property name="title">Certificate ID</property>
     32  <property name="fields">
     33   <element value="code"/>
     34  </property>
     35  <property name="is_required">True</property>
     36  <property name="label">Certificate ID</property>
     37  <property name="label_edit">Certificate ID</property>
     38  <property name="readonly_layout_modes"/>
     39  <property name="hidden_layout_modes">
     40   <element value="view"/>
     41   <element value="edit"/>
     42  </property>
     43  <property name="hidden_readonly_layout_modes"/>
     44 </widget>
    945 <widget name="admin_status" meta_type="String Widget">
    1046  <property name="title">Admin Status</property>
     
    116152  <property name="label">Original Code</property>
    117153  <property name="label_edit">Original Code</property>
    118   <property name="readonly_layout_modes"/>
    119   <property name="hidden_layout_modes"/>
     154  <property name="readonly_layout_modes">
     155    <element value="edit"/>
     156  </property>     
     157  <property name="hidden_layout_modes" >
     158    <element value="create"/>
     159  </property>     
    120160  <property name="hidden_readonly_layout_modes"/>
    121161 </widget>
     
    156196 <table>
    157197  <row>
     198   <cell name="code"/>
     199  </row>
     200  <row>
     201   <cell name="Title"/>
     202  </row>
     203  <row>
     204   <cell name="Description"/>
     205  </row>
     206  <row>
    158207   <cell name="original_code"/>
    159208  </row>
  • WAeUP_SRP/trunk/profiles/default/layouts/department.xml

    r486 r551  
    2929 </widget>
    3030 <widget name="code" meta_type="WAeUPId Widget">
    31   <property name="title">Object ID</property>
     31  <property name="title">Department ID</property>
    3232  <property name="fields">
    3333   <element value="code"/>
    3434  </property>
    3535  <property name="is_required">True</property>
    36   <property name="label">Object ID</property>
    37   <property name="label_edit">Object ID</property>
     36  <property name="label">Department ID</property>
     37  <property name="label_edit">Department ID</property>
    3838  <property name="readonly_layout_modes"/>
    3939  <property name="hidden_layout_modes">
    4040   <element value="view"/>
    4141   <element value="edit"/>
    42   </property>
    43   <property name="hidden_readonly_layout_modes"/>
    44  </widget>
    45  <widget name="code_alt" meta_type="String Widget">
    46   <property name="title">Object ID</property>
    47   <property name="fields">
    48    <element value="code"/>
    49   </property>
    50   <property name="label">Object ID</property>
    51   <property name="label_edit">Object ID</property>
    52   <property name="readonly_layout_modes"/>
    53   <property name="hidden_layout_modes">
    54    <element value="edit"/>
    55    <element value="view"/>
    5642  </property>
    5743  <property name="hidden_readonly_layout_modes"/>
  • WAeUP_SRP/trunk/profiles/default/layouts/faculty.xml

    r486 r551  
    3939  <property name="hidden_readonly_layout_modes"/>
    4040 </widget>
     41 <widget name="code" meta_type="WAeUPId Widget">
     42  <property name="title">Faculty ID</property>
     43  <property name="fields">
     44   <element value="code"/>
     45  </property>
     46  <property name="label">Faculty ID</property>
     47  <property name="label_edit">Faculty ID</property>
     48  <property name="readonly_layout_modes">
     49   <element value="edit"/>
     50  </property>
     51  <property name="hidden_layout_modes">
     52   <element value="edit"/>
     53  </property>
     54  <property name="hidden_readonly_layout_modes"/>
     55 </widget>
    4156 <widget name="college_code" meta_type="String Widget">
    4257  <property name="title">College Code</property>
     
    7590 <table>
    7691  <row>
     92   <cell name="code"/>
     93  </row>
     94  <row>
     95   <cell name="Title"/>
     96  </row>
     97  <row>
    7798   <cell name="title_prefix"/>
    7899  </row>
  • WAeUP_SRP/trunk/skins/waeup_academics/academics_index.py

    r542 r551  
    2727
    2828if isManager:
     29    if context.portal_type == 'AcademicsFolder':
     30        return context.academics.academics_index_view()
     31    elif context.portal_type == 'Faculty':
     32        return context.faculty_index_view()
    2933    return redirect("%s/academics_contents" % context.absolute_url())
    3034if isStudent:
  • WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py

    r537 r551  
    3232utool = context.portal_url
    3333mtool = context.portal_membership
     34wftool = context.portal_workflow
    3435portal = utool.getPortalObject()
    3536portal_absolute_url = portal.absolute_url()
     
    8384    member.setProperties(last_login_time=current,login_time=current)
    8485    if info['review_state'] == "application_pin_entered":
     86        wftool.doActionFor(info['app'],'open',dest_container=info['app'])
    8587        return response.redirect("%s/passport_entry_view" % student.absolute_url())
    8688    return response.redirect("%s" % student.absolute_url())
  • WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_create.pt

    r486 r551  
    1 <tal:block define="global creation python:1;
    2                    global formaction string:apply_admission" />
     1<tal:block define="global creation python:1" />
    32<metal:block use-macro="here/layout_waeup_edit/macros/default_edit" />
  • WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_edit.pt

    r486 r551  
    2020              cpsmcat nocall:here/translation_service;
    2121              ">
    22 <tal:block condition="python:1 or first_layout">
     22<tal:block condition="python:first_layout">
    2323  <tal:block
    2424  content="structure string:<form id='editForm' action='${formaction}' method='post'
Note: See TracChangeset for help on using the changeset viewer.