added hold-verify flag to copy editor. while i was in there, added checkmark/x...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 10 Oct 2008 17:06:54 +0000 (17:06 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 10 Oct 2008 17:06:54 +0000 (17:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10817 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/admin/copy_locations.js
Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml

index a83acb2..b236c9d 100644 (file)
@@ -6,6 +6,8 @@ var DELETE_CL = 'open-ils.circ:open-ils.circ.copy_location.delete';
 
 var YES;
 var NO;
+var _TRUE;
+var _FALSE;
 var locationSet;
 var focusOrg;
 
@@ -23,6 +25,8 @@ function clEditorInit() {
        $('user').appendChild(text(USER.usrname()));
        YES = $('yes').innerHTML;
        NO = $('no').innerHTML;
+    _TRUE = $('true');
+    _FALSE = $('false');
     locationSet = [];
 
        setTimeout( 
@@ -78,8 +82,8 @@ function clBuildNew() {
         return;
        var selector = $('cl_new_owner');
        var fselector = $('cl_org_filter');
-       buildMergedOrgSel(selector, org_list, 0);
-       buildMergedOrgSel(fselector, org_list, 0);
+       buildMergedOrgSel(selector, org_list, 0, 'shortname');
+       buildMergedOrgSel(fselector, org_list, 0, 'shortname');
     var org = findOrgUnit(org_list[0]);
     if(org_list.length > 1 || (org.children() &&  org.children()[0])) {
                selector.disabled = false;
@@ -107,6 +111,7 @@ function clCreateNew() {
        cl.name( $('cl_new_name').value );
        cl.owning_lib( getSelectorVal( $('cl_new_owner')));
        cl.holdable( ($('cl_new_hold_yes').checked) ? 1 : 0 );
+       cl.hold_verify( ($('cl_new_hold_verify_yes').checked) ? 1 : 0 );
        cl.opac_visible( ($('cl_new_vis_yes').checked) ? 1 : 0 );
        cl.circulate( ($('cl_new_circulate_yes').checked) ? 1 : 0 );
 
@@ -149,10 +154,12 @@ function clDraw() {
 
 function clBuildRow( tbody, row, cl ) {
        $n( row, 'cl_name').appendChild(text(cl.name()));
-       $n( row, 'cl_owner').appendChild(text(findOrgUnit(cl.owning_lib()).name()));
-       $n( row, 'cl_holdable').appendChild(text( (cl.holdable()) ? YES : NO ) );
-       $n( row, 'cl_visible').appendChild(text( (cl.opac_visible()) ? YES : NO ) );
-       $n( row, 'cl_circulate').appendChild(text( (cl.circulate()) ? YES : NO ) );
+       $n( row, 'cl_owner').appendChild(text(findOrgUnit(cl.owning_lib()).shortname()));
+
+       appendClear($n( row, 'cl_holdable'), (isTrue(cl.holdable())) ? _TRUE.cloneNode(true) : _FALSE.cloneNode(true) );
+       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) );
 
        var edit = $n( row, 'cl_edit');
        edit.onclick = function() { clEdit( cl, tbody, row ); };
@@ -173,15 +180,17 @@ function clEdit( cl, tbody, row ) {
        name.setAttribute('size', cl.name().length + 3);
        name.value = cl.name();
 
-       $n(r, 'cl_edit_owner').appendChild(text(findOrgUnit(cl.owning_lib()).name()));
+       $n(r, 'cl_edit_owner').appendChild(text(findOrgUnit(cl.owning_lib()).shortname()));
 
        var arr = _clOptions(r);
-       if(cl.holdable()) arr[0].checked = true;
+       if(isTrue(cl.holdable())) arr[0].checked = true;
        else arr[1].checked = true;
-       if(cl.opac_visible()) arr[2].checked = true;
+       if(isTrue(cl.opac_visible())) arr[2].checked = true;
        else arr[3].checked = true;
-       if(cl.circulate()) arr[4].checked = true;
+       if(isTrue(cl.circulate())) arr[4].checked = true;
        else arr[5].checked = true;
+       if(isTrue(cl.hold_verify())) arr[6].checked = true;
+       else arr[7].checked = true;
 
        $n(r, 'cl_edit_cancel').onclick = function(){cleanTbody(tbody,'edit');}
        $n(r, 'cl_edit_commit').onclick = function(){clEditCommit( tbody, r, cl ); }
@@ -199,6 +208,8 @@ function _clOptions(r) {
        arr[3] = $n( $n(r,'cl_edit_visible_no'), 'cl_edit_visible');
        arr[4] = $n( $n(r,'cl_edit_circulate_yes'), 'cl_edit_circulate');
        arr[5] = $n( $n(r,'cl_edit_circulate_no'), 'cl_edit_circulate');
+       arr[6] = $n( $n(r,'cl_edit_hold_verify_yes'), 'cl_edit_hold_verify');
+       arr[7] = $n( $n(r,'cl_edit_hold_verify_no'), 'cl_edit_hold_verify');
        return arr;
 }
 
@@ -211,6 +222,8 @@ function clEditCommit( tbody, r, cl ) {
        else cl.opac_visible(0);
        if(arr[4].checked) cl.circulate(1);
        else cl.circulate(0);
+       if(arr[6].checked) cl.hold_verify(1);
+       else cl.hold_verify(0);
        cl.name($n(r, 'cl_edit_name').value);
 
        var req = new Request( UPDATE_CL, SESSION, cl );
index 94ace5b..66a9e51 100644 (file)
                                                </td>
                                        </tr>
                                        <tr>
+                                               <td>&staff.server.admin.copy_locations.editor.hold_verify.label;</td>
+                                               <td>
+                                                       <span>&staff.server.admin.copy_locations.editor.yes;</span>
+                                                       <input type='radio' name='cl_new_hold' id='cl_new_hold_verify_yes'/>
+                                                       <span>&staff.server.admin.copy_locations.editor.no;</span>
+                                                       <input type='radio' name='cl_new_hold_verify'  
+                                                               id='cl_new_hold_verify_no' checked='checked'> </input>
+                                               </td>
                                                <td>&staff.server.admin.copy_locations.editor.library;</td>
-                                               <td colspan='2' >
+                                               <td>
                                                        <select id='cl_new_owner' disabled='disabled' style='width:auto;'> </select>
                                                </td>
-                                               <td><input id='sc_new_submit' type='submit' value='Create' disabled='disabled'/></td>
                                        </tr>
+                    <tr>
+                                               <td colspan='4'><input id='sc_new_submit' type='submit' value='Create' disabled='disabled'/></td>
+                    </tr>
                                </tbody>
                        </table>
 
                        <table class='data_grid data_grid_center' style='width: 95%'>
                                <thead>
                                        <tr>
-                                               <td width='15%'>&staff.server.admin.copy_locations.editor.name;</td>
-                                               <td width='20%'>&staff.server.admin.copy_locations.editor.library;</td>
-                                               <td width='15%'>
-                                                       <span>&staff.server.admin.copy_locations.editor.holdable;</span>
-                                                       <a class='context_help' href='javascript:clHoldMsg();'></a>
-                                               </td>
-                                               <td width='15%'>&staff.server.admin.copy_locations.editor.opac_visible;</td>
-                                               <td width='15%'>&staff.server.admin.copy_locations.editor.circulate;</td>
-                                               <td width='10%'>&staff.server.admin.copy_locations.editor.edit;</td>
-                                               <td width='10%'>&staff.server.admin.copy_locations.editor.delete;</td>
+                                               <td width=''>&staff.server.admin.copy_locations.editor.name;</td>
+                                               <td width=''>&staff.server.admin.copy_locations.editor.library;</td>
+                                               <td width=''>&staff.server.admin.copy_locations.editor.holdable;</td>
+                                               <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=''>&staff.server.admin.copy_locations.editor.edit;</td>
+                                               <td width=''>&staff.server.admin.copy_locations.editor.delete;</td>
                                        </tr>
                                </thead>
                                <tbody id='cl_tbody'>
                                                <td name='cl_name'> </td>
                                                <td name='cl_owner'> </td>
                                                <td name='cl_holdable'> </td>
+                                               <td name='cl_hold_verify'> </td>
                                                <td name='cl_visible'> </td>
                                                <td name='cl_circulate'> </td>
                                                <td><input type='submit' value='Edit' name='cl_edit' disabled='disabled'> </input></td>
                 </center>
 
                 <div class='hide_me'>
+            <span id='true' style='color:green;'>&#x2713;</span>
+            <span id='false' style='color:red;'>&#x2717;</span>
                        <span id='yes'>&staff.server.admin.copy_locations.editor.yes;</span>
                        <span id='no'>&staff.server.admin.copy_locations.editor.no;</span>
                        <span id='cl_hold_msg'>
                                                </td>
                                                <td>
                                                        <span>&staff.server.admin.copy_locations.editor.yes;</span>
+                                                       <span name='cl_edit_hold_verify_yes'>
+                                                               <input type='radio' name='cl_edit_hold_verify'/>
+                                                       </span>
+                                                       <span>&staff.server.admin.copy_locations.editor.no;</span>
+                                                       <span name='cl_edit_hold_verify_no'>
+                                                               <input type='radio' name='cl_edit_hold_verify'/>
+                                                       </span>
+                                               </td>
+                                               <td>
+                                                       <span>&staff.server.admin.copy_locations.editor.yes;</span>
                                                        <span name='cl_edit_visible_yes'>
                                                                <input type='radio' name='cl_edit_visible'/>
                                                        </span>