Browse Source

cleanup in memberentry,categories.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
3.0.x
Ryan Higgins 16 years ago
committed by Joshua Ferraro
parent
commit
f4811762d0
  1. 2
      admin/categorie.pl
  2. 1
      koha-tmpl/intranet-tmpl/prog/en/js/members.js
  3. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl
  4. 16
      koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
  5. 9
      members/memberentry.pl

2
admin/categorie.pl

@ -48,7 +48,7 @@ sub StringSearch {
$searchstring=~ s/\'/\\\'/g;
my @data=split(' ',$searchstring);
my $count=@data;
my $sth=$dbh->prepare("Select * from categories where (description like ?) order by category_type,description");
my $sth=$dbh->prepare("Select * from categories where (description like ?) order by category_type,description,categorycode");
$sth->execute("$data[0]%");
my @results;
while (my $data=$sth->fetchrow_hashref){

1
koha-tmpl/intranet-tmpl/prog/en/js/members.js

@ -62,6 +62,7 @@ else
}
//end function
//function test if date enrooled < date expiry
// WARNING: format-specific test.
function check_manip_date(status) {
if (status=='verify'){
// this part of function('verify') is used to check if dateenrolled<date expiry

2
koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl

@ -106,7 +106,7 @@
<li><label for="categorycode">Category code: </label> &nbsp; <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" /></li>
<!-- /TMPL_IF -->
<li><label for="description">Description: </label> &nbsp; <input type="text" name="description" id="description" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="description" -->" /></li>
<li><label for="enrolmentperiod">Enrollment period: </label> &nbsp; <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="enrolmentperiod" -->" /> months</li>
<li><label for="enrolmentperiod">Enrollment period: </label> &nbsp; <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="<!-- TMPL_VAR NAME="enrolmentperiod" -->" /> months</li>
<li><label for="dateofbirthrequired">Age required: </label> &nbsp; <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="<!-- TMPL_VAR NAME="dateofbirthrequired" -->" size="3" maxlength="3" /> years</li>
<li><label for="upperagelimit">Upperage limit: </label> &nbsp; <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="<!-- TMPL_VAR NAME="upperagelimit" -->" /> years</li>
<li><label for="enrolmentfee">Enrollment fee: </label>$<input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="<!-- TMPL_VAR NAME="enrolmentfee" -->" /></li>

16
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl

@ -156,7 +156,7 @@ patron <!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" -->
<label for="dateofbirth">
<!-- /TMPL_IF-->
Date of birth: </label>
<input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="<!-- TMPL_VAR NAME="dateofbirth" -->" />
<input type="text" id="dateofbirth" name="dateofbirth" size="20" <!-- TMPL_IF NAME="metric" -->onchange="CheckDate(document.form.dateofbirth);"<!-- /TMPL_IF --> value="<!-- TMPL_VAR NAME="dateofbirth" -->" />
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="dateofbirth_button" alt="Show Calendar" />
<script language="JavaScript" type="text/javascript">
Calendar.setup(
@ -194,13 +194,9 @@ patron <!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" -->
<input type="hidden" name="sex" value="N" />
<!--TMPL_ELSE-->
<li class="radio">
<!-- TMPL_IF NAME="female" -->
<label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" checked="checked" />
<label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
<!-- TMPL_ELSE -->
<label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
<label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" checked="checked" />
<!-- /TMPL_IF -->
<label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" <!-- TMPL_IF NAME="female" --> checked="checked" <!-- /TMPL_IF --> />
<label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" <!-- TMPL_IF NAME="male" --> checked="checked" <!-- /TMPL_IF --> />
<label for="sex-male">? </label><input type="radio" name="sex" id="sex-male" value="" <!-- TMPL_IF NAME="none" --> checked="checked" <!-- /TMPL_IF --> />
</li>
<!--/TMPL_IF-->
<!--TMPL_IF EXPR="showguarantor"--> <li><label for="">Guarantor: </label>
@ -519,7 +515,7 @@ patron <!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" -->
<label for="dateenrolled">
<!-- /TMPL_IF-->
Registration date: </label>
<input type="text" id="dateenrolled" name="dateenrolled" maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="<!-- TMPL_VAR NAME="dateenrolled" -->" />
<input type="text" id="dateenrolled" name="dateenrolled" maxlength="10" size="10" <!-- TMPL_IF NAME="metric" -->onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');"<!-- /TMPL_IF--> value="<!-- TMPL_VAR NAME="dateenrolled" -->" />
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="dateenrolled_button" alt="Show Calendar" />
<script language="JavaScript" type="text/javascript">
Calendar.setup(
@ -539,7 +535,7 @@ patron <!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" -->
<label for="dateexpiry">
<!-- /TMPL_IF-->
Expiry date: </label>
<input type="text" id="dateexpiry" name="dateexpiry" maxlength="10" size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="<!-- TMPL_VAR NAME="dateexpiry" -->" />
<input type="text" id="dateexpiry" name="dateexpiry" maxlength="10" size="10" <!-- TMPL_IF NAME="metric" -->onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');"<!-- /TMPL_IF--> value="<!-- TMPL_VAR NAME="dateexpiry" -->" />
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="dateexpiry_button" alt="Show Calendar" />
<script language="JavaScript" type="text/javascript">
Calendar.setup(

9
members/memberentry.pl

@ -108,9 +108,9 @@ if ($op eq 'insert' || $op eq 'modify' || $op eq 'save') {
$newdata{$key} = $input->param($key) if (defined $input->param($key));
$newdata{$key} =~ s/\"/&quot;/gg unless $key eq 'borrowernotes' or $key eq 'opacnote';
}
$newdata{'dateenrolled'}=format_date_in_iso($newdata{'dateenrolled'}) if ($newdata{dateenrolled});
$newdata{'dateexpiry'} =format_date_in_iso($newdata{'dateexpiry'} ) if ($newdata{dateexpiry});
$newdata{'dateofbirth'} =format_date_in_iso($newdata{'dateofbirth'} ) if ($newdata{dateofbirth});
# $newdata{'dateenrolled'}=format_date_in_iso($newdata{'dateenrolled'}) if ($newdata{dateenrolled});
# $newdata{'dateexpiry'} =format_date_in_iso($newdata{'dateexpiry'} ) if ($newdata{dateexpiry});
# $newdata{'dateofbirth'} =format_date_in_iso($newdata{'dateofbirth'} ) if ($newdata{dateofbirth});
# check permission to modify login info.
if (ref($borrower_data) && ($borrower_data->{'category_type'} eq 'S') && ! (C4::Auth::haspermission($dbh,$userenv->{'id'},{'staffaccess'=>1})) ) {
$NoUpdateLogin =1;
@ -171,6 +171,7 @@ if ($op eq 'save' || $op eq 'insert'){
$nok = 1;
}
}
warn $newdata{'dateofbirth'};
if (C4::Context->preference("IndependantBranches")) {
if ($userenv && $userenv->{flags} != 1){
@ -221,6 +222,7 @@ if ($op eq 'save'){
delete $newdata{'password'};
delete $newdata{'userid'};
}
warn $newdata{'dateofbirth'};
&ModMember(%newdata);
if ($destination eq "circ") {
print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$data{'cardnumber'}");
@ -489,6 +491,7 @@ $template->param(
guarantorinfo => $guarantorinfo,
flagloop => \@flagdata,
dateformat => C4::Dates->new()->visual(),
C4::Context->preference('dateformat') => 1,
check_categorytype =>$check_categorytype,#to recover the category type with checkcategorytype function
modify => $modify,
nok => $nok,#flag to konw if an error

Loading…
Cancel
Save