---
circ/circulation.pl | 7 ++++
.../prog/en/includes/circ-toolbar.inc | 20 ++++++++++-
.../prog/en/includes/members-toolbar.inc | 9 ++---
.../prog/en/modules/members/update-child.tmpl | 36 +++++++++++++------
members/boraccount.pl | 7 ++++
members/mancredit.pl | 8 ++++
members/maninvoice.pl | 7 ++++
members/member-flags.pl | 7 ++++
members/member-password.pl | 7 ++++
members/messaging.pl | 9 +++++
members/pay.pl | 7 ++++
members/readingrec.pl | 7 ++++
12 files changed, 112 insertions(+), 19 deletions(-)
diff --git a/circ/circulation.pl b/circ/circulation.pl
index 9708d09..61babaa 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -634,6 +634,13 @@ foreach $flag ( sort keys %$flags ) {
my $amountold = $borrower->{flags}->{'CHARGES'}->{'message'} || 0;
my @temp = split( /\$/, $amountold );
+ if ( $borrower->{'category_type'} eq 'C') {
+ my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE
category_type = ?' );
+ my $cnt = scalar(@$catcodes);
+ $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
+ $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
+ }
+
my $CGIorganisations;
my $member_of_institution;
if ( C4::Context->preference("memberofinstitution") ) {
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc
b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc
index 38a3133..ebd1f76 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc
@@ -12,6 +12,14 @@ function confirm_deletion() {
}
}
+function confirm_updatechild() {
+ var is_confirmed = window.confirm('Are you sure you want to update this
child to an Adult category? This cannot be undone.');
+
+ if (is_confirmed) {
+
window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=<!--
TMPL_VAR NAME="borrowernumber" -->&catcode=<!-- TMPL_VAR NAME="catcode"
-->&catcode_multi=<!-- TMPL_VAR NAME="CATCODE_MULTI" -->';
+ }
+}
+
function confirm_reregistration() {
var is_confirmed = window.confirm('Are you sure you want to renew this
patron\'s registration?');
var borrowernumbervalue1 = $("#borrowernumber").attr("value");
@@ -20,6 +28,15 @@ function confirm_reregistration() {
}
}
+function update_child() {
+ var borrowernumbervalue= $("#borrowernumber").attr("value");
+<!-- TMPL_IF NAME="CATCODE_MULTI" -->
+
window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=<!--
TMPL_VAR NAME="borrowernumber"
-->','UpdateChild','width=400,height=300,toolbar=no,scrollbars=no,resizable=yes');
+<!-- TMPL_ELSE -->
+ confirm_updatechild();
+<!-- /TMPL_IF -->
+}
+
// prepare DOM for YUI Toolbar
$(document).ready(function() {
@@ -50,7 +67,8 @@ function confirm_reregistration() {
<!-- TMPL_UNLESS NAME="CAN_user_staffaccess" -->,
disabled: true<!-- /TMPL_UNLESS-->
<!-- TMPL_ELSE --><!-- /TMPL_IF -->
<!-- TMPL_ELSE -->, disabled: true<!-- /TMPL_IF-->},
- { text: _("Delete"), <!-- TMPL_IF NAME="StaffMember" --><!--
TMPL_UNLESS NAME="CAN_user_staffaccess" -->disabled: true, <!-- /TMPL_UNLESS
--><!-- /TMPL_IF --> onclick: { fn: confirm_deletion } }
+ { text: _("Delete"), <!-- TMPL_IF NAME="StaffMember" --><!--
TMPL_UNLESS NAME="CAN_user_staffaccess" -->disabled: true, <!-- /TMPL_UNLESS
--><!-- /TMPL_IF --> onclick: { fn: confirm_deletion } },
+ { text: _("Update Child to Adult Patron") , onclick: {
fn: update_child }<!-- TMPL_UNLESS NAME="is_child" -->, disabled: true<!--
/TMPL_UNLESS -->}
];
new YAHOO.widget.Button({
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
index 2121ee0..b4cbd03 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
@@ -4,10 +4,8 @@
function confirm_deletion() {
var is_confirmed = window.confirm('Are you sure you want to delete this
patron? This cannot be undone.');
- var borrowernumbervalue=document.form.borrowernumber.value;
-
if (is_confirmed) {
-
window.location='/cgi-bin/koha/members/deletemem.pl?member='+borrowernumbervalue+'';
+ window.location='/cgi-bin/koha/members/deletemem.pl?member=<!--
TMPL_VAR NAME="borrowernumber" -->';
}
}
function confirm_updatechild() {
@@ -20,13 +18,12 @@ function confirm_updatechild() {
function confirm_reregistration() {
var is_confirmed = window.confirm('Are you sure you want to renew this
patron\'s registration?');
- var borrowernumbervalue1=document.form.borrowernumber.value; if
(is_confirmed) {
-
window.location='/cgi-bin/koha/members/moremember.pl?reregistration=y&borrowernumber='+borrowernumbervalue1+'';
+ if (is_confirmed) {
+
window.location='/cgi-bin/koha/members/moremember.pl?reregistration=y&borrowernumber=<!--
TMPL_VAR NAME="borrowernumber" -->';
}
}
function update_child() {
- var borrowernumbervalue=document.form.borrowernumber.value;
<!-- TMPL_IF NAME="CATCODE_MULTI" -->
window.open('update-child.pl?op=multi&borrowernumber=<!-- TMPL_VAR
NAME="borrowernumber"
-->','UpdateChild','width=400,height=300,toolbar=no,scrollbars=no,resizable=yes');
<!-- TMPL_ELSE -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tmpl
b/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tmpl
index 4367975..5cc059a 100755
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tmpl
@@ -1,15 +1,25 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha › Choose Adult category</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-
+<style type="text/css">
+ #custom-doc { width:29em;*width:28.3em;min-width:377px; margin:auto;
text-align:left; }
+</style>
</head>
<body>
-<div id="doc" class="yui-t7">
+<div id="custom-doc" class="yui-t7">
<div id="bd">
<!--TMPL_IF NAME="CONFIRM" -->
<script language="javascript" type="text/javascript">
+function confirm_updatechild() {
+ var is_confirmed = window.confirm('Are you sure you want to update this
child to an Adult category? This cannot be undone.');
+
+ if (is_confirmed) {
+
window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=<!--
TMPL_VAR NAME="borrowernumber" -->&catcode=<!-- TMPL_VAR NAME="catcode"
-->&catcode_multi=<!-- TMPL_VAR NAME="CATCODE_MULTI" -->';
+ }
+}
+
confirm_updatechild(<!-- TMPL_VAR NAME="borrowernumber" -->);
</script>
<!-- /TMPL_IF -->
@@ -25,22 +35,24 @@ window.close();
<!--TMPL_IF NAME="MULTI" -->
-<h1> Choose Adult category </h1>
+<h3> Choose Adult category </h3>
<!--TMPL_IF NAME="CAT_LOOP" -->
+
<form method="post" action="update-child.pl">
+<fieldset>
<table>
<tr>
-<th> </th>
-<th>CODE</th>
-<th>DESC</th>
+<th> </th>
+<th>Code</th>
+<th>Description</th>
</tr>
<!-- TMPL_LOOP NAME="CAT_LOOP" -->
<tr>
<td>
-<input type="radio" id="catcode" name="catcode" value="<!-- TMPL_VAR
NAME="catcode" -->" />
+<input type="radio" id="catcode<!-- TMPL_VAR NAME="catcode" -->"
name="catcode" value="<!-- TMPL_VAR NAME="catcode" -->" />
<td><!-- TMPL_VAR NAME="catcode" --></td>
-<td><b><!-- TMPL_VAR NAME="catdesc" --></b></td>
+<td><label for="catcode<!-- TMPL_VAR NAME="catcode" -->"><strong><!-- TMPL_VAR
NAME="catdesc" --></strong></label></td>
</tr>
<!-- /TMPL_LOOP -->
</table>
@@ -49,12 +61,12 @@ window.close();
<input type="hidden" name="catcode" value="<!-- TMPL_VAR NAME="catcode" -->" />
<input type="hidden" name="cattype" value="<!-- TMPL_VAR NAME="cattype" -->" />
<input type="hidden" name="catcode_multi" value="<!-- TMPL_VAR
NAME="CATCODE_MULTI" -->" />
-<input class="submit" type="submit" value="Submit"/>
-<script language="javascript" type="text/javascript">
-</script>
-
+<fieldset class="action"><input class="submit" type="submit" value="Submit" />
<a href="#" class="cancel close">Cancel</a></fieldset>
<!--/TMPL_IF-->
+</fieldset>
</form>
+<!-- /TMPL_IF -->
+
diff --git a/members/boraccount.pl b/members/boraccount.pl
index 1cfb5ef..8d94adb 100755
--- a/members/boraccount.pl
+++ b/members/boraccount.pl
@@ -46,6 +46,13 @@ my $borrowernumber=$input->param('borrowernumber');
#get borrower details
my $data=GetMember($borrowernumber,'borrowernumber');
+if ( $data->{'category_type'} eq 'C') {
+ my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE
category_type = ?' );
+ my $cnt = scalar(@$catcodes);
+ $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
+ $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
+}
+
#get account details
my ($total,$accts,$numaccts)=GetMemberAccountRecords($borrowernumber);
my $totalcredit;
diff --git a/members/mancredit.pl b/members/mancredit.pl
index 4832455..847e528 100755
--- a/members/mancredit.pl
+++ b/members/mancredit.pl
@@ -53,6 +53,14 @@ if ($add){
flagsrequired => {borrowers => 1},
debug => 1,
});
+
+ if ( $data->{'category_type'} eq 'C') {
+ my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE
category_type = ?' );
+ my $cnt = scalar(@$catcodes);
+ $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
+ $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
+ }
+
$template->param( adultborrower => 1 ) if ( $data->{category_type} eq 'A'
);
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
$template->param( picture => 1 ) if $picture;
diff --git a/members/maninvoice.pl b/members/maninvoice.pl
index 1744235..6e3f225 100755
--- a/members/maninvoice.pl
+++ b/members/maninvoice.pl
@@ -71,6 +71,13 @@ if ($add){
flagsrequired => {borrowers => 1},
debug => 1,
});
+
+ if ( $data->{'category_type'} eq 'C') {
+ my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE
category_type = ?' );
+ my $cnt = scalar(@$catcodes);
+ $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
+ $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
+ }
$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq
'A' );
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
diff --git a/members/member-flags.pl b/members/member-flags.pl
index 4f45033..64de60a 100755
--- a/members/member-flags.pl
+++ b/members/member-flags.pl
@@ -153,6 +153,13 @@ if ($input->param('newflags')) {
push @loop, \%row;
}
+ if ( $bor->{'category_type'} eq 'C') {
+ my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE
category_type = ?' );
+ my $cnt = scalar(@$catcodes);
+ $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
+ $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
+ }
+
$template->param( adultborrower => 1 ) if ( $bor->{'category_type'} eq 'A' );
my ($picture, $dberror) = GetPatronImage($bor->{'cardnumber'});
$template->param( picture => 1 ) if $picture;
diff --git a/members/member-password.pl b/members/member-password.pl
index 0ee5337..e538711 100755
--- a/members/member-password.pl
+++ b/members/member-password.pl
@@ -76,6 +76,13 @@ if ( $newpassword && ! $errormsg ) {
$defaultnewpassword.=substr($chars, int(rand(length($chars))),1);
}
+ if ( $bor->{'category_type'} eq 'C') {
+ my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE
category_type = ?' );
+ my $cnt = scalar(@$catcodes);
+ $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
+ $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
+ }
+
$template->param( adultborrower => 1 ) if ( $bor->{'category_type'} eq 'A' );
my ($picture, $dberror) = GetPatronImage($bor->{'cardnumber'});
$template->param( picture => 1 ) if $picture;
diff --git a/members/messaging.pl b/members/messaging.pl
index b37a066..81821e5 100755
--- a/members/messaging.pl
+++ b/members/messaging.pl
@@ -124,6 +124,15 @@ PREF: foreach my $option ( @$messaging_options ) {
$option->{'digest'} = 'CHECKED' if $pref->{'wants_digest'};
}
+ if ( $borrower->{'category_type'} eq 'C') {
+ my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE
category_type = ?' );
+ my $cnt = scalar(@$catcodes);
+ $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
+ $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
+ }
+
+my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'});
+$template->param( picture => 1 ) if $picture;
# get some recent messages sent to this borrower for display:
my $message_queue = C4::Letters::GetQueuedMessages( { borrowernumber =>
$query->param('borrowernumber') } );
diff --git a/members/pay.pl b/members/pay.pl
index e0de50a..c968797 100755
--- a/members/pay.pl
+++ b/members/pay.pl
@@ -131,6 +131,13 @@ if ( $check == 0 ) {
};
}
+if ( $data->{'category_type'} eq 'C') {
+ my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE
category_type = ?' );
+ my $cnt = scalar(@$catcodes);
+ $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
+ $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
+}
+
$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
$template->param( picture => 1 ) if $picture;
diff --git a/members/readingrec.pl b/members/readingrec.pl
index 611078b..2809129 100755
--- a/members/readingrec.pl
+++ b/members/readingrec.pl
@@ -77,6 +77,13 @@ for (my $i=0;$i<$count;$i++){
push(@loop_reading,\%line);
}
+if ( $data->{'category_type'} eq 'C') {
+ my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE
category_type = ?' );
+ my $cnt = scalar(@$catcodes);
+ $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
+ $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
+}
+
$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
if (! $limit){
$limit = 'full';
--
1.5.5.GIT
_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches