Bug 31835: Add page-section to holds queue
[koha-ffzg.git] / members / moremember.pl
index af3d324..0523d02 100755 (executable)
@@ -37,6 +37,7 @@ use List::MoreUtils qw( uniq );
 use Scalar::Util qw( looks_like_number );
 use Koha::Patron::Attribute::Types;
 use Koha::Patron::Debarments qw( GetDebarments );
+use Koha::Patron::Restriction::Types;
 use Koha::Patron::Messages;
 use Koha::CsvProfiles;
 use Koha::Holds;
@@ -79,6 +80,10 @@ for (qw(gonenoaddress lost borrowernotes is_debarred)) {
     $patron->$_ and $template->param(flagged => 1) and last;
 }
 
+$template->param(
+    restriction_types => scalar Koha::Patron::Restriction::Types->keyed_on_code()
+);
+
 if ( $patron->is_debarred ) {
     $template->param(
         'debarments'      => scalar GetDebarments({ borrowernumber => $borrowernumber }),
@@ -95,11 +100,11 @@ $template->param( flagged => 1 ) if $patron->account_locked;
 
 my @relatives;
 my $guarantor_relationships = $patron->guarantor_relationships;
-my @guarantees              = $patron->guarantee_relationships->guarantees;
-my @guarantors              = $guarantor_relationships->guarantors;
+my @guarantees              = $patron->guarantee_relationships->guarantees->as_list;
+my @guarantors              = $guarantor_relationships->guarantors->as_list;
 if (@guarantors) {
     push( @relatives, $_->id ) for @guarantors;
-    push( @relatives, $_->id ) for $patron->siblings();
+    push( @relatives, $_->id ) for $patron->siblings->as_list;
 }
 else {
     push( @relatives, $_->id ) for @guarantees;
@@ -162,7 +167,7 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) {
 }
 
 if ( C4::Context->preference("ExportCircHistory") ) {
-    $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]);
+    $template->param(csv_profiles => Koha::CsvProfiles->search({ type => 'marc' }));
 }
 
 my $patron_messages = Koha::Patron::Messages->search(
@@ -199,6 +204,11 @@ $template->param(
     WaitingHolds => $waiting_holds,
 );
 
+if ( C4::Context->preference('UseRecalls') ) {
+    my $waiting_recalls = $patron->recalls->search({ status => 'waiting' });
+    $template->param( waiting_recalls => $waiting_recalls );
+}
+
 my $no_issues_charge_guarantees = C4::Context->preference("NoIssuesChargeGuarantees");
 $no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees );
 if ( defined $no_issues_charge_guarantees ) {
@@ -275,4 +285,11 @@ $template->param(
     has_modifications         => $has_modifications,
 );
 
+if ( C4::Context->preference('UseRecalls') ) {
+    $template->param(
+        recalls         => $patron->recalls({},{ order_by => { -asc => 'recalldate' } })->filter_by_current,
+        specific_patron => 1,
+    );
+}
+
 output_html_with_http_headers $input, $cookie, $template->output;