Merge remote-tracking branch 'kc/new/bug_6094' into kcmaster
authorChris Cormack <chrisc@catalyst.net.nz>
Thu, 20 Oct 2011 15:32:31 +0000 (04:32 +1300)
committerChris Cormack <chrisc@catalyst.net.nz>
Thu, 20 Oct 2011 15:32:31 +0000 (04:32 +1300)
40 files changed:
C4/Auth.pm
C4/Circulation.pm
C4/Reserves.pm
circ/circulation.pl
installer/data/mysql/de-DE/mandatory/message_transport_types.txt
installer/data/mysql/de-DE/mandatory/subtag_registry.txt
installer/data/mysql/de-DE/mandatory/userflags.txt
installer/data/mysql/de-DE/marcflavour/marc21/mandatory/authorities_normal_marc21.txt
installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_default_matching_rules.txt
installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_fastadd_framework.txt
installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_simple_bib_frameworks.txt
installer/data/mysql/de-DE/optional/auth_val.txt
installer/data/mysql/de-DE/optional/patron_categories.txt
installer/data/mysql/de-DE/optional/sample_creator_data.txt
installer/data/mysql/de-DE/optional/sample_news.txt
installer/data/mysql/de-DE/optional/sample_z3950_servers.txt
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt
koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc
koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt
kohaversion.pl
members/boraccount.pl
members/mancredit.pl
members/maninvoice.pl
members/member-flags.pl
members/member-password.pl
members/moremember.pl
members/notices.pl
members/pay.pl
members/readingrec.pl
misc/cronjobs/batch_anonymise.pl [new file with mode: 0755]
opac/opac-sendshelf.pl
reserve/request.pl
virtualshelves/sendshelf.pl

index 36a6472..2aac678 100644 (file)
@@ -432,6 +432,7 @@ sub get_template_and_user {
             OpacHighlightedWords       => C4::Context->preference("OpacHighlightedWords"),
             OPACItemHolds             => C4::Context->preference("OPACItemHolds"),
             OPACShelfBrowser          => "". C4::Context->preference("OPACShelfBrowser"),
+            OpacShowRecentComments    => C4::Context->preference("OpacShowRecentComments"),
             OPACURLOpenInNewWindow    => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
             OPACUserCSS               => "". C4::Context->preference("OPACUserCSS"),
             OPACViewOthersSuggestions => "" . C4::Context->preference("OPACViewOthersSuggestions"),
index be62584..c43385a 100644 (file)
@@ -578,7 +578,7 @@ C<$issuingimpossible> and C<$needsconfirmation> are some hashref.
 
 =over 4
 
-=item C<$borrower> hash with borrower informations (from GetMemberDetails)
+=item C<$borrower> hash with borrower informations (from GetMember or GetMemberDetails)
 
 =item C<$barcode> is the bar code of the book being issued.
 
@@ -858,7 +858,7 @@ sub CanBookBeIssued {
     elsif ($issue->{borrowernumber}) {
 
         # issued to someone else
-        my $currborinfo =    C4::Members::GetMemberDetails( $issue->{borrowernumber} );
+        my $currborinfo =    C4::Members::GetMember( borrowernumber => $issue->{borrowernumber} );
 
 #        warn "=>.$currborinfo->{'firstname'} $currborinfo->{'surname'} ($currborinfo->{'cardnumber'})";
         $needsconfirmation{ISSUED_TO_ANOTHER} = 1;
@@ -872,7 +872,7 @@ sub CanBookBeIssued {
     my ( $restype, $res ) = C4::Reserves::CheckReserves( $item->{'itemnumber'} );
     if ($restype) {
                my $resbor = $res->{'borrowernumber'};
-               my ( $resborrower ) = C4::Members::GetMemberDetails( $resbor, 0 );
+               my ( $resborrower ) = C4::Members::GetMember( borrowernumber => $resbor );
                my $branches  = GetBranches();
                my $branchname = $branches->{ $res->{'branchcode'} }->{'branchname'};
         if ( $resbor ne $borrower->{'borrowernumber'} && $restype eq "Waiting" )
@@ -909,7 +909,7 @@ Issue a book. Does no check, they are done in CanBookBeIssued. If we reach this
 
 =over 4
 
-=item C<$borrower> is a hash with borrower informations (from GetMemberDetails).
+=item C<$borrower> is a hash with borrower informations (from GetMember or GetMemberDetails).
 
 =item C<$barcode> is the barcode of the item being issued.
 
@@ -1525,7 +1525,7 @@ sub AddReturn {
     my $issue  = GetItemIssue($itemnumber);
 #   warn Dumper($iteminformation);
     if ($issue and $issue->{borrowernumber}) {
-        $borrower = C4::Members::GetMemberDetails($issue->{borrowernumber})
+        $borrower = C4::Members::GetMember( borrowernumber => $issue->{borrowernumber})
             or die "Data inconsistency: barcode $barcode (itemnumber:$itemnumber) claims to be issued to non-existant borrowernumber '$issue->{borrowernumber}'\n"
                 . Dumper($issue) . "\n";
     } else {
@@ -2261,7 +2261,7 @@ sub AddRenewal {
     # based on the value of the RenewalPeriodBase syspref.
     unless ($datedue) {
 
-        my $borrower = C4::Members::GetMemberDetails( $borrowernumber, 0 ) or return undef;
+        my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber ) or return undef;
         my $itemtype = (C4::Context->preference('item-level_itypes')) ? $biblio->{'itype'} : $biblio->{'itemtype'};
 
         $datedue = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ?
@@ -2315,7 +2315,7 @@ sub GetRenewCount {
     my $renewsallowed = 0;
     my $renewsleft    = 0;
 
-    my $borrower = C4::Members::GetMemberDetails($bornum);
+    my $borrower = C4::Members::GetMember( borrowernumber => $bornum);
     my $item     = GetItem($itemno); 
 
     # Look in the issues table for this item, lent to this borrower,
index f7a2e72..4af8a85 100644 (file)
@@ -383,17 +383,15 @@ sub GetReservesFromBorrowernumber {
 sub CanBookBeReserved{
     my ($borrowernumber, $biblionumber) = @_;
 
-    my @items = GetItemsInfo($biblionumber);
-
-       #get items linked via host records
-       my $marcrecord= GetMarcBiblio($biblionumber);
-       my @hostitemInfos = GetHostItemsInfo($marcrecord);
-       if (@hostitemInfos){
-               push (@items,@hostitemInfos);
-       }
+    my @items = get_itemnumbers_of($biblionumber);
+    #get items linked via host records
+    my @hostitems = get_hostitemnumbers_of($biblionumber);
+    if (@hostitems){
+       push (@items,@hostitems);
+    }
 
     foreach my $item (@items){
-        return 1 if CanItemBeReserved($borrowernumber, $item->{itemnumber});
+        return 1 if CanItemBeReserved($borrowernumber, $item);
     }
     return 0;
 }
@@ -828,7 +826,7 @@ sub CheckReserves {
             } else {
                 # See if this item is more important than what we've got so far
                 if ( $res->{'priority'} && $res->{'priority'} < $priority ) {
-                    my $borrowerinfo=C4::Members::GetMemberDetails($res->{'borrowernumber'});
+                    my $borrowerinfo=C4::Members::GetMember(borrowernumber => $res->{'borrowernumber'});
                     my $iteminfo=C4::Items::GetItem($itemnumber);
                     my $branch=C4::Circulation::_GetCircControlBranch($iteminfo,$borrowerinfo);
                     my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$iteminfo->{'itype'});
index bbcccd5..efb87da 100755 (executable)
@@ -632,7 +632,14 @@ my $fast_cataloging = 0;
     if (defined getframeworkinfo('FA')) {
     $fast_cataloging = 1 
     }
-my $attributes = GetBorrowerAttributes($borrowernumber);
+
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+    my $attributes = GetBorrowerAttributes($borrowernumber);
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
+}
 
 $template->param(
     lib_messages_loop => $lib_messages_loop,
@@ -682,7 +689,6 @@ $template->param(
     circview => 1,
     soundon           => C4::Context->preference("SoundOn"),
     fast_cataloging   => $fast_cataloging,
-    extendedattributes => $attributes,
 );
 
 # save stickyduedate to session
index 2f7b684..7adfefd 100644 (file)
@@ -1,2 +1 @@
-Definiert Standardtransport für Benachrichtigungen per Email und SMS.
-
+Definiert die unterstützten Transportarten für Benachrichtigungen (Email, SMS, ...)
index ca9d954..e28a15c 100644 (file)
@@ -1,5 +1,4 @@
 I18N-Unterstützung in Koha
-
-Erweiterung für Bidirektionale Schriften, Arabisch und Hebräisch
-Standardmapping zwischen Schrift- und Sprachcodes
-Spracherweiterungen
+Erweiterung für bidirektionale Schriften, Arabisch und Hebräisch, 
+Standardmappings zwischen Schrift- und Sprachcodes,
+weitere Spracherweiterungen
index 0ba67d2..b594c98 100644 (file)
@@ -1 +1 @@
-Standard-Berechtigungen für Benutzer
+Modulbezogene Berechtigungen für Bibliotheksmitarbeiter
index 953b55b..1b04dd4 100644 (file)
@@ -1,8 +1,7 @@
-Standard-MARC21-Frameworks für Normdaten::
-
-       Personenname 
-       Körperschaftsname 
-       Kongressname 
+Standard-MARC21-Frameworks für Normdaten:
+       Person 
+       Körperschaft
+       Kongress
        Einheitstitel 
        Zeitschlagwort
        Sachschlagwort
index 6bb67cc..7386655 100644 (file)
@@ -1 +1 @@
-"FA", ein MARC21-Framework (Erfassungsmaske) gedacht für Schnellaufnahmen oder Fernleihtitel.
\ No newline at end of file
+"FA", ein MARC21-Framework (Erfassungsmaske) für Schnellaufnahmen oder Fernleihtitel
index a04c07e..bef7f28 100644 (file)
@@ -1,5 +1,4 @@
-Vereinfachte bibliographische MARC21-Frameworks (Erfassungsmasken) für einige typische Materialarten. Frameworks werden verwendet, um die Struktur eines MARC-Datensatzes und das Verhalten des integrierten MARC-Editors festzulegen. Sie können diese jederzeit nach der Installation ändern. Diese optionalen Standard-Frameworks beinhalten Vorschläge für:
-
+Vereinfachte bibliographische MARC21-Frameworks (Erfassungsmasken) für einige typische Materialarten. Frameworks werden verwendet, um die Struktur eines MARC-Datensatzes und das Verhalten des MARC-Editors in der Katalogisierung festzulegen. Sie können diese jederzeit nach der Installation ändern. Diese optionalen Frameworks enthalten Masken für:
 BKS    Monographien, Broschüren, Arbeitsbücher
 CF     CD-ROMs, DVD-ROMs, Online-Ressourcen
 SR     Audiokassetten, CDs
index 2df41d0..043bb07 100644 (file)
@@ -1 +1 @@
-Einige Beispielwerte für Bibliotheksbereiche, Verloren-Status, etc. Sie können diese jederzeit nach der Installation ändern.
\ No newline at end of file
+Beispiele für die Auswahllisten der verschiedenen normierten Werte (Verloren, Beschädigt, Sammlung, Standort etc.) Sie können diese nach der Installation jederzeit über die Oberfläche ändern oder ergänzen.
index 7e08b01..0940017 100644 (file)
@@ -1,6 +1,4 @@
-Beispiele für Benutzertypen und -kategorien:
-
-Kategorie:             Benutzertyp:
+Beispiele für Benutzerkategorien und -typen:
 
 Erwachsener Benutzer - Standardkategorie
                                PT      - Erwachsener
@@ -13,15 +11,15 @@ Kind - Benutzer mit einem Bürgen
                                YA      - Junger Erwachsener
 
 Organisation - Benutzer ist eine Institution, keine Person
-                               ILL - Fernleihbibliothek
+                               ILL     - Fernleihbibliothek
                                SC      - Schule
                                L       - Bibliothek
 
-Professioneller - Mitglied einer Organisation, Organisation ist Bürge
+Professioneller - Mitglied einer Organisation mit der Orgsnisation als Bürgen
                                T       - Lehrer
                                S       - Vorstand
                                
-Mitarbeiter - Benutzer ist Mitarbeiter der Bibliothek und hat entsprechende Berechtigungen
+Mitarbeiter - Benutzer ist Mitarbeiter der Bibliothek mit entsprechenden Berechtigungen
                                S       - Mitarbeiter
 
-Die Benutzerkategorien sind fest codiert, aber Sie können Benutzertypen nach der Installation im Administrationsbereich ändern, löschen und hinzufügen.
+Die Benutzerkategorien sind fest codiert, Benutzertypen können aber jederzeit im Administrationsbereich neu angelegt, geändert oder gelöscht werden.
index b0de859..36b8c62 100644 (file)
@@ -1 +1 @@
-Beispiele für Etiketten- und Benutzerausweisdruck
\ No newline at end of file
+Beispieltemplates und Layouts für den Etiketten- und Benutzerausweisdruck
index 121badd..83ce059 100644 (file)
@@ -1,3 +1,4 @@
+Einige vorkonfigurierte Z39.50-Server
 LIBRARY OF CONGRESS
 NEW YORK UNIVERSITY LIBRARIES
 COLUMBIA UNIVERSITY
index 7905d3f..ae2c1cb 100755 (executable)
@@ -327,4 +327,5 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL);
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo');
 
index 52c2a80..9939305 100755 (executable)
@@ -4530,13 +4530,21 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion($DBversion);
 }
 
-$DBversion = "3.05.00.XXX"; 
+$DBversion = "3.05.00.022"; 
 if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     $dbh->do("CREATE TABLE need_merge_authorities (id int NOT NULL auto_increment PRIMARY KEY, authid bigint NOT NULL, done tinyint DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=utf8");
     print "Upgrade to $DBversion done (6094: Fixing ModAuthority problems, add a need_merge_authorities table)\n";
     SetVersion($DBversion);
 }
 
+$DBversion = "3.05.00.023";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo');");
+    print "Upgrade to $DBversion done (Add syspref OpacShowRecentComments. When the preference is turned on a link to recent comments will appear in the OPAC masthead. )\n";
+    SetVersion($DBversion);
+}
+
+
 =head1 FUNCTIONS
 
 =head2 DropAllForeignKeys($table)
index a9fd453..67300d5 100644 (file)
             <li> <span class="empty">No email stored.</span>    </li>
         [% END %]
     [% END %]
-    [% FOREACH extendedattribute IN extendedattributes %]
+    [% IF ( ExtendedPatronAttributes ) %][% FOREACH extendedattribute IN extendedattributes %]
         [% IF ( extendedattribute.display_checkout ) %]
             [% IF ( extendedattribute.value ) %]
                 <li>[% extendedattribute.description %] : [% IF ( extendedattribute.value_description ) %][% extendedattribute.value_description %][% ELSE %][% extendedattribute.value %][% END %]</li>
             [% END %]
         [% END %]
-    [% END %]
+    [% END %][% END %]
     <li>Category: [% categoryname %] ([% categorycode %])</li>
     <li>Home Library: [% IF ( branchname ) %][% branchname %][% ELSE %][% branch %][% END %]</li>
 </ul></div>
index 47c1290..fe04b63 100644 (file)
@@ -50,13 +50,13 @@ in the global namespace %]
             <li> <span class="empty">No email stored.</span>    </li>
         [% END %]
     [% END %]
-    [% FOREACH extendedattribute IN borrower.extendedattributes %]
+    [% IF ( ExtendedPatronAttributes ) %][% FOREACH extendedattribute IN borrower.extendedattributes %]
         [% IF ( extendedattribute.display_checkout ) %]
             [% IF ( extendedattribute.value ) %]
                 <li>[% extendedattribute.description %] : [% IF ( extendedattribute.value_description ) %][% extendedattribute.value_description %][% ELSE %][% extendedattribute.value %][% END %]</li>
             [% END %]
         [% END %]
-    [% END %]
+    [% END %][% END %]
     <li>Category: [% borrower.description %] ([% borrower.categorycode %])</li>
     <li>Home Library: [% IF ( borrower.branchname ) %][% borrower.branchname %][% ELSE %][% borrower.branch %][% END %]</li>
 </ul></div>
index 746155f..7147b19 100644 (file)
@@ -45,8 +45,8 @@
         [% FOREACH item IN items %]
         <div id="outeritemblock">
         <div id="itemblock">
-            <ol>[% FOREACH iteminformatio IN item.iteminformation %]<li>
-                <div class="subfield_line" style="[% iteminformatio.hidden %];" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
+            <ol>[% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden %];">
+                <div class="subfield_line" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
                                 
                     <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
                     [% iteminformatio.marc_value %]
index 07927d1..d6ae2b2 100644 (file)
@@ -92,6 +92,13 @@ OPAC:
                   yes: Show
                   no: "Don't show"
             - "'Powered by Koha' text on OPAC footer."
+        -
+            - pref: OpacShowRecentComments
+              default: 0
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - a link to recent comments in the OPAC masthead.
         -
             - pref: OpacHighlightedWords
               choices:
index 3eb42f3..49a56cf 100644 (file)
@@ -285,12 +285,12 @@ function validate1(date) {
         <th>Type</th>
         <th>Value</th>
     </tr>
-    [% FOREACH patron_attribute IN patron_attributes %]
+    [% FOREACH extendedattribute IN extendedattributes %]
     <tr>
-        <td>[% patron_attribute.code %] ([% patron_attribute.description %])</td>
-        <td>[% patron_attribute.value %]
-            [% IF ( patron_attribute.value_description ) %]
-                ([% patron_attribute.value_description %])
+        <td>[% extendedattribute.code %] ([% extendedattribute.description %])</td>
+        <td>[% extendedattribute.value %]
+            [% IF ( extendedattribute.value_description ) %]
+                ([% extendedattribute.value_description %])
             [% END %]
         </td>
     </tr>
index 686d278..f307ba0 100644 (file)
@@ -17,9 +17,11 @@ Reference Manager or ProCite.
 [% IF ( comment ) %]
 [% comment %]
 [% END %]
-[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %][% BIBLIO_RESULT.title %][% IF ( BIBLIO_RESULT.subtitle ) %] [% BIBLIO_RESULT.subtitle %][% END %][% IF ( BIBLIO_RESULT.MARCAUTHORS ) %]
-Author(s): [% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %][% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% MARCAUTHOR_SUBFIELDS_LOO.separator %][% MARCAUTHOR_SUBFIELDS_LOO.value %][% END %][% UNLESS ( loop.last ) %]; [% ELSE %]
-[% END %][% END %][% END %][% IF ( BIBLIO_RESULT.ISBN ) %]
+[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %][% BIBLIO_RESULT.title %][% IF ( BIBLIO_RESULT.subtitle.size ) %] [% FOREACH subtitle IN BIBLIO_RESULT.subtitle %][% subtitle.subfield %][% END %][% END %][% IF ( BIBLIO_RESULT.author ) %]
+
+by [% BIBLIO_RESULT.author %][% END %]
+[% IF ( BIBLIO_RESULT.MARCAUTHORS.size ) %]
+Additional author(s): [% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %][% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% MARCAUTHOR_SUBFIELDS_LOO.separator %] [% MARCAUTHOR_SUBFIELDS_LOO.value %][% END %][% UNLESS ( loop.last ) %];[% END %][% END %][% END %][% IF ( BIBLIO_RESULT.ISBN ) %]
 ISBN: [% BIBLIO_RESULT.ISBN %][% END %]
 [% IF ( BIBLIO_RESULT.publishercode ) %]Published by: [% BIBLIO_RESULT.publishercode %][% END %][% IF ( BIBLIO_RESULT.publicationyear ) %] in [% END %][% BIBLIO_RESULT.publicationyear %][% IF ( BIBLIO_RESULT.pages ) %], [% END %][% BIBLIO_RESULT.pages %][% IF ( BIBLIO_RESULT.size ) %], [% END %][% BIBLIO_RESULT.size %][% IF ( BIBLIO_RESULT.collection ) %]
 Collection: [% BIBLIO_RESULT.seriestitle %][% END %][% IF ( BIBLIO_RESULT.subject ) %]
@@ -31,9 +33,9 @@ Serial: [% BIBLIO_RESULT.serial %][% END %][% IF ( BIBLIO_RESULT.dewey ) %]
 Dewey: [% BIBLIO_RESULT.dewey %][% END %][% IF ( BIBLIO_RESULT.classification ) %]
 Classification: [% BIBLIO_RESULT.classification %][% END %][% IF ( BIBLIO_RESULT.lccn ) %]
 LCCN: [% BIBLIO_RESULT.lccn %][% END %][% IF ( BIBLIO_RESULT.url ) %]
-url : [% BIBLIO_RESULT.url %][% END %]
+url : [% BIBLIO_RESULT.url %][% END %][% IF ( OPACBaseURL ) %]
 In the online catalog:
-[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %]
+    http://[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %][% END %]
 Items : [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
     [% ITEM_RESULT.branchname %] [% ITEM_RESULT.location %] [% IF ( ITEM_RESULT.itemcallnumber ) %]([% ITEM_RESULT.itemcallnumber %])[% END %] [% ITEM_RESULT.barcode %][% END %]
 
index fd352a9..0ffb881 100644 (file)
 <a href="/cgi-bin/koha/opac-search.pl">Advanced Search</a>
 [% IF ( OpacBrowser ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-browser.pl">Browse by Hierarchy</a>[% END %]
 [% IF ( OpacAuthorities ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-authorities-home.pl">Browse by author or subject</a>[% END %]
+[% IF ( OpacShowRecentComments ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-showreviews.pl">Recent Comments</a>[% END %]
 [% IF ( TagsEnabled ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags.pl">Tag Cloud</a>[% END %]
 [% IF ( OpacCloud ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject Cloud</a>[% END %]
 [% IF ( OpacTopissue ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-topissues.pl">Most Popular</a>[% END %]
index 74317df..f9f7c31 100644 (file)
@@ -17,8 +17,11 @@ Reference Manager or ProCite.
 [% IF ( comment ) %]
 [% comment %]
 [% END %]
-[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %][% BIBLIO_RESULT.title %][% IF ( BIBLIO_RESULT.subtitle ) %] [% BIBLIO_RESULT.subtitle %][% END %][% IF ( BIBLIO_RESULT.MARCAUTHORS ) %]
-Author(s): [% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %][% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% MARCAUTHOR_SUBFIELDS_LOO.separator %][% MARCAUTHOR_SUBFIELDS_LOO.value %][% END %][% UNLESS ( loop.last ) %]; [% ELSE %]
+[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %][% BIBLIO_RESULT.title %][% IF ( BIBLIO_RESULT.subtitle.size ) %] [% FOREACH subtitle IN BIBLIO_RESULT.subtitle %][% subtitle.subfield %][% END %][% END %][% IF ( BIBLIO_RESULT.author ) %]
+
+by [% BIBLIO_RESULT.author %][% END %]
+[% IF ( BIBLIO_RESULT.MARCAUTHORS.size ) %]
+Additional author(s): [% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %][% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% MARCAUTHOR_SUBFIELDS_LOO.separator %] [% MARCAUTHOR_SUBFIELDS_LOO.value %][% END %][% UNLESS ( loop.last ) %]; [% ELSE %]
 [% END %][% END %][% END %][% IF ( BIBLIO_RESULT.ISBN ) %]
 ISBN: [% BIBLIO_RESULT.ISBN %][% END %]
 [% IF ( BIBLIO_RESULT.publishercode ) %]Published by: [% BIBLIO_RESULT.publishercode %][% END %][% IF ( BIBLIO_RESULT.publicationyear ) %] in [% END %][% BIBLIO_RESULT.publicationyear %][% IF ( BIBLIO_RESULT.pages ) %], [% END %][% BIBLIO_RESULT.pages %][% IF ( BIBLIO_RESULT.size ) %], [% END %][% BIBLIO_RESULT.size %][% IF ( BIBLIO_RESULT.collection ) %]
@@ -31,9 +34,9 @@ Serial: [% BIBLIO_RESULT.serial %][% END %][% IF ( BIBLIO_RESULT.dewey ) %]
 Dewey: [% BIBLIO_RESULT.dewey %][% END %][% IF ( BIBLIO_RESULT.classification ) %]
 Classification: [% BIBLIO_RESULT.classification %][% END %][% IF ( BIBLIO_RESULT.lccn ) %]
 LCCN: [% BIBLIO_RESULT.lccn %][% END %][% IF ( BIBLIO_RESULT.url ) %]
-url : [% BIBLIO_RESULT.url %][% END %]
+url : [% BIBLIO_RESULT.url %][% END %][% IF ( OPACBaseURL ) %]
 In the online catalog:
-[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %]
+    http://[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %][% END %]
 Items : [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
     [% ITEM_RESULT.branchname %] [% ITEM_RESULT.location %] [% IF ( ITEM_RESULT.itemcallnumber ) %]([% ITEM_RESULT.itemcallnumber %])[% END %] [% ITEM_RESULT.barcode %][% END %]
 
index 174eef4..29a8b27 100644 (file)
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.05.00.021';
+    our $VERSION = '3.05.00.023';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
index b197b3f..e16405b 100755 (executable)
@@ -94,7 +94,14 @@ $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
 
 my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
 $template->param( picture => 1 ) if $picture;
-my $attributes = GetBorrowerAttributes($borrowernumber);
+
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+    my $attributes = GetBorrowerAttributes($borrowernumber);
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
+}
 
 $template->param(
     finesview           => 1,
@@ -120,7 +127,6 @@ $template->param(
     is_child            => ($data->{'category_type'} eq 'C'),
     reverse_col         => $reverse_col,
     accounts            => $accts,
-    extendedattributes => $attributes,
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;
index 801fcc2..3c664c2 100755 (executable)
@@ -78,7 +78,14 @@ if ($add){
     $template->param( adultborrower => 1 ) if ( $data->{category_type} eq 'A' );
     my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
     $template->param( picture => 1 ) if $picture;
+
+if (C4::Context->preference('ExtendedPatronAttributes')) {
     my $attributes = GetBorrowerAttributes($borrowernumber);
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
+}
     
     $template->param(
         borrowernumber => $borrowernumber,
@@ -99,7 +106,6 @@ if ($add){
                    branchcode => $data->{'branchcode'},
                    branchname => GetBranchName($data->{'branchcode'}),
                    is_child        => ($data->{'category_type'} eq 'C'),
-            extendedattributes => $attributes,
         );
     output_html_with_http_headers $input, $cookie, $template->output;
 }
index 9a040b6..1f42093 100755 (executable)
@@ -106,8 +106,14 @@ if ($add){
     $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
     my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
     $template->param( picture => 1 ) if $picture;
-    my $attributes = GetBorrowerAttributes($borrowernumber);
 
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+    my $attributes = GetBorrowerAttributes($borrowernumber);
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
+}
        $template->param(
                 borrowernumber => $borrowernumber,
                firstname => $data->{'firstname'},
@@ -127,7 +133,6 @@ if ($add){
                branchcode => $data->{'branchcode'},
                branchname => GetBranchName($data->{'branchcode'}),
                is_child        => ($data->{'category_type'} eq 'C'),
-        extendedattributes => $attributes,
     );
     output_html_with_http_headers $input, $cookie, $template->output;
 }
index 00a3268..76f300e 100755 (executable)
@@ -162,7 +162,14 @@ if ($input->param('newflags')) {
 $template->param( adultborrower => 1 ) if ( $bor->{'category_type'} eq 'A' );
     my ($picture, $dberror) = GetPatronImage($bor->{'cardnumber'});
     $template->param( picture => 1 ) if $picture;
-my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'});
+
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+    my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'});
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
+}
 
 $template->param(
                borrowernumber => $bor->{'borrowernumber'},
@@ -184,7 +191,6 @@ $template->param(
                branchname => GetBranchName($bor->{'branchcode'}),
                loop => \@loop,
                is_child        => ($bor->{'category_type'} eq 'C'),
-        extendedattributes => $attributes,
                );
 
     output_html_with_http_headers $input, $cookie, $template->output;
index 03f5243..25e9551 100755 (executable)
@@ -90,7 +90,14 @@ if ( $newpassword  && ! $errormsg ) {
 $template->param( adultborrower => 1 ) if ( $bor->{'category_type'} eq 'A' );
 my ($picture, $dberror) = GetPatronImage($bor->{'cardnumber'});
 $template->param( picture => 1 ) if $picture;
-my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'});
+
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+    my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'});
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
+}
 
     $template->param( othernames => $bor->{'othernames'},
            surname     => $bor->{'surname'},
@@ -114,7 +121,6 @@ my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'});
            destination => $destination,
                is_child        => ($bor->{'category_type'} eq 'C'),
            defaultnewpassword => $defaultnewpassword,
-       extendedattributes => $attributes,
        );
 
 
index 7f47dd6..9115dd1 100755 (executable)
@@ -425,8 +425,11 @@ my $branch=C4::Context->userenv->{'branch'};
 $template->param(%$data);
 
 if (C4::Context->preference('ExtendedPatronAttributes')) {
-    $template->param(ExtendedPatronAttributes => 1);
-    $template->param(patron_attributes => C4::Members::Attributes::GetBorrowerAttributes($borrowernumber));
+    my $attributes = GetBorrowerAttributes($borrowernumber);
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
     my @types = C4::Members::AttributeTypes::GetAttributeTypes();
     if (scalar(@types) == 0) {
         $template->param(no_patron_attribute_types => 1);
@@ -439,7 +442,6 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) {
     $template->param(SMSSendDriver => C4::Context->preference("SMSSendDriver"));
     $template->param(SMSnumber     => defined $data->{'smsalertnumber'} ? $data->{'smsalertnumber'} : $data->{'mobile'});
 }
-my $attributes = GetBorrowerAttributes($borrowernumber);
 
 $template->param(
     detailview => 1,
@@ -469,7 +471,6 @@ $template->param(
     "dateformat_" . (C4::Context->preference("dateformat") || '') => 1,
     samebranch     => $samebranch,
     quickslip            => $quickslip,
-    extendedattributes => $attributes,
 );
 
 #Get the slip news items
index a6e65c8..41f2a90 100755 (executable)
@@ -53,7 +53,14 @@ $template->param( picture => 1 ) if $picture;
 # Getting the messages
 my $queued_messages = C4::Letters::GetQueuedMessages({borrowernumber => $borrowernumber});
 $template->param( %{$borrower} );
-my $attributes = GetBorrowerAttributes($borrowernumber);
+
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+    my $attributes = GetBorrowerAttributes($borrowernumber);
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
+}
 
 $template->param(
                        QUEUED_MESSAGES         => $queued_messages,
@@ -61,7 +68,6 @@ $template->param(
                        sentnotices             => 1,
                         branchname              => GetBranchName($borrower->{'branchcode'}),
                         categoryname            => $borrower->{'description'},
-                        extendedattributes      => $attributes,
 );
 output_html_with_http_headers $input, $cookie, $template->output;
 
index 9389f82..6bc18fc 100755 (executable)
@@ -233,7 +233,13 @@ sub borrower_add_additional_fields {
     if ($picture) {
         $b_ref->{has_picture} = 1;
     }
-    $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber);
+
+    if (C4::Context->preference('ExtendedPatronAttributes')) {
+        $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber);
+        $template->param(
+            ExtendedPatronAttributes => 1,
+        );
+    }
 
     $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} );
     return;
index 04414e3..8c0cd6f 100755 (executable)
@@ -96,7 +96,14 @@ if (! $limit){
 
 my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
 $template->param( picture => 1 ) if $picture;
-my $attributes = GetBorrowerAttributes($borrowernumber);
+
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+    my $attributes = GetBorrowerAttributes($borrowernumber);
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
+}
 
 $template->param(
                                                readingrecordview => 1,
@@ -125,7 +132,6 @@ $template->param(
                                                branchname => GetBranchName($data->{'branchcode'}),
                                                showfulllink => (scalar @loop_reading > 50),                                    
                                                loop_reading => \@loop_reading,
-                                           extendedattributes => $attributes,
 );
 output_html_with_http_headers $input, $cookie, $template->output;
 
diff --git a/misc/cronjobs/batch_anonymise.pl b/misc/cronjobs/batch_anonymise.pl
new file mode 100755 (executable)
index 0000000..857171b
--- /dev/null
@@ -0,0 +1,76 @@
+#!/usr/bin/perl
+
+# Copyright 2011, ByWater Solutions.
+#
+# 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.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use strict;
+use warnings;
+
+BEGIN {
+
+    # find Koha's Perl modules
+    # test carefully before changing this
+    use FindBin;
+    eval { require "$FindBin::Bin/../kohalib.pl" };
+}
+
+use C4::Context;
+use C4::Circulation;
+use C4::Dates;
+use Date::Calc qw(
+  Today
+  Add_Delta_Days
+);
+use Getopt::Long;
+
+sub usage {
+    print STDERR <<USAGE;
+Usage: $0  --days DAYS  [-h|--help]
+   --days DAYS        (MANDATORY) anonymise patron history that is older than DAYS days.
+   -v --verbose       gives a little more information
+   -h --help          prints this help message, and exits, ignoring all
+                      other options
+USAGE
+    exit $_[0];
+}
+
+my ( $help, $days, $verbose );
+
+GetOptions(
+    'h|help'       => \$help,
+    'days:i'       => \$days,
+    'v|verbose'    => \$verbose,
+) || usage(1);
+
+if ($help) {
+    usage(0);
+}
+
+if ( !$days  ) {
+    print "The days parameter is mandatory.\n\n";
+    usage(1);
+}
+
+my ($year,$month,$day) = Today();
+my ($newyear,$newmonth,$newday) = Add_Delta_Days ($year,$month,$day,(-1)*$days);
+my $formatdate = sprintf "%4d-%02d-%02d",$newyear,$newmonth,$newday;
+$verbose and print "Checkouts before $formatdate will be anonymised.\n";
+
+my $rows = AnonymiseIssueHistory($formatdate);
+$verbose and print "$rows checkouts anonymised.\n";
+
+exit(0);
index b571e07..1de95ae 100755 (executable)
@@ -81,12 +81,13 @@ if ( $email ) {
     # retrieve biblios from shelf
     foreach my $biblio (@$items) {
         my $biblionumber = $biblio->{biblionumber};
-
+        my $fw               = GetFrameworkCode($biblionumber);
         my $dat              = GetBiblioData($biblionumber);
         my $record           = GetMarcBiblio($biblionumber);
         my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
         my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
         my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
+        my $subtitle         = GetRecordValue('subtitle', $record, $fw);
 
         my @items = GetItemsInfo( $biblionumber );
 
@@ -95,13 +96,18 @@ if ( $email ) {
         $dat->{MARCAUTHORS}    = $marcauthorsarray;
         $dat->{'biblionumber'} = $biblionumber;
         $dat->{ITEM_RESULTS}   = \@items;
+        $dat->{subtitle}       = $subtitle;
 
         $iso2709 .= $record->as_usmarc();
 
         push( @results, $dat );
     }
 
-    my $user = GetMember(borrowernumber => $borrowernumber); 
+    my $user = GetMember(borrowernumber => $borrowernumber);
+
+    if (C4::Context->preference('OPACBaseURL')){
+          $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') );
+    }
 
     $template2->param(
         BIBLIO_RESULTS => \@results,
@@ -185,4 +191,4 @@ END_OF_BODY
                       url     => "/cgi-bin/koha/opac-sendshelf.pl",
     );
     output_html_with_http_headers $query, $cookie, $template->output;
-}
\ No newline at end of file
+}
index cfeea73..21183da 100755 (executable)
@@ -129,7 +129,7 @@ if ($findborrower) {
 # If we have the borrowernumber because we've performed an action, then we
 # don't want to try to place another reserve.
 if ($borrowernumber_hold && !$action) {
-    my $borrowerinfo = GetMemberDetails( $borrowernumber_hold );
+    my $borrowerinfo = GetMember( borrowernumber => $borrowernumber_hold );
     my $diffbranch;
     my @getreservloop;
     my $count_reserv = 0;
@@ -217,8 +217,8 @@ if ($borrowerslist) {
     );
 }
 
-# FIXME launch another time GetMemberDetails perhaps until
-my $borrowerinfo = GetMemberDetails( $borrowernumber_hold );
+# FIXME launch another time GetMember perhaps until
+my $borrowerinfo = GetMember( borrowernumber => $borrowernumber_hold );
 
 my @biblionumbers = ();
 my $biblionumbers = $input->param('biblionumbers');
@@ -373,7 +373,7 @@ foreach my $biblionumber (@biblionumbers) {
 
             # checking reserve
             my ($reservedate,$reservedfor,$expectedAt) = GetReservesFromItemnumber($itemnumber);
-            my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0);
+            my $ItemBorrowerReserveInfo = GetMember( borrowernumber => $reservedfor );
 
             if ( defined $reservedate ) {
                 $item->{backgroundcolor} = 'reserved';
@@ -542,7 +542,7 @@ foreach my $biblionumber (@biblionumbers) {
         }
 
         #     get borrowers reserve info
-        my $reserveborrowerinfo = GetMemberDetails( $res->{'borrowernumber'}, 0);
+        my $reserveborrowerinfo = GetMember( borrowernumber => $res->{'borrowernumber'} );
         if (C4::Context->preference('HidePatronName')){
            $reserve{'hidename'} = 1;
            $reserve{'cardnumber'} = $reserveborrowerinfo->{'cardnumber'};
index 16ada89..37a98ec 100755 (executable)
@@ -77,13 +77,14 @@ if ( $email ) {
 
     # retrieve biblios from shelf
     foreach my $biblio (@$items) {
-        my $biblionumber = $biblio->{biblionumber};
-
+        my $biblionumber     = $biblio->{biblionumber};
+        my $fw               = GetFrameworkCode($biblionumber);
         my $dat              = GetBiblioData($biblionumber);
         my $record           = GetMarcBiblio($biblionumber);
         my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
         my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
         my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
+        my $subtitle         = GetRecordValue('subtitle', $record, $fw);
 
         my @items = GetItemsInfo( $biblionumber );
 
@@ -92,12 +93,17 @@ if ( $email ) {
         $dat->{MARCAUTHORS}    = $marcauthorsarray;
         $dat->{'biblionumber'} = $biblionumber;
         $dat->{ITEM_RESULTS}   = \@items;
+        $dat->{subtitle}       = $subtitle;
 
         $iso2709 .= $record->as_usmarc();
 
         push( @results, $dat );
     }
 
+  if (C4::Context->preference('OPACBaseURL')){
+        $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') );
+  }
+
     $template2->param(
         BIBLIO_RESULTS => \@results,
         email_sender   => $email_from,