Changeset 1062
- Timestamp:
- 14 Dec 2006, 20:16:23 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/PatchCatalogToolXMLAdapter.py
r559 r1062 24 24 na = node.attributes.items() 25 25 not_found = True 26 if na[0][1] == "CMF Catalog": 26 new_indexes = [] 27 new_columns = [] 28 if na[0][1] in ("WAeUP Table"): 27 29 not_found = False 30 elif na[0][1] == "CMF Catalog": 28 31 #print na[1][1] 32 not_found = False 29 33 for ch in node._get_childNodes(): 30 34 if ch.nodeName in ('index',): … … 34 38 if iname in inds.keys() and inds[iname] == itype: 35 39 continue 40 new_indexes.append(iname) 36 41 elif ch.nodeName in ('column',): 37 42 cha = ch.attributes.items() … … 39 44 if iname in columns: 40 45 continue 46 new_columns.append(iname) 41 47 else: 42 48 continue -
WAeUP_SRP/trunk/WAeUPTables.py
r1030 r1062 78 78 for field in self.schema() + self.indexes(): 79 79 record_data[field] = getattr(record, field) 80 record_data = {} 81 for field in self.schema() + self.indexes(): 82 record_data[field] = getattr(record, field) 80 83 # Add the updated data: 81 84 record_data.update(data) 82 85 self.catalog_object(dict2ob(record_data), uid) 83 86 87 def reindexIndex(self, name, REQUEST,pghandler=None): 88 if isinstance(name, str): 89 name = (name,) 90 paths = self._catalog.uids.items() 91 i = 0 92 #import pdb;pdb.set_trace() 93 for p,rid in paths: 94 i += 1 95 metadata = self.getMetadataForRID(rid) 96 record_data = {} 97 for field in name: 98 record_data[field] = metadata.get(field) 99 uid = metadata.get(self.key) 100 self.catalog_object(dict2ob(record_data), uid, idxs=name, 101 update_metadata=0) 102 84 103 security.declareProtected(ModifyPortalContent,"exportAllRecords") 85 104 def exportAllRecords(self): -
WAeUP_SRP/trunk/profiles/default/accommodation.xml
r805 r1062 1 1 <?xml version="1.0"?> 2 <object name="portal_catalog" meta_type=" CMF Catalog">2 <object name="portal_catalog" meta_type="WAeUP Table"> 3 3 <column value="bed"/> 4 4 <column value="bed_type"/> -
WAeUP_SRP/trunk/profiles/default/pins.xml
r1058 r1062 1 1 <?xml version="1.0"?> 2 <object name="portal_pins" meta_type=" CMF Catalog">2 <object name="portal_pins" meta_type="WAeUP Table"> 3 3 <column value="pin"/> 4 4 <column value="student"/> -
WAeUP_SRP/trunk/profiles/default/pumeresults.xml
r966 r1062 1 1 <?xml version="1.0"?> 2 <object name="portal_catalog" meta_type=" CMF Catalog">2 <object name="portal_catalog" meta_type="WAeUP Table"> 3 3 <column value="jamb_reg_no"/> 4 4 <column value="name"/> -
WAeUP_SRP/trunk/profiles/default/students_catalog.xml
r971 r1062 1 1 <?xml version="1.0"?> 2 <object name="portal_catalog" meta_type=" CMF Catalog">2 <object name="portal_catalog" meta_type="WAeUP Table"> 3 3 <column value="id"/> 4 4 <column value="jamb_reg_no"/> -
WAeUP_SRP/trunk/profiles/default/types/ScratchCardBatchesFolder.xml
r951 r1062 25 25 <property name="storage_methods"/> 26 26 <property name="cps_is_portlet">False</property> 27 <alias from="(Default)" to=" pins_view"/>27 <alias from="(Default)" to="search_pins"/> 28 28 <alias from="create_do" to=""/> 29 29 <alias from="created" to=""/> 30 <alias from="view" to=" pins_view"/>30 <alias from="view" to="search_pins"/> 31 31 <action title="View" action_id="view" category="object" 32 condition_expr="" url_expr="string:${object_url}/ pins_view"32 condition_expr="" url_expr="string:${object_url}/search_pins" 33 33 visible="True"> 34 34 <permission value="View"/> -
WAeUP_SRP/trunk/skins/waeup_pins/pins_view.pt
r1002 r1062 1 <metal:html> 1 <metal:html tal:define="info options/info; 2 rendered options/rendered; 3 mtool here/portal_membership; 4 member mtool/getAuthenticatedMember; 5 "> 2 6 <metal:body use-macro="here/main_template/macros/master"> 3 7 <metal:main fill-slot="main"> … … 5 9 </span> 6 10 <span tal:condition="not:isAnon"> 11 <span tal:replace="structure rendered" /> 12 <form action="." method="post"> 13 <table> 14 <tr tal:repeat="pin info/used"> 15 <td> 16 <input type="checkbox" name="ids:list" value="" id="" class="noborder" 17 tal:define="id string:${pin/serial}_${pin/prefix}" 18 tal:attributes="value id; 19 id python:'cb_' + id;" 20 /> 21 </td> 22 <td width="50px"> <span tal:content="pin/serial" />: </td> 23 <td tal:content="pin/pin" /> 24 <td tal:content="pin/student_id" /> 25 <td tal:condition="pin/student_url"> 26 <a tal:condition="pin/student_url" href="" tal:content="pin/student" 27 tal:attributes="href pin/student_url"></a> 28 <span tal:condition="not: pin/student_url" tal:content="pin/student" /> 29 </td> 30 </tr> 31 </table> 32 <table width="100%" cellspacing="0" cellpadding="2" 33 summary="contents of the folder" 34 class="folderButtons"> 35 <tr> 36 <td align="left" valign="top" rowspan="3"></td> 37 <td align="left" valign="top"> 38 <input type="submit" name="disable_pins:method" 39 value="disable pins" 40 class="destructive" 41 tal:attributes="onclick python:'return window.confirm(\'%s\')' % 42 (cpsmcat('really disable ?'), )" 43 /> 44 </td> 45 <td align="left" valign="top"> 46 <input type="submit" name="enable_pins:method" 47 value="enable pins" 48 class="destructive" 49 tal:attributes="onclick python:'return window.confirm(\'%s\')' % 50 (cpsmcat('really enable ?'), )" 51 /> 52 </td> 53 </tr> 54 </table> 55 </form> 7 56 <h3>PIN Batches</h3> 8 57 <br /> 9 <table tal:define="batches python: context.portal_catalog(portal_type='ScratchCardBatch')"> 10 <tr tal:repeat="batch batches"> 11 <td><a href="batch" 12 tal:attributes="href string:${batch/getPath}/search_pins" 13 tal:content="batch/Title"></a></td> 14 </tr> 15 </table> 58 <form action="." method="get"> 59 <select class="form-element" name=":action" 60 tal:attributes="onChange string:location.href='${context/absolute_url}/'+this.options[this.selectedIndex].value" 61 > 62 <option value="--">Goto Batch ...</option> 63 <option tal:repeat="batch context/objectIds" 64 tal:attributes="value batch" 65 tal:content="batch"> 66 </option> 67 </select> 68 </form> 16 69 </span> 17 70 </metal:main> -
WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py
r1012 r1062 33 33 ) 34 34 info = {} 35 info['batch_doc'] = context.getContent()36 info['unused'] = info['batch_doc'].getUnusedPins()37 35 info['used'] = [] 38 info['nr_used'] = info['batch_doc'].getNumberOfUsedPins() 39 36 if context.portal_type == "ScratchCardBatch": 37 info['batch_doc'] = context.getContent() 38 info['unused'] = info['batch_doc'].getUnusedPins() 39 info['nr_used'] = info['batch_doc'].getNumberOfUsedPins() 40 view = context.batch_view 41 elif context.portal_type == "ScratchCardBatchesFolder": 42 view = context.pins_view 40 43 if psm == '': 41 return context.batch_view(rendered = rend, 42 psm = psm, 43 #psm = "%s, %s" % (psm,ds), 44 info = info, 45 allowed = True, 46 ) 47 #set_trace() 44 return view(rendered = rend, 45 psm = psm, 46 #psm = "%s, %s" % (psm,ds), 47 info = info, 48 allowed = True, 49 ) 48 50 what = ds.get('search_mode') 49 51 term = ds.get('search_string') 52 pincat = context.portal_pins 50 53 if term != "": 51 54 if what == 'student' : 52 items_1 = context.portal_pins(student = term.upper())53 items_2 = context.portal_pins(student = term.lower())55 items_1 = pincat(student = term.upper()) 56 items_2 = pincat(student = term.lower()) 54 57 items = items_1 + items_2 55 58 elif what == 'pin': 56 items = context.portal_pins(pin = term.upper()) 59 items = pincat(pin = term.upper()) 60 elif what == 'serial': 61 try: 62 snr = int(term.strip()) 63 items = pincat(serial = snr) 64 except ValueError: 65 psm = "invalid number" 66 items = [] 67 pass 57 68 else: 58 69 items = [] … … 64 75 sno = i['student'] 65 76 item['student'] = sno 77 item['prefix'] = i.prefix_batch 66 78 item['serial'] = i.serial 67 item['pin'] = i.pin 79 if len(sno) > 0: 80 item['pin'] = i.pin 81 else: 82 item['pin'] = "%s%s****%s" % (i.prefix_batch,i.pin[-10:-7],i.pin[-3:]) 68 83 if i.pin in pins: 69 84 continue … … 73 88 res = context.students_catalog(jamb_reg_no=sno.upper()) 74 89 if len(res) > 0: 75 item['student_url'] = "%s/campus/students/%s" % (context.portal_url(),res[0].id) 90 if sno.startswith('disabled'): 91 item['student_url'] = None 92 else: 93 item['student_url'] = "%s/campus/students/%s" % (context.portal_url(),res[0].id) 76 94 item['student_id'] = res[0].id 77 95 else: … … 79 97 item['student_id'] = '' 80 98 elif sno: 81 item['student_url'] = '%s/campus/students/%s' % (students_url,item['student']) 82 item['student_id'] = student 99 if sno.startswith('disabled'): 100 item['student_url'] = None 101 else: 102 item['student_url'] = '%s/campus/students/%s' % (students_url,item['student']) 103 item['student_id'] = item['student'] 83 104 else: 84 105 item['student_url'] = '' … … 88 109 info['used'] = l 89 110 90 return context.batch_view(rendered = rend,91 92 93 94 95 111 return view(rendered = rend, 112 psm = psm, 113 #psm = "%s, %s" % (psm,ds), 114 info = info, 115 allowed = True, 116 )
Note: See TracChangeset for help on using the changeset viewer.