Bug 30291: Changes to staff client files

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Aleisha Amohia 2022-03-29 01:00:27 +13:00 committed by Fridolin Somers
parent 50d917dbfc
commit 674e385bf1
17 changed files with 86 additions and 86 deletions

View file

@ -408,7 +408,7 @@ foreach my $item (@items) {
}
if ( C4::Context->preference('UseRecalls') ) {
my $recall = Koha::Recalls->find({ itemnumber => $item->{itemnumber}, old => 0 });
my $recall = Koha::Recalls->find({ item_id => $item->{itemnumber}, completed => 0 });
if ( defined $recall ) {
$item->{recalled} = 1;
$item->{recall} = $recall;

View file

@ -396,14 +396,14 @@ if (@$barcodes) {
if ( C4::Context->preference('UseRecalls') && !$recall_id ) {
my $recall = Koha::Recalls->find(
{
biblionumber => $item->biblionumber,
itemnumber => [ undef, $item->itemnumber ],
status => [ 'requested', 'waiting' ],
old => 0,
borrowernumber => $patron->borrowernumber,
biblio_id => $item->biblionumber,
item_id => [ undef, $item->itemnumber ],
status => [ 'requested', 'waiting' ],
completed => 0,
patron_id => $patron->borrowernumber,
}
);
$recall_id = ( $recall and $recall->recall_id ) ? $recall->recall_id : undef;
$recall_id = ( $recall and $recall->id ) ? $recall->id : undef;
}
my $issue = AddIssue( $patron->unblessed, $barcode, $datedue, $cancelreserve, undef, undef, { onsite_checkout => $onsite_checkout, auto_renew => $session->param('auto_renew'), switch_onsite_checkout => $switch_onsite_checkout, cancel_recall => $cancel_recall, recall_id => $recall_id, } );
$template_params->{issue} = $issue;
@ -455,7 +455,7 @@ if ($patron) {
);
if ( C4::Context->preference('UseRecalls') ) {
$template->param(
recalls => $patron->recalls->filter_by_current->search({},{ order_by => { -asc => 'recalldate' } }),
recalls => $patron->recalls->filter_by_current->search({},{ order_by => { -asc => 'created_date' } }),
specific_patron => 1,
);
}

View file

@ -181,11 +181,11 @@ if ( $query->param('recall_id') ) {
if ($recall) {
my $item;
if ( !$recall->item_level_recall ) {
if ( !$recall->item_level ) {
$item = Koha::Items->find( $itemnumber );
}
if ( $recall->branchcode ne $return_branch ) {
if ( $recall->pickup_library_id ne $return_branch ) {
$recall->start_transfer({ item => $item }) if !$recall->in_transit;
} else {
my $expirationdate = $recall->calc_expirationdate;
@ -254,7 +254,7 @@ if ($transit) {
if ( $canceltransfer ) {
$transfer->cancel({ reason => 'Manual', force => 1});
if ( C4::Context->preference('UseRecalls') ) {
my $recall_transfer_deleted = Koha::Recalls->find({ itemnumber => $itemnumber, status => 'in_transit' });
my $recall_transfer_deleted = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
if ( defined $recall_transfer_deleted ) {
$recall_transfer_deleted->revert_transfer;
}
@ -268,7 +268,7 @@ if ($transit) {
my $transfer = $item->get_transfer;
$transfer->cancel({ reason => 'Manual', force => 1});
if ( C4::Context->preference('UseRecalls') ) {
my $recall_transfer_deleted = Koha::Recalls->find({ itemnumber => $itemnumber, status => 'in_transit' });
my $recall_transfer_deleted = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
if ( defined $recall_transfer_deleted ) {
$recall_transfer_deleted->revert_transfer;
}
@ -534,10 +534,10 @@ if ( $messages->{TransferredRecall} ) {
my $recall = $messages->{TransferredRecall};
# confirm transfer has arrived at the branch
my $transfer = Koha::Item::Transfers->search({ datearrived => { '!=' => undef }, itemnumber => $recall->itemnumber }, { order_by => { -desc => 'datearrived' } })->next;
my $transfer = Koha::Item::Transfers->search({ datearrived => { '!=' => undef }, itemnumber => $recall->item_id }, { order_by => { -desc => 'datearrived' } })->next;
# if transfer has completed, show popup to confirm as waiting
if ( defined $transfer and $transfer->tobranch eq $recall->branchcode ) {
if ( defined $transfer and $transfer->tobranch eq $recall->pickup_library_id ) {
$template->param(
found => 1,
recall => $recall,

View file

@ -18,20 +18,20 @@
<tbody>
[% FOREACH recall IN recalls %]
[% IF recall.old %]<tr class="old">[% ELSE %]<tr>[% END %]
[% IF recall.completed %]<tr class="old">[% ELSE %]<tr>[% END %]
[% IF checkboxes %]
<td class="recall-checkbox">
[% IF recall.old %]
[% IF recall.completed %]
&nbsp;
[% ELSE %]
<input type="checkbox" value="[% recall.recall_id | html %]" name="recall_ids">
<input type="checkbox" value="[% recall.id | html %]" name="recall_ids">
[% END %]
</td>
[% END %]
<td class="recall-title">
<b><a class="recall-title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblionumber | html %]">
<b><a class="recall-title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblio_id | html %]">
[% recall.biblio.title | html %]
[% FOREACH s IN recall.biblio.subtitle %]
[% s | html %]
@ -48,13 +48,13 @@
[% END %]
<td class="recall-date">
[% recall.recalldate | $KohaDates %]
[% recall.created_date | $KohaDates %]
</td>
<td class="recall-expiry">
[% IF ( recall.expirationdate ) %]
[% recall.expirationdate | $KohaDates %]
[% ELSIF ( !recall.old ) %]
[% IF ( recall.expiration_date ) %]
[% recall.expiration_date | $KohaDates %]
[% ELSIF ( !recall.completed ) %]
Never expires
[% ELSE %]
-
@ -71,9 +71,9 @@
[% ELSIF ( recall.waiting ) %]
Ready for pickup
[% ELSIF ( recall.expired ) %]
Expired on [% recall.expirationdate | $KohaDates %]
Expired on [% recall.expiration_date | $KohaDates %]
[% ELSIF ( recall.cancelled ) %]
Cancelled on [% recall.cancellationdate | $KohaDates %]
Cancelled on [% recall.completed_date | $KohaDates %]
[% ELSIF ( recall.overdue ) %]
Overdue to be returned
[% ELSIF ( recall.fulfilled ) %]
@ -87,8 +87,8 @@
<td class="recall-duedate">
[% IF recall.requested and recall.checkout %]
Due to be returned by [% recall.checkout.date_due | $KohaDates %]
[% ELSIF recall.waiting and RECALL.expirationdate %]
Pick up by [% RECALL.expirationdate | $KohaDates %]
[% ELSIF recall.waiting and RECALL.expiration_date %]
Pick up by [% RECALL.expiration_date | $KohaDates %]
[% ELSE %]
-
[% END %]
@ -97,22 +97,22 @@
[% UNLESS viewing_old %]
<td class="recall-cancel actions">
[% IF recall.old %]
[% IF recall.completed %]
&nbsp;
[% ELSE %]
<div class="btn-group">
<a class="btn btn-sm dropdown-toggle" data-toggle="dropdown" href="#"> Actions <span class="caret"></span></a>
<ul class="dropdown-menu pull-right">
[% IF ( recall.requested or recall.overdue ) %]
<li><a class="cancel_recall" data-id="[% recall.recall_id | html %]" data-action="cancel"><i class="fa fa-times"></i> Cancel</a></li>
<li><a class="cancel_recall" data-id="[% recall.id | html %]" data-action="cancel"><i class="fa fa-times"></i> Cancel</a></li>
[% IF ( recall.should_be_overdue ) %]
<li><a class="overdue_recall" data-id="[% recall.recall_id | html %]" data-action="overdue"><i class="fa fa-hourglass-end"></i> Mark as overdue</a></li>
<li><a class="overdue_recall" data-id="[% recall.id | html %]" data-action="overdue"><i class="fa fa-hourglass-end"></i> Mark as overdue</a></li>
[% END %]
[% ELSIF ( recall.waiting ) %]
<li><a class="revert_recall" data-id="[% recall.recall_id | html %]" data-action="revert"><i class="fa fa-undo"></i> Revert waiting</a></li>
<li><a class="expire_recall" data-id="[% recall.recall_id | html %]" data-action="expire"><i class="fa fa-times"></i> Expire</a></li>
<li><a class="revert_recall" data-id="[% recall.id | html %]" data-action="revert"><i class="fa fa-undo"></i> Revert waiting</a></li>
<li><a class="expire_recall" data-id="[% recall.id | html %]" data-action="expire"><i class="fa fa-times"></i> Expire</a></li>
[% ELSIF ( recall.in_transit ) %]
<li><a class="transit_recall" data-id="[% recall.recall_id | html %]" data-action="transit"><i class="fa fa-times"></i> Cancel recall and return to: [% Branches.GetName(recall.item.homebranch) | html %]</a></li>
<li><a class="transit_recall" data-id="[% recall.id | html %]" data-action="transit"><i class="fa fa-times"></i> Cancel recall and return to: [% Branches.GetName(recall.item.homebranch) | html %]</a></li>
[% END %]
</ul>
</div>

View file

@ -238,9 +238,9 @@
[% IF RECALLED %]
[% IF RECALLED.waiting %]
<li>Item <i>[% RECALLED.biblio.title | html %]</i> ([% RECALLED.item.barcode | html %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% RECALLED.borrowernumber | uri %]">[% RECALLED.patron.firstname | html %] [% RECALLED.patron.surname | html %]</a> ([% RECALLED.patron.cardnumber | html %]) at [% Branches.GetName( RECALLED.branchcode ) | html %] since [% RECALLED.waitingdate | $KohaDates %]</li>
<li>Item <i>[% RECALLED.biblio.title | html %]</i> ([% RECALLED.item.barcode | html %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% RECALLED.patron_id | uri %]">[% RECALLED.patron.firstname | html %] [% RECALLED.patron.surname | html %]</a> ([% RECALLED.patron.cardnumber | html %]) at [% Branches.GetName( RECALLED.pickup_library_id ) | html %] since [% RECALLED.waiting_date | $KohaDates %]</li>
[% ELSIF RECALLED.requested or RECALLED.overdue %]
<li>Item <i>[% RECALLED.biblio.title | html %]</i> [% IF RECALLED.item %]([% RECALLED.item.barcode | html %])[% END %] has been recalled by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% RECALLED.borrowernumber | uri %]">[% RECALLED.patron.firstname | html %] [% RECALLED.patron.surname | html %]</a> ([% RECALLED.patron.cardnumber | html %]) at [% Branches.GetName( RECALLED.branchcode ) | html %] since [% RECALLED.recalldate | $KohaDates %]</li>
<li>Item <i>[% RECALLED.biblio.title | html %]</i> [% IF RECALLED.item %]([% RECALLED.item.barcode | html %])[% END %] has been recalled by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% RECALLED.patron_id | uri %]">[% RECALLED.patron.firstname | html %] [% RECALLED.patron.surname | html %]</a> ([% RECALLED.patron.cardnumber | html %]) at [% Branches.GetName( RECALLED.pickup_library_id ) | html %] since [% RECALLED.created_date | $KohaDates %]</li>
[% END %]
[% END %]
@ -297,13 +297,13 @@
<p>
<label for="cancelrecall">Cancel recall</label>
<input type="radio" value="cancel" name="cancel_recall" id="cancelrecall" />
<input type="hidden" value="[% RECALLED.recall_id | html %]" name="recall_id" />
<input type="hidden" value="[% RECALLED.id | html %]" name="recall_id" />
</p>
[% IF RECALLED.waiting %]
<p>
<label for="revertrecall">Revert waiting status</label>
<input type="radio" value="revert" name="cancel_recall" id="revertrecall" checked="checked"/>
<input type="hidden" value="[% RECALLED.recall_id | html %]" name="recall_id" />
<input type="hidden" value="[% RECALLED.id | html %]" name="recall_id" />
</p>
[% END %]
[% END %]
@ -350,7 +350,7 @@
[% IF ( RECALLED ) %]
<form method="get" action="/cgi-bin/koha/circ/circulation.pl">
<button class="print" type="submit" onclick="Dopop('/cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id=[% RECALLED.recall_id | html %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
<button class="print" type="submit" onclick="Dopop('/cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id=[% RECALLED.id | html %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
</form>
[% END %]

View file

@ -749,19 +749,19 @@
<h3>
Recall found:
<br/>
<a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% recall.biblionumber | uri %]">[% recall.biblio.title | html %]</a>
<a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% recall.biblio_id | uri %]">[% recall.biblio.title | html %]</a>
[% IF recall.item %]
<div class="recall-found-barcode">
(<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% recall.biblionumber | uri %]&amp;itemnumber=[% recall.itemnumber | uri %]">[% recall.item.barcode | html %]</a>)
(<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% recall.biblio_id | uri %]&amp;itemnumber=[% recall.item_id | uri %]">[% recall.item.barcode | html %]</a>)
</div>
[% END %]
</h3>
</div>
<div class="modal-body">
[% IF ( recall.recallnotes ) %]
[% IF ( recall.notes ) %]
<h4>Notes:</h4>
<p>[% recall.recallnotes | html %]</p>
<p>[% recall.notes | html %]</p>
<hr />
[% END %]
<h5>Recall placed by:</h5>
@ -800,12 +800,12 @@
[% END %]
</ul>
[% IF ( transfertodo ) %]
<h4><strong>Transfer to:</strong> [% Branches.GetName( recall.branchcode ) | html %]</h4>
<h4><strong>Transfer to:</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
[% ELSE %]
<h4><strong>Recall at</strong> [% Branches.GetName( recall.branchcode ) | html %]</h4>
<h4><strong>Recall at</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
[% END %]
<input type="hidden" name="recall_id" value="[% recall.recall_id | html %]">
<input type="hidden" name="recall_id" value="[% recall.id | html %]">
<input type="hidden" name="itemnumber" value="[% itemnumber | html %]">
<input type="hidden" name="returnbranch" value="[% Branches.GetLoggedInBranchcode | html %]">
<input type="hidden" name="recall_slip" value="0">
@ -850,19 +850,19 @@
<h3>
Recall found (item is already waiting):
<br/>
<a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% recall.biblionumber | uri %]">[% recall.biblio.title | html %]</a>
<a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% recall.biblio_id | uri %]">[% recall.biblio.title | html %]</a>
[% IF recall.item %]
<div class="recall-found-barcode">
(<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% recall.biblionumber | uri %]&amp;itemnumber=[% recall.itemnumber | uri %]">[% recall.item.barcode | html %]</a>)
(<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% recall.biblio_id | uri %]&amp;itemnumber=[% recall.item_id | uri %]">[% recall.item.barcode | html %]</a>)
</div>
[% END %]
</h3>
</div>
<div class="modal-body">
[% IF ( recall.recallnotes ) %]
[% IF ( recall.notes ) %]
<h4>Notes:</h4>
<p>[% recall.recallnotes | html %]</p>
<p>[% recall.notes | html %]</p>
<hr />
[% END %]
<h5>Recall placed by:</h5>
@ -901,12 +901,12 @@
[% END %]
</ul>
[% IF ( transfertodo ) %]
<h4><strong>Transfer to:</strong> [% Branches.GetName( recall.branchcode ) | html %]</h4>
<h4><strong>Transfer to:</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
[% ELSE %]
<h4><strong>Wait for pickup at</strong> [% Branches.GetName( recall.branchcode ) | html %]</h4>
<h4><strong>Wait for pickup at</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
[% END %]
<input type="hidden" name="recall_id" value="[% recall.recall_id | html %]">
<input type="hidden" name="recall_id" value="[% recall.id | html %]">
<input type="hidden" name="itemnumber" value="[% itemnumber | html %]">
<input type="hidden" name="returnbranch" value="[% Branches.GetLoggedInBranchcode | html %]">
<input type="hidden" name="recall_slip" value="0">

View file

@ -59,7 +59,7 @@
<td class="recall-topull"><b>[% recall.pull_count | html %]</b></td>
<td class="recall-items">[% recall.items_count | html %]</td>
<td class="recall-patrons">[% recall.patrons_count | html %]</td>
<td class="recall-firstpatron"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.first_recall.borrowernumber | uri %]">[% recall.first_recall.patron.firstname | html %] [% recall.first_recall.patron.surname | html %]</a></td>
<td class="recall-firstpatron"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.first_recall.patron_id | uri %]">[% recall.first_recall.patron.firstname | html %] [% recall.first_recall.patron.surname | html %]</a></td>
<td class="recall-title">
[% INCLUDE 'biblio-title.inc' biblio=recall.first_recall.biblio link=1 %]
[% IF recall.first_recall.biblio.author %] by [% recall.first_recall.biblio.author | html %][% END %]
@ -107,11 +107,11 @@
</ul>
</td>
<td class="recall-date">
<span title="[% recall.first_recall.recalldate | html %]">[% recall.first_recall.recalldate | $KohaDates %] in [% recall.first_recall.library.branchname | html %]</span>
<span title="[% recall.first_recall.created_date | html %]">[% recall.first_recall.created_date | $KohaDates %] in [% recall.first_recall.library.branchname | html %]</span>
</td>
<td class="recall-action">
<form action="/cgi-bin/koha/recalls/recalls_to_pull.pl" method="post">
<input type="hidden" name="recall_id" value="[% recall.first_recall.recall_id | html %]">
<input type="hidden" name="recall_id" value="[% recall.first_recall.id | html %]">
<input type="hidden" name="op" value="cancel">
[% IF recall.first_recall.in_transit %]
<button type="submit" class="btn btn-default cancelreturn"><i class="fa fa-times"></i> Cancel recall and return to: [% Branches.GetName(recall.first_recall.item.homebranch) | html %]</button>

View file

@ -48,9 +48,9 @@
</tr></thead>
<tbody>
[% FOREACH recall IN recalls %]<tr>
<td class="recall-waitingdate">[% recall.waitingdate | $KohaDates %]</td>
<td class="recall-waitingdate">[% recall.waiting_date | $KohaDates %]</td>
<td class="recall-title">
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblionumber | uri %]">
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblio_id | uri %]">
[% recall.biblio.title | html %]
[% FOREACH s IN recall.biblio.subtitle %]
[% s | html %]
@ -60,14 +60,14 @@
<br><i>Barcode: [% recall.item.barcode | html %]</i>
</td>
<td class="recall-patron">
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %]</a>
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.patron_id | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %]</a>
[% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone | html %][% END %]
[% IF ( recall.patron.email ) %]<br /><a href="mailto:[% recall.patron.email | uri %]?subject=Recall waiting: [% recall.biblio.title | uri %]">[% recall.patron.email | html %]</a>[% END %]
</td>
<td class="recall-library">[% recall.library.branchname | html %]</td>
<td class="recall-action actions">
<form action="/cgi-bin/koha/recalls/recalls_waiting.pl" method="post">
<input type="hidden" name="recall_id" value="[% recall.recall_id | html %]">
<input type="hidden" name="recall_id" value="[% recall.id | html %]">
<input type="hidden" name="op" value="modify">
<fieldset class="action">
<input type="submit" name="revert" class="revert_recall" value="Revert waiting status">
@ -96,9 +96,9 @@
</tr></thead>
<tbody>
[% FOREACH recall IN over %]<tr>
<td class="recall-waitingdate">[% recall.waitingdate | $KohaDates %]</td>
<td class="recall-waitingdate">[% recall.waiting_date | $KohaDates %]</td>
<td class="recall-title">
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblionumber | uri %]">
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblio_id | uri %]">
[% recall.biblio.title | html %]
[% FOREACH s IN recall.biblio.subtitles %]
[% s | html %]
@ -109,14 +109,14 @@
<br><i>Barcode: [% recall.item.barcode | html %]</i>
</td>
<td class="recall-patron">
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %]</a>
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.patron_id | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %]</a>
[% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone | html %][% END %]
[% IF ( recall.patron.email ) %]<br /><a href="mailto:[% recall.patron.email | uri %]?subject=Recall waiting: [% recall.biblio.title | uri %]">[% recall.patron.email | html %]</a>[% END %]
</td>
<td class="recall-library">[% recall.library.branchname | html %]</td>
<td class="recall-action actions">
<form action="/cgi-bin/koha/recalls/recalls_waiting.pl" method="post">
<input type="hidden" name="recall_id" value="[% recall.recall_id | html %]">
<input type="hidden" name="recall_id" value="[% recall.id | html %]">
<input type="hidden" name="op" value="modify">
<fieldset class="action">
<input type="submit" name="revert" class="revert_recall" value="Revert waiting status">

View file

@ -33,7 +33,7 @@ my ($template, $loggedinuser, $cookie)= get_template_and_user(
);
my $borrowernumber = $input->param('borrowernumber');
my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber }, { order_by => { '-desc' => 'recalldate' } });
my $recalls = Koha::Recalls->search({ patron_id => $borrowernumber }, { order_by => { '-desc' => 'created_date' } });
my $patron = Koha::Patrons->find( $borrowernumber );
$template->param(

View file

@ -37,9 +37,9 @@ use C4::Log;
cronlogaction();
my $recalls = Koha::Recalls->search({ old => 0 });
my $recalls = Koha::Recalls->search({ completed => 0 });
while( my $recall = $recalls->next ) {
if ( ( $recall->requested or $recall->overdue ) and $recall->expirationdate and dt_from_string( $recall->expirationdate ) < dt_from_string() ){
if ( ( $recall->requested or $recall->overdue ) and $recall->expiration_date and dt_from_string( $recall->expiration_date ) < dt_from_string() ){
# recall is requested or overdue and has surpassed the specified expiration date
$recall->set_expired({ interface => 'COMMANDLINE' });
}
@ -47,10 +47,10 @@ while( my $recall = $recalls->next ) {
my $recall_shelf_time = Koha::CirculationRules->get_effective_rule({
categorycode => $recall->patron->categorycode,
itemtype => $recall->item->effective_itemtype,
branchcode => $recall->branchcode,
branchcode => $recall->pickup_library_id,
rule_name => 'recall_shelf_time',
});
my $waitingdate = dt_from_string( $recall->waitingdate );
my $waitingdate = dt_from_string( $recall->waiting_date );
my $now = dt_from_string();
my $days_waiting = $now->subtract_datetime( $waitingdate );
if ( defined $recall_shelf_time and $recall_shelf_time->rule_value > 0 ) {

View file

@ -38,8 +38,8 @@ my $recallid = $input->param('recall_id');
my $recall = Koha::Recalls->find($recallid);
my $itemnumber;
if ( $recall->itemnumber ){
$itemnumber = $recall->itemnumber;
if ( $recall->item_id ){
$itemnumber = $recall->item_id;
} else {
$itemnumber = $recall->checkout->itemnumber;
}
@ -50,11 +50,11 @@ my $letter = C4::Letters::GetPreparedLetter(
letter_code => 'RECALL_REQUESTER_DET',
message_transport_type => 'print',
tables => {
'branches' => $recall->branchcode,
'borrowers' => $recall->borrowernumber,
'biblio' => $recall->biblionumber,
'branches' => $recall->pickup_library_id,
'borrowers' => $recall->patron_id,
'biblio' => $recall->biblio_id,
'items' => $itemnumber,
'recalls' => $recall->recall_id,
'recalls' => $recall->id,
}
);

View file

@ -33,7 +33,7 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
}
);
my $recalls = Koha::Recalls->search({ old => 1 });
my $recalls = Koha::Recalls->search({ completed => 1 });
$template->param(
recalls => $recalls,
viewing_old => 1

View file

@ -45,7 +45,7 @@ if ( $op eq 'cancel_multiple_recalls' ) {
}
if ( $op eq 'list' ) {
my $recalls = Koha::Recalls->search({ status => 'O' });
my $recalls = Koha::Recalls->search({ status => 'overdue' });
# will be set as Overdue by the misc/cronjobs/recall/overdue_recalls.pl cronjob
$template->param(
recalls => $recalls,

View file

@ -42,7 +42,7 @@ if ( $op eq 'cancel_multiple_recalls' ) {
$op = 'list'
}
elsif ( $op eq 'list' ) {
my $recalls = Koha::Recalls->search({ old => 0 });
my $recalls = Koha::Recalls->search({ completed => 0 });
$template->param(
recalls => $recalls,
checkboxes => 1,

View file

@ -45,21 +45,21 @@ if ( $op eq 'cancel' ) {
}
if ( $op eq 'list' ) {
my @recalls = Koha::Recalls->search({ status => [ 'R','O','T' ] })->as_list;
my @recalls = Koha::Recalls->search({ status => [ 'requested','overdue','in_transit' ] })->as_list;
my @pull_list;
my %seen_bib;
foreach my $recall ( @recalls ) {
if ( $seen_bib{$recall->biblionumber} ){
if ( $seen_bib{$recall->biblio_id} ){
# we've already looked at the recalls on this biblio
next;
} else {
# this is an unseen biblio
$seen_bib{$recall->biblionumber}++;
$seen_bib{$recall->biblio_id}++;
# get recall data about this biblio
my @this_bib_recalls = Koha::Recalls->search({ biblionumber => $recall->biblionumber, status => [ 'R','O','T' ] }, { order_by => { -asc => 'recalldate' } })->as_list;
my @this_bib_recalls = Koha::Recalls->search({ biblio_id => $recall->biblio_id, status => [ 'requested','overdue','in_transit' ] }, { order_by => { -asc => 'created_date' } })->as_list;
my $recalls_count = scalar @this_bib_recalls;
my @unique_patrons = do { my %seen; grep { !$seen{$_->borrowernumber}++ } @this_bib_recalls };
my @unique_patrons = do { my %seen; grep { !$seen{$_->patron_id}++ } @this_bib_recalls };
my $patrons_count = scalar @unique_patrons;
my $first_recall = $this_bib_recalls[0];
@ -71,7 +71,7 @@ if ( $op eq 'list' ) {
my @locations;
my @libraries;
my @items = Koha::Items->search({ biblionumber => $recall->biblionumber });
my @items = Koha::Items->search({ biblio_id => $recall->biblio_id });
foreach my $item ( @items ) {
if ( $item->can_be_waiting_recall and !$item->checkout ) {
# if item can be pulled to fulfill recall, collect item data

View file

@ -51,13 +51,13 @@ if ( $op eq 'modify' ) {
}
if ( $op eq 'list' ) {
my @recalls = Koha::Recalls->search({ status => 'W' })->as_list;
my @recalls = Koha::Recalls->search({ status => 'waiting' })->as_list;
my $borrower = Koha::Patrons->find( $loggedinuser );
my @over;
my $maxdelay = C4::Context->preference('RecallsMaxPickUpDelay') || 7;
my $today = dt_from_string();
foreach my $r ( @recalls ){
my $lastwaitingday = dt_from_string( $r->waitingdate )->add( days => $maxdelay );
my $lastwaitingday = dt_from_string( $r->waiting_date )->add( days => $maxdelay );
if ( $today > $lastwaitingday ){
push @over, $r;
}

View file

@ -38,7 +38,7 @@ my ($template, $loggedinuser, $cookie)= get_template_and_user(
my $op = $input->param('op') || 'list';
my @recall_ids = $input->multi_param('recall_ids');
my $biblionumber = $input->param('biblionumber');
my $recalls = Koha::Recalls->search({ biblionumber => $biblionumber, old => 0 });
my $recalls = Koha::Recalls->search({ biblio_id => $biblionumber, completed => 0 });
my $biblio = Koha::Biblios->find( $biblionumber );
if ( $op eq 'cancel_multiple_recalls' ) {
@ -49,7 +49,7 @@ if ( $op eq 'cancel_multiple_recalls' ) {
}
if ( $op eq 'list' ) {
$recalls = Koha::Recalls->search({ biblionumber => $biblionumber, old => 0 });
$recalls = Koha::Recalls->search({ biblio_id => $biblionumber, completed => 0 });
$biblio = Koha::Biblios->find( $biblionumber );
}