Should be the last of the changes to these files
authorrangi <rangi>
Tue, 23 May 2006 02:18:21 +0000 (02:18 +0000)
committerrangi <rangi>
Tue, 23 May 2006 02:18:21 +0000 (02:18 +0000)
Have to build a table to store borrower->organisation (which are really just other borrowers) links and write a routine to populate that table.

May have to make another change to memberentry.pl

koha-tmpl/intranet-tmpl/prog/en/members/memberentryA.tmpl
members/memberentry.pl

index b005321..cf9150a 100755 (executable)
        <input type="hidden" name="fax"  value="<!-- TMPL_VAR NAME="fax" -->"> 
        <input type="hidden" name="email" value="<!-- TMPL_VAR NAME="email" -->" >
        <input type="hidden" name="emailpro" value="<!-- TMPL_VAR NAME="emailpro" -->" >
+       <input type="hidden" name="organisations" value="<!-- TMPL_VAR NAME="organisations" -->" >      
        <!-- TMPL_IF NAME="opadd" -->
                <input type="hidden" name="op" value="add">
        <!-- TMPL_ELSE -->
index cebf781..703a994 100755 (executable)
@@ -204,6 +204,10 @@ SELECT upperagelimit,
                                $nok=1;
                        } else {
                                $borrowerid = &newmember(%data);
+                               if ($data{'organisations'}){
+                                   # need to add the members organisations
+                                   add_member_orgs($borrowerid,$data{'organisations'});
+                                }
                                logaction($loggedinuser,"MEMBERS","add member", $borrowerid, "");
                        }
                }
@@ -393,19 +397,21 @@ if ($delete){
        if (C4::Context->preference("memberofinstitution")){
           my $organisations=get_institutions();
           my @orgs;
-          my %orgs;
+          my %org_labels;
           foreach my $organisation (keys %$organisations) {
               push @orgs,$organisation;
-              $orgs{$organisation}=$organisations->{$organisation}->{'surname'};
+              $org_labels{$organisation}=$organisations->{$organisation}->{'surname'};
           }
-              
           $member_of_institution=1;
           
-          $CGIorganisations = CGI::scrolling_list( -name=>'organisations',
-              -values=>\@orgs,
-              -size=>5,
-              -multiple=>'true'
-              -labels=>\%orgs,
+          $CGIorganisations = CGI::scrolling_list( -id => 'organisations',
+              -name     => 'organisations',
+              -labels   => \%org_labels,
+              -values   => \@orgs,
+              -size     => 5,
+              -multiple => 'true'
+
+              
           );
        }
 
@@ -506,6 +512,7 @@ if ($delete){
                citypopup       => $citypopup,
                roadpopup       => $roadpopup,  
                contacttype     => $data{'contacttype'},
+               organisations   => $data{'organisations'},
                flagloop        => \@flagdata,
 #                              "contacttype_".$data{'contacttype'} =>" SELECTED ",
                dateformat      => display_date_format(),