Merge remote-tracking branch 'origin/new/bug_7146'
authorPaul Poulain <paul.poulain@biblibre.com>
Sun, 6 Nov 2011 11:04:43 +0000 (12:04 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Sun, 6 Nov 2011 11:04:43 +0000 (12:04 +0100)
C4/Acquisition.pm
acqui/neworderbiblio.pl
koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-add-to-basket.inc
koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
opac/opac-user.pl
suggestion/suggestion.pl

index 19c4f08..a0dda42 100644 (file)
@@ -1581,33 +1581,33 @@ sub GetHistory {
 
     my @query_params  = ();
 
-    if ( defined $title ) {
+    if ( $title ) {
         $query .= " AND biblio.title LIKE ? ";
         $title =~ s/\s+/%/g;
         push @query_params, "%$title%";
     }
 
-    if ( defined $author ) {
+    if ( $author ) {
         $query .= " AND biblio.author LIKE ? ";
         push @query_params, "%$author%";
     }
 
-    if ( defined $isbn ) {
+    if ( $isbn ) {
         $query .= " AND biblioitems.isbn LIKE ? ";
         push @query_params, "%$isbn%";
     }
 
-    if ( defined $name ) {
+    if ( $name ) {
         $query .= " AND aqbooksellers.name LIKE ? ";
         push @query_params, "%$name%";
     }
 
-    if ( defined $from_placed_on ) {
+    if ( $from_placed_on ) {
         $query .= " AND creationdate >= ? ";
         push @query_params, $from_placed_on;
     }
 
-    if ( defined $to_placed_on ) {
+    if ( $to_placed_on ) {
         $query .= " AND creationdate <= ? ";
         push @query_params, $to_placed_on;
     }
index c348940..5824f6b 100755 (executable)
@@ -65,6 +65,8 @@ use C4::Biblio;
 use C4::Auth;
 use C4::Output;
 use C4::Koha;
+use C4::Members qw/ GetMember /;
+use C4::Budgets qw/ GetBudgetHierarchy /;
 
 my $input = new CGI;
 
@@ -121,10 +123,22 @@ foreach my $result ( @{$marcresults} ) {
 
 }
 
+my $borrower= GetMember('borrowernumber' => $loggedinuser);
+my $budgets = GetBudgetHierarchy(q{},$borrower->{branchcode},$borrower->{borrowernumber});
+my $has_budgets = 0;
+foreach my $r (@{$budgets}) {
+    if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) {
+        next;
+    }
+    $has_budgets = 1;
+    last;
+}
+
 $template->param(
+    has_budgets          => $has_budgets,
     basketno             => $basketno,
-    booksellerid     => $bookseller->{'id'},
-    name             => $bookseller->{'name'},
+    booksellerid         => $bookseller->{'id'},
+    name                 => $bookseller->{'name'},
     resultsloop          => \@results,
     total                => $total_hits,
     query                => $query,
index 9fe6c05..6082637 100644 (file)
@@ -15,4 +15,4 @@
     [% ELSE %]
         You can't create any orders unless you first <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">define a budget and a fund</a>.
     [% END %]
-</fieldset>
\ No newline at end of file
+</fieldset>
index f016158..e54529a 100644 (file)
@@ -7,6 +7,16 @@
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-search.inc' %]
 
+<script type="text/javascript" src="[% ( themelang ) %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<script type="text/javascript">//<![CDATA[
+$(document).ready(function() {
+        $("#holdst").tablesorter({
+                sortList: [[6,0]],
+        });
+});
+//]]>
+</script>
+
 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a>
 &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
 &rsaquo; <a href="/cgi-bin/koha/circ/view_holdsqueue.pl">Holds Queue</a>
index b6219c3..7068a87 100644 (file)
        <div id="yui-main">
 
        <div class="yui-b">
-               [% IF ( opacuserlogin ) %]
-           [% IF ( loggedinusername ) %]
-                       <div class="yui-g">
-                       <div>
-                       [% ELSE %]
-               <div class="yui-ge">
-               <div class="yui-u first">
+     [% IF ( opacuserlogin ) %]
+        [% IF ( loggedinusername ) %]
+            <div id="loggedin" class="yui-g">
+            <div>
+        [% ELSE %]
+            <div id="notloggedin" class="yui-ge">
+            <div class="yui-u first">
+         [% END %]
+     [% ELSE %]
+         <div id="notloggedin" class="yui-g">
+        <div>
     [% END %]
-       [% ELSE %]
-               <div class="yui-g">
-               <div>
-       [% END %]
        
        [% IF ( koha_news_count ) %]
 <div id="news" class="container">
index d9417ec..f460b40 100644 (file)
@@ -79,6 +79,12 @@ $.tablesorter.addParser({
         
                [% IF ( patronupdate ) %]<div class="dialog message"><h3>Thank you!</h3><p>Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.</p></div>[% END %]
                
+        [% IF ( BORROWER_INF.warndeparture ) %]
+        <div class="dialog alert">
+                <strong>Please note:</strong><span> Your card will expire on [% BORROWER_INF.warndeparture %]. Please contact the library if you wish to renew your subscription.</span>
+                [% IF ( BORROWER_INF.returnbeforeexpiry ) %]<span> Also note that you must return all checked out items before your card expires.</span>[% END %]
+        </div>
+        [% END %]
 
         [% IF ( BORROWER_INF.flagged ) %]
                <div class="dialog alert">
index e99e557..03c9e81 100755 (executable)
@@ -38,6 +38,12 @@ use C4::Branch; # GetBranches
 
 use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
 
+use Date::Calc qw(
+  Today
+  Add_Delta_Days
+  Date_to_Days
+);
+
 my $query = new CGI;
 
 BEGIN {
@@ -64,6 +70,9 @@ my $patronupdate = $query->param('patronupdate');
 # get borrower information ....
 my ( $borr ) = GetMemberDetails( $borrowernumber );
 
+my (  $today_year,   $today_month,   $today_day) = Today();
+my ($warning_year, $warning_month, $warning_day) = split /-/, $borr->{'dateexpiry'};
+
 for (qw(dateenrolled dateexpiry dateofbirth)) {
     ($borr->{$_}) and $borr->{$_} = format_date($borr->{$_});
 }
@@ -99,6 +108,18 @@ $borr->{'amountoutstanding'} = sprintf "%.02f", $borr->{'amountoutstanding'};
 my @bordat;
 $bordat[0] = $borr;
 
+# Warningdate is the date that the warning starts appearing
+if ( C4::Context->preference('NotifyBorrowerDeparture') &&
+    Date_to_Days(Add_Delta_Days($warning_year,$warning_month,$warning_day,- C4::Context->preference('NotifyBorrowerDeparture'))) <
+    Date_to_Days( $today_year, $today_month, $today_day ) ) 
+{
+    # borrower card soon to expire, warn the borrower
+    $borr->{'warndeparture'} = $borr->{dateexpiry};
+    if (C4::Context->preference('ReturnBeforeExpiry')){
+        $borr->{'returnbeforeexpiry'} = 1;
+    }
+}
+
 $template->param(   BORROWER_INFO     => \@bordat,
                     borrowernumber    => $borrowernumber,
                     patron_flagged    => $borr->{flagged},
index d00b632..18f71b0 100755 (executable)
@@ -59,7 +59,7 @@ sub GetCriteriumDesc{
     if ($displayby =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){
         my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
         return "" unless $borr;
-        return $$borr{firstname} . ", " . $$borr{surname};
+        return $$borr{surname} . ", " . $$borr{firstname};
     }
     if ( $displayby =~ /budgetid/) {
         my $budget = GetBudget($criteriumvalue);