Index: /WAeUP_SRP/trunk/Students.py
===================================================================
--- /WAeUP_SRP/trunk/Students.py	(revision 707)
+++ /WAeUP_SRP/trunk/Students.py	(revision 708)
@@ -1,4 +1,5 @@
 #-*- mode: python; mode: fold -*-
 # $Id$
+from string import Template
 from Globals import InitializeClass
 from AccessControl import ClassSecurityInfo
@@ -50,6 +51,6 @@
     def loadFullTimeStudentsFromCSV(self):
         """load Fulltime Studentdata from CSV values"""
-        #return
         import transaction
+        import random
         tr_count = 0
         name = 'short_full_time'
@@ -60,4 +61,7 @@
         logger = logging.getLogger('%s_import' % name)
         logger.info('Start loading from %s.csv' % name)
+        pwlist  = []
+        pwlist.append('"student_id","firstname","middlename","lastname","matric_no","jamb_reg_no","access_code"')
+        pwl_template = Template('"$student_id","$firstname","$middlename","$lastname","$matric_no","$jamb_reg_no","$access_code"')
         students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
         try:
@@ -103,5 +107,5 @@
             if matric_no not in matrics:
                 matrics.append(matric_no)
-                sid = generateStudentId()
+                sid = generateStudentId(student.get('Lastname')[0])
                 #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
                 logger.info('%(tr_count)s: Creating Student with ID %(sid)s Matric_no %(matric_no)s ' % vars())
@@ -115,8 +119,10 @@
                 logger.info('%(tr_count)s: Creating Student with ID %(sid)s Matric_no %(matric_no)s ' % vars())
                 s = getattr(self,sid)
+                access_code = "%d" % random.randint(1000000000,9999999999)
                 self.portal_registration.addMember(sid,
-                                                   'uNsEt' ,
+                                                   access_code ,
                                                    roles=('Member',
                                                           'Student',))
+                pwl_dict = {'student_id': sid,'access_code':access_code}
                 s.invokeFactory('StudentApplication','application')
                 da = {'Title': 'Application Data'}
@@ -124,5 +130,5 @@
                 da['jamb_reg_no'] = student.get('EntryRegNo')
                 sp = s.personal
-                d = {'Title': 'Personal Data'}
+                dp = {'Title': 'Personal Data'}
                 s.invokeFactory('StudentClearance','clearance')
                 sc = s.clearance
@@ -133,15 +139,15 @@
                 dc['nationality'] = student.get('Nationality')
                 dc['email'] = student.get('Emailaddress')
-                d['firstname'] = student.get('FirstName')
-                d['middlename'] = student.get('MiddleName')
-                d['lastname'] = student.get('Lastname')
-                d['former_surname'] = student.get('FormerSurname')
-                d['sex'] = student.get('Sex') == 'F'
-                d['perm_address'] = student.get('PermanentAddress')
-                d['perm_city'] = student.get('PermanentAddressCity')
-                d['campus_address'] = student.get('CampusAddress')
-                d['phone'] = student.get('PhoneNumber')
+                dp['firstname'] = student.get('FirstName')
+                dp['middlename'] = student.get('MiddleName')
+                dp['lastname'] = student.get('Lastname')
+                dp['former_surname'] = student.get('FormerSurname')
+                dp['sex'] = student.get('Sex') == 'F'
+                dp['perm_address'] = student.get('PermanentAddress')
+                dp['perm_city'] = student.get('PermanentAddressCity')
+                dp['campus_address'] = student.get('CampusAddress')
+                dp['phone'] = student.get('PhoneNumber')
                 s.application.getContent().edit(mapping=da)
-                sp.getContent().edit(mapping=d)
+                sp.getContent().edit(mapping=dp)
                 sc.getContent().edit(mapping=dc)
                 #
@@ -150,15 +156,12 @@
                 s.invokeFactory('StudentStudyCourse','study_course')
                 sc = s.study_course
-                d = {}
-                #d['matricel_no'] = student.get('MatricNo')
-                #d['entry_reg_no'] = student.get('EntryRegNo')
-                #d['faculty'] = student.get('Faculty')
-                #d['department'] = student.get('Dept')
-                d['study_course'] = certcode
+                dsc = {}
+                dsc['study_course'] = certcode
                 css = student.get('CurrentSession') or '2004-2005'
                 cs = int(css.split('-')[0]) - 2000
                 cl = int(student.get('StudentLevel'))/100
-                d['entry_session'] = "200%s" % (cs - cl)
-                sc.getContent().edit(mapping=d)
+                dsc['entry_session'] = "200%s" % (cs - cl)
+                dsc['clr_ac_pin'] = access_code
+                sc.getContent().edit(mapping=dsc)
                 #
                 # Level
@@ -175,10 +178,10 @@
                         logger.info('Level %(level)s not in %(certcode)s' % vars())
                     l.getContent().edit(mapping={'Title': "Level %s" % level})
-                    l.invokeFactory('StudentSemester','first')
-                    l.invokeFactory('StudentSemester','second')
-                    first_s = getattr(l,'first')
-                    first_s.getContent().edit(mapping={'Title': 'First Semester'})
-                    second_s = getattr(l,'second')
-                    second_s.getContent().edit(mapping={'Title': 'Second Semester'})
+##                    l.invokeFactory('StudentSemester','first')
+##                    l.invokeFactory('StudentSemester','second')
+##                    first_s = getattr(l,'first')
+##                    first_s.getContent().edit(mapping={'Title': 'First Semester'})
+##                    second_s = getattr(l,'second')
+##                    second_s.getContent().edit(mapping={'Title': 'Second Semester'})
             else:
                 em = 'Student with ID %(MatricNo)s %(fullname)s already exists\n' % student
@@ -192,4 +195,8 @@
                 tr_count = 0
             tr_count += 1
+            pwl_dict.update(dc)
+            pwl_dict.update(da)
+            pwl_dict.update(dp)
+            pwlist.append(pwl_template.substitute(pwl_dict))
         return self.REQUEST.RESPONSE.redirect("%s" % self.REQUEST.get('URL1'))
     ###)
Index: /WAeUP_SRP/trunk/skins/waeup_pins/batch_view.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_pins/batch_view.pt	(revision 707)
+++ /WAeUP_SRP/trunk/skins/waeup_pins/batch_view.pt	(revision 708)
@@ -35,6 +35,7 @@
             <td tal:content="pin/pin" />
             <td>
-              <a href="" tal:content="pin/student"
+              <a tal:condition="pin/student_url" href="" tal:content="pin/student"
                  tal:attributes="href pin/student_url"></a>
+              <span tal:condition="not: pin/student_url" tal:content="pin/student" />
             </td>
           </tr>
Index: /WAeUP_SRP/trunk/skins/waeup_pins/getBatchInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_pins/getBatchInfo.py	(revision 707)
+++ /WAeUP_SRP/trunk/skins/waeup_pins/getBatchInfo.py	(revision 708)
@@ -31,8 +31,9 @@
     if bd.prefix == "APP":
         jno = item['student']
-        item['student_url'] = "%s/%s" % (context.portal_url(),
-                                         context.portal_catalog(SearchableText=jno,
-                                                                portal_type='StudentApplication')[0].relative_path
-                                        )                        
+        res = context.portal_catalog(SearchableText=jno,portal_type='StudentApplication')
+        if len(res) == 1:
+            item['student_url'] = "%s/%s" % (context.portal_url(),res[0].relative_path)
+        else:
+            item['student_url'] == None
     else:
         item['student_url'] = '%s/%s' % (students_url,item['student'])
