From 6e19303ba0d37ec2bbbb05aab2e97753b3129931 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Fri, 12 Jun 2009 17:33:03 -0500 Subject: [PATCH] Cleanup - moremember.pl and .tmpl Removed last 3 EXPR statements. Removed toggle code. Fixed jquery for warning on image deletion. Fixed permission check for image upload to be granular. Lots of formatting/whitespace cleanup. Removed useless form and unused template vars. Signed-off-by: Galen Charlton --- .../prog/en/modules/members/moremember.tmpl | 337 +++++++++--------- members/moremember.pl | 65 ++-- 2 files changed, 196 insertions(+), 206 deletions(-) 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 e508ab0aca..63b1c245cf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl @@ -14,33 +14,34 @@ $.tablesorter.addParser({ }); $(document).ready(function() { $('#finesholdsissues > ul').tabs(); - $("#issuest").tablesorter({ + $("#issuest").tablesorter({ dateFormat: 'uk', sortList: [[1,0]], headers: { 1: { sorter: 'articles' },4:{sorter:false},5: { sorter: false },6:{sorter:false},7:{sorter:false}} }); - $("#holdst").tablesorter({ + $("#holdst").tablesorter({ dateFormat: 'uk', sortList: [[0,0]], headers: { 1: { sorter: 'articles' },6: { sorter: false }} }); - $('#manage-patron-image').find("input[@value*=Delete]").click(function(){ + + // new YAHOO.widget.Button("delpicture"); // FIXME: formatting mismatch between YUI and normal button + $('#delpicture').click(function(){ return confirm('Are you sure you want to delete this patron image? This cannot be undone.'); - }); + }); $('#manage-patron-image').find("input[@value*=Upload]").click(function(){ - if($("#uploadfile").val() == ""){ - alert("Please choose a file to upload"); - return false; - } else { - return confirm('Are you sure you want to replace the current patron image? This cannot be undone.'); - } + if($("#uploadfile").val() == ""){ + alert("Please choose a file to upload"); + return false; + } + return confirm('Are you sure you want to replace the current patron image? This cannot be undone.'); }); - $("#renew_all").click(function(){ $(".checkboxed").checkCheckboxes(":input[@name*=items]"); $(".checkboxed").unCheckCheckboxes(":input[@name*=barcodes]"); }); - $("#return_all").click(function(){ $(".checkboxed").checkCheckboxes(":input[@name*=barcodes]"); $(".checkboxed").unCheckCheckboxes(":input[@name*=items]"); }); - $("#CheckAllitems").click(function(){ $(".checkboxed").checkCheckboxes(":input[@name*=items]"); $(".checkboxed").unCheckCheckboxes(":input[@name*=barcodes]"); return false; }); - $("#CheckNoitems").click(function(){ $(".checkboxed").unCheckCheckboxes(":input[@name*=items]"); return false; }); + $("#renew_all" ).click(function(){ $(".checkboxed").checkCheckboxes(":input[@name*=items]" ); $(".checkboxed").unCheckCheckboxes(":input[@name*=barcodes]"); }); + $("#return_all" ).click(function(){ $(".checkboxed").checkCheckboxes(":input[@name*=barcodes]"); $(".checkboxed").unCheckCheckboxes(":input[@name*=items]" ); }); + $("#CheckAllitems" ).click(function(){ $(".checkboxed").checkCheckboxes(":input[@name*=items]" ); $(".checkboxed").unCheckCheckboxes(":input[@name*=barcodes]"); return false; }); + $("#CheckNoitems" ).click(function(){ $(".checkboxed").unCheckCheckboxes(":input[@name*=items]"); return false; }); $("#CheckAllreturns").click(function(){ $(".checkboxed").checkCheckboxes(":input[@name*=barcodes]"); $(".checkboxed").unCheckCheckboxes(":input[@name*=items]"); return false; }); - $("#CheckNoreturns").click(function(){ $(".checkboxed").unCheckCheckboxes(":input[@name*=barcodes]"); return false; }); + $("#CheckNoreturns" ).click(function(){ $(".checkboxed").unCheckCheckboxes(":input[@name*=barcodes]"); return false; }); @@ -58,9 +59,9 @@ $(document).ready(function() { $(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',''); } - }); + $(this).parent().siblings().find("input:checkbox").each(function(){ + if($(this).attr('checked')){ $(this).attr('checked',''); } + }); } }); } @@ -98,7 +99,11 @@ if (nodename =="barcodes[]"){ - +
@@ -108,38 +113,33 @@ if (nodename =="barcodes[]"){
- -

Userid / Password update failed

-Insufficient privileges. -

Other fields updated.

- - -

Unable to delete staff user

-

Insufficient privileges.

- - -

Unable to delete patrons from other libraries with current settings

-

Insufficient privileges.

- - -

Unable to delete patron:

-

Insufficient privileges.

- + +

Userid / Password update failed

+ Insufficient privileges. +

Other fields updated.

+ + +

Unable to delete staff user

+

Insufficient privileges.

+ + +

Unable to delete patrons from other libraries with current settings

+

Insufficient privileges.

+ + +

Unable to delete patron

+

Insufficient privileges.

+
+ -
- This patron does not exist. -
+
This patron does not exist.
-
Patron's account has been renewed until
-
-" /> -" /> -
+
Patron's account has been renewed until
- +
  • Patron is restricted @@ -153,8 +153,7 @@ if (nodename =="barcodes[]"){
  • Patron's address is in doubt.
  • Patron's card has been reported lost.
- - +

()

@@ -174,24 +173,23 @@ if (nodename =="barcodes[]"){
    - -
  1. Home:
  2. -
  3. Mobile:
  4. -
  5. Work:
  6. - - -
  7. Organization phone:
  8. -
  9. Organization email:
  10. - + +
  11. Organization phone:
  12. +
  13. Organization email:
  14. + +
  15. Home:
  16. +
  17. Mobile:
  18. +
  19. Work:
  20. + -
  21. Professional phone:
  22. -
  23. Professionnal mobile:
  24. +
  25. Professional phone:
  26. +
  27. Professional mobile:
  28. Fax:
  29. - -
  30. Email (home):">
  31. -
  32. Email (work): ">
  33. + +
  34. Email (home):">
  35. +
  36. Email (work): ">
  37. Initials:
  38. Date of birth:
  39. @@ -200,23 +198,23 @@ if (nodename =="barcodes[]"){
  40. Ethnicity:
  41. Ethnicity notes:
  42. - - -
  43. Guarantees:
  44. - - - -
  45. Guarantor:">,
  46. - - + + +
  47. Guarantees:
  48. + + + +
  49. Guarantor:">,
  50. + +
- - +
@@ -224,32 +222,34 @@ if (nodename =="barcodes[]"){
- -
- -
Manage Patron Image -
To update the image for , enter the name of the new image file to upload and click 'Upload.'
Click the 'Delete' button to remove the current image.
Only PNG, GIF, JPEG, XPM formats are supported.
- - -
Upload Patron Image -
does not currently have an image available. To import an image for , enter the name of an image file to upload.
Only PNG, JPEG, XPM formats are supported.
- - - " /> - " /> -
    -
  1. - -
  2. -
-
- - - &borrowernumber=" class="delete">Delete -
+ + +
+ + Manage Patron Image +
To update the image for , select a new image file and click 'Upload.'
Click the 'Delete' button to remove the current image. + + Upload Patron Image +
does not currently have an image available. To import an image for , enter the name of an image file to upload. + +
Only PNG, GIF, JPEG, XPM formats are supported. +
+ + " /> + " /> +
    +
  1. + +
  2. +
+
+ + + &borrowernumber=" class="delete">Delete
- - +
+ +
@@ -306,37 +306,37 @@ if (nodename =="barcodes[]"){
  • Expiration date: - +
  • Registration branch:
  • -
  • Sort field 1:
  • +
  • Sort field 1:
  • Sort field 2:
  • OPAC login:
  • +
  • OPAC password: -
  • OPAC password: *******
  • - -
  • OPAC password: ">Undefined
  • - -
  • Circulation note:
  • -
  • OPAC note:
  • + ******* + + ">Undefined + + +
  • Circulation note:
  • +
  • OPAC note:
  • - +

    Alternate Address

    - - +



    - - +
    1. Surname:
    2. First name:
    3. @@ -370,7 +370,7 @@ if (nodename =="barcodes[]"){

      Fines and Charges

      - +

      Total due:

      No outstanding charges

      @@ -379,13 +379,14 @@ if (nodename =="barcodes[]"){

      Checked Out

      -
      - " /> + + + " /> " /> - + - + @@ -395,15 +396,13 @@ if (nodename =="barcodes[]"){ - + + + - + - - - - - + - + - + @@ -513,46 +512,44 @@ if (nodename =="barcodes[]"){ "> - - - - - + + + + - - - + + Item hasn't been transfered yet from + + + "> + + + + + -
      Item TypeItem Type Title Checked out on Date dueReturn

      select all | none

      " alt="" /> @@ -429,9 +428,9 @@ if (nodename =="barcodes[]"){ - - ">On Hold - + + ">On Hold + Not Renewable @@ -450,13 +449,13 @@ if (nodename =="barcodes[]"){ Return Failed " onclick="uncheck_sibling(this);" /> - " checked="checked" style="display: none;" /> + " checked="checked" style="display: none;" />
      Totals:
      - - - ">, by - - - Item is waiting - - - Item in transit from - since - + + ">, by + + Item is waiting + + + Item in transit from + since + - - Item hasn't been transfered yet from - - - "> - - - " /> - " />
      + " /> + " /> +
      -
      -
      - -

      Patron has nothing on hold.

      - -
      + +
      + + +

      Patron has nothing on hold.

      + +
    diff --git a/members/moremember.pl b/members/moremember.pl index 00b1be4301..e7b718afff 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -187,12 +187,6 @@ else { } } -#Independant branches management -my $unvalidlibrarian = - ( ( C4::Context->preference("IndependantBranches") ) - && ( C4::Context->userenv->{flags} % 2 != 1 ) - && ( $data->{'branchcode'} ne C4::Context->userenv->{branch} ) ); - my %bor; $bor{'borrowernumber'} = $borrowernumber; @@ -212,8 +206,8 @@ $data->{'branchname'} = $branchdetail->{branchname}; my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); my $lib1 = &GetSortDetails( "Bsort1", $data->{'sort1'} ); my $lib2 = &GetSortDetails( "Bsort2", $data->{'sort2'} ); -( $template->param( lib1 => $lib1 ) ) if ($lib1); -( $template->param( lib2 => $lib2 ) ) if ($lib2); +$template->param( lib1 => $lib1 ) if ($lib1); +$template->param( lib2 => $lib2 ) if ($lib2); # current issues # @@ -224,19 +218,17 @@ my $today = POSIX::strftime("%Y-%m-%d", localtime); # iso format my @issuedata; my $overdues_exist = 0; my $totalprice = 0; -my $toggle = 0; for ( my $i = 0 ; $i < $count ; $i++ ) { my $datedue = $issue->[$i]{'date_due'}; - $issue->[$i]{'date_due'} = C4::Dates->new($issue->[$i]{'date_due'},'iso')->output('syspref'); + $issue->[$i]{'date_due'} = C4::Dates->new($issue->[$i]{'date_due'}, 'iso')->output('syspref'); $issue->[$i]{'issuedate'} = C4::Dates->new($issue->[$i]{'issuedate'},'iso')->output('syspref'); my %row = %{ $issue->[$i] }; $totalprice += $issue->[$i]{'replacementprice'}; $row{'replacementprice'} = $issue->[$i]{'replacementprice'}; if ( $datedue lt $today ) { $overdues_exist = 1; - $row{'red'} = 1; #print ""; + $row{'red'} = 1; } - $row{toggle} = $toggle++ % 2; #find the charge for an item my ( $charge, $itemtype ) = @@ -252,7 +244,7 @@ for ( my $i = 0 ; $i < $count ; $i++ ) { $row{'norenew'} = !$renewokay; $row{'can_confirm'} = ( !$renewokay && $renewerror ne 'on_reserve' ); $row{"norenew_reason_$renewerror"} = 1 if $renewerror; - $row{'renew_failed'} = $renew_failed{ $issue->[$i]{'itemnumber'} }; + $row{'renew_failed'} = $renew_failed{ $issue->[$i]{'itemnumber'} }; $row{'return_failed'} = $return_failed{$issue->[$i]{'barcode'}}; push( @issuedata, \%row ); } @@ -273,13 +265,13 @@ if ($borrowernumber) { my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers( $num_res->{'itemnumber'} ); - foreach (qw(waiting transfered nottransfered)) { - $getreserv{$_} = 0; - } + foreach (qw(waiting transfered nottransfered)) { + $getreserv{$_} = 0; + } $getreserv{reservedate} = C4::Dates->new($num_res->{'reservedate'},'iso')->output('syspref'); - foreach (qw(biblionumber title author itemcallnumber )) { - $getreserv{$_} = $getiteminfo->{$_}; - } + foreach (qw(biblionumber title author itemcallnumber )) { + $getreserv{$_} = $getiteminfo->{$_}; + } $getreserv{barcodereserv} = $getiteminfo->{'barcode'}; $getreserv{itemtype} = $itemtypeinfo->{'description'}; @@ -361,23 +353,24 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) { $template->param( detailview => 1, AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"), - DHTMLcalendar_dateformat=>C4::Dates->DHTMLcalendar(), - roaddetails => $roaddetails, - borrowernumber => $borrowernumber, - categoryname => $data->{'description'}, - reregistration => $reregistration, - branch => $branch, - totalprice => sprintf( "%.2f", $totalprice ), - totaldue => sprintf( "%.2f", $total ), - issueloop => \@issuedata, - overdues_exist => $overdues_exist, - unvalidlibrarian => $unvalidlibrarian, - error => $error, - $error => 1, - StaffMember => ($category_type eq 'S'), - is_child => ($category_type eq 'C'), - # reserveloop => \@reservedata, - dateformat => C4::Context->preference("dateformat"), + DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), + roaddetails => $roaddetails, + borrowernumber => $borrowernumber, + categoryname => $data->{'description'}, + reregistration => $reregistration, + branch => $branch, + totalprice => sprintf("%.2f", $totalprice), + totaldue => sprintf("%.2f", $total), + totaldue_raw => $total, + issueloop => \@issuedata, + overdues_exist => $overdues_exist, + error => $error, + $error => 1, + StaffMember => ($category_type eq 'S'), + is_child => ($category_type eq 'C'), +# reserveloop => \@reservedata, + dateformat => C4::Context->preference("dateformat"), + "dateformat_" . (C4::Context->preference("dateformat") || '') => 1, ); output_html_with_http_headers $input, $cookie, $template->output; -- 2.39.5