From 3d988121ed30a51ccd474390035735441a5003e8 Mon Sep 17 00:00:00 2001 From: plg Date: Thu, 30 Mar 2006 14:52:13 +0000 Subject: [PATCH] modification: deep circulation template rewrite to make it easier to read. HTML output uses fieldset, it should be cleaner, feedback welcomed. improvement: renewscript.pl simplified by using named submit buttons (renew_all and renew_checked), and by using arrays in HTTP query for items. --- .../prog/en/circ/circulation.tmpl | 748 +++++++++++------- reserve/renewscript.pl | 69 +- 2 files changed, 510 insertions(+), 307 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl index 9476b04fce..d1b1e64134 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl @@ -1,304 +1,500 @@ -Koha -- Circulation: Issuing to , () +Koha -- Circulation + +: Issuing to , +() + + + + - -

Circulation: Issues

+

Circulation: Issues

-
Circulation Parameters
- - - - - - -

Error Issuing Item:

- - - - - -

Please Confirm Issue:

- -

The patron has a debt of $

- - -

Item is currently issued to this patron. Renew?

- - -

Item is consigned for

- - -

Item is on reserve for

- - -

Item issued to . Return and issue?

- - -

Too many issues (already issued / max : )

- - -
- -

- - -

- - " /> - " /> - - " /> - " /> - " /> -
" />
- - - - - - -

Item issued

- - - - - - No patron matched Add a new patron - - +
Circulation Parameters
+ - -
- " /> - " /> - -

-

-

Patron not found? Add a new patron

-
- - + - -

()

-

    out, overdue

- - + +
+ Error Issuing Item -
+ + + +
+ Please Confirm Issue + + + +
+ + +

+ + +

+ + + +

+ + +

+ + + " /> + " /> + + " /> + " /> + " /> + +
+ +
+ +
+ +
+ " /> + +
+ +
+
+ +
+ + + + +

Item issued

-
  • - Overdues: Patron has ITEMS OVERDUE See highlighted items below -
  • - -
  • Fines: Patron has ">outstanding fines. Make ">Payment
  • - -
  • Fines: Patron has ">outstanding fines. Make ">Payment
  • + + +

    + No patron matched + Add a new patron +

    - - - - + +
    +
    + Borrower selection + + " /> + " /> + +

    + + +

    - -
    • Notes:
    - +

    - - - - - - - " /> - " /> - - - - - +

    + Patron not found? + Add a new patron +

    +
    + + + + +
    + Borrower informations + +

    ()

    + +

    +     out + + , overdue + +

    + + + + + + + + + + + + + + + +
    + + + +
    +
    + Search a borrower + +

    + + +

    + + " /> + " /> + +
    +
    + + - -
    - -

    - - - - /> - " /> - " /> - " /> - - - - " /> - -

    -
    - +
    +
    + Issue an item + + + + + - + + + + + + + + + + +
    + + + +
    />
    + + + + + " /> + " /> + " /> + + + + " /> + +
    + +
    +
    +
    + -
    " />" /> - - - - - - - - - - - - - - - - - - - - - - + +
    + Borrower existing issues - -
    - - - - - - - - - -
    Issues &print=page">(Print Page) &print=slip">(Print Slip)
    Due DateTitleAuthorCall NoBarcodeRenew?
    &type=intra">
    " value="y" checked="checked" />
    &type=intra">
    " value="y" checked="checked" />
    - -

    -
    +

    + &print=page">Print Page + / &print=slip">Print Slip +

    + + + " /> + " /> -
    " />" />" value="y" />
    - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + +
    Due DateTitleAuthorCall NoBarcodeRenew?
    + &type=intra"> +
    +
    + " + value="y" + + checked="checked" + + /> +
    + + + - + + + + &type=intra"> +
    +
    + " + + checked="checked" + + /> + " + checked="checked" + style="display: none;" + /> +
    +
    + + +
    + + + + + + + + diff --git a/reserve/renewscript.pl b/reserve/renewscript.pl index 80d27500bc..b878c526f2 100755 --- a/reserve/renewscript.pl +++ b/reserve/renewscript.pl @@ -24,43 +24,50 @@ # Suite 330, Boston, MA 02111-1307 USA use CGI; -# use C4::Circulation::Renewals2; use C4::Circulation::Circ2; -#get input -my $input= new CGI; -#print $input->header; -#print $input->dump; +my $input = new CGI; +my @names = $input->param(); -my @names=$input->param(); -my $count=@names; -my %data; +# +# find items to renew, all items or a selection of items +# + +# create a look-up table to check efficiently parameter availability +my %is_param = map {$_ => 1} @names; -for (my $i=0;$i<$count;$i++){ - if ($names[$i] =~ /renew/){ - my $temp=$names[$i]; - $temp=~ s/renew_item_//; - $data{$temp}=$input->param($names[$i]); - } +my @data; +if ($is_param{renew_all}) { + @data = $input->param('all_items[]'); } +else { + @data = $input->param('items[]'); +} + +# +# renew items +# my %env; -my $destination = $input->param("destination"); my $cardnumber = $input->param("cardnumber"); -my $bornum=$input->param("bornum"); -while ( my ($itemno, $value) = each %data) { -# warn "$itemno = $value\n"; - if ($value eq 'y'){ - #means we want to renew this item - #check its status - my $status=renewstatus(\%env,$bornum,$itemno); - if ($status == 1){ - renewbook(\%env,$bornum,$itemno); - } - } +my $bornum = $input->param("bornum"); + +foreach my $itemno (@data) { + #check status before renewing issue + if (renewstatus(\%env,$bornum,$itemno)){ + renewbook(\%env,$bornum,$itemno); + } } -if($destination eq "circ"){ - print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$cardnumber"); -} else { - print $input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$bornum"); -} \ No newline at end of file +# +# redirection to the referrer page +# +if ($input->param('destination') eq "circ"){ + print $input->redirect( + '/cgi-bin/koha/circ/circulation.pl?findborrower='.$cardnumber + ); +} +else { + print $input->redirect( + '/cgi-bin/koha/members/moremember.pl?bornum='.$bornum + ); +} -- 2.39.5