View | Details | Raw Unified | Return to bug 37309
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-26 / +29 lines)
Lines 57-66 Link Here
57
            <span class="itemselection_actions">
57
            <span class="itemselection_actions">
58
              | Actions:
58
              | Actions:
59
              [% IF CAN_user_tools_items_batchdel %]
59
              [% IF CAN_user_tools_items_batchdel %]
60
                <a class="itemselection_action_delete"><i class="fa fa-trash-can"></i> Delete selected items</a>
60
                  <form id="itemselection_action_delete_form" method="post" action="/cgi-bin/koha/tools/batchMod.pl">
61
                      [% INCLUDE 'csrf-token.inc' %]
62
                      <input name='src' type='hidden' value='CATALOGUING' />
63
                      <input name='biblionumber' type='hidden' value="[% biblionumber | html %]" />
64
                      <input name='op' type='hidden' value='cud-show' />
65
                      <input name='del' type='hidden' value='1' />
66
                      <button type="submit" class="itemselection_action_delete btn btn-link" /><i class="fa fa-trash-can"></i> Delete selected items</button>
67
                  </form>
61
              [% END %]
68
              [% END %]
62
              [% IF CAN_user_tools_items_batchmod %]
69
              [% IF CAN_user_tools_items_batchmod %]
63
                <a class="itemselection_action_modify"><i class="fa-solid fa-pencil"></i> Modify selected items</a>
70
                  <form id="itemselection_action_modify_form" method="post" action="/cgi-bin/koha/tools/batchMod.pl">
71
                      [% INCLUDE 'csrf-token.inc' %]
72
                      <input name='src' type='hidden' value='CATALOGUING' />
73
                      <input name='biblionumber' type='hidden' value="[% biblionumber | html %]" />
74
                      <input name='op' type='hidden' value='cud-show' />
75
                      <button type="submit" class="itemselection_action_modify btn btn-link" /><i class="fa-solid fa-pencil"></i> Modify selected items</button>
76
                  </form>
64
              [% END %]
77
              [% END %]
65
              [% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %]
78
              [% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %]
66
                <a class="itemselection_action_item_group_set" href="#"><i class="fa fa-book"></i> Add/move to item group</a>
79
                <a class="itemselection_action_item_group_set" href="#"><i class="fa fa-book"></i> Add/move to item group</a>
Lines 81-112 Link Here
81
    [% IF StaffDetailItemSelection %]
94
    [% IF StaffDetailItemSelection %]
82
95
83
        let items_selection = {};
96
        let items_selection = {};
84
        function itemSelectionBuildDeleteLink(tab_id) {
97
98
        function _itemSelectionBuildLink(tab_id, form) {
99
85
            var itemnumbers = items_selection[tab_id];
100
            var itemnumbers = items_selection[tab_id];
86
            if (itemnumbers.length > 0) {
87
                var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1';
88
                url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
89
                url += '&biblionumber=[% biblionumber | uri %]';
90
                url += '&src=CATALOGUING';
91
                $('a.itemselection_action_delete').attr('href', url);
92
            } else {
93
                return false;
94
            }
95
            return true
96
        }
97
101
102
            $(form).find("input[name='itemnumber']").remove();
103
104
            $(itemnumbers).each(function() {
105
                $(form).append("<input name='itemnumber' type='hidden' value='%s'/>".format(this));
106
            });
107
            return !!itemnumbers.length
108
        }
109
        function itemSelectionBuildDeleteLink(tab_id) {
110
            return _itemSelectionBuildLink(tab_id, $('#itemselection_action_delete_form'));
111
        }
98
        function itemSelectionBuildModifyLink(tab_id) {
112
        function itemSelectionBuildModifyLink(tab_id) {
99
            var itemnumbers = items_selection[tab_id];
113
            return _itemSelectionBuildLink(tab_id, $('#itemselection_action_modify_form'));
100
            if (itemnumbers.length > 0) {
101
                var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
102
                url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
103
                url += '&biblionumber=[% biblionumber | uri %]';
104
                url += '&src=CATALOGUING';
105
                $('a.itemselection_action_modify').attr('href', url);
106
            } else {
107
                return false;
108
            }
109
            return true;
110
        }
114
        }
111
115
112
        function itemSelectionBuildActionLinks(tab_id) {
116
        function itemSelectionBuildActionLinks(tab_id) {
113
- 

Return to bug 37309