opacuserlogin => "" . C4::Context->preference("opacuserlogin"),
reviewson => C4::Context->preference("reviewson"),
ShowReviewer => C4::Context->preference("ShowReviewer"),
+ ShowReviewerPhoto => C4::Context->preference("ShowReviewerPhoto"),
suggestion => "" . C4::Context->preference("suggestion"),
virtualshelves => "" . C4::Context->preference("virtualshelves"),
OPACSerialIssueDisplayCount => C4::Context->preference("OPACSerialIssueDisplayCount"),
my ($type, $item, $borrower, $branch) =
($opts->{type}, $opts->{item}, $opts->{borrower}, $opts->{branch});
my %message_name = (
- CHECKIN => 'Item Check-in',
- CHECKOUT => 'Item Checkout',
+ CHECKIN => 'Item_Check_in',
+ CHECKOUT => 'Item_Checkout',
);
my $borrower_preferences = C4::Members::Messaging::GetMessagingPreferences({
borrowernumber => $borrower->{borrowernumber},
'required' => '1',
'min_ver' => '2.22',
},
+ 'Gravatar::URL' => {
+ 'usage' => 'Photos in OPAC reviews',
+ 'required' => '0',
+ 'min_ver' => '1.03',
+ },
};
1;
my @parameters;
$query .= " AND DATE_FORMAT(timestamp, '%Y-%m-%d') >= \"".$iso_datefrom."\" " if $iso_datefrom; #fix me - mysql specific
$query .= " AND DATE_FORMAT(timestamp, '%Y-%m-%d') <= \"".$iso_dateto."\" " if $iso_dateto;
- if($user) {
+ if($user ne "") {
$query .= " AND user = ? ";
push(@parameters,$user);
}
}
}
my $execute_success=UpdateInTable("borrowers",\%data);
-# ok if its an adult (type) it may have borrowers that depend on it as a guarantor
-# so when we update information for an adult we should check for guarantees and update the relevant part
-# of their records, ie addresses and phone numbers
- my $borrowercategory= GetBorrowercategory( $data{'category_type'} );
- if ( exists $borrowercategory->{'category_type'} && $borrowercategory->{'category_type'} eq ('A' || 'S') ) {
- # is adult check guarantees;
- UpdateGuarantees(%data);
+ if ($execute_success) { # only proceed if the update was a success
+ # ok if its an adult (type) it may have borrowers that depend on it as a guarantor
+ # so when we update information for an adult we should check for guarantees and update the relevant part
+ # of their records, ie addresses and phone numbers
+ my $borrowercategory= GetBorrowercategory( $data{'category_type'} );
+ if ( exists $borrowercategory->{'category_type'} && $borrowercategory->{'category_type'} eq ('A' || 'S') ) {
+ # is adult check guarantees;
+ UpdateGuarantees(%data);
+ }
+ logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "UPDATE (executed w/ arg: $data{'borrowernumber'})") if C4::Context->preference("BorrowersLog");
}
- logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "UPDATE (executed w/ arg: $data{'borrowernumber'})")
- if C4::Context->preference("BorrowersLog");
-
return $execute_success;
}
$borrowernumber = &AddMember(%borrower);
insert new borrower into table
-Returns the borrowernumber
+Returns the borrowernumber upon success
+
+Returns as undef upon any db error without further processing
=cut
my $sth = $dbh->prepare("SELECT enrolmentfee FROM categories WHERE categorycode=?");
$sth->execute($data{'categorycode'});
my ($enrolmentfee) = $sth->fetchrow;
+ if ($sth->err) {
+ warn sprintf('Database returned the following error: %s', $sth->errstr);
+ return;
+ }
if ($enrolmentfee && $enrolmentfee > 0) {
# insert fee in patron debts
manualinvoice($data{'borrowernumber'}, '', '', 'A', $enrolmentfee);
}
+
return $data{'borrowernumber'};
}
# if ($cardnumber !~ /\S/ && $autonumber_members) {
($autonumber_members) or return $cardnumber;
+ defined($cardnumber) or return $cardnumber;
my $checkdigit = C4::Context->preference('checkdigit');
my $dbh = C4::Context->dbh;
if ( $checkdigit and $checkdigit eq 'katipo' ) {
sub checkcardnumber {
my ($cardnumber,$borrowernumber) = @_;
+ # If cardnumber is null, we assume they're allowed.
+ return 0 if !defined($cardnumber);
my $dbh = C4::Context->dbh;
my $query = "SELECT * FROM borrowers WHERE cardnumber=?";
$query .= " AND borrowernumber <> ?" if ($borrowernumber);
foreach my $attr (@$attr_list) {
$attr->{password} = undef unless exists $attr->{password};
$sth->execute($borrowernumber, $attr->{code}, $attr->{value}, $attr->{password});
+ if ($sth->err) {
+ warn sprintf('Database returned the following error: %s', $sth->errstr);
+ return; # bail immediately on errors
+ }
}
+ return 1; # borower attributes successfully set
}
=head2 extended_attributes_code_value_arrayref
my $print_mode = 0;
my $messagingprefs;
if ( $borrower->{'email'} || $borrower->{'smsalertnumber'} ) {
- $messagingprefs = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $borrowernumber, message_name => 'Hold Filled' } );
+ $messagingprefs = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $borrowernumber, message_name => 'Hold_Filled' } );
return if ( !defined( $messagingprefs->{'letter_code'} ) );
$letter_code = $messagingprefs->{'letter_code'};
to them they will do as instructed. A very basic robots.txt follow as an
example:
+-------------------------------------------
# go away
User-agent: *
Disallow: /
+-------------------------------------------
This tells every search engine that cares (User-agent: *) to not index the site
(Disallow everything past /).
+Another slightly more intelligent robots.txt file example allows for some bot indexing (good for your site in google, etc), but also stops your Koha from getting thrashing by ignoring URLs that cause heavy search load
+
+-------------------------------------------
+# do some indexing, but dont index search URLs
+User-agent: *
+Disallow: /cgi-bin/koha/opac-search.pl
+-------------------------------------------
+
If you have installed Koha to /usr/local/koha3 then this file would be placed
in the directory /usr/local/koha3/opac/htdocs/. This should prevent search
engines from browsing every biblio record, and every view of each record, on
for my $this_cgi ( split('&',$query_cgi) ) {
next unless $this_cgi;
- $this_cgi =~ m/(.?)=(.*)/;
+ $this_cgi =~ m/(.*?)=(.*)/;
my $input_name = $1;
my $input_value = $2;
push @query_inputs, { input_name => $input_name, input_value => $input_value };
att 1045 Record-control-number
att 1062 stocknumber
att 1079 Subject-topical
+att 1096 Title-later
# Koha Local-Use Biblio Indexes
melm 100$9 Cross-Reference:w,Koha-Auth-Number
melm 100$a Author,Author:p,Author:s,Editor,Author-personal-bibliography,Author-personal-bibliography:p,Author-personal-bibliography:s
-melm 100 Author,Author-title,Author-name-personal,Name,Name-and-title,Personal-name
+melm 100 Author,Author:p,Author:s,Author-title,Author-name-personal,Name,Name-and-title,Personal-name
melm 110$9 Koha-Auth-Number
-melm 110 Author,Author-title,Author-name-corporate,Name,Name-and-title,Corporate-name
+melm 110 Author,Author:p,Author:s,Author-title,Author-name-corporate,Name,Name-and-title,Corporate-name
melm 111$9 Koha-Auth-Number
-melm 111 Author,Author-title,Author-name-corporate,Name,Name-and-title,Conference-name
+melm 111 Author,Author:p,Author:s,Author-title,Author-name-corporate,Name,Name-and-title,Conference-name
melm 130$n Thematic-number
melm 130$r Music-key
melm 130$9 Koha-Auth-Number
-melm 130 Title,Title-uniform
+melm 130 Title,Title:p,Title-uniform
-melm 210 Title,Title-abbreviated
-melm 211 Title,Title-abbreviated
-melm 212 Title,Title-other-variant
-melm 214 Title,Title-expanded
-melm 222 Title,Title-key
+melm 210 Title,Title:p,Title-abbreviated
+melm 211 Title,Title:p,Title-abbreviated
+melm 212 Title,Title:p,Title-other-variant
+melm 214 Title,Title:p,Title-expanded
+melm 222 Title,Title:p,Title-key
melm 240$r Music-key
melm 240$n Thematic-number
melm 240 Title:w,Title:p,Title-uniform
melm 700$r Music-key
#melm 700$t author,Author-title,Name-and-title,Title,Title-uniform
melm 700$t Author-title,Name-and-title,Title,Title-uniform
-melm 700 Author,Author-name-corporate,Author-name-personal,Name,Editor,Personal-name
+melm 700 Author,Author:p,Author-name-personal,Name,Editor,Personal-name
#melm 710$t author,Author-title,Name-and-title,Title,Title-uniform
melm 710$t Author-title,Name-and-title,Title,Title-uniform
#melm 710$a author,author:p,Name-and-title
melm 710$a Name-and-title
melm 710$9 Koha-Auth-Number
-melm 710 Author,Corporate-name,Name
+melm 710 Author,Author:p,Corporate-name,Name
melm 711$a Name-and-title
#melm 711$t author,Author-title,Title,Title-uniform
melm 711$t Author-title,Title,Title-uniform
melm 711$9 Koha-Auth-Number
#melm 711 author,Author-name-corporate,Name,Conference-name
-melm 711 Author-name-corporate,Name,Conference-name
+melm 711 Author,Author:p,Author-name-corporate,Name,Conference-name
melm 730$n Thematic-number
melm 730$r Music-key
melm 730$9 Koha-Auth-Number
-melm 730 Title,Title-uniform
-melm 740 Title,Title-other-variant
+melm 730 Title,Title:p,Title-uniform
+melm 740 Title,Title:p,Title-other-variant
melm 751$a Name-geographic
melm 751$9 Koha-Auth-Number
melm 751 Name-geographic
melm 777$w Record-control-number
melm 780$t Title
melm 780$w Record-control-number
-melm 780 Title,Title-former,Related-periodical
+melm 780 Title,Title:p,Title-former,Related-periodical
melm 785$w Record-control-number
-melm 785 Related-periodical
+melm 785 Title,Title:p,Title-later,Related-periodical
melm 787$w Record-control-number
melm 800$a Name-and-title
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnLog',1,'If ON, enables the circulation (returns) log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('reviewson',1,'If ON, enables patron reviews of bibliographic records in the OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer',1,'If ON, name of reviewer will be shown above comments in OPAC','','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SpecifyDueDate',1,'Define whether to display \"Specify Due Date\" form in Circulation','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionHistory','simplified','Define the display preference for serials issue history in OPAC','simplified|full','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionLog',1,'If ON, enables subscriptions log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems' ,'','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O pacHiddenItems.txt for more informations.','','Textarea');
-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
\ No newline at end of file
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnLog',1,'If ON, enables the circulation (returns) log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('reviewson',1,'If ON, enables patron reviews of bibliographic records in the OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer',1,'If ON, name of reviewer will be shown above comments in OPAC','','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SpecifyDueDate',1,'Define whether to display \"Specify Due Date\" form in Circulation','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionHistory','simplified','Define the display preference for serials issue history in OPAC','simplified|full','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionLog',1,'If ON, enables subscriptions log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnLog', '0', 'Activer ce paramètre pour enregistrer les actions sur la circulation (les retours)', '', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('reviewson', '1', 'Active ou non les commentaires sur notice à l''OPAC', '', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer',1,'If ON, name of reviewer will be shown above comments in OPAC','','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SessionStorage', 'mysql', 'Utiliser mySQL ou un fichier temporaire pour stocker les informations de session. mySQL pose problème dans certains cas en France. Si vous avez des problèmes de perte d''identifiant, choisissez tmp', 'mysql|tmp', 'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionHistory', 'simplified', 'Ce paramètre définit la vue par défaut de l''état de collection, pour les abonnements. Habituellement, c''est "simplified". Choisissez "full" pour avoir l''état de collection complet par défaut', 'simplified|full', 'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionLog', '0', 'Activer ce paramètre pour enregistrer les actions sur le bulletinage', '', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
\ No newline at end of file
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('ReturnLog','1','','Se su ON, abilita i log delle restituzioni dal prestito.','YesNo');
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('reviewson','1','','Se ON, abilita la possibilità per gli utenti a inserire recensioni di record bibliografici nell\'OPAC.','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer',1,'If ON, name of reviewer will be shown above comments in OPAC','','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC','','YesNo');
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('RoutingSerials','1','','Se ON, il serial routing è attivato.','YesNo');
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('SearchMyLibraryFirst','0','','Se ON, le ricerche in OPAC restituiranno risultati limitatamente alla biblioteca impostata di default dell’utente se questi si è loggato.','YesNo');
insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('SessionStorage','mysql','mysql|Pg|tmp','Per usare un database o un file temporaneo per l\'archiviazione dei dati della sessione.','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O pacHiddenItems.txt for more informations.','','Textarea');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnBeforeExpiry',0,'If ON, checkout will be prevented if returndate is after patron card expiry',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnLog',1,'If ON, enables the circulation (returns) log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('reviewson',1,'If ON, enables patron reviews of bibliographic records in the OPAC','','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SpecifyDueDate',1,'Define whether to display \"Specify Due Date\" form in Circulation','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionHistory','simplified','Define the display preference for serials issue history in OPAC','simplified|full','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionLog',1,'If ON, enables subscriptions log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnLog',1,'If ON, enables the circulation (returns) log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('reviewson',1,'If ON, enables patron reviews of bibliographic records in the OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer',1,'If ON, name of reviewer will be shown above comments in OPAC','','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SpecifyDueDate',1,'Define whether to display \"Specify Due Date\" form in Circulation','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionHistory','simplified','Define the display preference for serials issue history in OPAC','simplified|full','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionLog',1,'If ON, enables subscriptions log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
\ No newline at end of file
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnLog',1,'If ON, enables the circulation (returns) log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('reviewson',1,'If ON, enables patron reviews of bibliographic records in the OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer',1,'If ON, name of reviewer will be shown above comments in OPAC','','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SpecifyDueDate',1,'Define whether to display \"Specify Due Date\" form in Circulation','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionHistory','simplified','Define the display preference for serials issue history in OPAC','simplified|full','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionLog',1,'If ON, enables subscriptions log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
\ No newline at end of file
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnLog',1,'If ON, enables the circulation (returns) log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('reviewson',1,'If ON, enables patron reviews of bibliographic records in the OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer',1,'If ON, name of reviewer will be shown above comments in OPAC','','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SpecifyDueDate',1,'Define whether to display \"Specify Due Date\" form in Circulation','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionHistory','simplified','Define the display preference for serials issue history in OPAC','simplified|full','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionLog',1,'If ON, enables subscriptions log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O pacHiddenItems.txt for more informations.','','Textarea');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
SetVersion ($DBversion);
}
+$DBversion = "3.05.00.003";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do(qq{
+ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
+ });
+ print "Upgrade to $DBversion done (Adds New System preference OpacRenewalBranch)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.05.00.004";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC',NULL,'YesNo');");
+ print "Upgrade to $DBversion done (Add syspref ShowReviewerPhoto)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 DropAllForeignKeys($table)
function update_child() {
// var borrowernumbervalue= $("#borrowernumber").attr("value");
[% IF ( CATCODE_MULTI ) %]
- window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=[% borrowernumber %]','UpdateChild','width=400,height=300,toolbar=no,scrollbars=no,resizable=yes');
+ window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=[% borrowernumber %]','UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes');
[% ELSE %]
confirm_updatechild();
[% END %]
function update_child() {
[% IF ( CATCODE_MULTI ) %]
- window.open('update-child.pl?op=multi&borrowernumber=[% borrowernumber %]','UpdateChild','width=400,height=300,toolbar=no,scrollbars=no,resizable=yes');
+ window.open('update-child.pl?op=multi&borrowernumber=[% borrowernumber %]','UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes');
[% ELSE %]
confirm_updatechild();
[% END %]
no: Hide
- reviewer's name above comments in OPAC.
-
+ - pref: ShowReviewerPhoto
+ choices:
+ yes: Show
+ no: Hide
+ - reviewer's photo beside comments in OPAC.
+ -
- pref: RequestOnOpac
choices:
yes: Allow
no: "Don't allow"
- patrons to renew their own books on the OPAC.
-
+ - Use
+ - pref: OpacRenewalBranch
+ choices:
+ itemhomebranch: "The Items' home branch"
+ patronhomebranch: "The Patrons' home branch"
+ checkoutbranch: "The branch the item was checked out from"
+ null: "NULL"
+ opacrenew: "OPACRenew"
+ - as branchcode to store in the statistics table
+ -
- Only allow patrons to renew their own books on the OPAC if they have less than
- pref: OPACFineNoRenewals
class: currency
[% IF ( pages ) %] [% END %][% pages %] [% IF ( illus ) %][% illus %][% END %]
[% IF ( size ) %][% size %][% END %]
</li>
-[% IF ( MARCurlS ) %]<li>
+[% IF ( MARCURLS ) %]<li>
<strong>Online Resources:</strong>
- <ul> [% FOREACH MARCurl IN MARCurlS %]
+ <ul> [% FOREACH MARCurl IN MARCURLS %]
<li>[% IF ( MARCurl.part ) %][% MARCurl.part %]
<br />[% END %]
<!-- here you might do a tmpl_if name="toc" and use greybox or equivalent for table of contents -->
- <a href="[% MARCurl.MARCurl %]" title="[% MARCurl.MARCurl %]">[% MARCurl.linktext %]</a>
+ <a href="[% MARCurl.MARCURL %]" title="[% MARCurl.MARCURL %]">[% MARCurl.linktext %]</a>
[% IF ( MARCurl.notes ) %]<ul>[% FOREACH note IN MARCurl.notes %]<li>[% note.note %]</li>[% END %]</ul>[% END %]</li>
[% END %]</ul>
</li>
<table>
<tr>
[% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]<th> </th>[% END %][% END %]
- <th>Results</th>
+ <th colspan="2">Results</th>
<th>Location</th>
</tr>
<!-- Actual Search Results -->
[% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
[% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
- [% IF ( SEARCH_RESULT.AmazonEnabled ) %][% IF ( SEARCH_RESULT.AmazonCoverImages ) %]
+ [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]
<td>
<a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
[% ELSIF ( BiblioDefaultViewisbd ) %]
<form action="/cgi-bin/koha/catalogue/ISBDdetail.pl" method="post">
[% ELSE %]
- <form action="/cgi-bin/koha/catalogue/detail.pl" method="post">
+ <form method="link" action="/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]"/>
[% END %]
+ <input type="submit" class="attachanother" value="Attach Another Item"/>
+ <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+ </form>
+ <form action="/cgi-bin/koha/catalogue/detail.pl" method="post">
<input type="submit" class="approve" value="OK" />
<input type="hidden" name="biblionumber" value="[% biblionumber %]" />
- </form></div>
+ </form>
+</div>
[% ELSE %]
[% IF ( missingparameter ) %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Choose Adult category</title>
[% INCLUDE 'doc-head-close.inc' %]
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<script type="text/javascript">
+ $(document).ready(function() {
+ $.tablesorter.defaults.widgets = ['zebra'];
+ $("#catst").tablesorter({
+ sortList: [[2,0]],
+ headers: { 0: { sorter: false }}
+ });
+ });
+</script>
<style type="text/css">
#custom-doc { width:29em;*width:28.3em;min-width:377px; margin:auto; text-align:left; }
</style>
<form method="post" action="update-child.pl">
<fieldset>
-<table>
+<table id="catst">
+<thead>
<tr>
<th> </th>
<th>Code</th>
<th>Description</th>
</tr>
+</thead>
+<tbody>
[% FOREACH CAT_LOO IN CAT_LOOP %]
<tr>
<td>
<td><label for="catcode[% CAT_LOO.catcode %]"><strong>[% CAT_LOO.catdesc %]</strong></label></td>
</tr>
[% END %]
+</tbody>
</table>
<input type="hidden" name="op" value="update" />
<input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
</div>
-[% INCLUDE 'intranet-bottom.inc' %]
+[% INCLUDE 'popup-bottom.inc' %]
<h1>Confirm Holds</h1>
[% END %]
- [% UNLESS ( cardnumber ) %]
+ [% UNLESS ( borrowernumber ) %]
[% IF ( messageborrower ) %]
<div class="dialog alert"><h3>Patron Not Found</h3><p>No patron with this name, Please, try another</p> </div>
[% END %]
<form action="placerequest.pl" method="post" onsubmit="return checkMultiHold();" name="form">
[% END %]
- <input type="hidden" size="10" name="member" value="[% cardnumber %]" />
+ <input type="hidden" size="10" name="borrowernumber" value="[% borrowernumber %]" />
<input type="hidden" name="type" value="str8" />
[% IF ( multi_hold ) %]
[% END %]
<ol> <li><span class="label">Patron:</span>
- [% IF ( cardnumber ) %]
+ [% IF ( borrowernumber ) %]
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %] ([% cardnumber %])</a>
[% ELSE %]
Not defined yet
</ol>
[% UNLESS ( multi_hold ) %]
<fieldset class="action">
- [% IF ( cardnumber ) %]
+ [% IF ( borrowernumber ) %]
[% IF ( override_required ) %]
<input type="submit" class="warning" value="Place Hold" />
[% ELSIF ( none_available ) %]
</table>
[% IF ( bibitemloo.hiddencount ) %]
<form>
- <p class="hiddencount"><a href="request.pl?biblionumber=[% bibitemloo.biblionumber %]&cardnumber=[% bibitemloo.cardnumber %]&showallitems=1">Show all items ([% bibitemloo.hiddencount %] hidden)</a></p>
+ <p class="hiddencount"><a href="request.pl?biblionumber=[% bibitemloo.biblionumber %]&borrowernumber=[% bibitemloo.borrowernumber %]&showallitems=1">Show all items ([% bibitemloo.hiddencount %] hidden)</a></p>
</form>
[% END %] <!-- hiddencount -->
[% END %] <!-- bibitemloop -->
[% END %]<!-- /multi_hold -->
<fieldset class="action">
- [% IF ( cardnumber ) %]
+ [% IF ( borrowernumber ) %]
[% IF ( override_required ) %]
<input type="submit" class="warning" value="Place Hold" />
[% ELSIF ( none_available ) %]
</fieldset>
[% END %]
-[% UNLESS ( cardnumber ) %]
+[% UNLESS ( borrowernumber ) %]
[% IF ( reserveloop ) %]
<form name="T[% time %]" action="modrequest.pl" method="post">
[% IF ( multi_hold ) %]
<td>
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.borrowernumber %]" >
[% IF ( reserveloo.hidename ) %]
- [% reserveloo.cardnumber %]
+ [% reserveloo.cardnumber (reserveloo.borrowernumber) %]
[% ELSE %]
[% reserveloo.firstname %] [% reserveloo.surname %]
[% END %]
// Prepare array of all column headers, incrementing each index by
// two to accomodate control and title columns
var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
+console.log(allColumns);
for( x=0; x<allColumns.length; x++ ){
allColumns[x] = Number(allColumns[x]) + 2;
}
<p id="selections"><strong>Show/hide columns:</strong> <span class="selected"><input type="checkbox" checked="checked" id="showall"/><label for="showall">Show all columns</label></span> <span><input type="checkbox" id="hideall"/><label for="hideall">Hide all columns</label></span>
[% FOREACH item_header_loo IN item_header_loop %]
- <span class="selected"><input id="checkheader[% item_header_loo.__counter %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
+ <span class="selected"><input id="checkheader[% loop.count %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
[% END %]
</p>
// Prepare array of all column headers, incrementing each index by
// two to accomodate control and title columns
var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
+console.log(allColumns);
for( x=0; x<allColumns.length; x++ ){
allColumns[x] = Number(allColumns[x]) + 2;
}
<p id="selections"><strong>Show/hide columns:</strong> <span class="selected"><input type="checkbox" checked="checked" id="showall"/><label for="showall">Show all columns</label></span> <span><input type="checkbox" id="hideall"/><label for="hideall">Hide all columns</label></span>
[% FOREACH item_header_loo IN item_header_loop %]
- <span class="selected"><input id="checkheader[% item_header_loo.__counter %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
+ <span class="selected"><input id="checkheader[% loop.count %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
[% END %]
</p>
<table id="itemst">
#comments .yours {
background-color : #effed5;
}
+.commentline .avatar {
+ float : right;
+ padding-left : .5em;
+}
#comments #addcomment {
margin : 0 -1em -1em -1em;
padding : .3em 1em;
<option value="1">Private</option>
<option value="2">Public</option>
</select></li></ol></fieldset>
- [% FOREACH biblio IN biblios %] <input type="hidden" name="biblionumber" value="[% biblio.biblionumber %]" />[% END %]
+ [% FOREACH biblio IN biblios %] <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html%]" />[% END %]
<fieldset class="action"><input type="submit" value="Save" class="submit" /> <a class="close cancel" href="#">Cancel</a></fieldset>
</form>
[% END %]
<br />[% END %]
<!-- here you might do a tmpl_if name="toc" and use greybox or equivalent for table of contents -->
- [% IF ( MARCurl.OPACurlOpenInNewWindow ) %]<a href="[% MARCurl.MARCurl %]" title="[% MARCurl.MARCurl %]" target="_blank">[% ELSE %]<a href="[% MARCurl.MARCurl %]" title="[% MARCurl.MARCurl %]">[% END %]
+ [% IF ( MARCurl.OPACurlOpenInNewWindow ) %]<a href="[% MARCurl.MARCURL %]" title="[% MARCurl.MARCURL %]" target="_blank">[% ELSE %]<a href="[% MARCurl.MARCURL %]" title="[% MARCurl.MARCURL %]">[% END %]
[% MARCurl.linktext %]</a>
[% IF ( MARCurl.notes ) %]<ul>[% FOREACH note IN MARCurl.notes %]<li>[% note.note %]</li>[% END %]</ul>[% END %]</li>
[% FOREACH review IN reviews %]
[% IF ( review.your_comment ) %]
<div class="commentline yours" id="c[% review.reviewid %]">
+ [% IF ( review.avatarurl ) %]
+ <img class="avatar" src="[% review.avatarurl %]" height="80" width="80"/>
+ [% END %]
<h5>
Your Comment
</h5>
[% ELSE %]
<div class="commentline">
[% IF ( ShowReviewer ) %]
+ [% IF ( review.avatarurl ) %]
+ <img class="avatar" src="[% review.avatarurl %]" height="80" width="80"/>
+ [% END %]
<h5>
Comment by
[% review.title %]
</select></li></ol>
</fieldset>
<fieldset class="action">
- <input type="hidden" name="bib_list" value="[% bib_list %]" />
+ <input type="hidden" name="bib_list" value="[% bib_list | html %]" />
<input type="submit" name="save" value="Go" />
</fieldset>
</form>
</select></li></ol>
</fieldset>
- <fieldset class="action"> <input type="hidden" name="shelfid" value="[% shelfid %]" />
+ <fieldset class="action"> <input type="hidden" name="shelfid" value="[% shelfid | html %]" />
<input type="submit" name="save" value="Go" /></fieldset>
</form>
[% IF ( cgi_debug ) %]alert(_('injecting OLD comment: ')+comment);[% END %]
parent.opener.$('#c[% reviewid %] p').prev("small").prev("h5").html("Your Edited Comment (preview, pending approval)");
parent.opener.$('#c[% reviewid %] p').html(comment);
- parent.opener.$('#c[% reviewid %] p').append(" <a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber %]&reviewid=[% reviewid %]\');\">Edit<\/a>");
+ parent.opener.$('#c[% reviewid %] p').append("<a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber | uri %]&reviewid=[% reviewid | uri%]\');\">Edit<\/a>");
[% END %]
return 1;
};
parent.opener.$('#newcomment').html(
"<h5>Your Comment (preview, pending approval)<\/h5>" +
"<p>"+comment+"<\/p>" +
- "<a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber %]\');\">Edit<\/a><\/p>"
+ "<a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber |uri%]\');\">Edit<\/a><\/p>"
);
parent.opener.$("#addcomment").prev("p").remove();
parent.opener.$("#addcomment").remove();
</div>
[% END %]
<form id="reviewf" action="/cgi-bin/koha/opac-review.pl[% IF ( cgi_debug ) %]?debug=1[% END %]" method="post">
- <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+ <input type="hidden" name="biblionumber" value="[% biblionumber | html%]" />
<fieldset class="brief">
<legend>Comments on <i>[% title |html %] [% subtitle %]</i>[% IF ( author ) %]by [% author %][% END %]</legend>
<ol><li><textarea id="review" name="review" cols="60" rows="8">[% review %]</textarea></li></ol>
<div id="userserialissues" class="container">
<h2>Issues for a subscription</h2>
<div id="views">
- <span class="view"><a id="Normalview" href="opac-detail.pl?biblionumber=[% biblionumber %]" class="button">Normal View</a></span>
+ <span class="view"><a id="Normalview" href="opac-detail.pl?biblionumber=[% biblionumber | html %]" class="button">Normal View</a></span>
<span class="view"><span id="Briefhistory">Brief history</span></span>
- <span class="view"><a id="Fullhistory" href="opac-serial-issues.pl?selectview=full&biblionumber=[% biblionumber %]" class="button">Full History</a></span>
+ <span class="view"><a id="Fullhistory" href="opac-serial-issues.pl?selectview=full&biblionumber=[% biblionumber | html%]" class="button">Full History</a></span>
</div>
<form method="post" name="f">
[% FOREACH subscription_LOO IN subscription_LOOP %]
[% END %]
[% IF ( review.copyrightdate ) %]<span class="results_summary"><span class="label">Date:</span>[% review.copyrightdate %]</span>[% END %]</p>
- <p class="commentline[% IF ( review.your_comment ) %] yours[% END %]">[% review.review |html %]
+ <p class="commentline[% IF ( review.your_comment ) %] yours[% END %]">
+ [% IF ( review.avatarurl ) %]
+ <img class="avatar" src="[% review.avatarurl %]" height="40" width="40"/>
+ [% END %]
+ [% review.review |html %]
<span style="font-size:87%;font-color:#CCC;">Added [% review.datereviewed %] [% IF ( review.your_comment ) %] by <strong>you</strong>[% ELSE %]
[% IF ( ShowReviewer ) %] by
[% review.firstname %] [% review.surname %][% END %][% END %]</span></p>
use strict;
sub kohaversion {
- our $VERSION = '3.05.00.002';
+ our $VERSION = '3.05.00.004';
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install
$debug and warn join "\t", map {"$_: $newdata{$_}"} qw(dateofbirth dateenrolled dateexpiry);
my $extended_patron_attributes = ();
if ($op eq 'save' || $op eq 'insert'){
- if (checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){
- push @errors, 'ERROR_cardnumber';
- }
- my $dateofbirthmandatory = (scalar grep {$_ eq "dateofbirth"} @field_check) ? 1 : 0;
- if ($newdata{dateofbirth} && $dateofbirthmandatory) {
- my $age = GetAge($newdata{dateofbirth});
- my $borrowercategory=GetBorrowercategory($newdata{'categorycode'});
- my ($low,$high) = ($borrowercategory->{'dateofbirthrequired'}, $borrowercategory->{'upperagelimit'});
- if (($high && ($age > $high)) or ($age < $low)) {
- push @errors, 'ERROR_age_limitations';
- $template->param('ERROR_age_limitations' => "$low to $high");
+ # If the cardnumber is blank, treat it as null.
+ $newdata{'cardnumber'} = undef if $newdata{'cardnumber'} =~ /^\s*$/;
+
+ if (checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){
+ push @errors, 'ERROR_cardnumber';
+ }
+ my $dateofbirthmandatory = (scalar grep {$_ eq "dateofbirth"} @field_check) ? 1 : 0;
+ if ($newdata{dateofbirth} && $dateofbirthmandatory) {
+ my $age = GetAge($newdata{dateofbirth});
+ my $borrowercategory=GetBorrowercategory($newdata{'categorycode'});
+ my ($low,$high) = ($borrowercategory->{'dateofbirthrequired'}, $borrowercategory->{'upperagelimit'});
+ if (($high && ($age > $high)) or ($age < $low)) {
+ push @errors, 'ERROR_age_limitations';
+ $template->param('ERROR_age_limitations' => "$low to $high");
+ }
}
- }
if($newdata{surname} && C4::Context->preference('uppercasesurnames')) {
$newdata{'surname'} = uc($newdata{'surname'});
$template->param( step_1 => 1, step_2 => 1, step_3 => 1, step_4 => 1, step_5 => 1, step_6 => 1 ) unless $step;
}
-# my $cardnumber=$data{'cardnumber'};
$data{'cardnumber'}=fixup_cardnumber($data{'cardnumber'}) if $op eq 'add';
if(!defined($data{'sex'})){
$template->param( none => 1);
#!/bin/bash
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
+### BEGIN INIT INFO
+# Provides: koha-pazpar-daemon
+# Required-Start: $syslog $remote_fs
+# Required-Stop: $syslog $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: PazPar2 server daemon for Koha
+### END INIT INFO
+
USER=__KOHA_USER__
GROUP=__KOHA_GROUP__
DBNAME=__DB_NAME__
#!/bin/bash
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
+### BEGIN INIT INFO
+# Provides: koha-zebra-daemon
+# Required-Start: $syslog $remote_fs
+# Required-Stop: $syslog $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Zebra server daemon for Koha indexing
+### END INIT INFO
+
USER=__KOHA_USER__
GROUP=__KOHA_GROUP__
DBNAME=__DB_NAME__
my ($record_type, $directory, $skip_export, $process_zebraqueue, $as_xml, $noxml, $nosanitize, $do_not_clear_zebraqueue, $verbose_logging, $zebraidx_log_opt, $server_dir) = @_;
my $num_records_exported = 0;
- my $num_records_deleted = 0;
+ my $records_deleted;
my $need_reset = check_zebra_dirs($server_dir);
if ($need_reset) {
print "$0: found broken zebra server directories: forcing a rebuild\n";
if ($process_zebraqueue) {
my $entries = select_zebraqueue_records($record_type, 'deleted');
mkdir "$directory/del_$record_type" unless (-d "$directory/del_$record_type");
- $num_records_deleted = generate_deleted_marc_records($record_type, $entries, "$directory/del_$record_type", $as_xml);
+ $records_deleted = generate_deleted_marc_records($record_type, $entries, "$directory/del_$record_type", $as_xml);
mark_zebraqueue_batch_done($entries);
$entries = select_zebraqueue_records($record_type, 'updated');
mkdir "$directory/upd_$record_type" unless (-d "$directory/upd_$record_type");
$num_records_exported = export_marc_records_from_list($record_type,
- $entries, "$directory/upd_$record_type", $as_xml, $noxml);
+ $entries, "$directory/upd_$record_type", $as_xml, $noxml, $records_deleted);
mark_zebraqueue_batch_done($entries);
} else {
my $sth = select_all_records($record_type);
my $record_fmt = ($as_xml) ? 'marcxml' : 'iso2709' ;
if ($process_zebraqueue) {
do_indexing($record_type, 'delete', "$directory/del_$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt)
- if $num_records_deleted;
+ if %$records_deleted;
do_indexing($record_type, 'update', "$directory/upd_$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt)
if $num_records_exported;
} else {
}
sub export_marc_records_from_list {
- my ($record_type, $entries, $directory, $as_xml, $noxml) = @_;
+ my ($record_type, $entries, $directory, $as_xml, $noxml, $records_deleted) = @_;
my $num_exported = 0;
open (OUT, ">:utf8 ", "$directory/exported_records") or die $!;
my $i = 0;
- my %found = ();
+
+ # Skip any deleted records. We check for this anyway, but this reduces error spam
+ my %found = %$records_deleted;
foreach my $record_number ( map { $_->{biblio_auth_number} }
grep { !$found{ $_->{biblio_auth_number} }++ }
@$entries ) {
sub generate_deleted_marc_records {
my ($record_type, $entries, $directory, $as_xml) = @_;
- my $num_exported = 0;
+ my $records_deleted = {};
open (OUT, ">:utf8 ", "$directory/exported_records") or die $!;
my $i = 0;
foreach my $record_number (map { $_->{biblio_auth_number} } @$entries ) {
}
print OUT ($as_xml) ? $marc->as_xml_record(C4::Context->preference("marcflavour")) : $marc->as_usmarc();
- $num_exported++;
+
+ $records_deleted->{$record_number} = 1;
}
- print "\nRecords exported: $num_exported\n" if ( $verbose_logging );
+ print "\nRecords exported: $i\n" if ( $verbose_logging );
close OUT;
- return $num_exported;
+ return $records_deleted;
}
ocoins => GetCOinSBiblio($biblionumber),
);
+my $libravatar_enabled = 0;
+eval 'use Libravatar::URL';
+if (!$@ and C4::Context->preference('ShowReviewer') and C4::Context->preference('ShowReviewerPhoto')) {
+ $libravatar_enabled = 1;
+}
+
my $reviews = getreviews( $biblionumber, 1 );
my $loggedincommenter;
foreach ( @$reviews ) {
$_->{title} = $borrowerData->{'title'};
$_->{surname} = $borrowerData->{'surname'};
$_->{firstname} = $borrowerData->{'firstname'};
+ if ($libravatar_enabled and $borrowerData->{'email'}) {
+ $_->{avatarurl} = libravatar_url(email => $borrowerData->{'email'}, https => $ENV{HTTPS});
+ }
$_->{userid} = $borrowerData->{'userid'};
$_->{cardnumber} = $borrowerData->{'cardnumber'};
$_->{datereviewed} = format_date($_->{datereviewed});
#written 18/1/2000 by chris@katipo.co.nz
# adapted for use in the hlt opac by finlay@katipo.co.nz 29/11/2002
# script to renew items from the web
-# Parts Copyright 2010 Catalyst IT
+# Parts Copyright 2010,2011 Catalyst IT
# This file is part of Koha.
#
use CGI;
use C4::Circulation;
use C4::Auth;
-
+use C4::Items;
+use C4::Members;
my $query = new CGI;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
for my $itemnumber ( @items ) {
my ($status,$error) = CanBookBeRenewed( $borrowernumber, $itemnumber );
if ( $status == 1 && $opacrenew == 1 ) {
- AddRenewal( $borrowernumber, $itemnumber );
+ my $renewalbranch = C4::Context->preference('OpacRenewalBranch');
+ my $branchcode;
+ if ($renewalbranch eq 'itemhomebranch'){
+ my $item = GetItem($itemnumber);
+ $branchcode=$item->{'homebranch'};
+ }
+ elsif ($renewalbranch eq 'patronhomebranch'){
+ my $borrower = GetMemberDetails($borrowernumber);
+ $branchcode = $borrower->{'branchcode'};
+ }
+ elsif ($renewalbranch eq 'checkoutbranch'){
+ my $issue = GetOpenIssue($itemnumber);
+ $branchcode = $issue->{'branchcode'};
+ }
+ elsif ($renewalbranch eq 'NULL'){
+ $branchcode='';
+ }
+ else {
+ $branchcode='OPACRenew'
+ }
+ AddRenewal( $borrowernumber, $itemnumber, $branchcode);
}
else {
$errorstring .= $error ."|";
);
}
+my $libravatar_enabled = 0;
+eval 'use Libravatar::URL';
+if (!$@ and C4::Context->preference('ShowReviewer') and C4::Context->preference('ShowReviewerPhoto')) {
+ $libravatar_enabled = 1;
+}
+
my $reviews = getallreviews(1,$offset,$results_per_page);
my $marcflavour = C4::Context->preference("marcflavour");
my $hits = numberofreviews();
$result->{timestamp} = $bib->{'timestamp'};
$result->{firstname} = $borr->{'firstname'};
$result->{surname} = $borr->{'surname'};
+ if ($libravatar_enabled and $borr->{'email'}) {
+ $result->{avatarurl} = libravatar_url(email => $borr->{'email'}, size => 40, https => $ENV{HTTPS});
+ }
+
if ($result->{borrowernumber} eq $borrowernumber) {
$result->{your_comment} = 1;
}
my $item = GetItem(undef,$barcode);
if (C4::Context->preference('SelfCheckoutByLogin') && !$patronid) {
my $dbh = C4::Context->dbh;
- my $resval, $patronid = checkpw($dbh, $patronlogin, $patronpw);
+ my ($resval, $patronid) = checkpw($dbh, $patronlogin, $patronpw);
}
my $borrower = GetMemberDetails(undef,$patronid);
# and probably remove the reserveconstraint table as well, I never could fill anything in this table.
my @reqbib=$input->param('reqbib');
my $biblionumber=$input->param('biblionumber');
-my $borrower=$input->param('member');
+my $borrowernumber=$input->param('borrowernumber');
my $notes=$input->param('notes');
my $branch=$input->param('pickup');
my $startdate=$input->param('reserve_date') || '';
my @rank=$input->param('rank-request');
my $type=$input->param('type');
my $title=$input->param('title');
-my $borrowernumber=GetMember('cardnumber'=>$borrower);
+my $borrower=GetMember('borrowernumber'=>$borrowernumber);
my $checkitem=$input->param('checkitem');
my $expirationdate = $input->param('expiration_date');
}
}
-if ($type eq 'str8' && $borrowernumber ne ''){
+if ($type eq 'str8' && $borrower){
foreach my $biblionumber (keys %bibinfos) {
my $count=@bibitems;
if ($multi_hold) {
my $bibinfo = $bibinfos{$biblionumber};
- AddReserve($branch,$borrowernumber->{'borrowernumber'},$biblionumber,'a',[$biblionumber],
+ AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',[$biblionumber],
$bibinfo->{rank},$startdate,$expirationdate,$notes,$bibinfo->{title},$checkitem,$found);
} else {
if ($input->param('request') eq 'any'){
# place a request on 1st available
- AddReserve($branch,$borrowernumber->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem,$found);
+ AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem,$found);
} elsif ($reqbib[0] ne ''){
# FIXME : elsif probably never reached, (see top of the script)
# place a request on a given item
- AddReserve($branch,$borrowernumber->{'borrowernumber'},$biblionumber,'o',\@reqbib,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem, $found);
+ AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'o',\@reqbib,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem, $found);
} else {
- AddReserve($branch,$borrowernumber->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem, $found);
+ AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem, $found);
}
}
}
} else {
print $input->redirect("request.pl?biblionumber=$biblionumber");
}
-} elsif ($borrowernumber eq ''){
+} elsif ($borrower eq ''){
print $input->header();
- print "Invalid card number please try again";
- print $input->Dump;
+ print "Invalid borrower number please try again";
+# Not sure that Dump() does HTML escaping. Use firebug or something to trace
+# instead.
+# print $input->Dump;
}
my $findborrower = $input->param('findborrower');
$findborrower = '' unless defined $findborrower;
$findborrower =~ s|,| |g;
-my $cardnumber = $input->param('cardnumber') || '';
+my $borrowernumber_hold = $input->param('borrowernumber') || '';
my $borrowerslist;
my $messageborrower;
my $warnings;
my @borrowers = @$borrowers;
- if ( $#borrowers == -1 ) {
- $input->param( 'findborrower', '' );
+ if ( !@borrowers ) {
$messageborrower = "'$findborrower'";
}
- elsif ( $#borrowers == 0 ) {
- $input->param( 'cardnumber', $borrowers[0]->{'cardnumber'} );
- $cardnumber = $borrowers[0]->{'cardnumber'};
+ elsif ( @borrowers == 1 ) {
+ $borrowernumber_hold = $borrowers[0]->{'borrowernumber'};
}
else {
$borrowerslist = \@borrowers;
}
}
-if ($cardnumber) {
- my $borrowerinfo = GetMemberDetails( 0, $cardnumber );
+if ($borrowernumber_hold) {
+ my $borrowerinfo = GetMemberDetails( $borrowernumber_hold );
my $diffbranch;
my @getreservloop;
my $count_reserv = 0;
my $number_reserves =
GetReserveCount( $borrowerinfo->{'borrowernumber'} );
- if ( C4::Context->preference('maxreserves') && $number_reserves >= C4::Context->preference('maxreserves') ) {
+ if ( C4::Context->preference('maxreserves') && ($number_reserves >= C4::Context->preference('maxreserves')) ) {
$warnings = 1;
$maxreserves = 1;
}
}
$template->param(
- borrowernumber => $borrowerinfo->{'borrowernumber'},
- borrowersurname => $borrowerinfo->{'surname'},
- borrowerfirstname => $borrowerinfo->{'firstname'},
- borrowerstreetaddress => $borrowerinfo->{'address'},
- borrowercity => $borrowerinfo->{'city'},
- borrowerphone => $borrowerinfo->{'phone'},
- borrowermobile => $borrowerinfo->{'mobile'},
- borrowerfax => $borrowerinfo->{'fax'},
- borrowerphonepro => $borrowerinfo->{'phonepro'},
- borroweremail => $borrowerinfo->{'email'},
- borroweremailpro => $borrowerinfo->{'emailpro'},
- borrowercategory => $borrowerinfo->{'category'},
- borrowerreservs => $count_reserv,
- maxreserves => $maxreserves,
- expiry => $expiry,
- diffbranch => $diffbranch,
- messages => $messages,
- warnings => $warnings
+ borrowernumber => $borrowerinfo->{'borrowernumber'},
+ borrowersurname => $borrowerinfo->{'surname'},
+ borrowerfirstname => $borrowerinfo->{'firstname'},
+ borrowerstreetaddress => $borrowerinfo->{'address'},
+ borrowercity => $borrowerinfo->{'city'},
+ borrowerphone => $borrowerinfo->{'phone'},
+ borrowermobile => $borrowerinfo->{'mobile'},
+ borrowerfax => $borrowerinfo->{'fax'},
+ borrowerphonepro => $borrowerinfo->{'phonepro'},
+ borroweremail => $borrowerinfo->{'email'},
+ borroweremailpro => $borrowerinfo->{'emailpro'},
+ borrowercategory => $borrowerinfo->{'category'},
+ borrowerreservs => $count_reserv,
+ cardnumber => $borrowerinfo->{'cardnumber'},
+ maxreserves => $maxreserves,
+ expiry => $expiry,
+ diffbranch => $diffbranch,
+ messages => $messages,
+ warnings => $warnings
);
}
} @{$borrowerslist}
)
{
- push @values, $borrower->{cardnumber};
+ push @values, $borrower->{borrowernumber};
- $labels{ $borrower->{cardnumber} } = sprintf(
+ $labels{ $borrower->{borrowernumber} } = sprintf(
'%s, %s ... (%s - %s) ... %s',
- $borrower->{surname}, $borrower->{firstname},
- $borrower->{cardnumber}, $borrower->{categorycode},
- $borrower->{address},
+ $borrower->{surname} ||'', $borrower->{firstname} || '',
+ $borrower->{cardnumber} || '', $borrower->{categorycode} || '',
+ $borrower->{address} || '',
);
}
$CGIselectborrower = CGI::scrolling_list(
- -name => 'cardnumber',
+ -name => 'borrowernumber',
-values => \@values,
-labels => \%labels,
-size => 7,
}
# FIXME launch another time GetMemberDetails perhaps until
-my $borrowerinfo = GetMemberDetails( 0, $cardnumber );
+my $borrowerinfo = GetMemberDetails( $borrowernumber_hold );
my @biblionumbers = ();
my $biblionumbers = $input->param('biblionumbers');
my $dat = GetBiblioData($biblionumber);
- if ( not CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber) ) {
+ unless ( CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber) ) {
$warnings = 1;
$maxreserves = 1;
}
$item->{'holdallowed'} = $branchitemrule->{'holdallowed'};
if ( $branchitemrule->{'holdallowed'} == 0 ||
- ( $branchitemrule->{'holdallowed'} == 1 && $borrowerinfo->{'branchcode'} ne $item->{'homebranch'} ) ) {
+ ( $branchitemrule->{'holdallowed'} == 1 &&
+ $borrowerinfo->{'branchcode'} ne $item->{'homebranch'} ) ) {
$policy_holdallowed = 0;
}
- if (IsAvailableForItemLevelRequest($itemnumber) and not $item->{cantreserve} and CanItemBeReserved($borrowerinfo->{borrowernumber}, $itemnumber) ) {
+ if (IsAvailableForItemLevelRequest($itemnumber) and
+ not $item->{cantreserve} and
+ CanItemBeReserved($borrowerinfo->{borrowernumber}, $itemnumber) ) {
if ( $policy_holdallowed ) {
$item->{available} = 1;
$num_available++;
date => $date,
biblionumber => $biblionumber,
findborrower => $findborrower,
- cardnumber => $cardnumber,
title => $dat->{title},
author => $dat->{author},
holdsview => 1,
my $input = CGI->new();
our $csv = Text::CSV->new({binary => 1}); # binary needed for non-ASCII Unicode
-# push @feedback, {feedback=>1, name=>'backend', value=>$csv->backend, backend=>$csv->backend};
+#push @feedback, {feedback=>1, name=>'backend', value=>$csv->backend, backend=>$csv->backend}; #XXX
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
template_name => "tools/import_borrowers.tmpl",
}
if ($extended) {
my $attr_str = $borrower{patron_attributes};
+ $attr_str =~ s/\xe2\x80\x9c/"/g; # fixup double quotes in case we are passed smart quotes
+ $attr_str =~ s/\xe2\x80\x9d/"/g;
+ push @feedback, {feedback=>1, name=>'attribute string', value=>$attr_str, filename=>$uploadborrowers};
delete $borrower{patron_attributes}; # not really a field in borrowers, so we don't want to pass it to ModMember.
$patron_attributes = extended_attributes_code_value_arrayref($attr_str);
}
}
unless (ModMember(%borrower)) {
$invalid++;
+ # untill we have better error trapping, we have no way of knowing why ModMember errored out...
+ push @errors, {unknown_error => 1};
$template->param('lastinvalid'=>$borrower{'surname'}.' / '.$borrowernumber);
next LINE;
}
my $old_attributes = GetBorrowerAttributes($borrowernumber);
$patron_attributes = extended_attributes_merge($old_attributes, $patron_attributes); #TODO: expose repeatable options in template
}
- SetBorrowerAttributes($borrower{'borrowernumber'}, $patron_attributes);
+ push @errors, {unknown_error => 1} unless SetBorrowerAttributes($borrower{'borrowernumber'}, $patron_attributes);
}
$overwritten++;
$template->param('lastoverwritten'=>$borrower{'surname'}.' / '.$borrowernumber);
$template->param('lastimported'=>$borrower{'surname'}.' / '.$borrowernumber);
} else {
$invalid++;
+ push @errors, {unknown_error => 1};
$template->param('lastinvalid'=>$borrower{'surname'}.' / AddMember');
}
}
if ( defined $input->param('compareinv2barcd') && ( ( $input->param('compareinv2barcd') eq 'on' ) && ( scalar @brcditems != scalar @$res ) ) && length($uploadbarcodes) > 0 ){
if ( scalar @brcditems > scalar @$res ){
for my $brcditem (@brcditems) {
- if (! grep(/$brcditem->{barcode}/, @$res) ){
+ if (! grep( $_->{barcode} =~ /$brcditem->{barcode}/ , @$res) ){
$brcditem->{notfoundkoha} = 1;
push @$res, $brcditem;
}
} else {
my @notfound;
for my $item (@$res) {
- if ( ! grep(/$item->{barcode}/, @brcditems) ){
+ if ( ! grep( $_->{barcode} =~ /$item->{barcode}/ , @brcditems) ){
$item->{notfoundbarcode} = 1;
push @notfound, $item;
}