Bugzilla – Attachment 24481 Details for
Bug 11513
Warnings in Patron categories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11513 - Warnings in Patron categories
Bug-11513---Warnings-in-Patron-categories.patch (text/plain), 8.39 KB, created by
Mark Tompsett
on 2014-01-17 02:58:30 UTC
(
hide
)
Description:
Bug 11513 - Warnings in Patron categories
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2014-01-17 02:58:30 UTC
Size:
8.39 KB
patch
obsolete
>From 46a3649cbb93bc73fdae7ce77f79d295daaa130d Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Fri, 10 Jan 2014 00:06:21 -0500 >Subject: [PATCH] Bug 11513 - Warnings in Patron categories > >Just going to the patron categories page triggered errors. >Running through all the plain options also triggered other >warnings. This fix silences them. > >Discovered tabs I had not corrected by running qa test tool. > >Some errors which I could not trigger were also fixed, such >as line 248 shown by Merllissia Manueli. > >TEST PLAN >--------- > 1) Log in to staff client > 2) Click 'Administration' > 3) Click 'Patron categories' > 4) Click '+ New category' > 5) Enter a dummy category and click 'Save' > 6) Click 'Edit' for the dummy category. > 7) Change a value and click 'Save' > 8) Click 'Delete' for the dummy category. > 9) Confirm to delete. >10) Review error log, several new warnings >11) Apply patch >12) Run the koha qa test tool. >13) Click 'Home' >14) Click 'Administration' >15) Click 'Patron categories' >16) Click '+ New category' >17) Enter a dummy category and click 'Save' >18) Click 'Edit' for the dummy category. >19) Change a value and click 'Save' >20) Click 'Delete' for the dummy category. >21) Confirm to delete. >22) Review error log, no new warnings >--- > admin/categorie.pl | 35 ++++++++++++++------ > .../prog/en/modules/admin/categorie.tt | 3 +- > 2 files changed, 26 insertions(+), 12 deletions(-) > >diff --git a/admin/categorie.pl b/admin/categorie.pl >index 952ef7a..6ea7b5a 100755 >--- a/admin/categorie.pl >+++ b/admin/categorie.pl >@@ -49,8 +49,10 @@ use C4::Form::MessagingPreferences; > sub StringSearch { > my ($searchstring,$type)=@_; > my $dbh = C4::Context->dbh; >+ $searchstring //= ''; > $searchstring=~ s/\'/\\\'/g; > my @data=split(' ',$searchstring); >+ push @data,q{} if $#data==-1; > my $count=@data; > my $sth=$dbh->prepare("Select * from categories where (description like ?) order by category_type,description,categorycode"); > $sth->execute("$data[0]%"); >@@ -67,7 +69,7 @@ my $input = new CGI; > my $searchfield=$input->param('description'); > my $script_name="/cgi-bin/koha/admin/categorie.pl"; > my $categorycode=$input->param('categorycode'); >-my $op = $input->param('op'); >+my $op = $input->param('op') // ''; > > my ($template, $loggedinuser, $cookie) > = get_template_and_user({template_name => "admin/categorie.tmpl", >@@ -106,7 +108,10 @@ if ($op eq 'add_form') { > $sth->finish; > } > >- $data->{'enrolmentperioddate'} = undef if ($data->{'enrolmentperioddate'} eq '0000-00-00'); >+ if ($data->{'enrolmentperioddate'} && $data->{'enrolmentperioddate'} eq '0000-00-00') { >+ $data->{'enrolmentperioddate'} = undef; >+ } >+ $data->{'category_type'} //= ''; > > my $branches = GetBranches; > my @branches_loop; >@@ -121,13 +126,13 @@ if ($op eq 'add_form') { > > $template->param(description => $data->{'description'}, > enrolmentperiod => $data->{'enrolmentperiod'}, >- enrolmentperioddate => C4::Dates::format_date($data->{'enrolmentperioddate'}), >+ enrolmentperioddate => $data->{'enrolmentperioddate'}, > upperagelimit => $data->{'upperagelimit'}, > dateofbirthrequired => $data->{'dateofbirthrequired'}, >- enrolmentfee => sprintf("%.2f",$data->{'enrolmentfee'}), >+ enrolmentfee => sprintf("%.2f",$data->{'enrolmentfee'} || 0), > overduenoticerequired => $data->{'overduenoticerequired'}, > issuelimit => $data->{'issuelimit'}, >- reservefee => sprintf("%.2f",$data->{'reservefee'}), >+ reservefee => sprintf("%.2f",$data->{'reservefee'} || 0), > hidelostitems => $data->{'hidelostitems'}, > category_type => $data->{'category_type'}, > SMSSendDriver => C4::Context->preference("SMSSendDriver"), >@@ -202,15 +207,18 @@ if ($op eq 'add_form') { > $template->param(totalgtzero => 1); > } > >+ if ($data->{'enrolmentperioddate'} && $data->{'enrolmentperioddate'} eq '0000-00-00') { >+ $data->{'enrolmentperioddate'} = undef; >+ } > $template->param( description => $data->{'description'}, > enrolmentperiod => $data->{'enrolmentperiod'}, >- enrolmentperioddate => C4::Dates::format_date($data->{'enrolmentperioddate'}), >+ enrolmentperioddate => $data->{'enrolmentperioddate'}, > upperagelimit => $data->{'upperagelimit'}, > dateofbirthrequired => $data->{'dateofbirthrequired'}, >- enrolmentfee => sprintf("%.2f",$data->{'enrolmentfee'}), >+ enrolmentfee => sprintf("%.2f",$data->{'enrolmentfee'} || 0), > overduenoticerequired => $data->{'overduenoticerequired'}, > issuelimit => $data->{'issuelimit'}, >- reservefee => sprintf("%.2f",$data->{'reservefee'}), >+ reservefee => sprintf("%.2f",$data->{'reservefee'} || 0), > hidelostitems => $data->{'hidelostitems'}, > category_type => $data->{'category_type'}, > ); >@@ -240,17 +248,22 @@ if ($op eq 'add_form') { > while ( my $branch = $sth->fetchrow_hashref ) { > push @selected_branches, $branch; > } >+ my $enrolmentperioddate = $results->[$i]{'enrolmentperioddate'}; >+ if ($enrolmentperioddate && $enrolmentperioddate eq '0000-00-00') { >+ $enrolmentperioddate = undef; >+ } >+ $results->[$i]{'category_type'} //= ''; > my %row = ( > categorycode => $results->[$i]{'categorycode'}, > description => $results->[$i]{'description'}, > enrolmentperiod => $results->[$i]{'enrolmentperiod'}, >- enrolmentperioddate => C4::Dates::format_date($results->[$i]{'enrolmentperioddate'}), >+ enrolmentperioddate => $enrolmentperioddate, > upperagelimit => $results->[$i]{'upperagelimit'}, > dateofbirthrequired => $results->[$i]{'dateofbirthrequired'}, >- enrolmentfee => sprintf("%.2f",$results->[$i]{'enrolmentfee'}), >+ enrolmentfee => sprintf("%.2f",$results->[$i]{'enrolmentfee'} || 0), > overduenoticerequired => $results->[$i]{'overduenoticerequired'}, > issuelimit => $results->[$i]{'issuelimit'}, >- reservefee => sprintf("%.2f",$results->[$i]{'reservefee'}), >+ reservefee => sprintf("%.2f",$results->[$i]{'reservefee'} || 0), > hidelostitems => $results->[$i]{'hidelostitems'}, > category_type => $results->[$i]{'category_type'}, > "type_".$results->[$i]{'category_type'} => 1, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt >index d1c2e4c..6106e5f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt >@@ -1,3 +1,4 @@ >+[% USE KohaDates -%] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Patron categories › [% IF ( add_form ) %][% IF ( categorycode ) %]Modify category '[% categorycode |html %]'[% ELSE %]New category[% END %][% END %] > [% IF ( add_validate ) %]Data recorded[% END %] >@@ -151,7 +152,7 @@ > <li><label for="enrolmentperiod" style="width:6em;">In months: </label> > <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF ( enrolmentperiod ) %][% enrolmentperiod %][% END %]" /> months</li> > <li><label for="enrolmentperioddate" style="width:6em;">Until date: </label> >- <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="[% enrolmentperioddate %]" /> >+ <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="[% enrolmentperioddate | $KohaDates %]" /> > <div id="enrolmentmessage" class="hint" style="margin-left:0;">Cannot have "months" and "until date" at the same time</div> > </li> > </ol> >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11513
:
24106
|
24107
|
24164
|
24169
|
24475
|
24476
|
24477
|
24478
|
24479
|
24480
|
24481
|
24865
|
24931