Index: /WAeUP_SRP/trunk/Academics.py
===================================================================
--- /WAeUP_SRP/trunk/Academics.py	(revision 279)
+++ /WAeUP_SRP/trunk/Academics.py	(revision 280)
@@ -46,4 +46,5 @@
             faculties = csv.DictReader(open("%s/import/faculty.csv" % i_home,"rb"))
         except:
+            logger.error('Error reading faculty.csv')
             return
         l = self.portal_catalog({'meta_type': "Faculty"})
@@ -91,4 +92,5 @@
             deps = csv.DictReader(open("%s/import/departments.csv" % i_home,"rb"))
         except:
+            logger.error('Error reading departments.csv')
             return
         l = self.portal_catalog({'meta_type': "Faculty"})
@@ -122,4 +124,5 @@
             courses = csv.DictReader(open("%s/import/courses.csv" % i_home,"rb"))
         except:
+            logger.error('Error reading courses.csv')
             return
         l = self.portal_catalog({'meta_type': "Faculty"})
@@ -163,9 +166,9 @@
             dict['code'] = course_id
             dict['org_code'] = course.get('CourseCode') 
-            dict['credits'] = course.get('Credits')
+            dict['credits'] = icourse.get('Credits')
             dict['semester'] = course.get('Semester')
             dict['session'] = course.get('Session')
             dict['category'] = course.get('Category')
-            dict['passmark'] = course.get('PassMark')
+            dict['passmark'] = int(course.get('PassMark'))
             c.getContent().edit(mapping=dict)
     ###)
@@ -179,4 +182,5 @@
             certificates = csv.DictReader(open("%s/import/certificates.csv" % i_home,"rb"))
         except:
+            logger.error('Error reading certificates.csv')
             return
         f_ids = [f.id for f in self.portal_catalog({'meta_type': "Faculty"})]
@@ -241,4 +245,5 @@
             cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb"))
         except:
+            logger.error('Error reading course_level_courses.csv')
             return
         d_ids = [d.id for d in self.portal_catalog({'meta_type': "Department"})]
@@ -367,5 +372,5 @@
         if ce:
             return "%s" % ce.credits
-        return 0
+        return "0"
     
     security.declareProtected(View,"passmark")
@@ -374,6 +379,14 @@
         ce = self.getCourseEntry(self.id)
         if ce:
-            return "%s" % ce.passmark
-        return "No such course"
+            return "%s" % ce.passmark.split(',')[0]
+        return "0"
+
+    security.declareProtected(View,"coursepath")
+    def coursepath(self):
+        """coursepath from course"""
+        ce = self.getCourseEntry(self.id)
+        if ce:
+            return ce.getPath()
+        return "?"
     
 
Index: /WAeUP_SRP/trunk/profiles/default/catalog.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/catalog.xml	(revision 280)
+++ /WAeUP_SRP/trunk/profiles/default/catalog.xml	(revision 280)
@@ -0,0 +1,152 @@
+<?xml version="1.0"?>
+<object name="portal_catalog" meta_type="CMF Catalog">
+ <property name="title"></property>
+ <object name="cps_defaut_lexicon" meta_type="ZCTextIndex Lexicon">
+  <element name="Whitespace splitter" group="Word Splitter"/>
+  <element name="Case Normalizer" group="Case Normalizer"/>
+ </object>
+ <object name="htmltext_lexicon" meta_type="ZCTextIndex Lexicon">
+  <element name="HTML aware splitter" group="Word Splitter"/>
+  <element name="Case Normalizer" group="Case Normalizer"/>
+  <element name="Remove listed stop words only" group="Stop Words"/>
+ </object>
+ <object name="plaintext_lexicon" meta_type="ZCTextIndex Lexicon">
+  <element name="Whitespace splitter" group="Word Splitter"/>
+  <element name="Case Normalizer" group="Case Normalizer"/>
+  <element name="Remove listed stop words only" group="Stop Words"/>
+ </object>
+ <index name="Creator" meta_type="FieldIndex">
+  <indexed_attr value="Creator"/>
+ </index>
+ <index name="Date" meta_type="DateIndex">
+  <property name="index_naive_time_as_local">True</property>
+ </index>
+ <index name="Description" meta_type="ZCTextIndex">
+  <indexed_attr value="Description"/>
+  <extra name="index_type" value="Okapi BM25 Rank"/>
+  <extra name="lexicon_id" value="plaintext_lexicon"/>
+ </index>
+ <index name="Language" meta_type="FieldIndex">
+  <indexed_attr value="Language"/>
+ </index>
+ <index name="SearchableText" meta_type="ZCTextIndex">
+  <indexed_attr value="SearchableText"/>
+  <extra name="index_type" value="Okapi BM25 Rank"/>
+  <extra name="lexicon_id" value="htmltext_lexicon"/>
+ </index>
+ <index name="Subject" meta_type="KeywordIndex">
+  <indexed_attr value="Subject"/>
+ </index>
+ <index name="Title" meta_type="FieldIndex">
+  <indexed_attr value="Title"/>
+ </index>
+ <index name="Type" meta_type="FieldIndex">
+  <indexed_attr value="Type"/>
+ </index>
+ <index name="ZCTitle" meta_type="ZCTextIndex">
+  <indexed_attr value="ZCTitle"/>
+  <extra name="index_type" value="Okapi BM25 Rank"/>
+  <extra name="lexicon_id" value="cps_defaut_lexicon"/>
+ </index>
+ <index name="allowedRolesAndUsers" meta_type="KeywordIndex">
+  <indexed_attr value="allowedRolesAndUsers"/>
+ </index>
+ <index name="container_path" meta_type="FieldIndex">
+  <indexed_attr value="container_path"/>
+ </index>
+ <index name="cps_filter_sets" meta_type="TopicIndex">
+  <filtered_set name="default_languages" meta_type="PythonFilteredSet"
+     expression="not hasattr(o, 'isDefaultLanguage') or o.isDefaultLanguage()"/>
+  <filtered_set name="leaves" meta_type="PythonFilteredSet"
+     expression="not o.isCPSFolderish()"/>
+  <filtered_set name="nodes" meta_type="PythonFilteredSet"
+     expression="o.isCPSFolderish()"/>
+  <filtered_set name="searchable" meta_type="PythonFilteredSet"
+     expression="not filter(lambda s: s.startswith('portal_') or s and s[0] in ('.', '_'), o.getPhysicalPath())"/>
+ </index>
+ <index name="created" meta_type="DateIndex">
+  <property name="index_naive_time_as_local">True</property>
+ </index>
+ <index name="effective" meta_type="DateIndex">
+  <property name="index_naive_time_as_local">True</property>
+ </index>
+ <index name="end" meta_type="DateIndex">
+  <property name="index_naive_time_as_local">True</property>
+ </index>
+ <index name="expires" meta_type="DateIndex">
+  <property name="index_naive_time_as_local">True</property>
+ </index>
+ <index name="getId" meta_type="FieldIndex">
+  <indexed_attr value="getId"/>
+ </index>
+ <index name="id" meta_type="FieldIndex">
+  <indexed_attr value="id"/>
+ </index>
+ <index name="in_reply_to" meta_type="FieldIndex">
+  <indexed_attr value="in_reply_to"/>
+ </index>
+ <index name="listCreators" meta_type="KeywordIndex">
+  <indexed_attr value="listCreators"/>
+ </index>
+ <index name="localUsersWithRoles" meta_type="KeywordIndex">
+  <indexed_attr value="localUsersWithRoles"/>
+ </index>
+ <index name="meta_type" meta_type="FieldIndex">
+  <indexed_attr value="meta_type"/>
+ </index>
+ <index name="modified" meta_type="DateIndex">
+  <property name="index_naive_time_as_local">True</property>
+ </index>
+ <index name="path" meta_type="PathIndex"/>
+ <index name="portal_type" meta_type="FieldIndex">
+  <indexed_attr value="portal_type"/>
+ </index>
+ <index name="position_in_container" meta_type="FieldIndex">
+  <indexed_attr value="position_in_container"/>
+ </index>
+ <index name="relative_path" meta_type="FieldIndex">
+  <indexed_attr value="relative_path"/>
+ </index>
+ <index name="relative_path_depth" meta_type="FieldIndex">
+  <indexed_attr value="relative_path_depth"/>
+ </index>
+ <index name="review_state" meta_type="FieldIndex">
+  <indexed_attr value="review_state"/>
+ </index>
+ <index name="start" meta_type="DateIndex">
+  <property name="index_naive_time_as_local">True</property>
+ </index>
+ <index name="time" meta_type="DateIndex">
+  <property name="index_naive_time_as_local">True</property>
+ </index>
+ <column value="Contributors"/>
+ <column value="CreationDate"/>
+ <column value="Creator"/>
+ <column value="Date"/>
+ <column value="Description"/>
+ <column value="EffectiveDate"/>
+ <column value="ExpirationDate"/>
+ <column value="Language"/>
+ <column value="ModificationDate"/>
+ <column value="Subject"/>
+ <column value="Title"/>
+ <column value="Type"/>
+ <column value="created"/>
+ <column value="credits"/>
+ <column value="effective"/>
+ <column value="end"/>
+ <column value="expires"/>
+ <column value="getIcon"/>
+ <column value="getId"/>
+ <column value="getRevision"/>
+ <column value="id"/>
+ <column value="listCreators"/>
+ <column value="modified"/>
+ <column value="passmark"/>
+ <column value="portal_type"/>
+ <column value="position_in_container"/>
+ <column value="relative_path"/>
+ <column value="review_state"/>
+ <column value="start"/>
+ <column value="time"/>
+</object>
Index: /WAeUP_SRP/trunk/profiles/default/skins.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/skins.xml	(revision 279)
+++ /WAeUP_SRP/trunk/profiles/default/skins.xml	(revision 280)
@@ -5,6 +5,6 @@
  <object name="waeup_default" meta_type="Filesystem Directory View"
     directory="WAeUP_SRP/skins/waeup_default"/>
- <object name="waeup_faculty" meta_type="Filesystem Directory View"
-    directory="WAeUP_SRP/skins/waeup_faculty"/>
+ <object name="waeup_academics" meta_type="Filesystem Directory View"
+    directory="WAeUP_SRP/skins/waeup_academics"/>
  <object name="waeup_student" meta_type="Filesystem Directory View"
     directory="WAeUP_SRP/skins/waeup_student"/>
@@ -12,10 +12,10 @@
   <layer name="waeup_default" insert-after="custom"/>
   <layer name="waeup_student" insert-after="cps_default"/>
-  <layer name="waeup_faculty" insert-after="cps_default"/>
+  <layer name="waeup_academics" insert-after="cps_default"/>
  </skin-path>
  <skin-path name="CPSSkins-macroless">
   <layer name="waeup_default" insert-after="custom"/>
   <layer name="waeup_student" insert-after="cps_default"/>
-  <layer name="waeup_faculty" insert-after="cps_default"/>
+  <layer name="waeup_academics" insert-after="cps_default"/>
  </skin-path>
 </object>
Index: /WAeUP_SRP/trunk/profiles/default/skins/waeup_academics.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/skins/waeup_academics.xml	(revision 280)
+++ /WAeUP_SRP/trunk/profiles/default/skins/waeup_academics.xml	(revision 280)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<object name="waeup_faculty" meta_type="Folder">
+ <property name="title"></property>
+</object>
Index: eUP_SRP/trunk/profiles/default/skins/waeup_faculty.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/skins/waeup_faculty.xml	(revision 279)
+++ 	(revision )
@@ -1,4 +1,0 @@
-<?xml version="1.0"?>
-<object name="waeup_faculty" meta_type="Folder">
- <property name="title"></property>
-</object>
Index: /WAeUP_SRP/trunk/profiles/default/types/Certificate.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/types/Certificate.xml	(revision 279)
+++ /WAeUP_SRP/trunk/profiles/default/types/Certificate.xml	(revision 280)
@@ -34,9 +34,8 @@
  <property name="storage_methods"/>
  <property name="cps_is_portlet">False</property>
- <alias from="(Default)" to="temporary_view_all"/>
- <alias from="view" to="temporary_view_all"/>
- <action title="Standard View" action_id="view" category="object"
-    condition_expr="" url_expr="string:${object_url}/temporary_view_all"
-    visible="True">
+ <alias from="(Default)" to="certificate_view"/>
+ <alias from="view" to="certificate_view"/>
+ <action title="View" action_id="view" category="object" condition_expr=""
+    url_expr="string:${object_url}/certificate_view" visible="True">
   <permission value="View"/>
  </action>
Index: /WAeUP_SRP/trunk/profiles/default/types/StudyLevel.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/types/StudyLevel.xml	(revision 279)
+++ /WAeUP_SRP/trunk/profiles/default/types/StudyLevel.xml	(revision 280)
@@ -40,9 +40,9 @@
  <action title="Register for Next Year" action_id="add_level"
     category="object"
-    condition_expr="python:member and 'Student'in member.getRoles()"
+    condition_expr="python:member and 'Student' in member.getRoles()"
     url_expr="string:${object_url}/register_level" visible="True"/>
  <action title="action_metadata" action_id="metadata" category="object"
     condition_expr="python:member and 'Manager' in member.getRoles()"
-    url_expr="string:${object_url}/cpsdocument_metadata" visible="True"/>
+    url_expr="string:${object_url}/cpsdocument_metadata" visible="False"/>
  <action title="delegate" action_id="localroles" category="object"
     condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
Index: /WAeUP_SRP/trunk/skins/waeup_academics/academics_view.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/academics_view.py	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/academics_view.py	(revision 280)
@@ -0,0 +1,17 @@
+##parameters=REQUEST=None,psm=None,groups=None
+# $Id$
+
+"""Default view for the forum. If post_id is not None, post with id = <post_id>
+will be displayed, otherwise first post will be displayed."""
+
+member = context.portal_membership.getAuthenticatedMember()
+
+if not context.portal_membership.isAnonymousUser():
+    if 'Manager' in member.getRoles():
+        return context.folder_view()
+index = getattr(context,'documents',None)
+if index:
+    fp = getattr(index,'academicsfrontpage',None)
+    if fp:
+        return fp() 
+return context.academics.academics_view_all(psm=psm)
Index: /WAeUP_SRP/trunk/skins/waeup_academics/academics_view_all.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/academics_view_all.pt	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/academics_view_all.pt	(revision 280)
@@ -0,0 +1,37 @@
+<html metal:use-macro="here/content_lib_master/macros/master">
+
+  <metal:block fill-slot="head_slot">
+    <tal:block tal:define="student here/getContent">
+    </tal:block>
+  </metal:block>
+
+  <metal:block fill-slot="css_slot">
+    <link rel="Stylesheet" type="text/css" href=""
+          tal:attributes="href string:${base_url}student.css" />
+  </metal:block>
+  <metal:block fill-slot="header">
+  </metal:block>
+
+  <metal:block fill-slot="main"
+               tal:define="items here/contentValues">
+    <h2>Academics (Faculties)</h2>
+    <table cellspacing="0" cellpadding="0">
+      <tal:block condition="python: len(items)">
+        <span tal:repeat="item items">
+          <tr tal:condition="python:item.portal_type == 'Faculty'">
+            <td colspan="1">
+              <a href="faculty" tal:attributes="href item/absolute_url" tal:content="item/title_or_id"></a>
+            </td>
+          </tr>
+        </span>
+      </tal:block>
+      <tr tal:condition="python:not len(items)">
+        <td>
+          nothing yet !
+        </td>
+      </tr>
+    </table>
+  </metal:block>
+  <metal:block fill-slot="sub">
+  </metal:block>
+</html>
Index: /WAeUP_SRP/trunk/skins/waeup_academics/certificate_view.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/certificate_view.py	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/certificate_view.py	(revision 280)
@@ -0,0 +1,16 @@
+##parameters=psm=None
+# $Id: temporary_view_all.py 197 2006-02-08 12:47:31Z joachim $
+
+"""
+"""
+
+member = context.portal_membership.getAuthenticatedMember()
+uname = str(member)
+roles = member.getRoles()
+cat = context.portal_catalog
+request = context.REQUEST
+url0 = request.get('URL0')
+cc = context.contentValues()
+
+cc.sort()
+return context.certificate_view_form(cc=cc)
Index: /WAeUP_SRP/trunk/skins/waeup_academics/certificate_view_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/certificate_view_form.pt	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/certificate_view_form.pt	(revision 280)
@@ -0,0 +1,57 @@
+<html metal:use-macro="here/content_lib_master/macros/master">
+  <metal:block fill-slot="head_slot">
+  </metal:block>
+
+  <metal:block fill-slot="css_slot">
+    <link rel="Stylesheet" type="text/css" href=""
+      tal:attributes="href string:${base_url}document.css" />
+  </metal:block>
+  <metal:block fill-slot="header">
+  </metal:block>
+
+  <metal:block fill-slot="main"
+               tal:define="roles member/getRoles;
+               backend python:'UniversityManager' in roles or 'StudentManager' in roles;
+               frontend python:'Student' in roles or isAnon;
+               folder here/getContent;
+               items options/cc;"
+               >
+    <h1> <span tal:content="context/title_or_id" /></h1>      
+  
+    <p>This is view of the object with id <em tal:content="here/id" /> 
+       of type <em tal:content="here/portal_type" /> 
+       which can be customized according to the customer's needs.</p>       
+  
+    <br />
+      <p>The object's data fields: </p>
+      <tal:block  
+          tal:content="structure python:doc.render()" />
+    <br />      
+    <p>Exemplary view of the <strong>list of items attached to (or contained in) the object</strong>: </p>
+    <tal:block condition="python: len(items)">  
+      <table>
+        <span tal:repeat="item items">
+          <tr>
+            <td>
+              <span tal:content="item/portal_type" />:
+            </td>
+            <td>
+              <i>
+                <a href="xxx"  
+                   tal:attributes="href item/absolute_url"
+                   tal:content="item/id"></a> <span tal:content="item/title_or_id" tal:omit-tag="" />
+              </i>
+            </td>
+          </tr>
+        </span>
+      </table>
+    </tal:block>
+    
+    <tal:block condition="python: not len(items)">
+        (No items contained here!)
+    </tal:block>
+  
+  </metal:block>
+  <metal:block fill-slot="sub">
+  </metal:block>
+</html>
Index: /WAeUP_SRP/trunk/skins/waeup_academics/course_index_html.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/course_index_html.py	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/course_index_html.py	(revision 280)
@@ -0,0 +1,14 @@
+##parameters=post_id=None, REQUEST=None
+
+# $Id$
+
+"""Default view for the Student."""
+member = context.portal_membership.getAuthenticatedMember()
+if not context.portal_membership.isAnonymousUser():
+    roles = member.getRoles()
+    if 'Manager' in roles:
+        return context.cpsdocument_view()
+    elif 'StudentManager' in roles:
+        return context.course_view_manager()
+return context.course_view_student()
+
Index: /WAeUP_SRP/trunk/skins/waeup_academics/course_view_manager.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/course_view_manager.pt	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/course_view_manager.pt	(revision 280)
@@ -0,0 +1,21 @@
+<metal:block define-macro="view">
+<metal:block use-macro="here/content_lib_master/macros/master">
+  <metal:block fill-slot="header">
+  </metal:block>
+
+  <metal:block fill-slot="css_slot">
+    <link rel="Stylesheet" type="text/css" href=""
+      tal:attributes="href string:${base_url}document.css" />
+    <link rel="Stylesheet" type="text/css" href=""
+      tal:attributes="href string:${base_url}forum.css" />
+  </metal:block>
+
+  <metal:block fill-slot="main">
+    <tal:block tal:content="structure rendered_main|python:doc.render(proxy=here)" />
+
+  </metal:block>
+  <metal:block fill-slot="sub">
+  </metal:block>
+
+</metal:block>
+</metal:block>
Index: /WAeUP_SRP/trunk/skins/waeup_academics/course_view_student.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/course_view_student.pt	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/course_view_student.pt	(revision 280)
@@ -0,0 +1,32 @@
+<metal:block define-macro="view">
+<metal:block use-macro="here/content_lib_master/macros/master">
+  <metal:block fill-slot="header">
+  </metal:block>
+
+  <metal:block fill-slot="css_slot">
+    <link rel="Stylesheet" type="text/css" href=""
+      tal:attributes="href string:${base_url}document.css" />
+    <link rel="Stylesheet" type="text/css" href=""
+      tal:attributes="href string:${base_url}forum.css" />
+  </metal:block>
+
+  <metal:block fill-slot="main">
+      
+    <tal:block tal:content="structure rendered_main|python:doc.render(proxy=here)" />
+
+    <tal:block tal:condition="python:hasattr(here,'portal_discussion') and
+      hasattr(here.portal_discussion, 'isCommentingAllowedFor')">
+      <tal:block tal:define="comments_allowed
+        python:here.portal_discussion.isCommentingAllowedFor(here);"
+        tal:condition="comments_allowed">
+        <metal:block
+          use-macro="here/forum_comment_lib_view_comments_inline/macros/view_comments_inline" />
+      </tal:block>
+    </tal:block>
+
+  </metal:block>
+  <metal:block fill-slot="sub">
+  </metal:block>
+
+</metal:block>
+</metal:block>
Index: /WAeUP_SRP/trunk/skins/waeup_academics/create_certificate.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/create_certificate.py	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/create_certificate.py	(revision 280)
@@ -0,0 +1,50 @@
+##parameters=REQUEST=None
+# $Id: create_course.py 145 2005-11-03 08:53:17Z joachim $
+"""
+Create a Course
+
+"""
+type_name = 'Certificate'
+REQUEST.set('type_name',type_name)
+
+ti = context.portal_types[type_name]
+pr = context.portal_registration
+pm = context.portal_membership
+
+validate = REQUEST.has_key("cpsdocument_create_button")
+
+lt = context.portal_layouts
+
+res,psm,ds = lt.renderLayout(layout_id= 'certificate',
+                      schema_id = 'certificate',
+                      context=context,
+                      mapping=validate and REQUEST,
+                      ob={},
+                      layout_mode='create',
+                      create_action = 'create_certificate',
+                      )
+if  psm == 'invalid':
+    return context.common_edit_form(rendered = res,
+                                 create = 1,
+                                 type_name = type_name,
+                                 psm = 'Please correct your errors',
+                                 )
+elif psm == '':
+    return context.common_edit_form(rendered = res,
+                                 create = 1,
+                                 type_name = type_name,
+                                 psm = psm,
+                                 )
+    
+elif psm == 'valid':
+    oid = "%s" % ds.get('code').replace(' ','')
+    context.invokeFactory(type_name,oid) 
+    object = getattr(context,oid)
+    ds.set('Title',ds.get('heading'))
+    object.getContent().edit(mapping=ds,proxy=object)
+    context.notifyCPSDocumentCreation(ob=object)
+    psm = 'new %s created' % oid
+    context_ti = context.portal_types[context.portal_type] 
+    index = context_ti.getActionById('view','university_view')
+    return getattr(context,index)(psm=psm)
+
Index: /WAeUP_SRP/trunk/skins/waeup_academics/create_course.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/create_course.py	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/create_course.py	(revision 280)
@@ -0,0 +1,50 @@
+##parameters=REQUEST=None
+# $Id$
+"""
+Create a Course
+
+"""
+type_name = 'Course'
+REQUEST.set('type_name',type_name)
+
+ti = context.portal_types[type_name]
+pr = context.portal_registration
+pm = context.portal_membership
+
+validate = REQUEST.has_key("cpsdocument_create_button")
+
+lt = context.portal_layouts
+
+res,psm,ds = lt.renderLayout(layout_id= 'course',
+                      schema_id = 'course',
+                      context=context,
+                      mapping=validate and REQUEST,
+                      ob={},
+                      layout_mode='create',
+                      create_action = 'create_course',
+                      )
+if  psm == 'invalid':
+    return context.common_edit_form(rendered = res,
+                                 create = 1,
+                                 type_name = type_name,
+                                 psm = 'Please correct your errors',
+                                 )
+elif psm == '':
+    return context.common_edit_form(rendered = res,
+                                 create = 1,
+                                 type_name = type_name,
+                                 psm = psm,
+                                 )
+    
+elif psm == 'valid':
+    oid = "%s" % ds.get('code').replace(' ','')
+    context.invokeFactory(type_name,oid) 
+    object = getattr(context,oid)
+    ds.set('Title',ds.get('heading'))
+    object.getContent().edit(mapping=ds,proxy=object)
+    context.notifyCPSDocumentCreation(ob=object)
+    psm = 'new %s created' % oid
+    context_ti = context.portal_types[context.portal_type] 
+    index = context_ti.getActionById('view','university_view')
+    return getattr(context,index)(psm=psm)
+
Index: /WAeUP_SRP/trunk/skins/waeup_academics/create_studycourse.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/create_studycourse.py	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/create_studycourse.py	(revision 280)
@@ -0,0 +1,50 @@
+##parameters=REQUEST=None
+# $Id: create_course.py 145 2005-11-03 08:53:17Z joachim $
+"""
+Create a Course
+
+"""
+type_name = 'StudyCourse'
+REQUEST.set('type_name',type_name)
+
+ti = context.portal_types[type_name]
+pr = context.portal_registration
+pm = context.portal_membership
+
+validate = REQUEST.has_key("cpsdocument_create_button")
+
+lt = context.portal_layouts
+
+res,psm,ds = lt.renderLayout(layout_id= 'studycourse',
+                      schema_id = 'studycourse',
+                      context=context,
+                      mapping=validate and REQUEST,
+                      ob={},
+                      layout_mode='create',
+                      create_action = 'create_studycourse',
+                      )
+if  psm == 'invalid':
+    return context.common_edit_form(rendered = res,
+                                 create = 1,
+                                 type_name = type_name,
+                                 psm = 'Please correct your errors',
+                                 )
+elif psm == '':
+    return context.common_edit_form(rendered = res,
+                                 create = 1,
+                                 type_name = type_name,
+                                 psm = psm,
+                                 )
+    
+elif psm == 'valid':
+    oid = "%s" % ds.get('code').replace(' ','')
+    context.invokeFactory(type_name,oid) 
+    object = getattr(context,oid)
+    ds.set('Title',ds.get('heading'))
+    object.getContent().edit(mapping=ds,proxy=object)
+    context.notifyCPSDocumentCreation(ob=object)
+    psm = 'new %s created' % oid
+    context_ti = context.portal_types[context.portal_type] 
+    index = context_ti.getActionById('view','university_view')
+    return getattr(context,index)(psm=psm)
+
Index: /WAeUP_SRP/trunk/skins/waeup_academics/department_index_html.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/department_index_html.py	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/department_index_html.py	(revision 280)
@@ -0,0 +1,13 @@
+##parameters=psm=None, REQUEST=None
+
+# $Id$
+
+"""Default view for a Faculty."""
+member = context.portal_membership.getAuthenticatedMember()
+if not context.portal_membership.isAnonymousUser():
+    roles = member.getRoles()
+    if 'Manager' in roles:
+        return context.folder_view()
+    elif 'StudentManager' in roles:
+        return context.department_view_manager()
+return context.department_view_student()
Index: /WAeUP_SRP/trunk/skins/waeup_academics/department_index_html.py~
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/department_index_html.py~	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/department_index_html.py~	(revision 280)
@@ -0,0 +1,13 @@
+##parameters=psm=None, REQUEST=None
+
+# $Id: department_index_html.py 91 2005-10-26 12:30:11Z joachim $
+
+"""Default view for a Faculty."""
+member = context.portal_membership.getAuthenticatedMember()
+if not context.portal_membership.isAnonymousUser():
+    roles = member.getRoles()
+    if 'Manager' in roles:
+        return context.folder_view()
+    elif 'StudentManager' in roles:
+        return context.department_view_manager()
+return context.department_view_student()
Index: /WAeUP_SRP/trunk/skins/waeup_academics/department_view_manager.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/department_view_manager.pt	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/department_view_manager.pt	(revision 280)
@@ -0,0 +1,43 @@
+<html metal:use-macro="here/content_lib_master/macros/master">
+
+  <metal:block fill-slot="head_slot">
+    <tal:block tal:define="student here/getContent">
+    </tal:block>
+  </metal:block>
+
+  <metal:block fill-slot="css_slot">
+    <link rel="Stylesheet" type="text/css" href=""
+          tal:attributes="href string:${base_url}student.css" />
+  </metal:block>
+  <metal:block fill-slot="header">
+  </metal:block>
+
+  <metal:block fill-slot="main"
+               tal:define="department here/getContent;
+               items here/contentValues"
+               >
+    <span>
+      <h2 tal:content="department/title_or_id"></h2>
+      <p tal:content="department/Description">
+      </p>
+      <br />
+      
+      <table cellspacing="0" cellpadding="0">
+        <tal:block condition="python: len(items)">
+          <tr tal:repeat="item items">
+            <td colspan="1">
+              <a href="student" tal:attributes="href item/absolute_url" tal:content="item/title_or_id"></a>
+            </td>
+          </tr>
+        </tal:block>
+        <tr tal:condition="python:not len(items)">
+          <td>
+            no courses yet !
+          </td>
+        </tr>
+      </table>
+    </span>
+  </metal:block>
+  <metal:block fill-slot="sub">
+  </metal:block>
+</html>
Index: /WAeUP_SRP/trunk/skins/waeup_academics/department_view_student.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/department_view_student.pt	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/department_view_student.pt	(revision 280)
@@ -0,0 +1,43 @@
+<html metal:use-macro="here/content_lib_master/macros/master">
+
+  <metal:block fill-slot="head_slot">
+    <tal:block tal:define="student here/getContent">
+    </tal:block>
+  </metal:block>
+
+  <metal:block fill-slot="css_slot">
+    <link rel="Stylesheet" type="text/css" href=""
+          tal:attributes="href string:${base_url}student.css" />
+  </metal:block>
+  <metal:block fill-slot="header">
+  </metal:block>
+
+  <metal:block fill-slot="main"
+               tal:define="department here/getContent;
+               items here/contentValues"
+               >
+    <span>
+      <h2 tal:content="department/title_or_id"></h2>
+      <p tal:content="department/Description">
+      </p>
+      <br />
+      
+      <table cellspacing="0" cellpadding="0">
+        <tal:block condition="python: len(items)">
+          <tr tal:repeat="item items">
+            <td colspan="1">
+              <a href="student" tal:attributes="href item/absolute_url" tal:content="item/title_or_id"></a>
+            </td>
+          </tr>
+        </tal:block>
+        <tr tal:condition="python:not len(items)">
+          <td>
+            no courses yet !
+          </td>
+        </tr>
+      </table>
+    </span>
+  </metal:block>
+  <metal:block fill-slot="sub">
+  </metal:block>
+</html>
Index: /WAeUP_SRP/trunk/skins/waeup_academics/faculty_index_html.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/faculty_index_html.py	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/faculty_index_html.py	(revision 280)
@@ -0,0 +1,14 @@
+##parameters=psm=None, REQUEST=None
+
+# $Id$
+
+"""Default view for a Faculty."""
+member = context.portal_membership.getAuthenticatedMember()
+
+if not context.portal_membership.isAnonymousUser():
+    roles = member.getRoles()
+    if 'Manager' in roles:
+        return context.folder_view()
+    elif 'StudentManager' in roles:
+        return context.faculty_view_manager()
+return context.faculty_view_student()
Index: /WAeUP_SRP/trunk/skins/waeup_academics/faculty_view_manager.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/faculty_view_manager.pt	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/faculty_view_manager.pt	(revision 280)
@@ -0,0 +1,40 @@
+<html metal:use-macro="here/content_lib_master/macros/master">
+
+  <metal:block fill-slot="head_slot">
+    <tal:block tal:define="student here/getContent">
+    </tal:block>
+  </metal:block>
+
+  <metal:block fill-slot="css_slot">
+    <link rel="Stylesheet" type="text/css" href=""
+          tal:attributes="href string:${base_url}student.css" />
+  </metal:block>
+  <metal:block fill-slot="header">
+  </metal:block>
+
+  <metal:block fill-slot="main"
+               tal:define="faculty here/getContent;
+               items here/contentValues"
+               >
+    <h2 tal:content="faculty/title_or_id"></h2>
+    <p tal:content="faculty/Description"></p>
+    <span> 
+      <table cellspacing="0" cellpadding="0">
+        <tal:block condition="python: len(items)">
+          <tr tal:repeat="item items">
+            <td colspan="1">
+              <a href="student" tal:attributes="href item/absolute_url" tal:content="item/title_or_id"></a>
+            </td>
+          </tr>
+        </tal:block>
+        <tr tal:condition="python:not len(items)">
+          <td>
+            nothing yet !
+          </td>
+        </tr>
+      </table>
+    </span>
+  </metal:block>
+  <metal:block fill-slot="sub">
+  </metal:block>
+</html>
Index: /WAeUP_SRP/trunk/skins/waeup_academics/faculty_view_student.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/faculty_view_student.pt	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/faculty_view_student.pt	(revision 280)
@@ -0,0 +1,40 @@
+<html metal:use-macro="here/content_lib_master/macros/master">
+
+  <metal:block fill-slot="head_slot">
+    <tal:block tal:define="student here/getContent">
+    </tal:block>
+  </metal:block>
+
+  <metal:block fill-slot="css_slot">
+    <link rel="Stylesheet" type="text/css" href=""
+          tal:attributes="href string:${base_url}student.css" />
+  </metal:block>
+  <metal:block fill-slot="header">
+  </metal:block>
+
+  <metal:block fill-slot="main"
+               tal:define="faculty here/getContent;
+               items here/contentValues"
+               >
+    <h2 tal:content="faculty/title_or_id"></h2>
+    <p tal:content="faculty/Description"></p>
+    <span> 
+      <table cellspacing="0" cellpadding="0">
+        <tal:block condition="python: len(items)">
+          <tr tal:repeat="item items">
+            <td colspan="1">
+              <a href="student" tal:attributes="href item/absolute_url" tal:content="item/title_or_id"></a>
+            </td>
+          </tr>
+        </tal:block>
+        <tr tal:condition="python:not len(items)">
+          <td>
+            nothing yet !
+          </td>
+        </tr>
+      </table>
+    </span>
+  </metal:block>
+  <metal:block fill-slot="sub">
+  </metal:block>
+</html>
Index: /WAeUP_SRP/trunk/skins/waeup_academics/get_departments_voc.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/get_departments_voc.py	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/get_departments_voc.py	(revision 280)
@@ -0,0 +1,11 @@
+##parameters=key=None
+# $Id$
+"""
+Return the faculties as an vocabulary
+
+"""
+if key is None:
+    res = context.portal_catalog.search({'meta_type': "Department"})    
+    return [(d.getId,d.Title,) for d in res]
+dep = context.portal_catalog.search({'meta_type': "Department", 'id': key})[-1]
+return dep.Title
Index: /WAeUP_SRP/trunk/skins/waeup_academics/get_faculties_voc.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/get_faculties_voc.py	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/get_faculties_voc.py	(revision 280)
@@ -0,0 +1,11 @@
+##parameters=key=None 
+# $Id$
+"""
+Return the faculties as an vocabulary
+
+"""
+if key is None:
+    res = context.portal_catalog.search({'meta_type': "Faculty"})    
+    return [(d.getId,d.Title,) for d in res]
+dep = context.portal_catalog.search({'meta_type': "Faculty", 'id': key})[-1]
+return dep.Title
Index: /WAeUP_SRP/trunk/skins/waeup_academics/level_view.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/level_view.py	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/level_view.py	(revision 280)
@@ -0,0 +1,13 @@
+##parameters=psm=None
+# $Id: temporary_view_all.py 197 2006-02-08 12:47:31Z joachim $
+
+"""
+"""
+
+member = context.portal_membership.getAuthenticatedMember()
+uname = str(member)
+roles = member.getRoles()
+cat = context.portal_catalog
+request = context.REQUEST
+url0 = request.get('URL0')
+return context.level_view_form()
Index: /WAeUP_SRP/trunk/skins/waeup_academics/level_view_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/level_view_form.pt	(revision 280)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/level_view_form.pt	(revision 280)
@@ -0,0 +1,50 @@
+<html metal:use-macro="here/content_lib_master/macros/master">
+  <metal:block fill-slot="head_slot">
+  </metal:block>
+
+  <metal:block fill-slot="css_slot">
+    <link rel="Stylesheet" type="text/css" href=""
+      tal:attributes="href string:${base_url}document.css" />
+  </metal:block>
+  <metal:block fill-slot="header">
+  </metal:block>
+
+  <metal:block fill-slot="main"
+               tal:define="roles member/getRoles;
+               backend python:'UniversityManager' in roles or 'StudentManager' in roles;
+               frontend python:'Student' in roles or isAnon;
+               folder here/getContent;
+               items python:context.filterContents(items=context.contentValues());"
+               >
+    <h1>Level  <span tal:content="context/title_or_id" /></h1>      
+  
+    <p>The courses for this level:</p>
+    <tal:block condition="python: len(items)">  
+      <table>
+        <span tal:repeat="item items">
+          <span tal:define="courses python:item.filterContents(items=item.contentValues())">
+          <tr>
+            <th> <span tal:content="item/id" tal:omit-tag="" /> Semester
+            </th>
+          </tr>
+         <tr tal:repeat="course courses">
+            <td> <a href="coures" tal:content="course/id" tal:attributes="href course/coursepath"></a>
+            </td>
+            <td tal:content="course/Title"></td>
+            <td tal:content="course/credits"></td>
+            <td tal:content="course/passmark"></td>
+          </tr>
+            <tr> <td></td></tr>
+        </span>
+        </span>
+      </table>
+    </tal:block>
+    
+    <tal:block condition="python: not len(items)">
+        (No Courses yet!)
+    </tal:block>
+  
+  </metal:block>
+  <metal:block fill-slot="sub">
+  </metal:block>
+</html>
