This patch fixes a problem with several patron-related pages, where the
"Update child to adult patron" menu item doesn't work. With some pages,
the right category information wasn't being passed from the script to
the template. With some, the right JavaScript variable weren't being
passed from the template to the included JavaScript file.
To test, apply the patch locate some patrons with "child" type patron
categories. With each patron, go to one of the following pages and test
the "update child" process in the toolbar's "More" menu.
- Circulation ->
- Batch check out
- Notices
- Statistics
- Files
- Housebound
- Delete (test from the deletion confirmation screen).
All test should be performed on a system with multiple adult patron
categories configured AND on a system with only a single adult patron
category.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'datatables.inc' %]
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'datatables.inc' %]
+ [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") %]
<script type="text/javascript">
<script type="text/javascript">
+
+ /* Set some variables needed in members-menu.js */
+ var borrowernumber = "[% patron.borrowernumber %]";
+ var advsearch = "[% advsearch %]";
+ var dateformat = "[% dateformat %]";
+ var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
+ var CATCODE_MULTI = "[% CATCODE_MULTI %]";
+ var catcode = "[% catcode %]";
+ var destination = "[% destination %]";
+ var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
+
$(document).ready(function() {
if($('#barcodelist').length) {
$('#barcodelist').focus();
$(document).ready(function() {
if($('#barcodelist').length) {
$('#barcodelist').focus();
+ [% Asset.js("js/members-menu.js") %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/members-menu.js") %]
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/members-menu.js") %]
+ <script>
+ /* Set some variables needed in members-menu.js */
+ var borrowernumber = "[% patron.borrowernumber %]";
+ var advsearch = "[% advsearch %]";
+ var dateformat = "[% dateformat %]";
+ var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
+ var CATCODE_MULTI = "[% CATCODE_MULTI %]";
+ var catcode = "[% catcode %]";
+ var destination = "[% destination %]";
+ var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
+ </script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'calendar.inc' %]
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'calendar.inc' %]
- [% Asset.js("js/members-menu.js") %]
<script type="text/javascript">
<script type="text/javascript">
+
+ /* Set some variables needed in members-menu.js */
+ var borrowernumber = "[% patron.borrowernumber %]";
+ var advsearch = "[% advsearch %]";
+ var dateformat = "[% dateformat %]";
+ var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
+ var CATCODE_MULTI = "[% CATCODE_MULTI %]";
+ var catcode = "[% catcode %]";
+ var destination = "[% destination %]";
+ var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
+
$(document).ready(function() {
$("a.delete").click(function(){
return confirm(_("Are you sure you want to delete this delivery?"));
});
});
</script>
$(document).ready(function() {
$("a.delete").click(function(){
return confirm(_("Are you sure you want to delete this delivery?"));
});
});
</script>
+ [% Asset.js("js/members-menu.js") %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
</div>
[% MACRO jsinclude BLOCK %]
</div>
[% MACRO jsinclude BLOCK %]
- [% Asset.js("js/members-menu.js") %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
+
+ /* Set some variables needed in members-menu.js */
+ var borrowernumber = "[% patron.borrowernumber %]";
+ var advsearch = "[% advsearch %]";
+ var dateformat = "[% dateformat %]";
+ var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
+ var CATCODE_MULTI = "[% CATCODE_MULTI %]";
+ var catcode = "[% catcode %]";
+ var destination = "[% destination %]";
+ var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
+
$(document).ready(function() {
$("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
"aaSorting": [[ 3, "desc" ]],
$(document).ready(function() {
$("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
"aaSorting": [[ 3, "desc" ]],
+ [% Asset.js("js/members-menu.js") %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
use Module::Load;
use Koha::Patrons;
use Koha::Token;
use Module::Load;
use Koha::Patrons;
use Koha::Token;
+use Koha::Patron::Categories;
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) {
load Koha::NorwegianPatronDB, qw( NLMarkForDeletion NLSync );
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) {
load Koha::NorwegianPatronDB, qw( NLMarkForDeletion NLSync );
+if ( $patron->is_child ) {
+ my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
+ $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
+ $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1;
+}
+
my $op = $input->param('op') || 'delete_confirm';
my $dbh = C4::Context->dbh;
my $is_guarantor = $dbh->selectrow_array("SELECT COUNT(*) FROM borrowers WHERE guarantorid=?", undef, $member);
my $op = $input->param('op') || 'delete_confirm';
my $dbh = C4::Context->dbh;
my $is_guarantor = $dbh->selectrow_array("SELECT COUNT(*) FROM borrowers WHERE guarantorid=?", undef, $member);
use Koha::DateUtils;
use Koha::Patrons;
use Koha::Patron::Files;
use Koha::DateUtils;
use Koha::Patrons;
use Koha::Patron::Files;
+use Koha::Patron::Categories;
+ if ( $patron->is_child ) {
+ my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
+ $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
+ $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1;
+ }
+
$template->param(
files => Koha::Patron::Files->new( borrowernumber => $borrowernumber )
->GetFilesInfo(),
$template->param(
files => Koha::Patron::Files->new( borrowernumber => $borrowernumber )
->GetFilesInfo(),
+if ( $patron->is_child ) {
+ my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
+ $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
+ $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1;
+}
+
$template->param(
housebound_profile => $houseboundprofile,
visit => $houseboundvisit,
$template->param(
housebound_profile => $houseboundprofile,
visit => $houseboundvisit,
use C4::Letters;
use C4::Members::Attributes qw(GetBorrowerAttributes);
use Koha::Patrons;
use C4::Letters;
use C4::Members::Attributes qw(GetBorrowerAttributes);
use Koha::Patrons;
+use Koha::Patron::Categories;
}
my $borrower = $patron->unblessed;
}
my $borrower = $patron->unblessed;
-my ($template, $loggedinuser, $cookie)
-= get_template_and_user({template_name => "members/notices.tt",
+my ($template, $loggedinuser, $cookie)= get_template_and_user({template_name => "members/notices.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
query => $input,
type => "intranet",
authnotrequired => 0,
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
+if ( $patron->is_child ) {
+ my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
+ $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
+ $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1;
+}
+
# Allow resending of messages in Notices tab
my $op = $input->param('op') || q{};
if ( $op eq 'resend_notice' ) {
# Allow resending of messages in Notices tab
my $op = $input->param('op') || q{};
if ( $op eq 'resend_notice' ) {
use C4::Members::Attributes qw(GetBorrowerAttributes);
use C4::Output;
use Koha::Patrons;
use C4::Members::Attributes qw(GetBorrowerAttributes);
use C4::Output;
use Koha::Patrons;
+use Koha::Patron::Categories;
+if ( $patron->is_child ) {
+ my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
+ $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
+ $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1;
+}
+
$template->param(
patron => $patron,
statisticsview => 1,
$template->param(
patron => $patron,
statisticsview => 1,