&GetPendingIssues
&GetAllIssues
- &get_institutions
&getzipnamecity
&getidcity
push @EXPORT, qw(
&AddMember
&AddMember_Opac
- &add_member_orgs
&MoveMemberToDeleted
&ExtendMemberSubscriptionTo
);
return $age;
} # sub get_age
-=head2 get_institutions
-
- $insitutions = get_institutions();
-
-Just returns a list of all the borrowers of type I, borrownumber and name
-
-=cut
-
-#'
-sub get_institutions {
- my $dbh = C4::Context->dbh();
- my $sth =
- $dbh->prepare(
-"SELECT borrowernumber,surname FROM borrowers WHERE categorycode=? ORDER BY surname"
- );
- $sth->execute('I');
- my %orgs;
- while ( my $data = $sth->fetchrow_hashref() ) {
- $orgs{ $data->{'borrowernumber'} } = $data;
- }
- return ( \%orgs );
-
-} # sub get_institutions
-
-=head2 add_member_orgs
-
- add_member_orgs($borrowernumber,$borrowernumbers);
-
-Takes a borrowernumber and a list of other borrowernumbers and inserts them into the borrowers_to_borrowers table
-
-=cut
-
-#'
-sub add_member_orgs {
- my ( $borrowernumber, $otherborrowers ) = @_;
- my $dbh = C4::Context->dbh();
- my $query =
- "INSERT INTO borrowers_to_borrowers (borrower1,borrower2) VALUES (?,?)";
- my $sth = $dbh->prepare($query);
- foreach my $otherborrowernumber (@$otherborrowers) {
- $sth->execute( $borrowernumber, $otherborrowernumber );
- }
-
-} # sub add_member_orgs
-
=head2 GetCities
$cityarrayref = GetCities();
my $duedatespec = $query->param('duedatespec') || $session->param('stickyduedate');
my $issueconfirmed = $query->param('issueconfirmed');
my $cancelreserve = $query->param('cancelreserve');
-my $organisation = $query->param('organisations');
my $print = $query->param('print') || q{};
my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice
my $charges = $query->param('charges') || q{};
$template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
}
-my $CGIorganisations;
-my $member_of_institution;
-if ( C4::Context->preference("memberofinstitution") ) {
- my $organisations = get_institutions();
- my @orgs;
- my %org_labels;
- foreach my $organisation ( keys %$organisations ) {
- push @orgs, $organisation;
- $org_labels{$organisation} = $organisations->{$organisation}->{'surname'};
- }
- $member_of_institution = 1;
- $CGIorganisations = CGI::popup_menu(
- -id => 'organisations',
- -name => 'organisations',
- -labels => \%org_labels,
- -values => \@orgs,
- );
-}
-
my $lib_messages_loop = GetMessages( $borrowernumber, 'L', $branch );
if($lib_messages_loop){ $template->param(flagged => 1 ); }
relprevissues => \@relprevissues,
displayrelissues => $displayrelissues,
inprocess => $inprocess,
- memberofinstution => $member_of_institution,
- CGIorganisations => $CGIorganisations,
is_child => ($borrower->{'category_type'} eq 'C'),
circview => 1,
soundon => C4::Context->preference("SoundOn"),
('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'),
('maxRecordsForFacets','20',NULL,NULL,'Integer'),
('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
-('memberofinstitution','0',NULL,'If ON, patrons can be linked to institutions','YesNo'),
('minPasswordLength','3',NULL,'Specify the minimum length of a patron/staff password','free'),
('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''),
('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'),
print "Upgrade to $DBversion done (Bug 3445: Add indexes to action_logs table)\n";
SetVersion($DBversion);
}
+$DBversion = "3.15.00.XXX";
+if (CheckVersion($DBversion)) {
+ $dbh->do(q|
+ DELETE FROM systempreferences WHERE variable= "memberofinstitution"
+ |);
+ print "Upgrade to $DBversion done (Bug 11751: Remove memberofinstitytion system preference)\n";
+ SetVersion($DBversion);
+}
=head1 FUNCTIONS
- '[% local_currency %].'
- Empty value means no limit. Single item caps are specified in the circulation rules matrix.
-
- - pref: memberofinstitution
- choices:
- yes: Do
- no: "Don't"
- - allow patrons to be linked to institutions (which must be set up as Institution patrons).
- -
- Login passwords for staff and patrons must be at least
- pref: minPasswordLength
class: integer
}
}
- if ($data{'organisations'}){
- # need to add the members organisations
- my @orgs=split(/\|/,$data{'organisations'});
- add_member_orgs($borrowernumber,\@orgs);
- }
if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) {
C4::Members::Attributes::SetBorrowerAttributes($borrowernumber, $extended_patron_attributes);
}
$template->param(no_categories => 1);
}
$template->param(no_add => $no_add);
-my $CGIorganisations;
-my $member_of_institution;
-if (C4::Context->preference("memberofinstitution")){
- my $organisations=get_institutions();
- my @orgs;
- my %org_labels;
- foreach my $organisation (keys %$organisations) {
- push @orgs,$organisation;
- $org_labels{$organisation}=$organisations->{$organisation}->{'surname'};
- }
- $member_of_institution=1;
-
- $CGIorganisations = CGI::scrolling_list( -id => 'organisations',
- -name => 'organisations',
- -labels => \%org_labels,
- -values => \@orgs,
- -size => 5,
- -multiple => 'true'
-
- );
-}
-
# --------------------------------------------------------------------------------------------------------
my $CGIsort = buildCGIsort("Bsort1","sort1",$data{'sort1'});
category_type =>$category_type,
modify => $modify,
nok => $nok,#flag to konw if an error
- memberofinstution => $member_of_institution,
- CGIorganisations => $CGIorganisations,
NoUpdateLogin => $NoUpdateLogin
);