[open-ils-commits] r17363 - in trunk/Open-ILS: examples src/sql/Pg xul/staff_client/server/admin (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Aug 27 17:11:11 EDT 2010


Author: dbs
Date: 2010-08-27 17:11:05 -0400 (Fri, 27 Aug 2010)
New Revision: 17363

Modified:
   trunk/Open-ILS/examples/fm_IDL.xml
   trunk/Open-ILS/src/sql/Pg/040.schema.asset.sql
   trunk/Open-ILS/xul/staff_client/server/admin/copy_locations.js
   trunk/Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml
Log:
Add label_prefix and label_suffix columns to asset.copy_location

These columns will be used to (optionally) set label prefixes and suffixes
when printing spine labels for copies at a given copy location.

The copy location editor has been taught to be aware of these new columns,
but right now a NULL prefix or suffix will be turned into an empty string
once the copy location has been edited. That might not be a big deal, but
I'm a foolish hobgoblin and like consistency.


Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml	2010-08-27 18:14:46 UTC (rev 17362)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2010-08-27 21:11:05 UTC (rev 17363)
@@ -3058,6 +3058,8 @@
 			<field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
 			<field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
+			<field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
+			<field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
 		</fields>
 		<links>
 			<link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>

Modified: trunk/Open-ILS/src/sql/Pg/040.schema.asset.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/040.schema.asset.sql	2010-08-27 18:14:46 UTC (rev 17362)
+++ trunk/Open-ILS/src/sql/Pg/040.schema.asset.sql	2010-08-27 21:11:05 UTC (rev 17363)
@@ -29,6 +29,8 @@
 	hold_verify	BOOL	NOT NULL DEFAULT FALSE,
 	opac_visible	BOOL	NOT NULL DEFAULT TRUE,
 	circulate	BOOL	NOT NULL DEFAULT TRUE,
+	label_prefix	TEXT,
+	label_suffix	TEXT,
 	CONSTRAINT acl_name_once_per_lib UNIQUE (name, owning_lib)
 );
 

Modified: trunk/Open-ILS/xul/staff_client/server/admin/copy_locations.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/copy_locations.js	2010-08-27 18:14:46 UTC (rev 17362)
+++ trunk/Open-ILS/xul/staff_client/server/admin/copy_locations.js	2010-08-27 21:11:05 UTC (rev 17363)
@@ -160,6 +160,8 @@
     appendClear($n( row, 'cl_hold_verify'), (isTrue(cl.hold_verify())) ? _TRUE.cloneNode(true) : _FALSE.cloneNode(true) );
     appendClear($n( row, 'cl_visible'), (isTrue(cl.opac_visible())) ? _TRUE.cloneNode(true) : _FALSE.cloneNode(true) );
     appendClear($n( row, 'cl_circulate'), (isTrue(cl.circulate())) ? _TRUE.cloneNode(true) : _FALSE.cloneNode(true) );
+    $n( row, 'cl_label_prefix').appendChild(text(cl.label_prefix()));
+    $n( row, 'cl_label_suffix').appendChild(text(cl.label_suffix()));
 
     var edit = $n( row, 'cl_edit');
     edit.onclick = function() { clEdit( cl, tbody, row ); };
@@ -201,6 +203,22 @@
     if(isTrue(cl.hold_verify())) arr[6].checked = true;
     else arr[7].checked = true;
 
+    var label_prefix = $n(r, 'cl_edit_label_prefix');
+    if (cl.label_prefix()) {
+        label_prefix.setAttribute('size', cl.label_prefix().length + 3);
+    } else {
+        label_prefix.setAttribute('size', 3);
+    }
+    label_prefix.value = cl.label_prefix();
+
+    var label_suffix = $n(r, 'cl_edit_label_suffix');
+    if (cl.label_suffix()) {
+        label_suffix.setAttribute('size', cl.label_suffix().length + 3);
+    } else {
+        label_suffix.setAttribute('size', 3);
+    }
+    label_suffix.value = cl.label_suffix();
+
     $n(r, 'cl_edit_cancel').onclick = function(){cleanTbody(tbody,'edit');}
     $n(r, 'cl_edit_commit').onclick = function(){clEditCommit( tbody, r, cl ); }
 
@@ -234,6 +252,8 @@
     if(arr[6].checked) cl.hold_verify(1);
     else cl.hold_verify(0);
     cl.name($n(r, 'cl_edit_name').value);
+    cl.label_prefix($n(r, 'cl_edit_label_prefix').value);
+    cl.label_suffix($n(r, 'cl_edit_label_suffix').value);
 
     var req = new Request( UPDATE_CL, SESSION, cl );
     req.send(true);

Modified: trunk/Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml	2010-08-27 18:14:46 UTC (rev 17362)
+++ trunk/Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml	2010-08-27 21:11:05 UTC (rev 17363)
@@ -116,6 +116,8 @@
                         <td width=''>&staff.server.admin.copy_locations.editor.hold_verify;</td>
                         <td width=''>&staff.server.admin.copy_locations.editor.opac_visible;</td>
                         <td width=''>&staff.server.admin.copy_locations.editor.circulate;</td>
+                        <td width=''>Label prefix</td>
+                        <td width=''>Label suffix</td>
                         <td width=''>&staff.server.admin.copy_locations.editor.edit;</td>
                         <td width=''>&staff.server.admin.copy_locations.editor.delete;</td>
                     </tr>
@@ -131,6 +133,8 @@
                         <td name='cl_hold_verify'> </td>
                         <td name='cl_visible'> </td>
                         <td name='cl_circulate'> </td>
+                        <td name='cl_label_prefix'> </td>
+                        <td name='cl_label_suffix'> </td>
                         <td><input type='submit' value='Edit' name='cl_edit' disabled='disabled'> </input></td>
                         <td><input type='submit' value='Delete' name='cl_delete' disabled='disabled'> </input></td>
                     </tr>
@@ -194,6 +198,8 @@
                                 <input type='radio' name='cl_edit_circulate'/>
                             </span>
                         </td>
+                        <td><input name='cl_edit_label_prefix' type='text'> </input></td>
+                        <td><input name='cl_edit_label_suffix' type='text'> </input></td>
                         <td><input type='submit' name='cl_edit_commit' value='&staff.server.admin.copy_locations.submit;'/></td>
                         <td><input type='submit' name='cl_edit_cancel' value='&staff.server.admin.copy_locations.cancel;'/></td>
                     </tr>



More information about the open-ils-commits mailing list