Index: WAeUP_SRP/trunk/skins/waeup_custom/functions.js.dtml
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_custom/functions.js.dtml	(revision 1700)
+++ WAeUP_SRP/trunk/skins/waeup_custom/functions.js.dtml	(revision 1700)
@@ -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/trunk/skins/waeup_default/functions.js.dtml
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/functions.js.dtml	(revision 1699)
+++ 	(revision )
@@ -1,330 +1,0 @@
-<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/trunk/skins/waeup_student/getStudentReviewState.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudentReviewState.py	(revision 1699)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudentReviewState.py	(revision 1700)
@@ -5,5 +5,5 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=
+##parameters=student_id=None
 ##title=
 ##
@@ -17,5 +17,6 @@
 except:
     aq_portal = None
-student_id = context.getStudentId()
+if student_id is None:
+    student_id = context.getStudentId()
 query = Eq('id',student_id)
 res = aq_portal(query)
Index: WAeUP_SRP/trunk/skins/waeup_student/list_students.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/list_students.py	(revision 1699)
+++ WAeUP_SRP/trunk/skins/waeup_student/list_students.py	(revision 1700)
@@ -49,13 +49,17 @@
 newquery = Eq('portal_type','StudentApplication') & MatchRegexp('SearchableText',r'^6*')
 #newquery = MatchRegexp('SearchableText','^5*')
-new_students = aq_portal(newquery)
-new_sids = []
-for ns in new_students:
-    new_sids.append(ns.getPath().split('/')[-2])
+#new_students = aq_portal(newquery)
+#set_trace()
+#new_sids = []
+#for ns in new_students:
+#    new_sids.append(ns.getPath().split('/')[-2])
+#set_trace()
 for student in cleared:
-    if student.getId not in new_sids:
-        continue
+##    if student.getId not in new_sids:
+##        continue
     erg = scat(id=student.getId)
     if not erg:
+        continue
+    if not erg[0].jamb_reg_no.startswith('6'):
         continue
     d = context.getFormattedStudentEntry(erg[0])
Index: WAeUP_SRP/trunk/skins/waeup_utilities/readOnlinePaymentsFromLog.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_utilities/readOnlinePaymentsFromLog.py	(revision 1699)
+++ WAeUP_SRP/trunk/skins/waeup_utilities/readOnlinePaymentsFromLog.py	(revision 1700)
@@ -95,5 +95,4 @@
                                                   ))
     if payment_doc.resp_code == "" and response_code == "00":
-        pd = {}
         review_state = wftool.getInfoFor(payment_obj,'review_state',None)
         if review_state != "opened":
@@ -104,10 +103,11 @@
             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)
+        readin['resp_code'] = 'IP ' + readin['resp_code']
+        readin['resp_desc'] = 'Payment approved by logfile import, %s. ' % (DateTime.DateTime()) \
+                              + readin['resp_desc']
+        payment_doc.edit(mapping=readin)
         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))
+        logger.info('%s approves epayment for %s by logfile import' % (member,student_id))
         wftool.doActionFor(payment_obj,'close')
         approved += 1
