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") ) {
}
}
+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");
}
}
+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() {
<!-- 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({
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() {
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 -->
<!-- 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 -->
<!--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>
<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 -->
+
#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;
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;
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'});
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;
$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;
$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') } );
};
}
+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;
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';