memberentryC.tmpl: modify and add conditions
authorbtoumi <btoumi>
Tue, 13 Jun 2006 15:25:17 +0000 (15:25 +0000)
committerbtoumi <btoumi>
Tue, 13 Jun 2006 15:25:17 +0000 (15:25 +0000)
moremember.tmpl:add op value in url (modify)
memberentry.pl:modify condition

koha-tmpl/intranet-tmpl/prog/en/members/memberentryC.tmpl
koha-tmpl/intranet-tmpl/prog/en/members/moremember.tmpl
members/memberentry.pl

index d59e3e8..4db42b1 100755 (executable)
@@ -5,7 +5,7 @@
 <!-- TMPL_INCLUDE NAME="menu-members.inc" -->
 <!-- TMPL_INCLUDE NAME="javascript/members.js" -->
 
-       <!-- TMPL_IF NAME="opadd" -->
+       <!-- TMPL_IF NAME="add" -->
        <h1>
                Add children member (step <!-- TMPL_VAR NAME="step" -->)
        </h1>
                        Other name</label>
                        <input style="text-transform:uppercase;" type="text" name="othernames" size="20"  value="<!-- TMPL_VAR NAME="othernames" -->" >
                </p>
-               <p><a href="javascript:Dopopguarantor('guarantor_search.pl');">Find guarantor</a>
-               </p>
+       
+               <!-- TMPL_UNLESS name="guarantorid"-->  
+       <p><a href="javascript:Dopopguarantor('guarantor_search.pl');">Find guarantor</a></p>
+               <!-- /TMPL_UNLESS -->
+       
        </fieldset>
        <fieldset id="memberentry_identity">
                <legend>Borrower type</legend>
index 06f3983..6de18c2 100644 (file)
@@ -9,7 +9,7 @@
        <!-- TMPL_UNLESS name="guarantorborrowernumber" -->
        <a href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=<!-- TMPL_VAR NAME="borrowernumber" -->&category_type=C">Add child</a> 
        <!-- /TMPL_UNLESS -->
-       <a href="/cgi-bin/koha/members/memberentry.pl?borrowernumber=<!-- TMPL_VAR NAME="bornum" -->&category_type=<!-- TMPL_VAR NAME="category_type"-->">
+       <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&borrowernumber=<!-- TMPL_VAR NAME="bornum" -->&category_type=<!-- TMPL_VAR NAME="category_type"-->">
 
                Edit this Record
        </a> 
index 6bfa455..d083349 100755 (executable)
@@ -116,7 +116,7 @@ if ($op eq 'add' or $op eq 'modify') {
 
 
 #recover all data from guarantor address phone ,fax... 
-if ($category_type eq 'C' and $guarantorid ne '' and $data{'contactname'} eq ''){
+if ($category_type eq 'C' and $guarantorid ne '' ){
                        my $guarantordata=getguarantordata($guarantorid);
                        if (($data{'contactname'} eq '' or $data{'contactname'} ne $guarantordata->{'surname'})) {
                                $data{'contactfirstname'}=$guarantordata->{'firstname'};        
@@ -134,7 +134,8 @@ if ($category_type eq 'C' and $guarantorid ne '' and $data{'contactname'} eq '')
                                $data{'fax'}=$guarantordata->{'fax'};
                                $data{'email'}=$guarantordata->{'email'};
                                $data{'emailpro'}=$guarantordata->{'emailpro'};
-                       $default_city=getidcity($data{'city'});
+                               
+                               $default_city=getidcity($data{'city'});
                        }
                     }
 
@@ -284,9 +285,8 @@ if ($delete){
                                        -default=>$default_category,
                                        -labels=>$labels);
        #test in city
-       
-       if ($op eq ''){
-       (my $selectcity=&getidcity($data{'city'})) if ($select_city eq '');
+       if ($op eq 'modify' and  $select_city eq '' ){
+       my $selectcity=&getidcity($data{'city'});
        $default_city=$selectcity;
        }
        my($cityid,$name_city)=getcities();