Merge remote-tracking branch 'kc/master' into new/bug_6350
authorChris Cormack <chrisc@catalyst.net.nz>
Tue, 5 Jul 2011 03:16:29 +0000 (15:16 +1200)
committerChris Cormack <chrisc@catalyst.net.nz>
Tue, 5 Jul 2011 03:16:29 +0000 (15:16 +1200)
51 files changed:
C4/Auth.pm
C4/Circulation.pm
C4/Installer/PerlDependencies.pm
C4/Log.pm
C4/Members.pm
C4/Members/Attributes.pm
C4/Reserves.pm
README.robots
catalogue/search.pl
etc/zebradb/biblios/etc/bib1.att
etc/zebradb/marc_defs/marc21/biblios/record.abs
installer/data/mysql/de-DE/mandatory/sysprefs.sql
installer/data/mysql/en/mandatory/sysprefs.sql
installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
installer/data/mysql/it-IT/necessari/sysprefs.sql
installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql
installer/data/mysql/pl-PL/mandatory/sysprefs.sql
installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt
koha-tmpl/opac-tmpl/prog/en/css/opac.css
koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-downloadcart.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-downloadshelf.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-serial-issues.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews.tt
kohaversion.pl
members/memberentry.pl
misc/bin/koha-pazpar2-ctl.sh
misc/bin/koha-zebra-ctl.sh
misc/migration_tools/rebuild_zebra.pl
opac/opac-detail.pl
opac/opac-renew.pl
opac/opac-showreviews.pl
opac/sco/sco-main.pl
reserve/placerequest.pl
reserve/request.pl
tools/import_borrowers.pl
tools/inventory.pl

index b416449..b6ec69a 100644 (file)
@@ -455,6 +455,7 @@ sub get_template_and_user {
             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"),
index 5efd090..179fe70 100644 (file)
@@ -2614,8 +2614,8 @@ sub SendCirculationAlert {
     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},
index 576dde4..63d14a6 100644 (file)
@@ -479,6 +479,11 @@ our $PERL_DEPS = {
        'required' => '1',
        'min_ver'  => '2.22',
     },
+    'Gravatar::URL' => {
+        'usage'    => 'Photos in OPAC reviews',
+        'required' => '0',
+        'min_ver'  => '1.03',
+    },
 };
 
 1;
index 822cda5..98cd8d5 100644 (file)
--- a/C4/Log.pm
+++ b/C4/Log.pm
@@ -213,7 +213,7 @@ sub GetLogs {
     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);
     }
index e03b40b..4eb9979 100644 (file)
@@ -772,17 +772,17 @@ sub ModMember {
         }
     }
        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;
 }
 
@@ -792,7 +792,9 @@ sub ModMember {
   $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
 
@@ -810,10 +812,15 @@ sub AddMember {
     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'};
 }
 
@@ -900,6 +907,7 @@ sub fixup_cardnumber ($) {
 
     #     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' ) {
@@ -1261,6 +1269,8 @@ sub checkuniquemember {
 
 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);
index 24c6f71..35d6702 100644 (file)
@@ -203,7 +203,12 @@ sub SetBorrowerAttributes {
     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 
index 87e2325..fde1223 100644 (file)
@@ -1666,7 +1666,7 @@ sub _koha_notify_reserve {
     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'};
index a08371d..6865d0a 100644 (file)
@@ -5,13 +5,23 @@ look for the file /robots.txt.  If this file is found and has lines that apply
 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
index a41b18a..8899d59 100755 (executable)
@@ -471,7 +471,7 @@ my $scan_index_to_use;
 
 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 };
index ed68092..c156fb4 100644 (file)
@@ -107,6 +107,7 @@ att 1036    Author-Title-Subject
 att 1045    Record-control-number
 att 1062    stocknumber
 att 1079    Subject-topical
+att 1096    Title-later
 
 
 # Koha Local-Use Biblio Indexes
index 7d12233..7a67d68 100755 (executable)
@@ -89,21 +89,21 @@ melm 086        Number-govt-pub
 
 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
@@ -203,24 +203,24 @@ melm 700$n      Thematic-number
 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
@@ -235,9 +235,9 @@ melm 776$w      Record-control-number
 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
index c7c885d..6eb67a3 100755 (executable)
@@ -99,6 +99,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
@@ -311,4 +312,5 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
index f98b053..0abf9d8 100755 (executable)
@@ -100,6 +100,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
@@ -312,3 +313,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
index 185c74b..59a258f 100755 (executable)
@@ -112,6 +112,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
@@ -312,4 +313,5 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
index fca0cfb..dcdf0ee 100755 (executable)
@@ -168,6 +168,7 @@ insert into `systempreferences` (`variable`, `value`, `options`, `explanation`,
 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');
@@ -299,3 +300,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
index b1c6fb5..ca71769 100644 (file)
@@ -118,6 +118,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
index c39e231..58ba035 100755 (executable)
@@ -98,6 +98,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
@@ -310,4 +311,5 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
index a7c6a10..54c533c 100755 (executable)
@@ -127,6 +127,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
@@ -365,4 +366,5 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
index f370766..9f095ab 100755 (executable)
@@ -126,6 +126,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
@@ -391,3 +392,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
index 3c7d043..8fb9656 100755 (executable)
@@ -4354,6 +4354,22 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     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)
index 1377aa5..503f954 100644 (file)
@@ -27,7 +27,7 @@ function confirm_reregistration() {
 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 %]
index 9331f5f..afad863 100644 (file)
@@ -25,7 +25,7 @@ function confirm_reregistration() {
 
 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 %]
index 71c9426..f4be568 100644 (file)
@@ -252,6 +252,12 @@ OPAC:
                   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
@@ -301,6 +307,16 @@ OPAC:
                   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
index 39c2cd3..fffe411 100644 (file)
@@ -138,14 +138,14 @@ function verify_images() {
                 [% 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>
index 456cacf..e1f84b8 100644 (file)
@@ -412,13 +412,13 @@ YAHOO.util.Event.onContentReady("searchheader", function () {
                 <table>
                     <tr>
                         [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]<th>&nbsp;</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 %]">
                                                                        
index 4956f18..553d130 100644 (file)
 [% 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 ) %]
index f73ce2d..81fa3b6 100644 (file)
@@ -1,6 +1,16 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; 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> 
@@ -41,12 +51,15 @@ window.close();
 
 <form method="post" action="update-child.pl">
 <fieldset>
-<table>
+<table id="catst">
+<thead>
 <tr>
 <th>&nbsp;</th>
 <th>Code</th>
 <th>Description</th>
 </tr>
+</thead>
+<tbody>
 [% FOREACH CAT_LOO IN CAT_LOOP %]
 <tr>
 <td>
@@ -55,6 +68,7 @@ window.close();
 <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 %]" />
@@ -72,4 +86,4 @@ window.close();
 
 
 </div>
-[% INCLUDE 'intranet-bottom.inc' %]
+[% INCLUDE 'popup-bottom.inc' %]
index 4b7aa7c..cbcfc55 100644 (file)
@@ -169,7 +169,7 @@ function checkMultiHold() {
     <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 %]
@@ -243,7 +243,7 @@ function checkMultiHold() {
             <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 ) %]
@@ -262,7 +262,7 @@ function checkMultiHold() {
         [% 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
@@ -358,7 +358,7 @@ function checkMultiHold() {
 </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 ) %]
@@ -465,7 +465,7 @@ function checkMultiHold() {
         </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 -->
@@ -538,7 +538,7 @@ function checkMultiHold() {
   [% END %]<!-- /multi_hold -->
 
     <fieldset class="action">
-        [% IF ( cardnumber ) %]
+        [% IF ( borrowernumber ) %]
             [% IF ( override_required ) %]
                 <input type="submit" class="warning" value="Place Hold" />
             [% ELSIF ( none_available ) %]
@@ -552,7 +552,7 @@ function checkMultiHold() {
        </fieldset>
 [% END %]
 
-[% UNLESS ( cardnumber ) %]
+[% UNLESS ( borrowernumber ) %]
 [% IF ( reserveloop ) %]
 <form name="T[% time %]" action="modrequest.pl" method="post">
   [% IF ( multi_hold ) %]
@@ -631,7 +631,7 @@ function checkMultiHold() {
         <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 %]
index 5aed1ba..af2a239 100644 (file)
@@ -12,6 +12,7 @@
 // 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;
 }
@@ -76,7 +77,7 @@ for( x=0; x<allColumns.length; x++ ){
 
        <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>
 
index 05fa978..67cd6e0 100644 (file)
@@ -12,6 +12,7 @@
 // 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;
 }
@@ -71,7 +72,7 @@ for( x=0; x<allColumns.length; x++ ){
 
 <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">
index aa295c9..b8a531f 100644 (file)
@@ -1873,6 +1873,10 @@ a#MARCview, a#MARCviewPop, a#ISBDview, a#Normalview, a#Fullhistory, a#Briefhisto
 #comments .yours {
        background-color : #effed5;
 }
+.commentline .avatar {
+       float : right;
+       padding-left : .5em;
+}
 #comments #addcomment {
        margin : 0 -1em -1em -1em;
        padding : .3em 1em;
index dab4fda..f6479f9 100644 (file)
@@ -66,7 +66,7 @@
                <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 %]
index 534aeee..4866ba0 100644 (file)
@@ -189,7 +189,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
             <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>
@@ -667,6 +667,9 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
         [% 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>
@@ -678,6 +681,9 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
             [% 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 %]
index 45d5de7..8d22c4d 100644 (file)
@@ -19,7 +19,7 @@
        </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>
index 608c955..b984f5d 100644 (file)
@@ -26,7 +26,7 @@
 
                </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>
 
index 338f174..3e69614 100644 (file)
@@ -11,7 +11,7 @@
                        [% 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 %]&amp;reviewid=[% reviewid %]\');\">Edit<\/a>");
+                       parent.opener.$('#c[% reviewid %] p').append("<a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber | uri %]&amp;reviewid=[% reviewid | uri%]\');\">Edit<\/a>");
                        [% END %]
                        return 1;
                };
@@ -21,7 +21,7 @@
                        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();
@@ -66,7 +66,7 @@
        </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>
index 8d6b94b..5d45b53 100644 (file)
@@ -12,9 +12,9 @@
 <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&amp;biblionumber=[% biblionumber %]" class="button">Full History</a></span>
+       <span class="view"><a id="Fullhistory" href="opac-serial-issues.pl?selectview=full&amp;biblionumber=[% biblionumber | html%]" class="button">Full History</a></span>
 </div>
 <form method="post" name="f">
 [% FOREACH subscription_LOO IN subscription_LOOP %]
index e64fcae..2839460 100644 (file)
@@ -46,7 +46,11 @@ $(document).ready(function(){
     [% 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>
index 470ca3d..00bdbec 100644 (file)
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 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
index 61c3c2c..be34cc4 100755 (executable)
@@ -236,19 +236,22 @@ if ( (defined $newdata{'userid'}) && ($newdata{'userid'} eq '')){
 $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'});
@@ -396,7 +399,6 @@ if ( $op eq "duplicate" ) {
     $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);
index c894702..bcedfea 100755 (executable)
@@ -1,4 +1,29 @@
 #!/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__
index 01e4fad..397eb19 100755 (executable)
@@ -1,4 +1,29 @@
 #!/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__
index bda6254..dadf43f 100755 (executable)
@@ -191,7 +191,7 @@ sub index_records {
     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";
@@ -212,12 +212,12 @@ sub index_records {
         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);
@@ -239,7 +239,7 @@ sub index_records {
        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 {
@@ -366,12 +366,14 @@ sub export_marc_records_from_sth {
 }
 
 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 ) {
@@ -396,7 +398,7 @@ sub export_marc_records_from_list {
 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 ) {
@@ -414,11 +416,12 @@ sub generate_deleted_marc_records {
         }
 
         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;
     
 
 }
index 6345da1..37a1bd4 100755 (executable)
@@ -295,6 +295,12 @@ $template->param(
     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 ) {
@@ -303,6 +309,9 @@ 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});
index 68abed0..dd3dcf2 100755 (executable)
@@ -3,7 +3,7 @@
 #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.
 #
@@ -27,7 +27,8 @@ use warnings;
 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(
@@ -48,7 +49,27 @@ my $errorstring='';
 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 ."|";
index f1e0b53..3a74270 100755 (executable)
@@ -65,6 +65,12 @@ if($format eq "rss"){
         );
 }
 
+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();
@@ -92,6 +98,10 @@ for my $result (@$reviews){
        $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;
        }
index b36ff64..2488f67 100755 (executable)
@@ -92,7 +92,7 @@ my $issuer   = GetMemberDetails($issuerid);
 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);
 
index bc3fc74..19d76be 100755 (executable)
@@ -44,14 +44,14 @@ my @bibitems=$input->param('biblioitem');
 #       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');
 
@@ -81,7 +81,7 @@ if ($checkitem ne ''){
     }
 }
 
-if ($type eq 'str8' && $borrowernumber ne ''){
+if ($type eq 'str8' && $borrower){
 
     foreach my $biblionumber (keys %bibinfos) {
         my $count=@bibitems;
@@ -100,18 +100,18 @@ if ($type eq 'str8' && $borrowernumber ne ''){
 
         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);
             }
         }
     }
@@ -124,8 +124,10 @@ if ($type eq 'str8' && $borrowernumber ne ''){
     } 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;
 }
index 0b3bebc..79ff6b5 100755 (executable)
@@ -85,7 +85,7 @@ my $CGIbranch = CGI::scrolling_list(
 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;
@@ -117,21 +117,19 @@ if ($findborrower) {
 
     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;
@@ -143,7 +141,7 @@ if ($cardnumber) {
     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;
     }
@@ -164,24 +162,25 @@ if ($cardnumber) {
     }
 
     $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
     );
 }
 
@@ -200,18 +199,18 @@ if ($borrowerslist) {
         } @{$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,
@@ -220,7 +219,7 @@ if ($borrowerslist) {
 }
 
 # FIXME launch another time GetMemberDetails perhaps until
-my $borrowerinfo = GetMemberDetails( 0, $cardnumber );
+my $borrowerinfo = GetMemberDetails( $borrowernumber_hold );
 
 my @biblionumbers = ();
 my $biblionumbers = $input->param('biblionumbers');
@@ -238,7 +237,7 @@ foreach my $biblionumber (@biblionumbers) {
 
     my $dat          = GetBiblioData($biblionumber);
 
-    if ( not CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber) ) {
+    unless ( CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber) ) {
                $warnings = 1;
         $maxreserves = 1;
     }
@@ -429,11 +428,14 @@ foreach my $biblionumber (@biblionumbers) {
             $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++;
@@ -564,7 +566,6 @@ foreach my $biblionumber (@biblionumbers) {
                      date              => $date,
                      biblionumber      => $biblionumber,
                      findborrower      => $findborrower,
-                     cardnumber        => $cardnumber,
                      title             => $dat->{title},
                      author            => $dat->{author},
                      holdsview => 1,
index 6141998..74a5889 100755 (executable)
@@ -66,7 +66,7 @@ my $columnkeystpl = [ map { {'key' => $_} }  grep {$_ ne 'borrowernumber' && $_
 
 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",
@@ -193,6 +193,9 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) {
         }
         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); 
         }
@@ -246,6 +249,8 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) {
             }
             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;
             }
@@ -254,7 +259,7 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) {
                     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);
@@ -276,6 +281,7 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) {
                 $template->param('lastimported'=>$borrower{'surname'}.' / '.$borrowernumber);
             } else {
                 $invalid++;
+                push @errors, {unknown_error => 1};
                 $template->param('lastinvalid'=>$borrower{'surname'}.' / AddMember');
             }
         }
index 7ca8baf..5e7b198 100755 (executable)
@@ -196,7 +196,7 @@ if ( ! ($uploadbarcodes && length($uploadbarcodes)>0 ) || ( $input->param('compa
     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;
                 }
@@ -204,7 +204,7 @@ if ( ! ($uploadbarcodes && length($uploadbarcodes)>0 ) || ( $input->param('compa
         } else {
             my @notfound;
             for my $item (@$res) {
-                if ( ! grep(/$item->{barcode}/, @brcditems) ){
+                if ( ! grep( $_->{barcode} =~ /$item->{barcode}/ , @brcditems) ){
                     $item->{notfoundbarcode} = 1;
                     push @notfound, $item;
                 }