Add label_prefix and label_suffix columns to asset.copy_location
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 27 Aug 2010 21:11:05 +0000 (21:11 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 27 Aug 2010 21:11:05 +0000 (21:11 +0000)
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.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17363 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/040.schema.asset.sql
Open-ILS/xul/staff_client/server/admin/copy_locations.js
Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml

index eb79fa0..639018d 100644 (file)
@@ -3058,6 +3058,8 @@ SELECT  usr,
                        <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"/>
index c09d080..a3fb73d 100644 (file)
@@ -29,6 +29,8 @@ CREATE TABLE asset.copy_location (
        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)
 );
 
index 51e5da0..32d406e 100644 (file)
@@ -160,6 +160,8 @@ function clBuildRow( tbody, row, cl ) {
     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 @@ function clEdit( cl, tbody, row ) {
     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 @@ function clEditCommit( tbody, r, cl ) {
     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);
index b1f5906..2a1ff8e 100644 (file)
                         <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>
                         <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>
                                 <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>