More changes to update-child process. Many scripts missing necessary data for checkin...
authorOwen Leonard <oleonard@myacpl.org>
Tue, 8 Jul 2008 14:28:55 +0000 (09:28 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 8 Jul 2008 23:09:38 +0000 (18:09 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
12 files changed:
circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tmpl
members/boraccount.pl
members/mancredit.pl
members/maninvoice.pl
members/member-flags.pl
members/member-password.pl
members/messaging.pl
members/pay.pl
members/readingrec.pl

index 9708d09..61babaa 100755 (executable)
@@ -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") ) {
index 38a3133..ebd1f76 100644 (file)
@@ -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({
index 2121ee0..b4cbd03 100644 (file)
@@ -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 -->
index 4367975..5cc059a 100755 (executable)
@@ -1,15 +1,25 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; 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>&nbsp;</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 -->
+
 
 
 
index 1cfb5ef..8d94adb 100755 (executable)
@@ -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;
index 4832455..847e528 100755 (executable)
@@ -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;
index 1744235..6e3f225 100755 (executable)
@@ -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'});
index 4f45033..64de60a 100755 (executable)
@@ -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;
index 0ee5337..e538711 100755 (executable)
@@ -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;
index b37a066..81821e5 100755 (executable)
@@ -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') } );
index e0de50a..c968797 100755 (executable)
@@ -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;
index 611078b..2809129 100755 (executable)
@@ -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';