Merge remote-tracking branch 'kc/new/bug_6497' into kcmaster
authorChris Cormack <chrisc@catalyst.net.nz>
Sun, 19 Jun 2011 10:14:15 +0000 (22:14 +1200)
committerChris Cormack <chrisc@catalyst.net.nz>
Sun, 19 Jun 2011 10:14:15 +0000 (22:14 +1200)
24 files changed:
C4/Auth_with_ldap.pm
C4/Items.pm
basket/basket.pl
basket/sendbasket.pl
catalogue/detail.pl
catalogue/detailprint.pl
docs/history.txt
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt
koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc
koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.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
misc/admin/koha-preferences
misc/migration_tools/rebuild_zebra.pl
opac/opac-ISBDdetail.pl
opac/opac-detail.pl
opac/opac-sendbasket.pl
opac/opac-sendshelf.pl
reports/reservereport.pl
serials/routing-preview.pl
virtualshelves/sendshelf.pl

index acbd923..6ad17f7 100644 (file)
@@ -82,11 +82,6 @@ sub search_method {
     my $userid = shift or return;
        my $uid_field = $mapping{userid}->{is} or die ldapserver_error("mapping for 'userid'");
        my $filter = Net::LDAP::Filter->new("$uid_field=$userid") or die "Failed to create new Net::LDAP::Filter";
-    my $res = ($config{anonymous}) ? $db->bind : $db->bind($ldapname, password=>$ldappassword);
-    if ($res->code) {          # connection refused
-        warn "LDAP bind failed as ldapuser " . ($ldapname || '[ANONYMOUS]') . ": " . description($res);
-        return 0;
-    }
        my $search = $db->search(
                  base => $base,
                filter => $filter,
@@ -124,10 +119,21 @@ sub checkpw_ldap {
         }
 
        # FIXME dpavlin -- we really need $userldapentry leater on even if using auth_by_bind!
-       my $search = search_method($db, $userid) or return 0;   # warnings are in the sub
-       $userldapentry = $search->shift_entry;
+
+       # BUG #5094
+       # 2010-08-04 JeremyC
+       # a $userldapentry is only needed if either updating or replicating are enabled
+       if($config{update} or $config{replicate}) {
+           my $search = search_method($db, $userid) or return 0;   # warnings are in the sub
+           $userldapentry = $search->shift_entry;
+       }
 
        } else {
+               my $res = ($config{anonymous}) ? $db->bind : $db->bind($ldapname, password=>$ldappassword);
+               if ($res->code) {               # connection refused
+                       warn "LDAP bind failed as ldapuser " . ($ldapname || '[ANONYMOUS]') . ": " . description($res);
+                       return 0;
+               }
         my $search = search_method($db, $userid) or return 0;   # warnings are in the sub
         $userldapentry = $search->shift_entry;
                my $cmpmesg = $db->compare( $userldapentry, attr=>'userpassword', value => $password );
index 44272e2..9342564 100644 (file)
@@ -1112,16 +1112,12 @@ sub GetItemsByBiblioitemnumber {
 
 =head2 GetItemsInfo
 
-  @results = GetItemsInfo($biblionumber, $type);
+  @results = GetItemsInfo($biblionumber);
 
-Returns information about books with the given biblionumber.
-
-C<$type> may be either C<intra> or anything else. If it is not set to
-C<intra>, then the search will exclude lost, very overdue, and
-withdrawn items.
+Returns information about items with the given biblionumber.
 
 C<GetItemsInfo> returns a list of references-to-hash. Each element
-contains a number of keys. Most of them are table items from the
+contains a number of keys. Most of them are attributes from the
 C<biblio>, C<biblioitems>, C<items>, and C<itemtypes> tables in the
 Koha database. Other keys include:
 
@@ -1157,7 +1153,7 @@ If this is set, it is set to C<One Order>.
 =cut
 
 sub GetItemsInfo {
-    my ( $biblionumber, $type ) = @_;
+    my ( $biblionumber ) = @_;
     my $dbh   = C4::Context->dbh;
     # note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance.
     my $query = "
index ed6e5a4..8fc15e4 100755 (executable)
@@ -66,7 +66,7 @@ foreach my $biblionumber ( @bibs ) {
     my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
     my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
     my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
-    my @items            = &GetItemsInfo( $biblionumber, 'opac' );
+    my @items            = GetItemsInfo( $biblionumber );
 
     my $hasauthors = 0;
     if($dat->{'author'} || @$marcauthorsarray) {
index 107a737..66f73fa 100755 (executable)
@@ -80,7 +80,7 @@ if ( $email_add ) {
         my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
         my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
 
-        my @items = &GetItemsInfo( $biblionumber, 'opac' );
+        my @items = GetItemsInfo( $biblionumber );
 
         my $hasauthors = 0;
         if($dat->{'author'} || @$marcauthorsarray) {
index 03271b4..8738737 100755 (executable)
@@ -112,8 +112,7 @@ my $branches = GetBranches();
 my $itemtypes = GetItemTypes();
 my $dbh = C4::Context->dbh;
 
-# 'intra' param included, even though it's not respected in GetItemsInfo currently
-my @all_items= GetItemsInfo($biblionumber, 'intra');
+my @all_items = GetItemsInfo( $biblionumber );
 my @items;
 for my $itm (@all_items) {
     push @items, $itm unless ( $itm->{itemlost} && GetHideLostItemsPreference($borrowernumber) && !$showallitems);
index 41d346f..fe92fe5 100755 (executable)
@@ -35,7 +35,7 @@ my $type  = $query->param('type');
 my $biblionumber = $query->param('biblionumber');
 
 # change back when ive fixed request.pl
-my @items = GetItemsInfo( $biblionumber, $type );
+my @items = GetItemsInfo( $biblionumber );
 my $norequests = 1;
 foreach my $itm (@items) {
     $norequests = 0 unless $itm->{'notforloan'};
index 357181d..5b2c29f 100644 (file)
@@ -548,4 +548,5 @@ May 15 2011 Koha 3.2.9 released     releases
 May 22 2011    Koha 3.4.1 released     releases
 June 1 2011    Fridolyn Somers becomes the 143rd developer to have a patch pushed
 June 3 2011    Elliott Davis becomes the 144th developer to have a patch pushed
-
+June 15 2011   First ever global sign off day
+June 17 2011   Jeremy Crabtree becomes the 145th developer to have a patch pushed
index bfa17e2..d8e1a69 100644 (file)
                 <li>Andrew Chilton</li>
                 <li>Garry Collum</li>
                <li>John Copeland</li>
+               <li>Jeremy Crabtree</li>
                <li>Christophe Croullebois</li>
                 <li>Nate Curulla</li>
                 <li>Vincent Danjean</li>
index f22e407..43ef0c9 100644 (file)
@@ -49,7 +49,7 @@ $(document).ready(function(){
             <td>[% IF ( branchloo.seen ) %]
                     <span style="display:none;">[% branchloo.seen %][% branchloo.seentime %]</span>
                     <!-- invisible span for eventual use by tablesorter -->
-                    [% DEFAULT branchloo.seentime="??:??" %] [% branchloo.seen %] 
+                    [% branchloo.seen %] [% branchloo.seentime %]
                 [% ELSE %]Never
                 [% END %]
             </td>
index 2129026..3507880 100644 (file)
@@ -2,7 +2,6 @@
 [% IF ( facets_loop ) %]
 <div id="search-facets">
 <h4>Refine your search</h4>
-[% query_cgi %]
 <ul>
        <li>Availability<ul><li>[% IF ( available ) %]Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi_not_availablity %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">Show all items</a>[% ELSE %]Limit to <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]&amp;limit=available">currently available items.</a>[% END %]</li></ul>
        [% IF ( related ) %] <li>(related searches: [% FOREACH relate IN related %][% relate.related_search %][% END %])</li>[% END %]
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 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 a9e33f4..6728609 100755 (executable)
@@ -125,6 +125,8 @@ sub SetPreferences {
 
         _set_preference( $row->{'variable'}, $preferences{$row->{'variable'}} );
     }
+
+    C4::Context->clear_syspref_cache();
 }
 
 sub _fetch_preference {
index 6710224..bda6254 100755 (executable)
@@ -320,7 +320,7 @@ sub export_marc_records_from_sth {
                           ? GetXmlBiblio( $record_number )
                           : GetAuthorityXML( $record_number );
             if ($record_type eq 'biblio'){
-                my @items = GetItemsInfo($record_number, 'intra');
+                my @items = GetItemsInfo($record_number);
                 if (@items){
                     my $record = MARC::Record->new;
                     my @itemsrecord;
index b50947d..e141da7 100755 (executable)
@@ -124,7 +124,7 @@ $template->param(
 
 my $norequests = 1;
 my $res = GetISBDView($biblionumber, "opac");
-my @items = &GetItemsInfo($biblionumber, 'opac');
+my @items = GetItemsInfo( $biblionumber );
 
 my $itemtypes = GetItemTypes();
 for my $itm (@items) {
index b357a56..6345da1 100755 (executable)
@@ -85,7 +85,7 @@ if (C4::Context->preference("OPACXSLTDetailsDisplay") ) {
 
 $template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); 
 # change back when ive fixed request.pl
-my @all_items = &GetItemsInfo( $biblionumber, 'opac' );
+my @all_items = GetItemsInfo( $biblionumber );
 my @items;
 
 # Getting items to be hidden
index 0042c42..df1b4c5 100755 (executable)
@@ -81,7 +81,7 @@ if ( $email_add ) {
         my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
         my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
 
-        my @items = &GetItemsInfo( $biblionumber, 'opac' );
+        my @items = GetItemsInfo( $biblionumber );
 
         my $hasauthors = 0;
         if($dat->{'author'} || @$marcauthorsarray) {
index e3798f8..b571e07 100755 (executable)
@@ -88,7 +88,7 @@ if ( $email ) {
         my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
         my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
 
-        my @items = &GetItemsInfo( $biblionumber, 'opac' );
+        my @items = GetItemsInfo( $biblionumber );
 
         $dat->{MARCNOTES}      = $marcnotesarray;
         $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
index 67f384c..42a1d20 100755 (executable)
@@ -96,7 +96,7 @@ for ( my $i = 0 ; $i < $count ; $i++ ) {
         # FIXME still need to shift the text to the template so its translateable
         if ( $data->[$i]) {
             # find if its on issue
-            my @items = GetItemsInfo($line{'biblionumber'}, 'intra' );
+            my @items = GetItemsInfo( $line{biblionumber} );
             my $onissue = 0;
             foreach my $item (@items) {
                 if ( $item->{'datedue'} eq 'Reserved' ) {
index 5d57c13..64849b5 100755 (executable)
@@ -65,7 +65,7 @@ if($ok){
     # get biblio information....
     my $biblio = $subs->{'biblionumber'};
        my ($count2,@bibitems) = GetBiblioItemByBiblioNumber($biblio);
-       my @itemresults = GetItemsInfo($subs->{'biblionumber'}, 'intra');
+       my @itemresults = GetItemsInfo( $subs->{biblionumber} );
        my $branch = $itemresults[0]->{'holdingbranch'};
        my $branchname = GetBranchName($branch);
 
index d902398..16ada89 100755 (executable)
@@ -85,7 +85,7 @@ if ( $email ) {
         my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
         my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
 
-        my @items = &GetItemsInfo( $biblionumber, 'opac' );
+        my @items = GetItemsInfo( $biblionumber );
 
         $dat->{MARCNOTES}      = $marcnotesarray;
         $dat->{MARCSUBJCTS}    = $marcsubjctsarray;