From 963c7de328849f448ee133cac74e2724788f8816 Mon Sep 17 00:00:00 2001 From: btoumi Date: Thu, 15 Jun 2006 14:05:23 +0000 Subject: [PATCH] Members.pm:add a field in sql request (sub getborrowercategory) to return category_type memberentry.pl:modify call to getborrowercategory moremember.tmpl:modify condition to display "add child" option (only for adult) moremember.pl:add condition,call to getborrowercategory , change variable name --- C4/Members.pm | 12 ++++++------ .../intranet-tmpl/prog/en/members/moremember.tmpl | 10 ++++------ members/memberentry.pl | 9 ++++----- members/moremember.pl | 13 +++++-------- 4 files changed, 19 insertions(+), 25 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index aa74812541..201901497f 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -412,7 +412,7 @@ sub newmember { $data{'dateofbirth'} = format_date_in_iso( $data{'dateofbirth'} ); $data{'dateenrolled'} = format_date_in_iso( $data{'dateenrolled'} ); $data{'dateexpiry'} = format_date_in_iso( $data{'dateexpiry'} ); - my $query = + my $query = "insert into borrowers set cardnumber=" . $dbh->quote( $data{'cardnumber'} ) . ",surname=" @@ -1162,10 +1162,10 @@ sub borrowercategories { =head2 getborrowercategory - $description = &getborrowercategory($categorycode); + $description,$dateofbirthrequired,$upperagelimit,$category_type = &getborrowercategory($categorycode); Given the borrower's category code, the function returns the corresponding -description for a comprehensive information display. +description , dateofbirthrequired , upperagelimit and category type for a comprehensive information display. =cut @@ -1174,11 +1174,11 @@ sub getborrowercategory { my $dbh = C4::Context->dbh; my $sth = $dbh->prepare( - "SELECT description,dateofbirthrequired,upperagelimit FROM categories WHERE categorycode = ?"); + "SELECT description,dateofbirthrequired,upperagelimit,category_type FROM categories WHERE categorycode = ?"); $sth->execute($catcode); - my ($description,$dateofbirthrequired,$upperagelimit) = $sth->fetchrow(); + my ($description,$dateofbirthrequired,$upperagelimit,$category_type) = $sth->fetchrow(); $sth->finish(); - return ($description,$dateofbirthrequired,$upperagelimit); + return ($description,$dateofbirthrequired,$upperagelimit,$category_type); } # sub getborrowercategory diff --git a/koha-tmpl/intranet-tmpl/prog/en/members/moremember.tmpl b/koha-tmpl/intranet-tmpl/prog/en/members/moremember.tmpl index 6de18c2884..9b15e37481 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/members/moremember.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/members/moremember.tmpl @@ -6,13 +6,11 @@

()