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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/edit_serial_issues.inc (-3 / +15 lines)
Lines 9-19 Link Here
9
                    <h4 class="modal-title" id="edit-serial-issues-modal-label">Edit serial issues</h4>
9
                    <h4 class="modal-title" id="edit-serial-issues-modal-label">Edit serial issues</h4>
10
                </div>
10
                </div>
11
                <div class="modal-body">
11
                <div class="modal-body">
12
                    <h5 style="margin-bottom: 15px;">This item has a serial issue linked to it, would you like to edit this as well?</h5>
12
                    [% IF batch %]
13
                        <h5 style="margin-bottom: 15px;">Some of these items have linked serial issues, would you like to edit these as well?</h5>
14
                    [% ELSE %]
15
                        <h5 style="margin-bottom: 15px;">This item has a serial issue linked to it, would you like to edit this as well?</h5>
16
                    [% END %]
13
                </div>
17
                </div>
14
                <div class="modal-footer">
18
                <div class="modal-footer">
15
                    <button id="edit-serial-issues-modal-btn-submit" type="button" class="btn btn-primary"><i class="fa fa-exclamation-circle"></i> Edit serial issue</button>
19
                    [% IF batch %]
16
                    <button id="no-edit-serial-issues-modal-btn-submit" class="btn btn-default deny cancel" href="#" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> Save item without editing serial issue</button>
20
                        <button id="edit-serial-issues-modal-btn-submit" type="button" class="btn btn-primary"><i class="fa fa-exclamation-circle"></i> Edit serial issues</button>
21
                    [% ELSE %]
22
                        <button id="edit-serial-issues-modal-btn-submit" type="button" class="btn btn-primary"><i class="fa fa-exclamation-circle"></i> Edit serial issue</button>
23
                    [% END %]
24
                    [% IF batch %]
25
                        <button id="no-edit-serial-issues-modal-btn-submit" class="btn btn-default deny cancel" href="#" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> Save items without editing serial issues</button>
26
                    [% ELSE %]
27
                        <button id="no-edit-serial-issues-modal-btn-submit" class="btn btn-default deny cancel" href="#" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> Save item without editing serial issue</button>
28
                    [% END %]
17
                </div>
29
                </div>
18
            </div>
30
            </div>
19
        </div>
31
        </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt (-1 / +10 lines)
Lines 162-167 Link Here
162
            <input type="hidden" name="searchid" value="[% searchid | html %]" />
162
            <input type="hidden" name="searchid" value="[% searchid | html %]" />
163
            <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
163
            <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
164
            <input type="hidden" name="src" id="src" value="[% src | html %]" />
164
            <input type="hidden" name="src" id="src" value="[% src | html %]" />
165
            [% FOREACH linked_serial_id IN linked_serial_ids %]
166
                <input type="hidden" name="linked_serial_id" id="linked_serial_id" value="[% linked_serial_id | html %]" />
167
            [% END %]
165
            [% IF biblionumber %]
168
            [% IF biblionumber %]
166
                <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
169
                <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
167
            [% END %]
170
            [% END %]
Lines 237-243 Link Here
237
                        </fieldset>
240
                        </fieldset>
238
241
239
                        <fieldset class="action">
242
                        <fieldset class="action">
240
                            <input type="submit" id="mainformsubmit" class="btn btn-primary" value="Save" />
243
                            [% IF linked_serials %]
244
                                <input type="button" class="submit" value="Save" onclick="return ShowSerialEditingConfirmation(this.form)">
245
                                <input type="hidden" name="edit-serial-issues" id="edit-serial-issues" value />
246
                            [% ELSE %]
247
                                <input type="submit" id="mainformsubmit" class="btn btn-primary" value="Save" />
248
                            [% END %]
241
                            <a href="/cgi-bin/koha/tools/batchMod.pl" class="cancel">Cancel</a>
249
                            <a href="/cgi-bin/koha/tools/batchMod.pl" class="cancel">Cancel</a>
242
                        </fieldset>
250
                        </fieldset>
243
                    </div> <!-- /#cataloguing_additem_newitem -->
251
                    </div> <!-- /#cataloguing_additem_newitem -->
Lines 260-265 Link Here
260
                </fieldset> <!-- /.action -->
268
                </fieldset> <!-- /.action -->
261
            [% END %]
269
            [% END %]
262
        </form>
270
        </form>
271
        [% INCLUDE 'modals/edit_serial_issues.inc' batch=1 %]
263
272
264
    [% MACRO jsinclude BLOCK %]
273
    [% MACRO jsinclude BLOCK %]
265
        [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
274
        [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js (+16 lines)
Lines 117-122 function hideAllColumns() { Link Here
117
    Cookies.set("showColumns", cookieString, { expires: date, path: '/', sameSite: 'Lax'  });
117
    Cookies.set("showColumns", cookieString, { expires: date, path: '/', sameSite: 'Lax'  });
118
}
118
}
119
119
120
function ShowSerialEditingConfirmation(form) {
121
    $('#edit-serial-issues-modal').modal('show');
122
    return false;
123
}
124
120
$(document).ready(function () {
125
$(document).ready(function () {
121
    var items_table = KohaTable("itemst", {
126
    var items_table = KohaTable("itemst", {
122
        "columnDefs":  [
127
        "columnDefs":  [
Lines 166-169 $(document).ready(function () { Link Here
166
            }
171
            }
167
        }
172
        }
168
    });
173
    });
174
    $(document).on('click', '#edit-serial-issues-modal-btn-submit', function (e) {
175
        e.preventDefault();
176
        $('#edit-serial-issues-modal').modal('hide');
177
        $('#edit-serial-issues').val('1');
178
        return $("form[name='f'").submit();
179
    });
180
    $(document).on('click', '#no-edit-serial-issues-modal-btn-submit', function (e) {
181
        e.preventDefault();
182
        $('#edit-serial-issues-modal').modal('hide');
183
        return $("form[name='f'").submit();
184
    });
169
});
185
});
(-)a/tools/batchMod.pl (-1 / +21 lines)
Lines 186-191 if ( $op eq "cud-action" ) { Link Here
186
              Koha::BackgroundJob::BatchUpdateItem->new->enqueue($params);
186
              Koha::BackgroundJob::BatchUpdateItem->new->enqueue($params);
187
            $nextop = 'enqueued';
187
            $nextop = 'enqueued';
188
            $template->param( job_id => $job_id, );
188
            $template->param( job_id => $job_id, );
189
190
            if ( $input->param('edit-serial-issues') ) {
191
                my @linked_serial_ids = $input->multi_param('linked_serial_id');
192
                my $subscriptionid    = Koha::Serials->find( $linked_serial_ids[0] )->subscriptionid;
193
                my $redirect_url      = "/cgi-bin/koha/serials/serials-edit.pl?";
194
                for my $serial_id (@linked_serial_ids) {
195
                    $redirect_url .= "serialid=$serial_id&";
196
                }
197
                $redirect_url .= "subscriptionid=$subscriptionid";
198
                print $input->redirect($redirect_url);
199
                exit;
200
            }
189
        }
201
        }
190
        catch {
202
        catch {
191
            push @messages,
203
            push @messages,
Lines 269-274 if ($op eq "cud-show" || $op eq "show"){ Link Here
269
        $template->param(itemnumbers_array => \@itemnumbers);
281
        $template->param(itemnumbers_array => \@itemnumbers);
270
    }
282
    }
271
283
284
    my @linked_serial_ids;
285
    foreach my $itemnumber (@itemnumbers) {
286
        my $item        = Koha::Items->find($itemnumber);
287
        my $serial_item = $item->serial_item;
288
        push( @linked_serial_ids, $serial_item->serialid ) if $serial_item;
289
    }
290
    $template->param( linked_serial_ids => \@linked_serial_ids );
291
    $template->param( linked_serials    => 1 ) if scalar(@linked_serial_ids) > 0;
292
272
    # now, build the item form for entering a new item
293
    # now, build the item form for entering a new item
273
294
274
    # Getting list of subfields to keep when restricted batchmod edit is enabled
295
    # Getting list of subfields to keep when restricted batchmod edit is enabled
275
- 

Return to bug 37116