Changeset 440


Ignore:
Timestamp:
29 Aug 2006, 11:56:53 (18 years ago)
Author:
joachim
Message:

levels can be created
keyerror elective fixed
check for blanks in Id's checked

Location:
WAeUP_SRP/trunk
Files:
6 added
16 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Academics.py

    r398 r440  
    3939    portal_type = meta_type
    4040    security = ClassSecurityInfo()
     41    use_catalog_for_folder_contents = True
    4142
    4243    security.declareProtected(View,"Title")
  • WAeUP_SRP/trunk/Students.py

    r435 r440  
    3333    portal_type = meta_type
    3434    security = ClassSecurityInfo()
    35     use_catalog_for_folder_contents = True
    3635
    3736    security.declareProtected(ModifyPortalContent,"loadFullTimeStudentsFromCSV")###(
     
    470469###)
    471470
    472 class StudentDocuments(CPSDocument): ###(
    473     """
    474     WAeUP Student container for the various student data
    475     """
    476     meta_type = 'StudentDocuments'
    477     portal_type = meta_type
    478     security = ClassSecurityInfo()
    479 
    480     security.declareProtected(View,"Title")
    481     def Title(self):
    482         """compose title"""
    483         content = self.getContent()
    484         return "Scanned Documents"
    485 
    486 
    487 InitializeClass(StudentDocuments)
    488 
    489 def addStudentDocuments(container, id, REQUEST=None, **kw):
    490     """Add a Students documents"""
    491     ob = StudentDocuments(id, **kw)
    492     return CPSBase_adder(container, ob, REQUEST=REQUEST)
    493 
    494 ###)
    495 
    496 class Jamb(CPSDocument): ###(
    497     """
    498     WAeUP Jamb containing the courses and students
    499     """
    500     meta_type = 'Jamb'
    501     portal_type = meta_type
    502     security = ClassSecurityInfo()
    503 
    504     security.declareProtected(View,"Title")
    505     def Title(self):
    506         """compose title"""
    507         content = self.getContent()
    508         return "JAMB Data for %s %s" % (content.firstname,content.lastname)
    509 
    510     security.declareProtected(View,"setOwnership")
    511     def setOwnership(self,member_id):
    512         """set ownership"""
    513         pm = getattr(self,'portal_membership')
    514         member = pm.getMemberById(member_id)
    515         self.changeOwnership(member)
    516 
    517 InitializeClass(Jamb)
    518 
    519 def addJamb(container, id, REQUEST=None, **kw):
    520     """Add a Jamb."""
    521     ob = Jamb(id, **kw)
    522     return CPSBase_adder(container, ob, REQUEST=REQUEST)
    523 
    524 ###)
    525 
    526471class StudyLevel(CPSDocument): ###(
    527472    """
     
    531476    portal_type = meta_type
    532477    security = ClassSecurityInfo()
     478
     479    security.declareProtected(View,"Title")
     480    def Title(self):
     481        """compose title"""
     482        return "Level %s" % self.aq_parent.getId()
     483   
    533484
    534485InitializeClass(StudyLevel)
     
    558509###)
    559510
     511class ScratchCardBatchesFolder(CPSDocument): ###(
     512    """
     513    WAeUP Student container for the various student data
     514    """
     515    meta_type = 'ScratchCardBatchesFolder'
     516    portal_type = meta_type
     517    security = ClassSecurityInfo()
     518
     519    security.declareProtected(View,"Title")
     520    def Title(self):
     521        """compose title"""
     522        return "Pin Batches"
     523
     524
     525InitializeClass(ScratchCardBatchesFolder)
     526
     527def addScratchCardBatchesFolder(container, id, REQUEST=None, **kw):
     528    """Add a Students personal data."""
     529    ob = ScratchCardBatchesFolder(id, **kw)
     530    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     531
     532###)
     533
     534from Products.WAeUP_SRP.WAeUPTables import PinTable
     535
     536class ScratchCardBatch(CPSDocument): ###(
     537    """
     538    WAeUP Student container for the various student data
     539    """
     540    meta_type = 'ScratchCardBatch'
     541    portal_type = meta_type
     542    security = ClassSecurityInfo()
     543
     544    security.declareProtected(View,"Title")
     545    def Title(self):
     546        """compose title"""
     547        doc = self.getContent()
     548        return "Pin Batch %s BatchNo %d" % (doc.prefix, doc.batch_no)
     549
     550
     551InitializeClass(ScratchCardBatch)
     552
     553def addScratchCardBatch(container, id, REQUEST=None, **kw):
     554    """Add a Students personal data."""
     555    ob = ScratchCardBatch(id, **kw)
     556    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     557
     558###)
  • WAeUP_SRP/trunk/WAeUPTables.py

    r414 r440  
    7777InitializeClass(AccommodationTable)
    7878
     79class PinTable(WAeUPTable):
     80   
     81    meta_type = 'WAeUP Pin Tool'
     82   
     83    def __init__(self):
     84        WAeUPTable.__init__(self, 'portal_pins')
     85
     86    def addRecord(self, **data):
     87        # The uid is the same as "bed".
     88        uid = data['bed']
     89        self.catalog_object(dict2ob(data), uid=uid)
     90        return uid
     91
     92
     93InitializeClass(PinTable)
     94
    7995# BBB:
    8096AccomodationTable = AccommodationTable
  • WAeUP_SRP/trunk/Widgets.py

    r422 r440  
    159159            value = datastructure[widget_id].upper()
    160160            err = 0
    161             if value.split() > 1:
     161            if len(value.split()) > 1:
    162162                err = 'Invalid Id (Id contains space(s)'
    163163            elif hasattr(self.aq_parent,value):
  • WAeUP_SRP/trunk/__init__.py

    r423 r440  
    3232from Products.WAeUP_SRP.Students import StudentClearance, addStudentClearance
    3333from Products.WAeUP_SRP.Students import StudentPersonal, addStudentPersonal
    34 from Products.WAeUP_SRP.Students import StudentDocuments, addStudentDocuments
    35 from Products.WAeUP_SRP.Students import Jamb, addJamb
     34from Products.WAeUP_SRP.Students import ScratchCardBatch, addScratchCardBatch
     35from Products.WAeUP_SRP.Students import ScratchCardBatchesFolder, addScratchCardBatchesFolder
    3636from Products.WAeUP_SRP.Students import StudyLevel, addStudyLevel
    3737from Products.WAeUP_SRP.Students import Semester, addSemester
     
    5858    StudentClearance,
    5959    StudentPersonal,
    60     StudentDocuments,
    61     Jamb,
     60    ScratchCardBatch,
     61    ScratchCardBatchesFolder,
    6262    StudyLevel,
    6363    Semester,
     
    8282    addStudentClearance,
    8383    addStudentPersonal,
    84     addStudentDocuments,
    85     addJamb,
     84    addScratchCardBatch,
     85    addScratchCardBatchesFolder,
    8686    addStudyLevel,
    8787    addSemester,
    8888    )
    8989
    90 fti = (
    91     {}, # University
    92     {}, #AcademicsFolder
    93     {}, #Certificate
    94     {}, #CertificateCourse
    95     {}, # Faculty
    96     {}, # Department
    97     {}, # Course
    98     {}, # CourseTicket
    99     {}, # CertificateCourse
    100     {}, # AccoFolder
    101     {}, # Accommodation
    102     {}, # StudentsFolder,
    103     {}, # Student,
    104     {}, # StudentStudyCourse,
    105     {}, # StudentAdmission,
    106     {}, # StudentClearance,
    107     {}, # StudentAdmission,
    108     {}, # StudentClearance,
    109     {}, # StudentPersonal,
    110     {}, # StudentDocuments,
    111     {}, # Jamb,
    112     {}, # StudyLevel,
    113     {}, # Semester,
    114     )
     90fti = [{} for t in range(len(contentConstructors))]
     91##fti = (
     92##    {}, # University
     93##    {}, #AcademicsFolder
     94##    {}, #Certificate
     95##    {}, #CertificateCourse
     96##    {}, # Faculty
     97##    {}, # Department
     98##    {}, # Course
     99##    {}, # CourseTicket
     100##    {}, # CertificateCourse
     101##    {}, # AccoFolder
     102##    {}, # Accommodation
     103##    {}, # StudentsFolder,
     104##    {}, # Student,
     105##    {}, # StudentStudyCourse,
     106##    {}, # StudentAdmission,
     107##    {}, # StudentClearance,
     108##    {}, # StudentAdmission,
     109##    {}, # StudentClearance,
     110##    {}, # StudentPersonal,
     111##    {}, # ScratchCardBatch,
     112##    {}, # ScratchCardBatchesFolder,
     113##    {}, # StudyLevel,
     114##    {}, # Semester,
     115##    )
    115116
    116117registerDirectory('skins', globals())
  • WAeUP_SRP/trunk/profiles/catalog.xml

    r368 r440  
    11<?xml version="1.0"?>
    22<object name="portal_catalog" meta_type="CMF Catalog">
    3  <column value="credits"/>
    4  <column value="passmark"/>
     3 <property name="title"></property>
     4 <index name="jamb_reg_no" meta_type="FieldIndex">
     5  <indexed_attr value="jamb_reg_no"/>
     6 </index>
     7 <index name="matric_no" meta_type="FieldIndex">
     8  <indexed_attr value="matric_no"/>
     9 </index>
    510</object>
  • WAeUP_SRP/trunk/profiles/default/layouts/study_level.xml

    r370 r440  
    77 <property name="flexible_widgets"/>
    88 <property name="validate_values_expr"></property>
    9  <widget name="Title" meta_type="String Widget">
    10   <property name="title">Title</property>
     9 <widget name="code" meta_type="String Widget">
     10  <property name="title">Level No</property>
    1111  <property name="fields">
    12    <element value="Title"/>
    13   </property>
    14   <property name="label">Level Nr</property>
    15   <property name="label_edit">Level Nr</property>
    16   <property name="readonly_layout_modes"/>
    17   <property name="hidden_layout_modes"/>
    18   <property name="hidden_readonly_layout_modes"/>
    19   <property name="display_width">40</property>
    20  </widget>
    21  <widget name="sc_id" meta_type="String Widget">
    22   <property name="title">SC ID</property>
    23   <property name="fields">
    24    <element value="sc_id"/>
    25   </property>
    26   <property name="label">Card Serial Number </property>
    27   <property name="label_edit">Card Serial Number</property>
    28   <property name="description">Card Serial Number </property>
    29   <property
    30      name="help">This can be found on the bottom right of the reverse side of your Scratch Card</property>
    31   <property name="readonly_layout_modes"/>
    32   <property name="hidden_layout_modes"/>
    33   <property name="hidden_readonly_layout_modes"/>
    34   <property name="hidden_if_expr">python:1</property>
    35   <property name="display_width">10</property>
    36  </widget>
    37  <widget name="sc_pin" meta_type="Scratchcard Pin Widget">
    38   <property name="title">SC PIN</property>
    39   <property name="fields">
    40    <element value="sc_pin"/>
     12   <element value="code"/>
    4113  </property>
    4214  <property name="is_required">True</property>
    43   <property name="label">Enter  PIN</property>
    44   <property
    45      name="label_edit">Enter Scratchcard Pin with the value above</property>
    46   <property
    47      name="help">Please enter a Scratchcard Pin valid for Registration of Next Level</property>
     15  <property name="label">Level No</property>
     16  <property name="label_edit">Level No</property>
    4817  <property name="readonly_layout_modes"/>
    49   <property name="hidden_layout_modes"/>
    50   <property name="hidden_readonly_layout_modes"/>
    51   <property name="display_width">10</property>
    52   <property name="size_max">10</property>
    53  </widget>
    54  <widget name="sc_value" meta_type="Float Widget">
    55   <property name="title">Scratch card value</property>
    56   <property name="fields">
    57    <element value="sc_value"/>
    58   </property>
    59   <property name="label">Scratcard Value</property>
    60   <property name="label_edit">Scratcard Value</property>
    61   <property name="readonly_layout_modes">
    62    <element value="create"/>
    63   </property>
    6418  <property name="hidden_layout_modes"/>
    6519  <property name="hidden_readonly_layout_modes"/>
     
    6721 <table>
    6822  <row>
    69    <cell name="Title"/>
     23   <cell name="code"/>
    7024  </row>
    7125 </table>
  • WAeUP_SRP/trunk/profiles/default/roots/campus.xml

    r326 r440  
    66  <object name="accommodation" portal_type="AccoFolder" />
    77  <object name="students" portal_type="StudentsFolder" />
     8  <object name="pins" portal_type="ScratchCardBatchesFolder" />
    89</object>
  • WAeUP_SRP/trunk/profiles/default/schemas/study_level.xml

    r199 r440  
    11<?xml version="1.0"?>
    22<object name="study_level" meta_type="CPS Schema">
    3  <field name="sc_id" meta_type="CPS String Field">
    4   <property name="is_searchabletext">True</property>
    5   <property name="acl_write_roles">SectionReader</property>
    6  </field>
    7  <field name="sc_pin" meta_type="CPS String Field">
    8   <property name="is_searchabletext">True</property>
    9   <property name="acl_write_roles">SectionReader</property>
    10  </field>
    11  <field name="sc_value" meta_type="CPS Float Field">
    12   <property name="default_expr">python:1000.</property>
    13   <property name="is_searchabletext">True</property>
    14  </field>
     3 <field name="code" meta_type="CPS String Field"/>
    154</object>
     5
  • WAeUP_SRP/trunk/profiles/default/toolset.xml

    r404 r440  
    33 <required tool_id="portal_accommodation"
    44           class="Products.WAeUP_SRP.WAeUPTables.AccommodationTable"/>
     5 <required tool_id="portal_pins"
     6           class="Products.WAeUP_SRP.WAeUPTables.PinTable"/>
    57</tool-setup>
  • WAeUP_SRP/trunk/profiles/default/types/Semester.xml

    r435 r440  
    2121 <property name="cps_display_as_document_in_listing">True</property>
    2222 <property name="schemas">
    23  </property>
     23<element value="metadata"/>
     24  </property>
    2425 <property name="layouts"/>
    2526 <property name="layout_clusters">
     
    3536  <permission value="View"/>
    3637 </action>
    37  <action title="Book Semester Courses" action_id="book_semester_courses"
    38     category="object" condition_expr=""
    39     url_expr="string:${object_url}/book_semester_courses" visible="False">
    40   <permission value="Take ownership"/>
    41  </action>
    42  <action title="action_metadata" action_id="metadata" category="object"
    43     condition_expr=""
    44     url_expr="string:${object_url}/cpsdocument_metadata" visible="False">
    45   <permission value="Modify portal content"/>
    46  </action>
    47  <action title="Delegate" action_id="localroles" category="object"
    48     condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
    49     visible="False">
    50   <permission value="Modify portal content"/>
    51  </action>
    5238 <action title="Add Course" action_id="new_entry" category="object"
    5339    condition_expr=""
  • WAeUP_SRP/trunk/profiles/default/types/StudentPersonal.xml

    r435 r440  
    1313 <property name="allowed_content_types"/>
    1414 <property name="allow_discussion">False</property>
    15  <property name="cps_is_searchable">True</property>
     15 <property name="cps_is_searchable">False</property>
    1616 <property name="cps_proxy_type">document</property>
    1717 <property name="cps_display_as_document_in_listing">True</property>
  • WAeUP_SRP/trunk/profiles/default/types/StudyLevel.xml

    r435 r440  
    88 <property name="product">WAeUP_SRP</property>
    99 <property name="factory">addStudyLevel</property>
    10  <property name="immediate_view">folder_view</property>
     10 <property name="immediate_view">academics_contents</property>
    1111 <property name="global_allow">True</property>
    1212 <property name="filter_content_types">True</property>
     
    2424  <element value="study_level"/>
    2525 </property>
    26  <property name="layout_clusters">
    27   <element value=""/>
    28  </property>
     26 <property name="layout_clusters"/>
    2927 <property name="flexible_layouts"/>
    3028 <property name="storage_methods"/>
    3129 <property name="cps_is_portlet">False</property>
    3230 <alias from="(Default)" to="academics_contents"/>
     31 <alias from="create_do" to="waeup_document_create_do"/>
    3332 <alias from="created" to="level_created"/>
    3433 <alias from="view" to="academics_contents"/>
  • WAeUP_SRP/trunk/profiles/default/workflows.xml

    r427 r440  
    8787   <bound-workflow workflow_id="section_folder_wf"/>
    8888  </type>
    89   <type type_id="Workspace">
    90    <bound-workflow workflow_id="workspace_folder_wf"/>
     89  <type type_id="ScratchCardBatchesFolder">
     90   <bound-workflow workflow_id="section_folder_wf"/>
     91  </type>
     92  <type type_id="ScratchCardBatch">
     93   <bound-workflow workflow_id="section_folder_wf"/>
    9194  </type>
    9295 </bindings>
  • WAeUP_SRP/trunk/skins/waeup_custom/getContentInfo.py

    r430 r440  
    187187info['url'] = utool.getUrlFromRpath(info['rpath'])
    188188
    189 info['title_or_id'] = proxy.title_or_id()
     189info['title_or_id'] = proxy.id
    190190info['id'] = proxy.getId()
    191191try:
     
    193193except AttributeError:
    194194    raise AttributeError, 'invalid object: %s in %s' % (info['title_or_id'],
    195                                                         info['rpath'])
     195                                                             info['rpath'])
     196except TypeError:
     197    info['title'] = proxy.getContent().id
     198
    196199info['icon'] = proxy.getIcon(relative_to_portal=1)
    197200info['type'] = proxy.getPortalTypeName()
     
    227230        core = 'core'
    228231        if not doc.core_or_elective:
    229             core = elective
     232            core = 'elective'
    230233        info['core_or_elective'] = core
    231234    info['time'] = doc.modified()
  • WAeUP_SRP/trunk/skins/waeup_default/waeup_document_create_do.py

    r373 r440  
    1010from Products.CMFCore.utils import getToolByName
    1111
    12 id = datamodel.get('code').upper()
    13 datamodel.set('code',id)
     12if type_name == "StudyLevel":
     13    id = datamodel.get('code')
     14else:
     15    id = datamodel.get('code').upper()
     16    datamodel.set('code',id)
    1417##if not id:
    1518##    id = 'my ' + type_name
Note: See TracChangeset for help on using the changeset viewer.