From e50bc421c44a909c94143418d1c7328109b3be05 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 28 Aug 2009 08:12:28 -0500 Subject: [PATCH] Changes to make checkouts/holds display the same on circulation and patron detail screens (Bug 3106) Signed-off-by: Galen Charlton --- circ/circulation.pl | 12 +- .../prog/en/modules/circ/circulation.tmpl | 225 ++++++++++++++---- .../prog/en/modules/members/moremember.tmpl | 46 ++-- members/moremember.pl | 9 +- reserve/modrequest.pl | 2 + 5 files changed, 215 insertions(+), 79 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 6d791241f5..de6013a09e 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -425,13 +425,14 @@ my @previousissues; ## ADDED BY JF: new itemtype issuingrules counter stuff my $issued_itemtypes_count; my @issued_itemtypes_count_loop; +my $totalprice = 0; if ($borrower) { # get each issue of the borrower & separate them in todayissues & previous issues my ($issueslist) = GetPendingIssues($borrower->{'borrowernumber'}); - # split in 2 arrays for today & previous foreach my $it ( @$issueslist ) { + my $itemtypeinfo = getitemtypeinfo( (C4::Context->preference('item-level_itypes')) ? $it->{'itype'} : $it->{'itemtype'} ); # set itemtype per item-level_itype syspref - FIXME this is an ugly hack $it->{'itemtype'} = ( C4::Context->preference( 'item-level_itypes' ) ) ? $it->{'itype'} : $it->{'itemtype'}; @@ -447,8 +448,13 @@ if ($borrower) { $it->{'can_renew'} = $can_renew; $it->{'can_confirm'} = !$can_renew && !$restype; $it->{'renew_error'} = $restype; + $it->{'checkoutdate'} = C4::Dates->new($it->{'issuedate'},'iso')->output('syspref'); + $totalprice += $it->{'replacementprice'}; + $it->{'itemtype'} = $itemtypeinfo->{'description'}; + $it->{'itemtype_image'} = $itemtypeinfo->{'imageurl'}; $it->{'dd'} = format_date($it->{'date_due'}); + $it->{'issuedate'} = format_date($it->{'issuedate'}); $it->{'od'} = ( $it->{'date_due'} lt $todaysdate ) ? 1 : 0 ; ($it->{'author'} eq '') and $it->{'author'} = ' '; $it->{'renew_failed'} = $renew_failed{$it->{'itemnumber'}}; @@ -619,6 +625,8 @@ foreach my $flag ( sort keys %$flags ) { my $amountold = $borrower->{flags}->{'CHARGES'}->{'message'} || 0; $amountold =~ s/^.*\$//; # remove upto the $, if any +my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); + if ( $borrower->{'category_type'} eq 'C') { my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); my $cnt = scalar(@$catcodes); @@ -676,6 +684,8 @@ $template->param( duedatespec => $duedatespec, message => $message, CGIselectborrower => $CGIselectborrower, + totalprice => sprintf("%.2f", $totalprice), + totaldue => sprintf("%.2f", $total), todayissues => \@todaysissues, previssues => \@previousissues, inprocess => $inprocess, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index 013a30373d..c43201a96f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -21,7 +21,7 @@ $.tablesorter.addParser({ $.tablesorter.defaults.widgets = ['zebra']; $("#issuest").tablesorter({ dateFormat: 'uk', - headers: { 1: { sorter: 'articles' },5: { sorter: false },6:{sorter:false}} + headers: { 1: { sorter: 'articles' },5: { sorter: false },6:{sorter:false},7:{sorter:false},8:{sorter:false}} }); $("#issuest").bind("sortEnd",function() { $("#previous").parents("tr").remove(); // 'previous checkouts' header chokes table sorter @@ -41,14 +41,91 @@ $.tablesorter.addParser({ } } ).attr( 'checked', false ); - $("td").click(function(e){ - if(e.target.tagName.toLowerCase() == 'td'){ - $(this).find("input:checkbox").each( function() { - $(this).attr('checked', !$(this).attr('checked')); - }); - } - }); + +var allcheckboxes = $(".checkboxed"); + $("#renew_all").click(function(){ + $(allcheckboxes).checkCheckboxes(":input[name*=items]"); + $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); + }); + $("#return_all").click(function(){ + $(allcheckboxes).checkCheckboxes(":input[name*=barcodes]"); + $(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); + }); + $("#CheckAllitems").click(function(){ + $(allcheckboxes).checkCheckboxes(":input[name*=items]"); + $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); return false; + }); + $("#CheckNoitems").click(function(){ + $(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false; + }); + $("#CheckAllreturns").click(function(){ + $(allcheckboxes).checkCheckboxes(":input[name*=barcodes]"); + $(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false; + }); + $("#CheckNoreturns" ).click(function(){ + $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); return false; + }); + + + + $( '#override_limit' ).click( function () { + if ( this.checked ) { + $( '.renewals-allowed' ).show(); $( '.renewals-disabled' ).hide(); + } else { + $( '.renewals-allowed' ).hide(); $( '.renewals-disabled' ).show(); + } + } ).attr( 'checked', false ); + + + $("td").click(function(e){ + if(e.target.tagName.toLowerCase() == 'td'){ + $(this).find("input:checkbox").each( function() { + $(this).attr('checked', !$(this).attr('checked')); + if($(this).attr('checked')){ + $(this).parent().siblings().find("input:checkbox").each(function(){ + if($(this).attr('checked')){ $(this).attr('checked',''); } + }); + } + }); + } + }); + }); +function uncheck_sibling(me){ +nodename=me.getAttribute("name"); +if (nodename =="barcodes[]"){ + var Node=me.parentNode.previousSibling; + while (Node.nodeName!="TD"){Node=Node.previousSibling} + var Nodes=Node.childNodes; + for (var i=0;i @@ -428,7 +505,7 @@ No patron matched 0 Checkouts
  • - Holds(s) + Hold(s) 0 Holds
  • @@ -438,23 +515,54 @@ No patron matched
    -
    + " /> " /> " /> - - - - - - - - + + + + + + + + + + + + + + + + + @@ -464,17 +572,13 @@ No patron matched - - + + + - - - + + - + + + + + @@ -512,8 +622,8 @@ No patron matched - - + + @@ -525,17 +635,15 @@ No patron matched - + + - - - + + - + + + + + @@ -577,15 +691,16 @@ No patron matched
    Due dateTitleItem TypeCall noBarcodeRenewalsRenew?Check In?Due dateTitleItem TypeChecked out onCall noChargePriceRenew

    select all | none

    Check in

    select all | none

    Totals: +

    + Renewal due date: " /> + /lib/calendar/cal.gif" id="newduedate_button" alt="Show Calendar" /> + +

    +

    + +

    +
    &type=intra">, by - - - - " /> - - &type=intra">, by - &itemnumber=#item"> " alt="" /> &itemnumber=#item"> + " checked="checked" style="display: none;" /> @@ -504,7 +608,13 @@ No patron matched ">Check InCheckin Failed" onclick="uncheck_sibling(this);" /> + " checked="checked" style="display: none;" /> + Renewal Failed
    Previous checkouts
    Previous checkouts
    Previous checkouts
    Previous checkouts
    &type=intra">
    -
    &type=intra">, by - &itemnumber=#item"> - - " /> - &itemnumber=#item"> + 0 " checked="checked" style="display: none;" /> @@ -565,7 +673,13 @@ No patron matched ">Check InCheckin Failed" onclick="uncheck_sibling(this);" /> + " checked="checked" style="display: none;" /> + Renewal Failed
    - + - - - -
    + + + + +
    @@ -596,21 +711,22 @@ No patron matched
    +
    + - + "> - - + +
    Hold date TitleItem Type Call Number Barcode PriorityDelete?
    ">, by ">, by Item waiting at @@ -621,15 +737,22 @@ No patron matched hasn't been transfered yet from - - Hold priority - + + " /> + " /> +
    +
    +
    -

    Patron has no pending holds.

    +

    Patron has nothing on hold.

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl index 8e6b73c71e..240e75e44a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl @@ -14,10 +14,10 @@ $.tablesorter.addParser({ }); $(document).ready(function() { $('#finesholdsissues > ul').tabs(); + $.tablesorter.defaults.widgets = ['zebra']; $("#issuest").tablesorter({ dateFormat: 'uk', - sortList: [[1,0]], - headers: { 1: { sorter: 'articles' },4:{sorter:false},5: { sorter: false },6:{sorter:false},7:{sorter:false}} + headers: { 1: { sorter: 'articles' },5: { sorter: false },6:{sorter:false},7:{sorter:false},8:{sorter:false}} }); $("#holdst").tablesorter({ dateFormat: 'uk', @@ -368,13 +368,16 @@ if (nodename =="barcodes[]"){
    -

    Fines and Charges

    Total due:

    @@ -383,7 +386,6 @@ if (nodename =="barcodes[]"){
    -

    Checked Out

    " /> @@ -391,18 +393,19 @@ if (nodename =="barcodes[]"){ - + + - + - + - + @@ -433,13 +436,7 @@ if (nodename =="barcodes[]"){ - - - - + + + + - - + - @@ -529,7 +528,6 @@ if (nodename =="barcodes[]"){ -
    Item TypeDue date TitleItem Type Checked out onDate dueCall no Charge Price Renew

    select all | none

    Return

    select all | none

    Check in

    select all | none

    Totals:Totals: @@ -420,7 +423,7 @@ if (nodename =="barcodes[]"){

    - Forgive fines on return: +

    - " alt="" /> - - ">"> , by ; , &itemnumber=#item"> + class="od"> @@ -447,12 +444,16 @@ if (nodename =="barcodes[]"){ ">, by ; , &itemnumber=#item"> " alt="" /> Renewal Failed + Return FailedCheckin Failed " onclick="uncheck_sibling(this);" /> " checked="checked" style="display: none;" /> @@ -509,7 +510,6 @@ if (nodename =="barcodes[]"){
    -

    Patron current holds

    @@ -517,7 +517,6 @@ if (nodename =="barcodes[]"){
    Hold date TitleItem Type Call Number Barcode Priority ">, by Item is waiting diff --git a/members/moremember.pl b/members/moremember.pl index 67446d850d..3959c12b1a 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -216,13 +216,13 @@ $template->param( lib2 => $lib2 ) if ($lib2); # current issues # my $issue = GetPendingIssues($borrowernumber); -my $count = scalar(@$issue); +my $issuecount = scalar(@$issue); my $roaddetails = &GetRoadTypeDetails( $data->{'streettype'} ); my $today = POSIX::strftime("%Y-%m-%d", localtime); # iso format my @issuedata; my $overdues_exist = 0; my $totalprice = 0; -for ( my $i = 0 ; $i < $count ; $i++ ) { +for ( my $i = 0 ; $i < $issuecount ; $i++ ) { my $datedue = $issue->[$i]{'date_due'}; my $issuedate = $issue->[$i]{'issuedate'}; $issue->[$i]{'date_due'} = C4::Dates->new($issue->[$i]{'date_due'}, 'iso')->output('syspref'); @@ -347,7 +347,9 @@ if ($borrowernumber) { } # return result to the template - $template->param( reservloop => \@reservloop ); + $template->param( reservloop => \@reservloop, + countreserv => scalar @reservloop, + ); } # current alert subscriptions @@ -396,6 +398,7 @@ $template->param( totaldue => sprintf("%.2f", $total), totaldue_raw => $total, issueloop => \@issuedata, + issuecount => $issuecount, overdues_exist => $overdues_exist, error => $error, $error => 1, diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl index 3b66623886..8b7d8ee918 100755 --- a/reserve/modrequest.pl +++ b/reserve/modrequest.pl @@ -72,6 +72,8 @@ else { my $from=$query->param('from'); if ($from eq 'borrower'){ print $query->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrower[0]"); + } elsif ($from eq 'circ'){ + print $query->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrower[0]"); } else { my $url = "/cgi-bin/koha/reserve/request.pl?"; if ($multi_hold) { -- 2.20.1