From 0f47a7db16b755350d6f1b2be4b38cfeaa04469f Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 17 Dec 2008 14:09:27 -0600 Subject: [PATCH] bug 2799: followup Various fixes to meet coding standards, template design, and basic functionality: * (bug 2505) turned on warnings * use correct loop names when populating $template * put all TMPL_FOO in HTML comments * assign UseBranchTransferLimits to circulation tab * change template to use "library" instead of "branch" * use standard YUI scripting for toolbar buttons * add new script to admin menu Signed-off-by: Galen Charlton --- admin/branch_transfer_limits.pl | 24 +++--- admin/systempreferences.pl | 1 + .../prog/en/includes/admin-menu.inc | 1 + .../prog/en/modules/admin/admin-home.tmpl | 4 +- .../modules/admin/branch_transfer_limits.tmpl | 83 ++++++++++++------- 5 files changed, 69 insertions(+), 44 deletions(-) diff --git a/admin/branch_transfer_limits.pl b/admin/branch_transfer_limits.pl index 8c5c0646a5..c05b0f7832 100755 --- a/admin/branch_transfer_limits.pl +++ b/admin/branch_transfer_limits.pl @@ -18,12 +18,15 @@ # Suite 330, Boston, MA 02111-1307 USA use strict; +use warnings; + use CGI; use C4::Auth; use C4::Context; use C4::Output; use C4::Koha; use C4::Branch; +use C4::Circulation qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit }; my $input = new CGI; @@ -77,18 +80,18 @@ foreach my $branchcode ( @branchcodes ) { } ## Build the default data -my @loop0; +my @itemtypes_loop; foreach my $itemtype ( @itemtypes ) { - my @loop1; + my @to_branch_loop; my %row_data; $row_data{ itemtype } = $itemtype; - $row_data{ loop1 } = \@loop1; + $row_data{ to_branch_loop } = \@to_branch_loop; foreach my $toBranch ( @branchcodes ) { - my @loop2; + my @from_branch_loop; my %row_data; $row_data{ itemtype } = $itemtype; $row_data{ toBranch } = $toBranch; - $row_data{ loop2 } = \@loop2; + $row_data{ from_branch_loop } = \@from_branch_loop; foreach my $fromBranch ( @branchcodes ) { my %row_data; @@ -98,22 +101,19 @@ foreach my $itemtype ( @itemtypes ) { $row_data{ fromBranch } = $fromBranch; $row_data{ isChecked } = $isChecked; - push( @loop2, \%row_data ); + push( @from_branch_loop, \%row_data ); } - push( @loop1, \%row_data ); + push( @to_branch_loop, \%row_data ); } - push( @loop0, \%row_data ); + push( @itemtypes_loop, \%row_data ); } $template->param( - loop0 => \@loop0, + itemtypes_loop => \@itemtypes_loop, branchcode_loop => \@branchcode_loop, - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 01c088dee9..a5cdd8dd44 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -155,6 +155,7 @@ $tabsysprefs{RandomizeHoldsQueueWeight} = "Circulation"; $tabsysprefs{StaticHoldsQueueWeight} = "Circulation"; $tabsysprefs{AllowOnShelfHolds} = "Circulation"; $tabsysprefs{AllowHoldsOnDamagedItems} = "Circulation"; +$tabsysprefs{UseBranchTransferLimits} = "Circulation"; # Staff Client $tabsysprefs{TemplateEncoding} = "StaffClient"; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc index ed16f0cec9..f6d16f244d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc @@ -18,6 +18,7 @@
  • Road types
  • Patron attribute types
  • Circulation and fines rules
  • +
  • Library transfer limits
  • Catalog
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl index e4f056b1c6..b4f6b4ccca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl @@ -48,8 +48,8 @@
    Define extended attributes (identifiers and statistical categories) for patron records
    Circulation and fines rules
    Define circulation and fines rules for combinations of libraries, patron categories, and item types
    -
    Branch Transfer Limits
    -
    Limit the ability to transfer items between libraries based on the branch sending, the brand recieving, and the itemtype involved. These rules only go into effect if the preference UseBranchTransferLimits is set to ON.
    +
    Library Transfer Limits
    +
    Limit the ability to transfer items between libraries based on the library sending, the library receiving, and the item type involved. These rules only go into effect if the preference UseBranchTransferLimits is set to ON.
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tmpl index 1c7ba60a92..e30001751b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tmpl @@ -1,5 +1,5 @@ -Koha › Administration › Set Branch Transfer Limits +Koha › Administration › Library Transfer Limits + + +

    Library Transfer Limits

    +
    Check the boxes for the items that should not be transferable.
    -

    Check the boxes for the items that should not be transferable.

    -

    - - -

    - + - + - - + + - + - - + + - - - - + + + +
    To/From
    Limits for Item Type:
    Limits for Item Type:
    __" + name="__" type="checkbox" value="1" - checked - > + checked="checked" + />
    - - + +
    - - - - - + + +
    + +
    + + -- 2.39.5