Index: WAeUP_SRP/trunk/Academics.py
===================================================================
--- WAeUP_SRP/trunk/Academics.py	(revision 289)
+++ WAeUP_SRP/trunk/Academics.py	(revision 290)
@@ -71,4 +71,5 @@
                 logger.info('Faculty with ID %(FacultyCode)s %(Description)s already exists' % faculty)
                 no_import.write('"%(Session)s","%(FacultyCode)s","%(Description)s","%(CollegeCode)s","%(FacultyKey)s","%(Status)s","%(degree_grade)s","%(Bankcode)s"\n' % faculty)
+        return self.getContent().temporary_view_all()
     ###)
 
@@ -89,4 +90,6 @@
             logger.info('dumping %s %s ' % (faculty.id, faculty.title))
             print yaml.dump(faculty)
+        return self.academics.temporary_view_all()
+        return self.temporary_view_all()
             
     ###)
@@ -129,4 +132,6 @@
                 dict = {'Title': dep['Description']}
                 d.getContent().edit(mapping=dict)
+        return self.academics.temporary_view_all()
+        return self.temporary_view_all()
     ###)
     
@@ -215,7 +220,10 @@
                 dict['passmark'] = 0
             c.getContent().edit(mapping=dict)
+        return self.academics.temporary_view_all()
+        return self.temporary_view_all()
     ###)
 
     security.declareProtected(ModifyPortalContent,"loadCertificatesFromCSV")###(
+
     def loadCertificatesFromCSV(self):
         """install Universityspecific Certificates from CSV values"""
@@ -290,4 +298,6 @@
             dict['probation_credits'] = certificate.get('ProbationCredits')
             c.getContent().edit(mapping=dict)
+        return self.academics.temporary_view_all()
+        return self.temporary_view_all()
     ###)
 
@@ -297,4 +307,6 @@
         #return
         logger = logging.getLogger('loadcertificatecourses')
+        name = 'certificate_courses'
+        no_import = False
         try:
             cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb"))
@@ -303,7 +315,9 @@
             return
         d_ids = [d.id for d in self.portal_catalog({'meta_type': "Department"})]
+        c_ids = [c.id for c in self.portal_catalog({'meta_type': "Course"})]
         for cert_course in cert_courses:
             logger.info('Processing %(CosCode)s %(CertCode)s %(CoreKey)s %(Session)s %(Level)s %(Core)s %(Elective)s %(Mandatory)s %(AdmStatus)s %(Dept)s %(Semester)s' % cert_course)
             depid = cert_course.get('Dept')
+            course_code = cert_course.get('CosCode')
             code = cert_course.get('CertCode')
             code = code.replace('.','')
@@ -313,18 +327,38 @@
             code = code.replace(' ','')
             code = code.replace('_','')
-            if cert_course.get('Session') != '2002/2003':
-                continue
+##            if cert_course.get('Session') != '2002/2003':
+##                continue
             certificate = self.portal_catalog({'meta_type': "Certificate",
                                                'SearchableText': code})
             if not certificate:
-                print code
-                logger.info('CertCode %(CertCode)s for %(CosCode)s not found' % cert_course)
+                #print code
+                em = 'CertCode %(CertCode)s for %(CosCode)s not found\n' % cert_course
+                logger.info(em)
+                if not no_import:
+                    no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w")
+                    no_import.write('"CosCode","CertCode","CoreKey","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n')
+                no_import.write(em)
+                no_import.write('"%(CosCode)s","%(CertCode)s","%(CoreKey)s","%(Session)s","%(Level)s","%(Core)s","%(Elective)s","%(Mandatory)s","%(AdmStatus)s","%(Dept)s","%(Semester)s"\n' % cert_course)
                 continue
             certificate = certificate[-1].getObject()
             certificate_code = certificate.getId()
+            if course_code not in c_ids:
+                em = 'CorseCode %(CosCode)s for %(CertCode)s not found in Courses\n' % cert_course
+                logger.info(em)
+                if not no_import:
+                    no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w")
+                    no_import.write('"CosCode","CertCode","CoreKey","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n')
+                no_import.write(em)
+                no_import.write('"%(CosCode)s","%(CertCode)s","%(CoreKey)s","%(Session)s","%(Level)s","%(Core)s","%(Elective)s","%(Mandatory)s","%(AdmStatus)s","%(Dept)s","%(Semester)s"\n' % cert_course)
+                continue
             if depid not in d_ids:
-                logger.info('Department %(Dept)s for %(CertCode)s not found' % cert_course)
-                continue
-            course_code = cert_course.get('CosCode')
+                em = 'Department %(Dept)s for %(CertCode)s not found\n' % cert_course
+                logger.info(em)
+                if not no_import:
+                    no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w")
+                    no_import.write('"CosCode","CertCode","CoreKey","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n')
+                no_import.write(em)
+                no_import.write('"%(CosCode)s","%(CertCode)s","%(CoreKey)s","%(Session)s","%(Level)s","%(Core)s","%(Elective)s","%(Mandatory)s","%(AdmStatus)s","%(Dept)s","%(Semester)s"\n' % cert_course)
+                continue
             level = cert_course.get('Level')
             l = getattr(certificate,level,None)
@@ -336,4 +370,5 @@
                 l.invokeFactory('Semester','first')
                 l.invokeFactory('Semester','second')
+            certificate.orderObjects('id')
             first_s = getattr(l,'first')
             second_s = getattr(l,'second')
@@ -344,6 +379,10 @@
             if hasattr(semester,course_code):
                 logger.info('Duplicate %(CosCode)s in Level %(Level)s' % cert_course)
-                continue
-                
+                if not no_import:
+                    no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w")
+                    no_import.write('"CosCode","CertCode","CoreKey","Session","Level","Core","Elective","Mandatory","AdmStatus","Dept","Semester"\n')
+                no_import.write('Duplicate %(CosCode)s in Level %(Level)s' % cert_course)
+                no_import.write('"%(CosCode)s","%(CertCode)s","%(CoreKey)s","%(Session)s","%(Level)s","%(Core)s","%(Elective)s","%(Mandatory)s","%(AdmStatus)s","%(Dept)s","%(Semester)s"\n' % cert_course)
+                continue
             semester.invokeFactory('CertificateCourse',course_code)
             cc = getattr(semester,course_code)
@@ -360,5 +399,5 @@
                 dict['core_or_elective'] = False
             dict['level'] = cert_course.get('Level')
-            cc.getContent().edit(mapping=dict)
+            cc.academics.edit(mapping=dict)
     ###)
 
@@ -433,8 +472,6 @@
         """passmark from course"""
         ce = self.getCourseEntry(self.id)
-        if ce:
-            return "%s" % ce.passmark.split(',')[0]
-        return "0"
-
+        return ce.passmark
+    
     security.declareProtected(View,"coursepath")
     def coursepath(self):
Index: WAeUP_SRP/trunk/profiles/default/layouts/faculty.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/layouts/faculty.xml	(revision 289)
+++ WAeUP_SRP/trunk/profiles/default/layouts/faculty.xml	(revision 290)
@@ -28,7 +28,22 @@
   <property name="size_max">200</property>
  </widget>
+ <widget name="institution_type" meta_type="Select Widget">
+  <property name="title">Type of Institution</property>
+  <property name="fields">
+   <element value="institution_type"/>
+  </property>
+  <property name="label">Type of Institution</property>
+  <property name="label_edit">Type of Institution</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">institution_types_voc</property>
+ </widget>
  <table>
   <row>
    <cell name="Title"/>
+  </row>
+  <row>
+   <cell name="institution_type"/>
   </row>
   <row>
Index: WAeUP_SRP/trunk/profiles/default/schemas/faculty.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/schemas/faculty.xml	(revision 289)
+++ WAeUP_SRP/trunk/profiles/default/schemas/faculty.xml	(revision 290)
@@ -1,2 +1,4 @@
 <?xml version="1.0"?>
-<object name="faculty" meta_type="CPS Schema"/>
+<object name="faculty" meta_type="CPS Schema">
+ <field name="institution_type" meta_type="CPS String Field"/>
+</object>
Index: WAeUP_SRP/trunk/profiles/default/types/AcademicsFolder.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/types/AcademicsFolder.xml	(revision 289)
+++ WAeUP_SRP/trunk/profiles/default/types/AcademicsFolder.xml	(revision 290)
@@ -43,5 +43,5 @@
  <action title="Add Faculty" action_id="add_faculty" category="object"
     condition_expr="python:True or member and 'UniversityManager'in member.getRoles()"
-    url_expr="string:${object/absolute_url}/create_common?type_name=Faculty"
+    url_expr="string:${object/absolute_url}/content_create?type_name=Faculty"
     visible="True"/>
  <action title="action_folder_contents" action_id="contents" category="object"
Index: WAeUP_SRP/trunk/profiles/default/types/Department.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/types/Department.xml	(revision 289)
+++ WAeUP_SRP/trunk/profiles/default/types/Department.xml	(revision 290)
@@ -43,15 +43,19 @@
     condition_expr="python:member and 'Manager' in member.getRoles()"
     url_expr="string:${object_url}/cpsdocument_edit_form" visible="True">
-  <permission value="Modify portal content"/>
+  <permission value=""/>
  </action>
  <action title="Add Course" action_id="create_course" category="object"
-    condition_expr="" url_expr="string:${object/absolute_url}/create_course"
+    condition_expr="" url_expr="string:${object/absolute_url}/content_create?type_name=Course"
     visible="True">
-  <permission value="University Manage"/>
+  <permission value=""/>
+ </action>
+ <action title="Add Certificate" action_id="create_certificate" category="object"
+    condition_expr="" url_expr="string:${object/absolute_url}/content_create?type_name=Certificate"
+    visible="True">
  </action>
  <action title="action_folder_contents" action_id="contents" category="object"
     condition_expr="python:member and 'Manager' in member.getRoles()"
     url_expr="string:${object_url}/folder_contents" visible="True">
-  <permission value="Modify portal content"/>
+  <permission value=""/>
  </action>
  <action title="action_metadata" action_id="metadata" category="object"
Index: WAeUP_SRP/trunk/profiles/default/types/Faculty.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/types/Faculty.xml	(revision 289)
+++ WAeUP_SRP/trunk/profiles/default/types/Faculty.xml	(revision 290)
@@ -45,13 +45,13 @@
  </action>
  <action title="Add Department" action_id="add_department" category="object"
+    url_expr="string:${object/absolute_url}/content_create?type_name=Department"
     condition_expr=""
-    url_expr="string:${object/absolute_url}/create_common?type_name=Department"
     visible="True">
-  <permission value="University Manage"/>
+  <permission value=""/>
  </action>
  <action title="action_folder_contents" action_id="contents" category="object"
     condition_expr="" url_expr="string:${object_url}/folder_contents"
     visible="False">
-  <permission value="University Manage"/>
+  <permission value=""/>
  </action>
  <action title="action_metadata" action_id="metadata" category="object"
@@ -65,9 +65,3 @@
   <permission value="Modify portal content"/>
  </action>
- <action title="Add Faculty" action_id="add_faculty" category="object"
-    condition_expr="python:member and 'UniversityManager'in member.getRoles()"
-    url_expr="string:${object/absolute_url}/create_common?type_name=Faculty"
-    visible="True">
-  <permission value="University Manage"/>
- </action>
 </object>
Index: WAeUP_SRP/trunk/profiles/default/vocabularies.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/vocabularies.xml	(revision 289)
+++ WAeUP_SRP/trunk/profiles/default/vocabularies.xml	(revision 290)
@@ -4,4 +4,5 @@
  <object name="courselevel" meta_type="CPS Vocabulary"/>
  <object name="faculties" meta_type="CPS Vocabulary"/>
+ <object name="institution_types_voc" meta_type="CPS Vocabulary"/>
  <object name="get_departments_voc" meta_type="CPS Method Vocabulary"/>
  <object name="get_faculties_voc" meta_type="CPS Method Vocabulary"/>
Index: WAeUP_SRP/trunk/profiles/default/workflows.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows.xml	(revision 289)
+++ WAeUP_SRP/trunk/profiles/default/workflows.xml	(revision 290)
@@ -56,5 +56,5 @@
   </type>
   <type type_id="CourseTicket">
-   <bound-workflow workflow_id="waeup_student_wf"/>
+   <bound-workflow workflow_id="waeup_base_wf"/>
   </type>
   <type type_id="Department">
@@ -77,5 +77,5 @@
   </type>
   <type type_id="Semester">
-   <bound-workflow workflow_id="waeup_student_wf"/>
+   <bound-workflow workflow_id="waeup_base_wf"/>
   </type>
   <type type_id="Student">
Index: WAeUP_SRP/trunk/skins/waeup_academics/certificate_view.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_academics/certificate_view.py	(revision 289)
+++ WAeUP_SRP/trunk/skins/waeup_academics/certificate_view.py	(revision 290)
@@ -11,6 +11,3 @@
 request = context.REQUEST
 url0 = request.get('URL0')
-cc = context.contentValues()
-
-cc.sort()
-return context.certificate_view_form(cc=cc)
+return context.certificate_view_form()
Index: WAeUP_SRP/trunk/skins/waeup_academics/certificate_view_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_academics/certificate_view_form.pt	(revision 289)
+++ WAeUP_SRP/trunk/skins/waeup_academics/certificate_view_form.pt	(revision 290)
@@ -15,5 +15,5 @@
                frontend python:'Student' in roles or isAnon;
                folder here/getContent;
-               items options/cc;"
+               items here/contentValues"
                >
     <h1> <span tal:content="context/title_or_id" /></h1>      
Index: WAeUP_SRP/trunk/skins/waeup_default/cpsdocument_edit_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/cpsdocument_edit_form.pt	(revision 289)
+++ 	(revision )
@@ -1,69 +1,0 @@
-<tal:block define="res python:here.editCPSDocument(REQUEST=request);
-                   rendered_main python: res[0];
-                   portal_status_message python: res[1];
-                   edition python:1;
-  ">
-<metal:block define-macro="edit_form">
-<metal:block use-macro="here/content_lib_master/macros/master">
-  <metal:block fill-slot="css_slot">
-    <link rel="Stylesheet" type="text/css" href=""
-      tal:attributes="href string:${base_url}document.css" />
-
-    <metal:block define-macro="widgets_javascript">
-    <!-- XXX this has to move to CPSSchemas -->
-    <style type="text/css"
-      tal:content="string:@import url(${base_url}calendar-win2k-1.css);"></style>
-    <script type="text/javascript" src="calendar.js"
-      tal:attributes="src string:${base_url}calendar.js"></script>
-    <script type="text/javascript" src="lang/calendar-en.js"
-      tal:define="local cpsmcat/getSelectedLanguage"
-      tal:attributes="src string:${base_url}lang/calendar-${local}.js"></script>
-    <script type="text/javascript" src="calendar-setup.js"
-      tal:attributes="src string:${base_url}calendar-setup.js"></script>
-
-    <script type="text/javascript">
-    <!--
-     function popup_rte(input_id, label_edit) {
-       var args, value
-       value = document.getElementById(input_id).value;
-       args='?input_id='+input_id+'&label_edit='+escape(label_edit);
-       popup = window.open('popup_rte_form'+args, input_id, 'toolbar=0, scrollbars=0, location=0, statusbar=0, menubar=0, resizable=1, dependent=1, width=640, height=480')
-       if(!popup.opener)
-         popup.opener = window;
-       return false;
-   }
-   //-->
-   </script>
-   </metal:block>
-  </metal:block>
-
-  <metal:block fill-slot="header"
-    tal:define="creation creation|nothing;
-                edition edition|nothing;
-                metadata metadata|nothing">
-    <h1 tal:condition="creation" i18n:translate="">
-      Create a document of type
-      <tal:block i18n:name="type_name" i18n:translate=""
-            tal:define="type_name request/type_name;
-                        type_info python:here.portal_types[type_name]"
-            tal:content="type_info/Title">Type Title</tal:block>
-    </h1>
-    <h1 tal:condition="not:creation">
-      <img tal:replace="structure python:here.getImgTag('/'+here.getIcon(), base_url='')">
-      <tal:block condition="edition"
-        i18n:translate="">Edit <span i18n:name="title"
-        tal:content="here/title_or_id">Page Title</span></tal:block>
-      <tal:block tal:condition="metadata"
-        i18n:translate="">heading_metadata_edit</tal:block>
-    </h1>
-  </metal:block>
-
-  <metal:block fill-slot="main">
-    <div tal:replace="structure rendered_main" />
-  </metal:block>
-  <metal:block fill-slot="sub">
-  </metal:block>
-
-</metal:block>
-</metal:block>
-</tal:block>
Index: WAeUP_SRP/trunk/skins/waeup_default/create_common.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/create_common.py	(revision 289)
+++ WAeUP_SRP/trunk/skins/waeup_default/create_common.py	(revision 290)
@@ -16,5 +16,5 @@
 
 res,psm,ds = lt.renderLayout(layout_id= type_name.lower(),
-                      schema_id= 'metadata',
+                      schema_id= type_name.lower(),
                       context=context,
                       mapping=validate and REQUEST,
Index: WAeUP_SRP/trunk/skins/waeup_default/getCreatableItems.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/getCreatableItems.py	(revision 289)
+++ WAeUP_SRP/trunk/skins/waeup_default/getCreatableItems.py	(revision 290)
@@ -12,6 +12,6 @@
 base_url = utool.getBaseUrl()
 
-if context.getPortalTypeName() == 'Portal':
-    return items
+##if context.getPortalTypeName() == 'Portal':
+##    return items
 
 content_types = context.getSortedContentTypes(allowed=1)
Index: WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_create.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_create.pt	(revision 289)
+++ WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_create.pt	(revision 290)
@@ -1,2 +1,2 @@
 <tal:block define="global creation python:1" />
-<metal:block use-macro="here/waeup_layout_lib/macros/common_edit" />
+<metal:block use-macro="here/layout_lib_default_edit/macros/default_edit" />
Index: WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_edit.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_edit.pt	(revision 289)
+++ WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_edit.pt	(revision 290)
@@ -1,1 +1,1 @@
-<metal:block use-macro="here/waeup_layout_lib/macros/default_edit" />
+<metal:block use-macro="here/layout_lib_default_edit/macros/default_edit" />
Index: WAeUP_SRP/trunk/skins/waeup_default/temporary_view_all.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/temporary_view_all.py	(revision 289)
+++ WAeUP_SRP/trunk/skins/waeup_default/temporary_view_all.py	(revision 290)
@@ -5,23 +5,22 @@
 """
 
-member = context.portal_membership.getAuthenticatedMember()
-uname = str(member)
-roles = member.getRoles()
-cat = context.portal_catalog
-request = context.REQUEST
-url0 = request.get('URL0')
-#return context.temporary_view_all_form(psm=psm)
-if context.portal_membership.isAnonymousUser():
-    if not url0.endswith('chat'):
-        return context.students.student_view_all_form(psm=psm)
-    return context.Chat()
-else:
-    return context.temporary_view_all_form(psm=psm)
-    if url0.find(uname) > 0 or 'DepartmentManager' in roles or 'Manager' in roles:
-        return context.temporary_view_all_form(psm=psm)
-    elif 'Student' in roles and 'StudentManager' not in roles:
-        res = cat(pathindex="/portal/sections/students/%s" % uname)
-        for r in res:
-            if r.getPath().endswith("students/%s" % uname):
-                return r.getObject().student_view_student_form(psm=psm)
-        return context.students.student_view_all_form(psm=psm)
+return context.temporary_view_all_form(psm=psm)
+##member = context.portal_membership.getAuthenticatedMember()
+##uname = str(member)
+##roles = member.getRoles()
+##cat = context.portal_catalog
+##request = context.REQUEST
+##url0 = request.get('URL0')
+##if context.portal_membership.isAnonymousUser():
+##    if not url0.endswith('chat'):
+##        return context.students.student_view_all_form(psm=psm)
+##    return context.Chat()
+##else:
+##    if url0.find(uname) > 0 or 'DepartmentManager' in roles or 'Manager' in roles:
+##        return context.temporary_view_all_form(psm=psm)
+##    elif 'Student' in roles and 'StudentManager' not in roles:
+##        res = cat(pathindex="/portal/sections/students/%s" % uname)
+##        for r in res:
+##            if r.getPath().endswith("students/%s" % uname):
+##                return r.getObject().student_view_student_form(psm=psm)
+##        return context.students.student_view_all_form(psm=psm)
