Bug 18423 - Add child button not always appearing - problem in template variable
This patch removes the retrieval of the syspref borrowerRelationship from the scripts and moves it to a check using the Template Toolkit plugin To test: 1 - Apply patch 2 - Ensure 'Add child' button displays appropriately on all member pages. Tested 3 pateches together, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
46d0be3114
commit
e28f19f0a8
|
|
@ -636,7 +636,6 @@ $template->param(
|
|||
AudioAlerts => C4::Context->preference("AudioAlerts"),
|
||||
fast_cataloging => $fast_cataloging,
|
||||
CircAutoPrintQuickSlip => C4::Context->preference("CircAutoPrintQuickSlip"),
|
||||
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
|
||||
SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'),
|
||||
AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
|
||||
RoutingSerials => C4::Context->preference('RoutingSerials'),
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ function searchToHold(){
|
|||
[% END %]
|
||||
|
||||
[% IF ( CAN_user_borrowers ) %]
|
||||
[% IF ( adultborrower AND activeBorrowerRelationship ) %]
|
||||
[% IF adultborrower AND Koha.Preference("borrowerRelationship") %]
|
||||
<a id="addchild" class="btn btn-default btn-sm" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]"><i class="fa fa-plus"></i> Add child</a>
|
||||
[% END %]
|
||||
[% IF ( CAN_user_borrowers ) %]
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ $template->param(
|
|||
is_child => ($data->{'category_type'} eq 'C'),
|
||||
reverse_col => $reverse_col,
|
||||
accounts => $accts,
|
||||
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
|
||||
RoutingSerials => C4::Context->preference('RoutingSerials'),
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,6 @@ if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'} or $is_
|
|||
phone => $bor->{'phone'},
|
||||
email => $bor->{'email'},
|
||||
branchcode => $bor->{'branchcode'},
|
||||
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
|
||||
RoutingSerials => C4::Context->preference('RoutingSerials'),
|
||||
);
|
||||
if ($countissues >0) {
|
||||
|
|
|
|||
|
|
@ -99,7 +99,6 @@ if ($add){
|
|||
borrowernumber => $borrowernumber,
|
||||
categoryname => $data->{'description'},
|
||||
is_child => ($data->{'category_type'} eq 'C'),
|
||||
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
|
||||
RoutingSerials => C4::Context->preference('RoutingSerials'),
|
||||
);
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -124,7 +124,6 @@ if ($add){
|
|||
borrowernumber => $borrowernumber,
|
||||
categoryname => $data->{'description'},
|
||||
is_child => ($data->{'category_type'} eq 'C'),
|
||||
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
|
||||
RoutingSerials => C4::Context->preference('RoutingSerials'),
|
||||
);
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -212,7 +212,6 @@ $template->param(
|
|||
branchcode => $bor->{'branchcode'},
|
||||
loop => \@loop,
|
||||
is_child => ($bor->{'category_type'} eq 'C'),
|
||||
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
|
||||
RoutingSerials => C4::Context->preference('RoutingSerials'),
|
||||
csrf_token => Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -143,7 +143,6 @@ $template->param(
|
|||
userid => $bor->{'userid'},
|
||||
destination => $destination,
|
||||
is_child => ( $bor->{'category_type'} eq 'C' ),
|
||||
activeBorrowerRelationship => ( C4::Context->preference('borrowerRelationship') ne '' ),
|
||||
minPasswordLength => $minpw,
|
||||
RoutingSerials => C4::Context->preference('RoutingSerials'),
|
||||
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID'), }),
|
||||
|
|
|
|||
|
|
@ -348,7 +348,6 @@ $template->param(
|
|||
quickslip => $quickslip,
|
||||
housebound_role => $patron->housebound_role,
|
||||
privacy_guarantor_checkouts => $data->{'privacy_guarantor_checkouts'},
|
||||
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
|
||||
AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
|
||||
SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'),
|
||||
RoutingSerials => C4::Context->preference('RoutingSerials'),
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ $template->param(
|
|||
borrowernumber => $borrowernumber,
|
||||
sentnotices => 1,
|
||||
categoryname => $borrower->{'description'},
|
||||
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
|
||||
RoutingSerials => C4::Context->preference('RoutingSerials'),
|
||||
);
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,6 @@ for (@names) {
|
|||
|
||||
$template->param(
|
||||
finesview => 1,
|
||||
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
|
||||
RoutingSerials => C4::Context->preference('RoutingSerials'),
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,6 @@ $template->param(
|
|||
borrower => $borrower,
|
||||
categoryname => $borrower->{description},
|
||||
total => $total_due,
|
||||
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
|
||||
RoutingSerials => C4::Context->preference('RoutingSerials'),
|
||||
ExtendedPatronAttributes => C4::Context->preference('ExtendedPatronAttributes'),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -126,8 +126,6 @@ $template->param(
|
|||
categoryname => $data->{description},
|
||||
is_child => ( $data->{category_type} eq 'C' ),
|
||||
loop_reading => $issues,
|
||||
activeBorrowerRelationship =>
|
||||
( C4::Context->preference('borrowerRelationship') ne '' ),
|
||||
RoutingSerials => C4::Context->preference('RoutingSerials'),
|
||||
);
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
|
|
|
|||
Loading…
Reference in New Issue