# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
=head1 request.pl
query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => { reserveforothers => 1 },
+ flagsrequired => { reserveforothers => 'place_holds' },
}
);
my $messages;
my $date = C4::Dates->today('iso');
+my $action = $input->param('action');
+
+if ( $action eq 'move' ) {
+ my $where = $input->param('where');
+ my $borrowernumber = $input->param('borrowernumber');
+ my $biblionumber = $input->param('biblionumber');
+
+ AlterPriority( $where, $borrowernumber, $biblionumber );
+
+} elsif ( $action eq 'cancel' ) {
+ my $borrowernumber = $input->param('borrowernumber');
+ my $biblionumber = $input->param('biblionumber');
+ CancelReserve( $biblionumber, '', $borrowernumber );
+} elsif ( $action eq 'setLowestPriority' ) {
+ my $borrowernumber = $input->param('borrowernumber');
+ my $biblionumber = $input->param('biblionumber');
+ ToggleLowestPriority( $borrowernumber, $biblionumber );
+}
if ($findborrower) {
my ( $count, $borrowers ) =
}
}
- my $branchitemrule = GetBranchItemRule( $item->{'homebranch'}, $item->{'itype'} );
+ my $branch = C4::Circulation::_GetCircControlBranch($item, $borrowerinfo);
+
+ my $branchitemrule = GetBranchItemRule( $branch, $item->{'itype'} );
my $policy_holdallowed = 1;
$item->{'holdallowed'} = $branchitemrule->{'holdallowed'};
);
}
- if ( defined $res->{'found'} && $res->{'found'} eq 'W' ) {
+ if ( defined $res->{'found'} && $res->{'found'} eq 'W' || $res->{'found'} eq 'T' ) {
my $item = $res->{'itemnumber'};
$item = GetBiblioFromItemNumber($item,undef);
$reserve{'wait'}= 1;
}
# set found to 1 if reserve is waiting for patron pickup
$reserve{'found'} = 1 if $res->{'found'} eq 'W';
+ $reserve{'intransit'} = 1 if $res->{'found'} eq 'T';
} elsif ($res->{priority} > 0) {
if (defined($res->{itemnumber})) {
my $item = GetItem($res->{itemnumber});
$reserve{'hidename'} = 1;
$reserve{'cardnumber'} = $reserveborrowerinfo->{'cardnumber'};
}
+ $reserve{'expirationdate'} = format_date( $res->{'expirationdate'} )
+ unless ( !defined($res->{'expirationdate'}) || $res->{'expirationdate'} eq '0000-00-00' );
$reserve{'date'} = format_date( $res->{'reservedate'} );
$reserve{'borrowernumber'} = $res->{'borrowernumber'};
$reserve{'biblionumber'} = $res->{'biblionumber'};
$reserve{'ccode'} = $res->{'ccode'};
$reserve{'barcode'} = $res->{'barcode'};
$reserve{'priority'} = $res->{'priority'};
+ $reserve{'lowestPriority'} = $res->{'lowestPriority'};
$reserve{'branchloop'} = GetBranchesLoop($res->{'branchcode'});
$reserve{'optionloop'} = \@optionloop;
$template->param( biblioloop => \@biblioloop );
$template->param( biblionumbers => $biblionumbers );
+$template->param( DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar() );
if ($multihold) {
$template->param( multi_hold => 1 );
}
if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) {
- $template->param(
- reserve_in_future => 1,
- DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
- );
+ $template->param( reserve_in_future => 1 );
}
# printout the page