Index: WAeUP_SRP/branches/joachim-event-branch/PatchCatalogToolXMLAdapter.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/PatchCatalogToolXMLAdapter.py	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/PatchCatalogToolXMLAdapter.py	(revision 1669)
@@ -21,12 +21,10 @@
         inds[ind.attributes.items()[1][1]] = ind.attributes.items()[0][1]
         #print ind.attributes.items()
-    #print "indexes: ", inds
+    #from pdb import set_trace; set_trace()
     na = node.attributes.items()
     not_found = True
     new_indexes = []
     new_columns = []
-    if na[0][1] in ("WAeUP Table"):
-        not_found = False
-    elif na[0][1] == "CMF Catalog":
+    if na[0][1] in ("CMF Catalog","WAeUP Table"):
         #print na[1][1]
         not_found = False
@@ -49,11 +47,13 @@
             not_found = True
     if not_found:
-        self._initProperties(node)
-        self._initObjects(node)
-        self._initIndexes(node)
+        self._logger.info("%s modified." % na[1][1])
+        #self._initProperties(node)
+        #self._initObjects(node)
+        if new_indexes and len(self.context()) == 0: #disable creation of new indexes if records in the table
+            self._initIndexes(node)
         self._initColumns(node)
-        self._refreshCatalog()
+        #self._refreshCatalog()
 
-    self._logger.info("Catalog tool imported.")
+    self._logger.info("Catalog tool %s imported."  % na[1][1])
     
 from Products.CPSCore.exportimport.catalog import CatalogToolXMLAdapter
Index: WAeUP_SRP/branches/joachim-event-branch/doc/srp_documentation.mm
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/doc/srp_documentation.mm	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/doc/srp_documentation.mm	(revision 1669)
@@ -1,3 +1,3 @@
-<map version="0.8.0">
+<map version="0.9.0_Beta_8">
 <!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
 <node CREATED="1170079518946" ID="Freemind_Link_650524897" MODIFIED="1172489583516" TEXT="WAeUP Documentation">
@@ -8,5 +8,5 @@
 </node>
 <node CREATED="1172489529057" ID="Freemind_Link_43083883" MODIFIED="1172489545651" POSITION="right" TEXT="SRP Data Structure">
-<node CREATED="1170079621592" FOLDED="true" ID="Freemind_Link_1297017754" MODIFIED="1170079640872" TEXT="Campus">
+<node CREATED="1170079621592" ID="Freemind_Link_1297017754" MODIFIED="1170079640872" TEXT="Campus">
 <node CREATED="1171710559043" ID="Freemind_Link_1592396213" MODIFIED="1171710565212" TEXT="Id: campus"/>
 <node CREATED="1170079643589" FOLDED="true" ID="Freemind_Link_1231068129" MODIFIED="1171710686426" TEXT="Academic Section">
@@ -48,8 +48,8 @@
 </node>
 </node>
-<node CREATED="1170082138244" FOLDED="true" ID="Freemind_Link_1354366927" MODIFIED="1171710679266" TEXT="Student Section">
+<node CREATED="1170082138244" ID="Freemind_Link_1354366927" MODIFIED="1171710679266" TEXT="Student Section">
 <node CREATED="1171709784119" ID="_" MODIFIED="1171709937449" TEXT="Type: StudentsFolder" VSHIFT="104"/>
 <node CREATED="1171710545564" ID="Freemind_Link_221165828" MODIFIED="1171710551332" TEXT="Id: students"/>
-<node CREATED="1170082147831" FOLDED="true" ID="Freemind_Link_115332414" MODIFIED="1171709774415" TEXT="{Student}">
+<node CREATED="1170082147831" ID="Freemind_Link_115332414" MODIFIED="1171709774415" TEXT="{Student}">
 <node CREATED="1171114205479" ID="Freemind_Link_1051911128" LINK="../profiles/default/types/Student.xml" MODIFIED="1171353141707" TEXT="Type: Student"/>
 <node CREATED="1171124926993" ID="Freemind_Link_1838352082" LINK="../profiles/default/schemas/student.xml" MODIFIED="1171353152905" TEXT="Schema: student"/>
@@ -171,5 +171,5 @@
 </node>
 </node>
-<node CREATED="1170082392807" FOLDED="true" ID="Freemind_Link_1979443941" MODIFIED="1171711179966" TEXT="Study Course">
+<node CREATED="1170082392807" ID="Freemind_Link_1979443941" MODIFIED="1171711179966" TEXT="Study Course">
 <node CREATED="1170930140692" ID="Freemind_Link_607082969" MODIFIED="1171009488850" TEXT="Id: study_course"/>
 <node CREATED="1170930264337" ID="Freemind_Link_1384807180" LINK="../profiles/default/types/StudentStudyCourse.xml" MODIFIED="1172159914623" TEXT="Type: StudentStudyCourse"/>
@@ -197,4 +197,35 @@
 <node CREATED="1170883263996" ID="Freemind_Link_39098989" LINK="../profiles/default/schemas/payment.xml" MODIFIED="1170959080069" TEXT="Schema: payment"/>
 <node CREATED="1171711449483" ID="Freemind_Link_165499016" MODIFIED="1171711455191" TEXT="Layout: payment"/>
+</node>
+</node>
+<node CREATED="1170082164451" ID="Freemind_Link_1991619732" MODIFIED="1175265930974" TEXT="Pume Data">
+<node CREATED="1170083733194" ID="Freemind_Link_474120928" MODIFIED="1175265946729" TEXT="Id: pume"/>
+<node CREATED="1170083603042" ID="Freemind_Link_1353178566" LINK="../profiles/default/types/StudentPume.xml" MODIFIED="1175265977383" TEXT="Type: StudentPume"/>
+<node CREATED="1170083649773" ID="Freemind_Link_1635748093" LINK="../profiles/default/schemas/student_pume.xml" MODIFIED="1175266051911" TEXT="Schema: student_pume"/>
+<node CREATED="1171353188624" FOLDED="true" ID="Freemind_Link_1752727630" LINK="../profiles/default/workflows/waeup_student_subobject_wf/definition.xml" MODIFIED="1172163415549" TEXT="Workflow: waeup_student_subobject_wf">
+<node CREATED="1172156481009" ID="Freemind_Link_615932491" LINK="waeup_student_subobject_wf.gif" MODIFIED="1172903933018" TEXT="Diagram"/>
+</node>
+<node CREATED="1170883343230" ID="Freemind_Link_1769098562" MODIFIED="1172162754390" TEXT="User Interface">
+<node CREATED="1170883352226" ID="Freemind_Link_1332793129" MODIFIED="1172163796143" TEXT="Student">
+<node CREATED="1171124982312" ID="Freemind_Link_1964031449" LINK="../profiles/default/layouts/student_pume.xml" MODIFIED="1175266093912" TEXT="Layout: student_pume" VSHIFT="2"/>
+<node CREATED="1172488817664" ID="Freemind_Link_183452447" MODIFIED="1172488820358" TEXT="view">
+<node CREATED="1172163808013" LINK="../skins/waeup_student/application_slip.pt" MODIFIED="1172488857021" TEXT="PT: application_slip"/>
+<node CREATED="1172163797590" LINK="../skins/waeup_student/application_view.pt" MODIFIED="1172488862899" TEXT="PT: application_view"/>
+</node>
+<node CREATED="1172488821089" FOLDED="true" ID="Freemind_Link_1024852395" MODIFIED="1172488823242" TEXT="edit">
+<node CREATED="1172163808013" LINK="../skins/waeup_student/application_edit_form.pt" MODIFIED="1172488851172" TEXT="PT: application_edit_form"/>
+<node CREATED="1172163808013" ID="Freemind_Link_987823120" LINK="../skins/waeup_student/application_edit.py" MODIFIED="1173007903444" TEXT="PY: application_edit"/>
+</node>
+</node>
+<node CREATED="1170883352226" FOLDED="true" ID="Freemind_Link_156982782" MODIFIED="1172488273241" TEXT="Officer">
+<node CREATED="1171124982312" LINK="../profiles/default/layouts/student_application.xml" MODIFIED="1172488456165" TEXT="Layout: student_application" VSHIFT="2"/>
+<node CREATED="1172488875157" FOLDED="true" ID="Freemind_Link_1326488938" MODIFIED="1172488877500" TEXT="view">
+<node CREATED="1172163808013" LINK="../skins/waeup_default/waeup_document_view.pt" MODIFIED="1172488738180" TEXT="PT: waeup_document_view"/>
+</node>
+<node CREATED="1172488878061" FOLDED="true" ID="Freemind_Link_1633752071" MODIFIED="1172488879643" TEXT="edit">
+<node CREATED="1172163808013" LINK="../skins/waeup_default/waeup_edit.py" MODIFIED="1172488745821" TEXT="PY: waeup_edit"/>
+<node CREATED="1172163808013" LINK="../skins/waeup_default/waeup_edit_form.pt" MODIFIED="1172488792728" TEXT="PT: waeup_edit_form"/>
+</node>
+</node>
 </node>
 </node>
Index: WAeUP_SRP/branches/joachim-event-branch/exportimport.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/exportimport.py	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/exportimport.py	(revision 1669)
@@ -90,5 +90,5 @@
                                               roles=('SectionReader',))
             students.manage_setLocalGroupRoles(groupid = 'CourseAdvisers',
-                                              roles=('SectionReader',))                                              
+                                              roles=('SectionReader',))
             students.manage_setLocalGroupRoles(groupid='MemberAdmins',
                                          roles=('SectionOfficer',))
@@ -120,4 +120,5 @@
     importWAeUPTable(site.courses_catalog, '', context,'courses_catalog')
     importWAeUPTable(site.payments_catalog, '', context,'payments_catalog')
+    importWAeUPTable(site.online_payments_import, '', context,'online_payments_import')
     importWAeUPTable(site.portal_pins, '', context,'pins')
     importWAeUPTable(site.portal_pumeresults, '', context,'pumeresults')
Index: WAeUP_SRP/branches/joachim-event-branch/profiles/default/actions.xml
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/profiles/default/actions.xml	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/profiles/default/actions.xml	(revision 1669)
@@ -177,5 +177,5 @@
   <action title="Change Password" action_id="change_password"
      category="student" condition_expr="member"
-     url_expr="string:${portal_url}/change_password" visible="True">
+     url_expr="string:${portal_url}/change_password" visible="False">
    <permission>View</permission>
   </action>
Index: WAeUP_SRP/branches/joachim-event-branch/profiles/default/layouts/student_change_password.xml
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/profiles/default/layouts/student_change_password.xml	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/profiles/default/layouts/student_change_password.xml	(revision 1669)
@@ -35,5 +35,5 @@
     <property name="hidden_readonly_layout_modes"/>
     <property name="password_widget"></property>
-    <property name="check_digit">False</property>
+    <property name="check_digit">True</property>
     <property name="size_min">6</property>
     <property name="size_max">10</property>
Index: WAeUP_SRP/branches/joachim-event-branch/profiles/default/online_payments_import.xml
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/profiles/default/online_payments_import.xml	(revision 1669)
+++ WAeUP_SRP/branches/joachim-event-branch/profiles/default/online_payments_import.xml	(revision 1669)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="catalog.xsl"?>
+<object name="online_payments_import" meta_type="WAeUP Table">
+ <column value="datetime"/>
+ <column value="student_id"/>
+ <column value="order_id"/>
+ <column value="response_code"/>
+ <column value="amount"/>
+ <index name="student_id" meta_type="FieldIndex">
+  <indexed_attr value="student_id"/>
+ </index>
+ <index name="datetime" meta_type="DateIndex">
+  <indexed_attr value="datetime"/>
+ </index>
+ <index name="order_id" meta_type="FieldIndex">
+  <indexed_attr value="order_id"/>
+ </index>
+</object>
Index: WAeUP_SRP/branches/joachim-event-branch/profiles/default/schemas/payment.xml
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/profiles/default/schemas/payment.xml	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/profiles/default/schemas/payment.xml	(revision 1669)
@@ -6,5 +6,5 @@
   <field name="type_description" meta_type="CPS String Field" >
     <property name="is_searchabletext">True</property>
-  </field> <field name="order_id" meta_type="CPS String Field"/>
+  </field> 
   <field name="amount" meta_type="CPS String Field"/>
   <field name="resp_pay_reference" meta_type="CPS String Field"/>
Index: WAeUP_SRP/branches/joachim-event-branch/profiles/default/schemas/student_study_level.xml
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/profiles/default/schemas/student_study_level.xml	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/profiles/default/schemas/student_study_level.xml	(revision 1669)
@@ -4,7 +4,6 @@
  <field name="code" meta_type="CPS String Field"/>
  <field name="session" meta_type="CPS String Field"/>
- <field name="gpa" meta_type="CPS Float Field"/>
- <field name="status" meta_type="CPS String Field"/>
  <field name="verdict" meta_type="CPS String Field"/>
-  <field name="imported_gpa" meta_type="CPS Float Field"/>
+ <field name="validated_by" meta_type="CPS String Field"/>
+ <field name="validation_date" meta_type="CPS DateTime Field"/>
 </object>
Index: WAeUP_SRP/branches/joachim-event-branch/profiles/default/students_catalog.xml
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/profiles/default/students_catalog.xml	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/profiles/default/students_catalog.xml	(revision 1669)
@@ -32,8 +32,8 @@
  </index>
  <index name="jamb_reg_no" meta_type="FieldIndex">
-  <indexed_attr value="student_application:jamb_reg_no"/>
+  <indexed_attr value="jamb_reg_no"/>
  </index>
  <index name="matric_no" meta_type="FieldIndex">
-  <indexed_attr value="student_clearance:matric_no"/>
+  <indexed_attr value="matric_no"/>
  </index>
  <index name="faculty" meta_type="KeywordIndex">
@@ -41,5 +41,5 @@
  </index>
  <index name="entry_mode" meta_type="KeywordIndex">
-  <indexed_attr value="student_application:entry_mode"/>
+  <indexed_attr value="entry_mode"/>
  </index>
  <index name="entry_year" meta_type="KeywordIndex">
@@ -50,11 +50,11 @@
  </index>
  <index name="level" meta_type="KeywordIndex">
-  <indexed_attr value="student_study_course:current_level"/>
+  <indexed_attr value="current_level"/>
  </index>
  <index name="verdict" meta_type="KeywordIndex">
-  <indexed_attr value="student_study_course:current_verdict"/>
+  <indexed_attr value="current_verdict"/>
  </index>
  <index name="course" meta_type="KeywordIndex">
-  <indexed_attr value="student_study_course:study_course"/>
+  <indexed_attr value="study_course"/>
  </index>
  <index name="registered_courses" meta_type="KeywordIndex">
Index: WAeUP_SRP/branches/joachim-event-branch/profiles/default/themes.xml
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/profiles/default/themes.xml	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/profiles/default/themes.xml	(revision 1669)
@@ -6,5 +6,4 @@
   <element key="external_edit_form" value="WAeUP_Student+Slippage"/>
   <element key="external_clearance_edit_form" value="WAeUP_Student+Slippage"/>
-  <element key="contact_student_form" value="WAeUP_Student+Slippage"/>
   <element key="login_staff" value="WAeUP_Backoffice+Default"/>
   <element key="logged_out" value="WAeUP_Student+Default"/>
Index: WAeUP_SRP/branches/joachim-event-branch/profiles/default/toolset.xml
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/profiles/default/toolset.xml	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/profiles/default/toolset.xml	(revision 1669)
@@ -7,4 +7,6 @@
  <required tool_id="payments_catalog"
            class="Products.WAeUP_SRP.WAeUPTables.PaymentsCatalog"/>
+ <required tool_id="online_payments_import"
+           class="Products.WAeUP_SRP.WAeUPTables.OnlinePaymentsImport"/>
  <required tool_id="portal_pins"
            class="Products.WAeUP_SRP.WAeUPTables.PinTable"/>
Index: WAeUP_SRP/branches/joachim-event-branch/profiles/default/workflows/waeup_student_subobject_wf/definition.xml
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/profiles/default/workflows/waeup_student_subobject_wf/definition.xml	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/profiles/default/workflows/waeup_student_subobject_wf/definition.xml	(revision 1669)
@@ -9,5 +9,7 @@
  <permission>Modify portal content</permission>
  <permission>View</permission>
+ <permission>View</permission>
  <state state_id="closed" title="">
+  <exit-transition transition_id="create_content"/>
   <exit-transition transition_id="open"/>
   <permission-map name="Add portal content" acquired="True">
@@ -103,5 +105,5 @@
              new_state="closed" trigger="USER"
              before_script="" after_script="">
-  
+
   <guard>
    <guard-role>SectionOfficer</guard-role>
@@ -115,5 +117,5 @@
              new_state="content_addable" trigger="USER"
              before_script="" after_script="">
-  
+
   <guard>
    <guard-role>SectionOfficer</guard-role>
@@ -127,5 +129,5 @@
              new_state="created" trigger="USER"
              before_script="" after_script="">
-  
+
   <guard>
   </guard>
@@ -136,5 +138,5 @@
              new_state="" trigger="USER" before_script=""
              after_script="">
-  
+
   <guard>
   </guard>
@@ -144,5 +146,5 @@
              new_state="opened" trigger="USER"
              before_script="" after_script="">
-  
+
   <guard>
    <guard-role>SectionOfficer</guard-role>
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics/getCertificateInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics/getCertificateInfo.py	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics/getCertificateInfo.py	(revision 1669)
@@ -12,4 +12,13 @@
 return Info about a Certificate
 """
+def cmp_id(a,b):
+    s1 = "%(id)s" % a
+    s2 = "%(id)s" % b
+    if s1 == s2:
+        return 0
+    if s1 > s2:
+        return 1
+    return -1
+
 request = context.REQUEST
 
@@ -18,5 +27,5 @@
 
 info = {}
-info['action'] = "%s" % context.campus.absolute_url()
+info['action'] = "%s" % context.absolute_url()
 info['choosen_ids'] = request.get('ids',[])
 info['doc'] = context.getContent()
@@ -33,4 +42,5 @@
     row['url'] = l.absolute_url()
     items.append(row)
+items.sort(cmp_id)
 info['items'] = items
 return info
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics/getLevelInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics/getLevelInfo.py	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics/getLevelInfo.py	(revision 1669)
@@ -16,4 +16,5 @@
 wf = context.portal_workflow
 mtool = context.portal_membership
+academics_path = "%s/campus/academics" % context.portal_url()
 path_info = request.get('PATH_INFO').split('/')
 try:
@@ -44,5 +45,5 @@
     ro = r.getObject()
     rd = ro.getContent()
-    row['id'] = r.getId
+    course_id = row['id'] = r.getId
     row['title'] = rd.Title()
     row['core'] = rd.core_or_elective
@@ -50,5 +51,10 @@
     row['url'] = ro.absolute_url()
     row['review_state'] = wf.getInfoFor(ro,'review_state','None')
-    row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
+    editable = row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
+    if editable:
+        course_res = context.courses_catalog(code=course_id)
+        if course_res:
+            rc = course_res[0]
+            row['real_course_path'] = "%s/%s/%s/courses/%s" % (academics_path,rc.faculty,rc.department,course_id)
     if rd.semester == 'first':
         first.append(row)
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics/level_view.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics/level_view.pt	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_academics/level_view.pt	(revision 1669)
@@ -48,4 +48,8 @@
                     [edit]
                     </a> 
+                <a tal:condition="row/real_course_path|nothing" 
+                   href="edit" tal:attributes="href string:${row/real_course_path}">
+                    [goto course]
+                    </a> 
                 </td>
               </tr>
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_default/functions.js.dtml
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_default/functions.js.dtml	(revision 1669)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_default/functions.js.dtml	(revision 1669)
@@ -0,0 +1,330 @@
+<dtml-comment>
+CPS JavaScript functions
+$Id: functions.js.dtml 32288 2006-01-26 17:36:06Z tziade $
+</dtml-comment>
+
+<dtml-let last_modified="_.DateTime()-14" expires="_.DateTime()+1" >
+<dtml-call "REQUEST.RESPONSE.setHeader( 'Content-Type', 'text/javascript' )">
+<dtml-call "REQUEST.RESPONSE.setHeader( 'Last-Modified', last_modified.toZone('GMT').rfc822() )">
+<dtml-call "REQUEST.RESPONSE.setHeader( 'Cache-Control', 'max-age=36000, must-revalidate' )">
+<dtml-call "REQUEST.RESPONSE.setHeader( 'Expires', expires.toZone('GMT').rfc822() )" >
+</dtml-let>
+
+var msie5 = (navigator.userAgent.indexOf('MSIE 5') != -1);
+
+//************************************************************
+// Folder content
+var isSelected = false;
+
+function toggleSelect(toggleSelectButton, selectAllText, deselectAllText) {
+  formElements = toggleSelectButton.form.elements;
+
+  if (isSelected) {
+    for (i = 0; i < formElements.length; i++) {
+      formElements[i].checked = false;
+    }
+    isSelected = false;
+    toggleSelectButton.value = selectAllText;
+  } else {
+    for (i = 0; i < formElements.length; i++) {
+      formElements[i].checked = true;
+    }
+    isSelected = true;
+    toggleSelectButton.value = deselectAllText;
+  }
+}
+
+//************************************************************
+/**
+ * Toggles an element's visibility.
+ * Function to show tooltips.
+ * If your element is a span, you must use inline display instead of block
+ * XXX recognize div and span then automaticly choose the best display rule
+ */
+function toggleElementVisibility(id) {
+  element = document.getElementById(id);
+  if (element) {
+    //window.alert(element.tagName)
+    if (element.style.visibility == 'hidden') {
+      element.style.visibility = 'visible';
+      if (element.tagName == 'DIV') {
+        element.style.display = 'block';
+      } else if (element.tagName == 'SPAN') {
+        element.style.display = 'inline';
+      } else {
+        element.style.display = 'block';
+      }
+    } else {
+      element.style.visibility = 'hidden';
+      element.style.display = 'none';
+    }
+  }
+}
+
+function showElement(show, id) {
+  element = document.getElementById(id);
+  if (element) {
+    //window.alert(element.tagName)
+    if (show) {
+      element.style.visibility = 'visible';
+      if (element.tagName in ['DIV', 'P']) {
+        element.style.display = 'block';
+      } else {
+        element.style.display = 'inline';
+      }
+    } else {
+      element.style.visibility = 'hidden';
+      element.style.display = 'none';
+    }
+  }
+}
+
+//************************************************************
+function trim(s) {
+  if (s) {
+    return s.replace(/^\s*|\s*$/g, "");
+  }
+  return "";
+}
+
+//************************************************************
+function checkEmptySearch(formElem) {
+  var query = trim(formElem.SearchableText.value);
+  if (query != '') {
+    formElem.SearchableText.value = query;
+    return true;
+  }
+  formElem.SearchableText.value = query;
+  formElem.SearchableText.focus();
+  return false;
+}
+
+//************************************************************
+/**
+ * Sets focus on <input> elements that have a class attribute
+ * containing the class 'focus'.
+ * Examples:
+ * <input type="text" id="username" name="__ac_name" class="focus"/>
+ * <input type="text" id="searchableText" class="standalone giant focus"/>
+ *
+ * This function does not work on crappy MSIE5.0 and MSIE5.5.
+ */
+function setFocus() {
+  if (msie5) {
+    return false;
+  }
+  var elements = document.getElementsByTagName('input');
+  for (var i = 0; i < elements.length; i++) {
+    var nodeClass = elements[i].getAttributeNode('class');
+    //alert("nodeClass = " + nodeClass);
+    if (nodeClass) {
+      var classes = nodeClass.value.split(' ');
+      for (var j = 0; j < classes.length; j++) {
+        if (classes[j] == 'focus') {
+          elements[i].focus();
+          return true;
+        }
+      }
+    }
+  }
+}
+
+/**
+ * Validates that the input fields designated by the given ids are not empty.
+ * It returns true if all the input fields are not empty, it returns false
+ * otherwise.
+ * Example:
+ * <form onsubmit="return validateRequiredFields(['field1', 'field2'],
+ * ['Title', 'Comments'], 'are empty while they are required fields.')">
+ */
+function validateRequiredFields(fieldIds, fieldLabels, informationText) {
+  for (i = 0; i < fieldIds.length; i++) {
+    element = document.getElementById(fieldIds[i]);
+    if (element && !element.value) {
+      window.alert("'" + fieldLabels[i] + "' " + informationText);
+      return false;
+    }
+  }
+  return true;
+}
+
+//************************************************************
+function getSelectedRadio(buttonGroup) {
+  if (buttonGroup[0]) {
+    for (var i=0; i<buttonGroup.length; i++) {
+      if (buttonGroup[i].checked) {
+        return i
+      }
+    }
+  } else {
+    if (buttonGroup.checked) { return 0; }
+  }
+  return -1;
+}
+
+function getSelectedRadioValue(buttonGroup) {
+  var i = getSelectedRadio(buttonGroup);
+  if (i == -1) {
+    return "";
+  } else {
+    if (buttonGroup[i]) {
+    return buttonGroup[i].value;
+    } else {
+    return buttonGroup.value;
+    }
+  }
+}
+
+function getSelectedRadioId(buttonGroup) {
+  var i = getSelectedRadio(buttonGroup);
+  if (i == -1) {
+    return "";
+  } else {
+    if (buttonGroup[i]) {
+      return buttonGroup[i].id;
+    } else {
+      return buttonGroup.id;
+    }
+  }
+}
+
+/**
+ * Return the label content corresponding to a radio selection
+ */
+function getSelectedRadioLabel(buttonGroup) {
+  var id = getSelectedRadioId(buttonGroup);
+  if (id == "") {
+    return "";
+  } else {
+    for (var i=0; i<document.getElementsByTagName("label").length; i++) {
+      var element_label = document.getElementsByTagName("label")[i];
+      if (element_label.htmlFor == id) {
+        return element_label.firstChild.nodeValue;
+      }
+    }
+  }
+}
+
+
+//************************************************************
+/*
+    Used to highlight search terms
+    from Geir Bækholt, adapted for CPS
+
+ */
+function highlightSearchTerm() {
+  var query_elem = document.getElementById('searchGadget')
+  if (! query_elem){
+    return false
+  }
+  var query = query_elem.value
+  // _robert_ ie 5 does not have decodeURI
+  if (typeof decodeURI != 'undefined'){
+    query = unescape(decodeURI(query)) // thanks, Casper
+  }
+  else {
+    return false
+  }
+  if (query){
+    queries = query.replace(/\+/g,' ').split(/\s+/)
+    // make sure we start the right place and not higlight menuitems or breadcrumb
+    searchresultnode = document.getElementById('searchResults')
+    if (searchresultnode) {
+      for (q=0;q<queries.length;q++) {
+        // don't highlight reserved catalog search terms
+        if (queries[q].toLowerCase() != 'not'
+          && queries[q].toLowerCase() != 'and'
+          && queries[q].toLowerCase() != 'or') {
+          climb(searchresultnode,queries[q]);
+        }
+      }
+    }
+  }
+}
+
+function climb(node, word){
+  // traverse childnodes
+  if (! node){
+    return false
+  }
+  if (node.hasChildNodes) {
+    var i;
+    for (i=0;i<node.childNodes.length;i++) {
+      climb(node.childNodes[i],word);
+    }
+    if (node.nodeType == 3) {
+      checkforhighlight(node, word);
+      // check all textnodes. Feels inefficient, but works
+    }
+  }
+}
+
+function checkforhighlight(node,word) {
+  ind = node.nodeValue.toLowerCase().indexOf(word.toLowerCase())
+  if (ind != -1) {
+    if (node.parentNode.className != "highlightedSearchTerm"){
+      par = node.parentNode;
+      contents = node.nodeValue;
+      // make 3 shiny new nodes
+      hiword = document.createElement("span");
+      hiword.className = "highlightedSearchTerm";
+      hiword.appendChild(document.createTextNode(contents.substr(ind,word.length)));
+      par.insertBefore(document.createTextNode(contents.substr(0,ind)),node);
+      par.insertBefore(hiword,node);
+      par.insertBefore(document.createTextNode( contents.substr(ind+word.length)),node);
+      par.removeChild(node);
+    }
+  }
+}
+
+/************************************************************
+/**
+ * searchLanguage widget functions
+ * used to auto select languages checkbox/radio
+ * cf CPSSchemas/skins/cps_schemas/widget_searchlanguage_render.pt
+ */
+function searchLanguageCheckSelected(languages, no_language, language) {
+  var count=0;
+  for (var i=0; i<languages.length; i++) {
+    if (languages[i].checked) {
+      count++;
+    }
+  }
+  no_language.checked = (count <= 0);
+  language.checked = (count > 0);
+}
+
+function searchLanguageClearSelected(languages) {
+  for (i=0; i<languages.length; i++) {
+    languages[i].checked = 0;
+  }
+}
+
+function toggleLayers(more_block, more_items) {
+  var objMoreBlock = document.getElementById(more_block).style;
+  var objMoreItems = document.getElementById(more_items).style;
+  if(objMoreBlock.display == "block")
+    objMoreBlock.display = "none";
+  if(objMoreItems.display == "none")
+    objMoreItems.display = "block";
+}
+
+/************************************************************
+/**
+ * waeup specific functions
+ */
+
+/**
+ * submit_once(): Avoid multiple sendings of forms...
+ */
+
+submitted = false;
+function submit_once() {
+    if (submitted) {
+        alert("Your request is being processed.\nPlease be patient.");
+        event.returnValue = 0;    // work-around for IE
+        return 0;
+    }
+    submitted = true;
+    return 1;
+}
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_default/mail2admin.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_default/mail2admin.py	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_default/mail2admin.py	(revision 1669)
@@ -37,5 +37,5 @@
      email,
      'kehindesamuel@waeup.org',
-     'henrik@waeup.org',
+     'waeup@saoas.org',
 #    'js@aixtraware.de',
      email,
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/check_online_payments.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/check_online_payments.py	(revision 1669)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/check_online_payments.py	(revision 1669)
@@ -0,0 +1,69 @@
+## Script (Python) "check_online_payments"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+payment callback
+"""
+import logging
+logger = logging.getLogger('Skins.check_online_payments')
+from AccessControl import Unauthorized
+import DateTime
+if context.portal_membership.isAnonymousUser():
+    return None
+
+request = context.REQUEST
+response = request.RESPONSE
+students = context.portal_url.getPortalObject().campus.students
+wftool = context.portal_workflow
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+member_id = str(member)
+student_id = context.getStudentId()
+online_transactions = context.online_payments_import
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+def rwrite(s):
+    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
+    response.write("%s<br>\n" % s)
+try:
+    from Products.AdvancedQuery import Eq, Between, Le,In
+    aq_portal = context.portal_catalog.evalAdvancedQuery
+    aq_students = context.students_catalog.evalAdvancedQuery
+except:
+    aq_portal = None
+
+query1 = Eq('portal_type','Payment')
+query2 = Eq('SearchableText',"Approved Successful")	 	
+online_payments = aq_portal(query1 & query2)
+set_trace()
+online_transactions = context.online_payments_import
+
+for op_brain in online_payments:
+    student_id = op_brain.getPath().split('/')[-3]
+    payment_doc = op_brain.getObject().getContent()
+    order_id = "%s%s" % (student_id[1:],op_brain.getId[1:])
+    transactions = online_transactions(student_id = student_id)
+    payment_id = op_brain.getId
+    if payment_doc.resp_code == "00" and not transactions:
+        rwrite('"%s","%s","no transaction for successfull payment","","%s"' % (student_id,payment_id,payment_doc.date))
+        continue
+    for transaction in transactions:
+        t_order_id = transaction.order_id
+        if t_order_id == order_id:
+            rwrite('"%s","%s","%s","%s","%s"' % (student_id,
+                                                                        op_brain.getId,
+                                                                        transaction.response_code,
+                                                                        payment_doc.resp_code,
+                                                                        payment_doc.date
+                                                                        ))
+            continue
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/check_transactions.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/check_transactions.py	(revision 1669)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/check_transactions.py	(revision 1669)
@@ -0,0 +1,92 @@
+## Script (Python) "check_transactions"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+payment callback
+"""
+import logging
+logger = logging.getLogger('Skins.check_transactions')
+from AccessControl import Unauthorized
+import DateTime
+if context.portal_membership.isAnonymousUser():
+    return None
+
+request = context.REQUEST
+response = request.RESPONSE
+students = context.portal_url.getPortalObject().campus.students
+wftool = context.portal_workflow
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+member_id = str(member)
+student_id = context.getStudentId()
+online_transactions = context.online_payments_import
+def rwrite(s):
+    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
+    response.write("%s<br>\n" % s)
+correct = 0
+count = 0
+approved = 0
+for ot_brain in online_transactions():
+    student_id = ot_brain.student_id
+    if not students.hasObject(student_id):
+        rwrite("%s not found" % student_id)
+        continue
+    student_obj = getattr(students,student_id)
+    if not student_obj.hasObject('payments'):
+        rwrite("%s payments-folder not found" % student_id)
+        continue
+    payments_folder = getattr(student_obj,'payments')
+    payment_id = "p%s" % ot_brain.order_id[6:]
+    if not payments_folder.hasObject(payment_id):
+        rwrite("%s payment %s not found" % (student_id,payment_id))
+        continue
+    payment_obj = getattr(payments_folder,payment_id)
+    payment_doc = payment_obj.getContent()
+    response_code = ot_brain.response_code
+    count +=1
+    if payment_doc.resp_code != response_code:
+        rwrite('"%d","%d","%s","%s","%s","%s"' % (
+                                                  count,correct,
+                                                  student_id,
+                                                  payment_id,
+                                                  response_code,
+                                                  payment_doc.resp_code
+                                                  ))
+    elif payment_doc.resp_code == response_code:
+        correct +=1
+        rwrite('"%d","%d","%s","%s","%s","%s"' % (
+                                                  count,correct,
+                                                  student_id,
+                                                  payment_id,
+                                                  response_code,
+                                                  payment_doc.resp_code
+                                                  ))
+    if payment_doc.resp_code == "" and response_code == "00":
+        pd = {}
+        review_state = wftool.getInfoFor(payment_obj,'review_state',None)
+        if review_state != "opened":
+            logger.info('payment object of %s closed' % (student_id))
+            continue
+        review_state = wftool.getInfoFor(student_obj,'review_state',None)
+        if review_state != "cleared_and_validated":
+            logger.info('%s review_state = %s' % (student_id,review_state))
+            continue
+        pd['resp_code'] = 'IP'
+        pd['resp_desc'] = 'Payment approved by import, %s' % (DateTime.DateTime())
+        payment_doc.edit(mapping=pd)
+        if payment_doc.type_description.startswith('School Fee'):
+            wftool.doActionFor(student_obj,'pay_school_fee')
+        logger.info('%s approves epayment for %s by import' % (member,student_id))
+        wftool.doActionFor(payment_obj,'close')
+        approved += 1
+        if approved > 50:
+            context.waeup_tool.doCommit()
+            logger.info('%s transactions commited' % (approved))
+            approved = 0
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/payment_receipt.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/payment_receipt.pt	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/payment_receipt.pt	(revision 1669)
@@ -8,5 +8,5 @@
       <span tal:condition="info">
       
-        <metal:block tal:condition="python:info_doc['doc'].resp_code in ('00','AP',)">            
+        <metal:block tal:condition="python:info_doc['doc'].resp_code in ('00','AP','IP')">            
         <h3>Online Payment Receipt</h3>
         <br />
@@ -106,5 +106,5 @@
         </metal:block>
         
-        <metal:block tal:condition="python:info_doc['doc'].resp_code not in ('SC','00','AP','')">            
+        <metal:block tal:condition="python:info_doc['doc'].resp_code not in ('SC','00','AP','IP','')">            
         <h3>Response from Bank: "<span tal:content="python:info_doc['doc'].resp_desc" />"</h3>
         <br />        
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/payments_view.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/payments_view.pt	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/payments_view.pt	(revision 1669)
@@ -34,9 +34,17 @@
             </td>
             <td>
-            <a tal:condition="python:row['is_approvable']"
+            <a tal:condition="row/is_approvable"
                tal:attributes="href string:${context/absolute_url}/${row/id}/approve_epayment;
                                onclick python:'return window.confirm(\'%s\')' %(cpsmcat('Are you sure? You will not be able to undo the approval.'), );
                                ">
                 [approve payment]
+            </a>             
+            </td>
+            <td tal:condition="nothing">
+            <a tal:condition="row/is_requeryable"
+               tal:attributes="href string:${context/absolute_url}/${row/id}/requery_payment;
+                               onclick python:'return window.confirm(\'%s\')' %(cpsmcat('Are you sure? You will not be able to undo the approval.'), );
+                               ">
+                [requery payment]
             </a>             
             </td>
@@ -53,4 +61,8 @@
                 value="Initiate School Fee Online Payment" 
                 />
+                
+
+
+                
         </form>  
 
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/requery_payment.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/requery_payment.py	(revision 1669)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/requery_payment.py	(revision 1669)
@@ -0,0 +1,66 @@
+## Script (Python) "pay_online"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+requery online-payment
+"""
+from urllib import urlencode
+import logging
+logger = logging.getLogger('Skins.requery_payment')
+import DateTime
+
+if context.portal_membership.isAnonymousUser():
+    return None
+
+request = context.REQUEST
+wftool = context.portal_workflow
+students = context.portal_url.getPortalObject().campus.students
+
+student_id = context.getStudentId()
+student = getattr(students,student_id)
+
+sbrain = context.students_catalog(id=student_id)[0]
+info = {}
+info['site_id'] = '300100100'
+info['currency_id'] = '566'
+
+#from Products.zdb import set_trace;set_trace()
+if student_id is None:
+    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
+
+if context.portal_url().find('uniben-demo.waeup.org') >-1 or\
+   context.portal_url().find('uniben.waeup.org') >-1:
+    info['action'] = "http://www.wemaonlinepayments.biz/querytransaction.aspx"
+else:
+    #pass
+    #return None
+    info['action'] = "%s/payments/%s/simulate_queryatransaction" % (student.absolute_url(),p_id)
+
+
+payment = context
+if payment.portal_type != 'Payment':
+    return
+payment_doc = payment.getContent()
+#from Products.zdb import set_trace;set_trace()
+info['order_id'] = p_id = payment_doc.order_id
+info['callback_url'] = "%s/payments/%s/epayment_requery_cb" % (student.absolute_url(),p_id)
+info['type_description'] = payment_doc.type_description
+info['amount'] = payment_doc.amount
+info['student_id'] = student_id
+logger.info('%(student_id)s requeried online school fee payment for order_id %(order_id)s' % info)
+payment_fields = (('x_SiteID','site_id'),
+                  ('x_OrderID','order_id'),
+                  ('x_Redirect_url','callback_url'),
+                  )
+args = {}
+for arg,field in payment_fields:
+    args[arg] = info[field]
+info['args'] = args
+return context.requery_payment_form(info=info)
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/requery_payment_form.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/requery_payment_form.pt	(revision 1669)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_epayment/requery_payment_form.pt	(revision 1669)
@@ -0,0 +1,42 @@
+<metal:body use-macro="here/main_template/macros/master">
+    <metal:main fill-slot="main"
+                tal:define="info options/info">
+                
+        <h3>Requery Online Payment! </h3>
+        <br />
+                
+      <form method="post" action="pay_online"
+            tal:attributes="action info/action ">
+      <span tal:repeat="arg python:info['args'].items()"
+            tal:omit-tag="">
+          <input type="hidden" tal:attributes="name python:arg[0];value python:arg[1]" />
+      </span>          
+        <table>
+          <tr>
+            <td width="100px">
+            Payment:</td>
+            <td tal:content="info/type_description"></td>
+          </tr>
+          <tr>
+            <td >
+            Amount:
+            </td>
+            <td> Naira <span tal:content="info/amount" /></td>
+          </tr>
+          <tr>
+            <td >
+            Bank:
+            </td>
+            <td>Wema Bank</td>
+          </tr>          
+        </table>
+        <br />
+        <input type="submit" 
+               class="standalone" 
+               name="goto_bank" 
+               value="Requery this payment with Bank" 
+               />
+      </form>
+    </metal:main>
+</metal:body>
+
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/change_password.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/change_password.py	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/change_password.py	(revision 1669)
@@ -4,4 +4,14 @@
 
 """
+
+return
+
+
+
+
+
+
+
+
 request = context.REQUEST
 import DateTime,logging
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/clearance_edit.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/clearance_edit.py	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/clearance_edit.py	(revision 1669)
@@ -120,5 +120,5 @@
         wftool.doActionFor(info['clear'],'open')
         wftool.doActionFor(info['student'],'reject_clearance')
-        action = "/contact_student_form"
+        action = "/external_contact_student_form"
         psm = "Student's clearance request has been rejected! Please fill and submit the form below!"
         subject = "Clearance request rejected"
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getSessionResults.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getSessionResults.py	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getSessionResults.py	(revision 1669)
@@ -101,5 +101,5 @@
 #set_trace()
 verdict_voc = context.portal_vocabularies.verdicts
-verdict_code = student_from_cat.get('verdict',None)
+verdict_code = student_from_cat.verdict
 if verdict_code:
     info['verdict'] = verdict = verdict_voc.get(verdict_code,'N/A').upper()
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudyLevelInfo.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudyLevelInfo.py	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/getStudyLevelInfo.py	(revision 1669)
@@ -40,8 +40,10 @@
     return 0.0
 
-def cmp_semester(a,b):
-    if a['semester'] == b['semester']:
+def cmp_semester_id(a,b):
+    s1 = "%(semester)s%(id)s" % a
+    s2 = "%(semester)s%(id)s" % b
+    if s1 == s2:
         return 0
-    if a['semester'] > b['semester']:
+    if s1 > s2:
         return 1
     return -1
@@ -104,7 +106,7 @@
         normal.append(d)
 info['credits_total'] = credits_total
-carry_overs.sort(cmp_semester)
+carry_overs.sort(cmp_semester_id)
 info['carry_overs'] = carry_overs
-normal.sort(cmp_semester)
+normal.sort(cmp_semester_id)
 info['normal'] = normal
 
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/layout_personal_view.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/layout_personal_view.pt	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/layout_personal_view.pt	(revision 1669)
@@ -9,5 +9,5 @@
       <td><span class="dlabel">Student ID</span>:
       </td>
-      <td tal:condition="nothing"> 
+      <td> 
          <span tal:replace="context/getStudentId" />
       </td>      
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/statistics_new_view.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/statistics_new_view.pt	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/statistics_new_view.pt	(revision 1669)
@@ -33,5 +33,5 @@
             <th align="right">CR</th>
             <th align="right">VC</th>
-            <th align="right">SFP</th>
+            <th align="right">SFP+</th>
           </tr>
           <tr tal:repeat="d departments"
@@ -74,5 +74,5 @@
         <tr><td>CR: </td> <td>Clearance requested</td></tr>
         <tr><td>VC: </td> <td>Validated and cleared</td></tr>
-        <tr><td>SFP: </td> <td>School fee paid</td></tr>
+        <tr><td>SFP+: </td> <td>School fee paid and further</td></tr>
         </table>
       </span>
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/study_course_view.pt
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/study_course_view.pt	(revision 1655)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_student/study_course_view.pt	(revision 1669)
@@ -58,5 +58,5 @@
         </table>        
       
-      <form action="" method="post" class="group"
+      <form action="" method="post" class="group" onsubmit="return submit_once()"
             tal:attributes="action info/action"
             tal:define="rows python: info['items'];"
@@ -66,5 +66,5 @@
             tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
             <td align="left" valign="middle" style="width: 5px;" 
-                tal:condition="python: 0 and is_so">
+                tal:condition="python:is_so">
               <input type="checkbox" name="ids:list" value="" id="" class="noborder"
                      tal:condition="is_so"
@@ -84,9 +84,8 @@
                summary="contents of the folder"
                class="folderButtons">
-          <tr>
+          <tr tal:condition="python: is_so and info['items']">
             <td align="left" valign="top" rowspan="3"></td>
             <td align="left" valign="top">
-              <span tal:condition="python:0 and is_so">
-                <input type="button" value="button_select_all" class="context"
+              <input type="button" value="button_select_all" class="context"
                        onclick="someJavaScriptFunctionThatWillBeReplaced"
                        i18n:attributes="value"
@@ -94,15 +93,14 @@
                        % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
                        />
-                <input type="submit" name="folder_delete:method" value="button_delete"
-                       class="destructive" i18n:attributes="value"
-                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
-                       (cpsmcat('description_confirm_delete'), )" 
-                       />
-              </span>
+              <input type="submit" name="folder_delete:method" value="button_delete"
+                     class="destructive" i18n:attributes="value"
+                     tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                     (cpsmcat('description_confirm_delete'), )" 
+                     />
             </td>
           </tr>
         </table>
       </form>
-      <form action="" method="post" class="group"
+      <form action="" method="post" class="group" onsubmit="return submit_once()"
             tal:attributes="action string:${context/absolute_url}/create_level"
             tal:define="rows python: info['items'];"
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/ti_151_resolve.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/ti_151_resolve.py	(revision 1669)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/ti_151_resolve.py	(revision 1669)
@@ -0,0 +1,114 @@
+## Script (Python) "ti_151_resolve"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+resolve ticket #151
+"""
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+import logging
+#>>>>>>>>>>>>>>>><
+logger = logging.getLogger('Skins.ti_151_resolve')
+logger.info('already done on 26.3.07 by joachim')
+return
+#<<<<<<<<<<<<<<<<<
+request = context.REQUEST
+session = request.SESSION
+response = request.RESPONSE
+setheader = request.RESPONSE.setHeader
+students = context.portal_url.getPortalObject().campus.students
+#from string import Template
+def rwrite(s):
+    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
+    response.write(s)
+def getObject(outer,object):
+    if outer.hasObject(object):
+        return getattr(outer,object)
+    return None
+
+try:
+    from Products.AdvancedQuery import Eq, Between, Le,In
+    aq_students = context.students_catalog.evalAdvancedQuery
+except:
+    evalAdvancedQuery = None
+
+students_cat = context.students_catalog
+query = Eq('faculty','PSC') & Eq('department','PHY') & In('level',('300','400'))
+brains = aq_students(query)
+#brains = students_cat(faculty = 'PSC',department='PHY', level='400')
+total = 0
+count_ok = 0
+count_nosc = 0
+count_nolevel = 0
+count_level = 0
+count_renamed = 0
+#set_trace()
+#template = Template('"$count","$id","$course"')
+to_rename = []
+for student in brains:
+    student_dict = {}
+    for field in students_cat.schema():
+        student_dict[field] = getattr(student,field)
+    #s = template.substitute(student_dict,count=count,)
+    student_dict['total'] = total
+    while True:
+        if student.course == "BSCINP":
+            student_dict['message'] = "OK"
+            count_ok += 1
+            student_dict['sp_count'] = count_ok
+            s = '"%(total)d","%(sp_count)s","%(id)s","%(course)s","%(message)s",' % student_dict
+            break
+        student_dict['message'] = ""
+        student_obj = getObject(students,student.id)
+        if student_obj is None:
+            student_dict['message'] = "No student object"
+            break
+        study_course_obj = getObject(student_obj,'study_course')
+        if study_course_obj is None:
+            student_dict['message'] = "No study_course object"
+            count_nosc += 1
+            student_dict['sp_count'] = count_nosc
+            break
+        level_obj = getObject(student_obj,student.level)
+        if level_obj:
+            count_level += 1
+            study_course.manage_delObjects((student.level,))
+            student_dict['message'] = "Level deleted"
+            student_dict['sp_count'] = count_level
+        count_renamed += 1
+        to_rename.append(student.id)
+        student_dict['sp_count'] = count_renamed
+        student_dict['message'] = student_dict['message'] + "renamed to BSCINP"
+        study_course_doc = study_course_obj.getContent()
+        study_course_obj.edit(mapping = {'study_course': "BSCINP"})
+        total += 1
+        s = '"%(total)d","%(sp_count)s","%(id)s","%(course)s","%(message)s",' % student_dict
+        rwrite("%s<br />\r\n" %s)
+        break
+    total += 1
+    s = '"%(total)d","%(sp_count)s","%(id)s","%(course)s","%(message)s",' % student_dict
+    rwrite("%s<br />\r\n" %s)
+for sid in to_rename:
+    students_cat.modifyRecord(id = sid,course="BSCINP")
+sum = count_ok + count_nosc + count_nolevel + count_level    
+rwrite("total=%d,sum of below=%d,<br>\r\n correct study_course=%d<br>\r\n no study_course=%d<br>\r\n no level=%d<br>\r\n with level =%d,<br />\n Done" %
+        (total,
+         sum,
+         count_ok,
+         count_nosc,
+         count_nolevel,
+         count_level)
+         )
+
+logger.info("total=%d,sum=%d,ok=%d,no study_course=%d,no level=%d,with level =%d,\n Done" %
+             (total,sum,count_ok,count_nosc,count_nolevel,count_level))
Index: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/ti_165_resolve.py
===================================================================
--- WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/ti_165_resolve.py	(revision 1669)
+++ WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/ti_165_resolve.py	(revision 1669)
@@ -0,0 +1,98 @@
+## Script (Python) "ti_151_resolve"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+resolve ticket #151
+"""
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+import logging
+#>>>>>>>>>>>>>>>><
+logger = logging.getLogger('Skins.ti_165_resolve')
+#logger.info('already done on 26.3.07 by joachim')
+#return
+#<<<<<<<<<<<<<<<<<
+request = context.REQUEST
+session = request.SESSION
+response = request.RESPONSE
+setheader = request.RESPONSE.setHeader
+students = context.portal_url.getPortalObject().campus.students
+#from string import Template
+def rwrite(s):
+    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
+    response.write("%s<br>\n\r" % s)
+def getObject(outer,object):
+    if outer.hasObject(object):
+        return getattr(outer,object)
+    return None
+
+try:
+    from Products.AdvancedQuery import Eq, Between, Le,In
+    aq_students = context.students_catalog.evalAdvancedQuery
+except:
+    evalAdvancedQuery = None
+
+students_cat = context.students_catalog
+pumeresults = context.portal_pumeresults
+de_students = students_cat(entry_mode = 'DE')
+found = 0
+not_found = 0
+for des in de_students:
+    if not des.jamb_reg_no.startswith('6'):
+        continue
+    pres = pumeresults(jamb_reg_no = des.jamb_reg_no)
+    if not pres:
+        student_obj = getObject(students,des.id)
+        if student_obj is None:
+            rwrite('%s with jamb_reg_no %s %s/%s/%s student object not found' % (des.id,
+                                                                            des.jamb_reg_no,
+                                                                            des.faculty,
+                                                                            des.department,
+                                                                            des.course,
+                                                                            ))
+            continue
+        pume_obj = getObject(student_obj,'pume')
+        if pume_obj is None:
+            rwrite('%s with jamb_reg_no %s %s/%s/%s pume object not found' % (des.id,
+                                                                            des.jamb_reg_no,
+                                                                            des.faculty,
+                                                                            des.department,
+                                                                            des.course,
+                                                                            ))
+            continue
+        pume_doc = pume_obj.getContent()
+        score = pume_doc.pume_tot_score
+        dict = {}
+        dict['student_id'] = des.id
+        dict['jamb_reg_no'] = des.jamb_reg_no
+        dict['course_code'] = des.course
+        dict['department'] = des.department
+        dict['faculty'] = des.faculty
+        dict['name'] = des.name
+        dict['score'] = score
+        dict['result_type'] = 'DE'
+        dict['sex'] = 'M'
+        if des.sex:
+            dict['sex'] = 'F'
+        s = '%(jamb_reg_no)s with student_id %(student_id)s not in pumeresults should be recreatet<br>\r\n'
+        s += 'Sex:%(sex)s,Name: %(name)s,Type:%(result_type)s<br>\n\r'
+        s += 'Studycourse: %(course_code)s,Faculty: %(faculty)s,Department: %(department)s,Score: %(score)s'
+        rwrite(s % (dict))
+            
+        not_found += 1
+        continue
+    found += 1
+    #rwrite('%s with jamb_reg_no %s found in pumeresults' % (des.id,des.jamb_reg_no))
+rwrite('%d found in pumeresults <br>%d not found in pumeresults<br>total in portal_pumeresults %d <br>' 
+        % (found,not_found,len(pumeresults())))
+    
