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

(-)a/circ/batch_holding.pl (-8 / +22 lines)
Lines 87-105 if ($op eq "show"){ Link Here
87
    if (@itemnumbers) {
87
    if (@itemnumbers) {
88
        foreach my $itemnumber (@itemnumbers) {
88
        foreach my $itemnumber (@itemnumbers) {
89
            my $item = Koha::Items->find({ itemnumber => $itemnumber });
89
            my $item = Koha::Items->find({ itemnumber => $itemnumber });
90
            my $biblio = Koha::Biblios->find({ biblionumber => $item->biblionumber });
90
            my $holdable = CanItemBeReserved($borrowernumber, $item->itemnumber)->{status};
91
            my $holdable = CanItemBeReserved($borrowernumber, $item->itemnumber)->{status};
91
            push @holdloop, {
92
            push @holdloop, {
92
                                        'itemnumber' => $item->itemnumber,
93
                'biblionumber' => $biblio->biblionumber,
93
                                        'barcode' => $item->barcode,
94
                'title' => $biblio->title,
94
                                        'holdable' => ($action eq "cancel" || $holdable eq 'OK') ? 1 : 0,
95
                'itemnumber' => $item->itemnumber,
95
                                      };
96
                'barcode' => $item->barcode,
97
                'holdable' => ($action eq "cancel" || $holdable eq 'OK') ? 1 : 0,
98
            };
96
        }
99
        }
97
100
98
    }
101
    }
102
    my $borrower = Koha::Patrons->find({ borrowernumber => $borrowernumber });
99
    $template->param(
103
    $template->param(
100
        show => 1,
104
        show => 1,
101
        holdloop => \@holdloop,
105
        holdloop => \@holdloop,
102
        borrowernumber => $borrowernumber,
106
        borrowernumber => $borrowernumber,
107
        borrowersurname => $borrower->surname,
108
        borrowerfirstname => $borrower->firstname,
103
        branch => $branch,
109
        branch => $branch,
104
        action => $action,
110
        action => $action,
105
        op => $op
111
        op => $op
Lines 116-121 elsif ($op eq "result") { Link Here
116
        if ($action eq "place") {
122
        if ($action eq "place") {
117
            my $item = Koha::Items->find({ itemnumber => $itemnumber });
123
            my $item = Koha::Items->find({ itemnumber => $itemnumber });
118
            my $biblionumber = $item->biblionumber;
124
            my $biblionumber = $item->biblionumber;
125
            my $biblio = Koha::Biblios->find({ biblionumber => $item->biblionumber });
119
            my $reserve_id = AddReserve({
126
            my $reserve_id = AddReserve({
120
                branchcode => $branch,
127
                branchcode => $branch,
121
                borrowernumber => $borrowernumber,
128
                borrowernumber => $borrowernumber,
Lines 123-131 elsif ($op eq "result") { Link Here
123
                itemnumber => $itemnumber
130
                itemnumber => $itemnumber
124
            });
131
            });
125
            push @holdloop, {
132
            push @holdloop, {
126
                                'itemnumber' => $itemnumber,
133
                'biblionumber' => $biblio->biblionumber,
127
                                'reserve_id' => $reserve_id,
134
                'title' => $biblio->title,
128
                            };
135
                'itemnumber' => $itemnumber,
136
                'barcode' => $item->barcode,
137
                'reserve_id' => $reserve_id,
138
            };
129
        } else {
139
        } else {
130
            my $holds = Koha::Holds->search({ itemnumber => $itemnumber, borrowernumber => $borrowernumber });
140
            my $holds = Koha::Holds->search({ itemnumber => $itemnumber, borrowernumber => $borrowernumber });
131
            if ($holds) {
141
            if ($holds) {
Lines 139-148 elsif ($op eq "result") { Link Here
139
            }
149
            }
140
        }
150
        }
141
    }
151
    }
142
152
    my $borrower = Koha::Patrons->find({ borrowernumber => $borrowernumber });
143
    $template->param(
153
    $template->param(
144
        result => 1,
154
        result => 1,
145
        holdloop => \@holdloop,
155
        holdloop => \@holdloop,
156
        borrowernumber => $borrowernumber,
157
        borrowersurname => $borrower->surname,
158
        borrowerfirstname => $borrower->firstname,
159
        branch => $branch,
146
        cancel => $action eq "cancel" ? 1 : 0,
160
        cancel => $action eq "cancel" ? 1 : 0,
147
        place => $action eq "place" ? 1 : 0,
161
        place => $action eq "place" ? 1 : 0,
148
        op => $op
162
        op => $op
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/batch_holding.tt (-22 / +43 lines)
Lines 66-72 Link Here
66
                        [% ELSE %]
66
                        [% ELSE %]
67
                            <h1>Cancel holds on the following barcodes</h1>
67
                            <h1>Cancel holds on the following barcodes</h1>
68
                        [% END %]
68
                        [% END %]
69
69
                        <ul>
70
                            <li>Patron: <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | uri %]">[% borrowersurname | html %][% IF ( borrowerfirstname ) %], [% borrowerfirstname | html %][% END %]</a></li>
71
                            <li>Pickup location: [% Branches.GetName( branch ) | html %]</li>
72
                        </ul>
70
                        <div id="toolbar">
73
                        <div id="toolbar">
71
                            <a id="SelectAll" href="#"><i class="fa fa-check"></i> Select all</a> |
74
                            <a id="SelectAll" href="#"><i class="fa fa-check"></i> Select all</a> |
72
                            <a id="ClearAll" href="#"><i class="fa fa-remove"></i> Clear all</a>
75
                            <a id="ClearAll" href="#"><i class="fa fa-remove"></i> Clear all</a>
Lines 74-91 Link Here
74
77
75
                        <form action="batch_holding.pl" id="hold_selections" method="POST">
78
                        <form action="batch_holding.pl" id="hold_selections" method="POST">
76
                            <table>
79
                            <table>
80
                                <thead><tr><th>Hold</th><th>Title</th><th>Item</th><th>Comment</th></tr></thead>
77
                                <tbody>
81
                                <tbody>
78
                                [% FOREACH hold IN holdloop %]
82
                                [% FOREACH hold IN holdloop %]
79
                                    <tr>
83
                                    <tr>
80
                                        <td>
84
                                        <td>
81
                                            [% IF hold.holdable %]
85
                                            <input type="checkbox" name="holdable" [% IF !hold.holdable %]disabled="disabled"[% END %] checked="checked" value="[% hold.itemnumber | html %]" />
82
                                                <label>
86
                                        </td>
83
                                                    <input type="checkbox" name="holdable" checked="checked" value="[% hold.itemnumber | html %]" />
87
                                        <td>
84
                                                    [% hold.barcode | html %]
88
                                            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber | uri %]">[% hold.title | html %]</a>
85
                                                </label>
89
                                        </td>
86
                                            [% ELSE %]
90
                                        <td>
91
                                            <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% hold.biblionumber | uri %]&itemnumber=[% hold.itemnumber | uri %]">[% hold.barcode | html %]</a>
92
                                        </td>
93
                                        <td>
94
                                            [% IF !hold.holdable %]
87
                                                <i class="fa fa-warning"></i>
95
                                                <i class="fa fa-warning"></i>
88
                                                [% hold.barcode | html %] (This item cannot be placed on hold)
96
                                                This item cannot be placed on hold
89
                                            [% END %]
97
                                            [% END %]
90
                                        </td>
98
                                        </td>
91
                                    </tr>
99
                                    </tr>
Lines 111-135 Link Here
111
                    [% IF (holdloop) %]
119
                    [% IF (holdloop) %]
112
                        <h1>Results</h1>
120
                        <h1>Results</h1>
113
                        [% IF place %]
121
                        [% IF place %]
114
                            The following items have been placed on hold:
122
                            <p>The following items have been placed on hold:</p>
115
                            <ul>
116
                                [% FOREACH hold IN holdloop %]
117
                                    <li>itemnumber [% hold.itemnumber | html %], reserve_id [% hold.reserve_id | html %]</li>
118
                                [% END %]
119
                            </ul>
120
                        [% END %]
123
                        [% END %]
121
                        [% IF cancel %]
124
                        [% IF cancel %]
122
                            The following holds were cancelled:
125
                            <p>The following holds were cancelled:</p>
123
                            <ul>
126
                        [% END %]
124
                                [% FOREACH hold IN holdloop %]
127
                        <ul>
125
                                    <li>itemnumber [% hold.itemnumber | html %]</li>
128
                            <li>Patron: <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | uri %]">[% borrowersurname | html %][% IF ( borrowerfirstname ) %], [% borrowerfirstname | html %][% END %]</a></li>
126
                                [% END %]
129
                            <li>Pickup location: [% Branches.GetName( branch ) | html %]</li>
127
                            </ul>
130
                        </ul>
131
                        <table>
132
                        <thead><tr><th>Title</th><th>Item</th><th>Holds</th></tr></thead>
133
                        <tbody>
134
                        [% FOREACH hold IN holdloop %]
135
                            <tr>
136
                                <td>
137
                                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber | uri %]">[% hold.title | html %]</a>
138
                                </td>
139
                                <td>
140
                                    <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% hold.biblionumber | uri %]&itemnumber=[% hold.itemnumber | uri %]">[% hold.barcode | html %]</a>
141
                                </td>
142
                                <td>
143
                                    <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% hold.biblionumber | uri %]">Show holds</a>
144
                                </td>
145
                            </tr>
128
                        [% END %]
146
                        [% END %]
147
                        </tbody>
148
                        </table>
149
129
                    [% ELSE %]
150
                    [% ELSE %]
130
                        <p>No holds could be placed or cancelled.</p>
151
                        <p>No holds could be placed or cancelled.</p>
131
                    [% END %]
152
                    [% END %]
132
                    <a href="batch_holding.pl">Batch place or cancel other holds</a>
153
154
                    <p><a href="batch_holding.pl">Batch place or cancel other holds</a></p>
133
155
134
                [% ELSE %]
156
                [% ELSE %]
135
157
136
- 

Return to bug 23258