[Koha-patches] [PATCH] Bug 2670: Removes EXPR from opac-userupdate.tmpl

Garry Collum gcollum at gmail.com
Sat Jun 26 02:08:40 CEST 2010


---
 .../opac-tmpl/prog/en/modules/opac-userupdate.tmpl |    8 ++++----
 opac/opac-userupdate.pl                            |    7 +++++++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl
index bb0a473..364ac43 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl
@@ -65,8 +65,8 @@
 <ol>
 <li><label for="dob">Date of Birth: </label> <input id="dob" type="text" size="10" value="<!-- TMPL_VAR NAME="dateofbirth" -->" name="dateofbirth" /></li>
 <li><label for="sex">Sex: </label> <select name="sex" id="sex"><option></option>
-<!-- TMPL_IF EXPR="sex eq 'F'" --><option value="F" selected="selected">Female</option><!-- TMPL_ELSE --><option value="F">Female</option><!-- /TMPL_IF -->
-<!-- TMPL_IF EXPR="sex eq 'M'" --><option value="M" selected="selected">Male</option><!-- TMPL_ELSE --><option value="M">Male</option><!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="sex_female" --><option value="F" selected="selected">Female</option><!-- TMPL_ELSE --><option value="F">Female</option><!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="sex_male" --><option value="M" selected="selected">Male</option><!-- TMPL_ELSE --><option value="M">Male</option><!-- /TMPL_IF -->
 </select></li>
 </ol></fieldset>
 <fieldset class="brief">
@@ -123,8 +123,8 @@
 <ol>
 <li><span class="label">Date of Birth:</span> <!-- TMPL_VAR NAME="dateofbirth" --></li>
 <li><span class="label">Sex:</span>
-<!-- TMPL_IF EXPR="sex eq 'F'" -->Female<!-- /TMPL_IF -->
-<!-- TMPL_IF EXPR="sex eq 'M'" -->Male<!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="sex_female" -->Female<!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="sex_male" -->Male<!-- /TMPL_IF -->
 </li>
 </ol>
 </fieldset>
diff --git a/opac/opac-userupdate.pl b/opac/opac-userupdate.pl
index d15e740..a89fccb 100755
--- a/opac/opac-userupdate.pl
+++ b/opac/opac-userupdate.pl
@@ -152,6 +152,13 @@ $borr->{'dateexpiry'}       = format_date( $borr->{'dateexpiry'} );
 $borr->{'dateofbirth'}  = format_date( $borr->{'dateofbirth'} );
 $borr->{'ethnicity'}    = fixEthnicity( $borr->{'ethnicity'} );
 
+if($borr->{'sex'} eq 'F') {
+    $borr->{'sex_female'} = 'F';
+} 
+if($borr->{'sex'} eq 'M') {
+    $borr->{'sex_male'} = 'M';
+}
+
 if (C4::Context->preference('ExtendedPatronAttributes')) {
     my $attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber, 'opac');
     if (scalar(@$attributes) > 0) {
-- 
1.5.6.5



More information about the Koha-patches mailing list