CAT-188 Copy table view/edit links browser support
authorBill Erickson <berickxx@gmail.com>
Mon, 24 Sep 2018 15:52:04 +0000 (11:52 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/openils/var/templates_kcls/opac/parts/record/summary.tt2

index c9e6cf5..63f8a44 100644 (file)
             <td>[% copy_info.call_number_label | html %]</td>
             <td>[% copy_info.barcode | html %]
                 [% IF ctx.is_staff %]
-                    <a onclick="xulG.new_tab(xulG.urls.XUL_COPY_STATUS, {}, {'from_item_details_new': true, 'barcodes': ['[%- copy_info.barcode | html | replace('\'', '\\\'') -%]']})"
-                        href="javascript:;">[% l('view') %]</a>
-                    [%# if the user can edit copies, show the copy edit link %]
-                    [% IF ctx.has_perm('UPDATE_COPY', copy_info.circ_lib)
-                        OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %]
-                        <span> | </span>
-                        <a href="javascript:;"
-                            onclick="xulG.volume_item_creator({copy_id : [% copy_info.id %]})">
-                            [% l(' edit') %]
-                        </a>
-                    [% END %]
+                  [%- IF ctx.is_browser_staff %]
+                    <a target="_blank" href="[% ctx.base_path %]/staff/cat/item/[% copy_info.id %]">[% l('view') %]</a>
+                    [% IF ctx.has_perm('UPDATE_COPY', copy_info.circ_lib)      
+                      OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %]
+                      <span> | </span>                                       
+                      <a target="_blank" href="[% ctx.base_path %]/staff/cat/item/[% copy_info.id %]/edit">[% l('edit') %]</a>
+                    [% END %]  
+                  [% ELSE %]<!-- XUL client -->
+                      <a onclick="xulG.new_tab(xulG.urls.XUL_COPY_STATUS, {}, {'from_item_details_new': true, 'barcodes': ['[%- copy_info.barcode | html | replace('\'', '\\\'') -%]']})"
+                          href="javascript:;">[% l('view') %]</a>
+
+                      [% IF ctx.has_perm('UPDATE_COPY', copy_info.circ_lib)
+                          OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %]
+                          <span> | </span>
+                          <a href="javascript:;"
+                              onclick="xulG.volume_item_creator({copy_id : [% copy_info.id %]})">
+                              [% l(' edit') %]
+                          </a>
+                      [% END %]
+                  [% END %]
                 [% END %]
             </td>
             <td>[% copy_info.copy_location | html %]</td>