Index: WAeUP_SRP/trunk/skins/waeup_pins/disable_pins.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_pins/disable_pins.py	(revision 1062)
+++ WAeUP_SRP/trunk/skins/waeup_pins/disable_pins.py	(revision 1062)
@@ -0,0 +1,42 @@
+## Script (Python) "disable_pins"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=REQUEST,ids=[]
+##title=
+##
+# $Id$
+"""
+disable pins
+"""
+import DateTime
+current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
+import logging
+logger = logging.getLogger('getStudentInfo')
+
+request = REQUEST
+wftool = context.portal_workflow
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+#from Products.zdb import set_trace
+#set_trace()
+
+if not ids:
+    return
+
+pincat = context.portal_pins
+for pid in ids:
+    serial,prefix = pid.split("_")
+    res = pincat(prefix_batch=prefix,
+                 serial=int(serial))
+    if len(res) != 1:
+        continue
+    uid = res[0].pin
+    dict = {"pin": uid,
+            "student": "disabled by: %s on %s" % (member,current)
+            }
+    pincat.modifyRecord(**dict)
+    logger.info('"%s","disabled pin","%s"' % (member,uid))
+return request.RESPONSE.redirect("%s/campus/pins/search_pins" % context.portal_url())
Index: WAeUP_SRP/trunk/skins/waeup_pins/enable_pins.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_pins/enable_pins.py	(revision 1062)
+++ WAeUP_SRP/trunk/skins/waeup_pins/enable_pins.py	(revision 1062)
@@ -0,0 +1,45 @@
+## Script (Python) "enable_pins"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=REQUEST,ids=[]
+##title=
+##
+# $Id$
+"""
+enable pins
+"""
+import DateTime
+current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
+import logging
+logger = logging.getLogger('getStudentInfo')
+
+request = REQUEST
+wftool = context.portal_workflow
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+#from Products.zdb import set_trace
+#set_trace()
+
+if not ids:
+    return
+
+pincat = context.portal_pins
+for pid in ids:
+    serial,prefix = pid.split("_")
+    res = pincat(prefix_batch=prefix,
+                 serial=int(serial))
+    if len(res) != 1:
+        continue
+    rec = res[0]
+    uid = rec.pin
+    if not rec.student.startswith('disabled'):
+        continue
+    dict = {"pin": uid,
+            "student": ""
+            }
+    pincat.modifyRecord(**dict)
+    logger.info('"%s","enabled pin","%s"' % (member,pid))
+return request.RESPONSE.redirect("%s/campus/pins/search_pins" % context.portal_url())
Index: WAeUP_SRP/trunk/skins/waeup_pins/pins_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_pins/pins_view.pt	(revision 1061)
+++ WAeUP_SRP/trunk/skins/waeup_pins/pins_view.pt	(revision 1062)
@@ -1,3 +1,7 @@
-<metal:html>
+<metal:html tal:define="info options/info;
+                        rendered options/rendered;
+                        mtool here/portal_membership;
+                        member mtool/getAuthenticatedMember;
+                        ">
   <metal:body use-macro="here/main_template/macros/master">
     <metal:main fill-slot="main">
@@ -5,13 +9,62 @@
       </span>  
       <span tal:condition="not:isAnon">
+        <span tal:replace="structure rendered" />
+      <form action="." method="post">
+        <table>
+          <tr tal:repeat="pin info/used">
+            <td>
+              <input type="checkbox" name="ids:list" value="" id="" class="noborder"
+                     tal:define="id string:${pin/serial}_${pin/prefix}"
+                     tal:attributes="value id;
+                     id python:'cb_' + id;"
+                     />
+            </td>
+            <td width="50px"> <span tal:content="pin/serial" />: </td>
+            <td tal:content="pin/pin" />
+            <td tal:content="pin/student_id" />
+            <td tal:condition="pin/student_url">
+              <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>
+        </table>
+        <table width="100%" cellspacing="0" cellpadding="2"
+               summary="contents of the folder"
+               class="folderButtons">
+          <tr>
+            <td align="left" valign="top" rowspan="3"></td>
+            <td align="left" valign="top">
+              <input type="submit" name="disable_pins:method" 
+                     value="disable pins"
+                     class="destructive"
+                     tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                     (cpsmcat('really disable ?'), )" 
+                     />
+            </td>
+            <td align="left" valign="top">
+              <input type="submit" name="enable_pins:method" 
+                     value="enable pins"
+                     class="destructive"
+                     tal:attributes="onclick python:'return window.confirm(\'%s\')' %
+                     (cpsmcat('really enable ?'), )" 
+                     />
+            </td>
+          </tr>
+        </table>
+      </form>
         <h3>PIN Batches</h3>
         <br />
-        <table tal:define="batches python: context.portal_catalog(portal_type='ScratchCardBatch')">
-          <tr tal:repeat="batch batches">
-            <td><a href="batch" 
-                   tal:attributes="href string:${batch/getPath}/search_pins"
-                   tal:content="batch/Title"></a></td>    
-          </tr>
-        </table>
+      <form action="." method="get">
+        <select class="form-element" name=":action" 
+                tal:attributes="onChange string:location.href='${context/absolute_url}/'+this.options[this.selectedIndex].value"
+                >
+          <option value="--">Goto Batch ...</option>
+          <option tal:repeat="batch context/objectIds"
+                  tal:attributes="value batch"
+                  tal:content="batch">
+          </option>
+        </select>
+      </form>
       </span>
     </metal:main>
Index: WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py	(revision 1061)
+++ WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py	(revision 1062)
@@ -33,26 +33,37 @@
                       )
 info = {}
-info['batch_doc'] = context.getContent() 
-info['unused'] = info['batch_doc'].getUnusedPins()
 info['used'] = []
-info['nr_used'] = info['batch_doc'].getNumberOfUsedPins()
-
+if context.portal_type == "ScratchCardBatch":
+    info['batch_doc'] = context.getContent() 
+    info['unused'] = info['batch_doc'].getUnusedPins()
+    info['nr_used'] = info['batch_doc'].getNumberOfUsedPins()
+    view = context.batch_view
+elif context.portal_type == "ScratchCardBatchesFolder":
+    view = context.pins_view
 if psm == '':
-    return context.batch_view(rendered = rend,
-                             psm = psm,
-                             #psm = "%s, %s" % (psm,ds),
-                             info = info,
-                             allowed = True,
-                             )
-#set_trace()
+    return view(rendered = rend,
+                psm = psm,
+                #psm = "%s, %s" % (psm,ds),
+                info = info,
+                allowed = True,
+                )
 what = ds.get('search_mode')
 term = ds.get('search_string')
+pincat = context.portal_pins
 if term != "":
     if what == 'student' :
-        items_1 = context.portal_pins(student = term.upper())
-        items_2 = context.portal_pins(student = term.lower())
+        items_1 = pincat(student = term.upper())
+        items_2 = pincat(student = term.lower())
         items = items_1 + items_2
     elif what == 'pin':
-        items = context.portal_pins(pin = term.upper())
+        items = pincat(pin = term.upper())
+    elif what == 'serial':
+        try:
+            snr = int(term.strip())
+            items = pincat(serial = snr)
+        except ValueError:
+            psm = "invalid number"
+            items = []
+            pass
     else:
         items = []
@@ -64,6 +75,10 @@
         sno = i['student']
         item['student'] = sno
+        item['prefix'] = i.prefix_batch
         item['serial'] = i.serial
-        item['pin'] = i.pin
+        if len(sno) > 0:
+            item['pin'] = i.pin
+        else:
+            item['pin'] = "%s%s****%s" % (i.prefix_batch,i.pin[-10:-7],i.pin[-3:])
         if i.pin in pins:
             continue
@@ -73,5 +88,8 @@
             res = context.students_catalog(jamb_reg_no=sno.upper())
             if len(res) > 0:
-                item['student_url'] = "%s/campus/students/%s" % (context.portal_url(),res[0].id)
+                if sno.startswith('disabled'):
+                    item['student_url'] = None
+                else:
+                    item['student_url'] = "%s/campus/students/%s" % (context.portal_url(),res[0].id)
                 item['student_id'] = res[0].id
             else:
@@ -79,6 +97,9 @@
                 item['student_id'] = ''
         elif sno:
-            item['student_url'] = '%s/campus/students/%s' % (students_url,item['student'])
-            item['student_id'] = student
+            if sno.startswith('disabled'):
+                item['student_url'] = None
+            else:
+                item['student_url'] = '%s/campus/students/%s' % (students_url,item['student'])
+            item['student_id'] = item['student']
         else:
             item['student_url'] = ''
@@ -88,8 +109,8 @@
     info['used'] = l
 
-return context.batch_view(rendered = rend,
-                             psm = psm,
-                             #psm = "%s, %s" % (psm,ds),
-                             info = info,
-                             allowed = True,
-                             )
+return view(rendered = rend,
+            psm = psm,
+            #psm = "%s, %s" % (psm,ds),
+            info = info,
+            allowed = True,
+            )
