From ca138060731f89901f70a7c42ebbc8317dd58617 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 22 Oct 2014 01:04:25 -0400 Subject: [PATCH] Bug 10860 - Change "in-house use" to "on-site checkout" Signed-off-by: Tomas Cohen Arazi --- C4/Circulation.pm | 10 +++---- C4/Items.pm | 6 ++--- C4/Stats.pm | 2 +- circ/circulation.pl | 10 +++---- installer/data/mysql/kohastructure.sql | 4 +-- installer/data/mysql/sysprefs.sql | 4 +-- installer/data/mysql/updatedatabase.pl | 10 +++---- .../prog/en/css/staff-global.css | 8 +++--- .../prog/en/includes/strings.inc | 2 +- .../intranet-tmpl/prog/en/js/checkouts.js | 18 ++++++------- .../prog/en/js/pages/circulation.js | 6 ++--- .../admin/preferences/circulation.pref | 8 +++--- .../prog/en/modules/catalogue/detail.tt | 4 +-- .../prog/en/modules/circ/circulation.tt | 26 +++++++++---------- .../prog/en/modules/members/readingrec.tt | 10 +++---- .../bootstrap/en/includes/item-status.inc | 2 +- svc/checkouts | 4 +-- 17 files changed, 66 insertions(+), 68 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 5caa9293ca..e5619de5d8 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1189,11 +1189,11 @@ AddIssue does the following things : sub AddIssue { my ( $borrower, $barcode, $datedue, $cancelreserve, $issuedate, $sipmode, $params ) = @_; - my $inhouse_use = $params->{inhouse_use}; + my $onsite_checkout = $params->{onsite_checkout}; my $auto_renew = $params->{auto_renew}; my $dbh = C4::Context->dbh; my $barcodecheck=CheckValidBarcode($barcode); - $inhouse_use = ( $inhouse_use ? 1 : 0 ); + $onsite_checkout = ( $onsite_checkout ? 1 : 0 ); if ($datedue && ref $datedue ne 'DateTime') { $datedue = dt_from_string($datedue); @@ -1268,7 +1268,7 @@ sub AddIssue { my $sth = $dbh->prepare( "INSERT INTO issues - (borrowernumber, itemnumber,issuedate, date_due, branchcode, inhouse_use, auto_renew) + (borrowernumber, itemnumber,issuedate, date_due, branchcode, onsite_checkout, auto_renew) VALUES (?,?,?,?,?,?,?)" ); unless ($datedue) { @@ -1284,7 +1284,7 @@ sub AddIssue { $issuedate->strftime('%Y-%m-%d %H:%M:00'), # issuedate $datedue->strftime('%Y-%m-%d %H:%M:00'), # date_due C4::Context->userenv->{'branch'}, # branchcode - $inhouse_use, + $onsite_checkout, $auto_renew ? 1 : 0 # automatic renewal ); if ( C4::Context->preference('ReturnToShelvingCart') ) { ## ReturnToShelvingCart is on, anything issued should be taken off the cart. @@ -1326,7 +1326,7 @@ sub AddIssue { # Record the fact that this book was issued. &UpdateStats({ branch => C4::Context->userenv->{'branch'}, - type => ( $inhouse_use ? 'inhouse_use' : 'issue' ), + type => ( $onsite_checkout ? 'onsite_checkout' : 'issue' ), amount => $charge, other => ($sipmode ? "SIP-$sipmode" : ''), itemnumber => $item->{'itemnumber'}, diff --git a/C4/Items.pm b/C4/Items.pm index 6085960d6a..a8d75f701e 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1300,8 +1300,8 @@ sub GetItemsInfo { holding.opac_info as holding_branch_opac_info, home.opac_info as home_branch_opac_info "; - $query .= ", issues.inhouse_use" - if C4::Context->preference("In-House Use"); + $query .= ", issues.onsite_checkout" + if C4::Context->preference("On-site checkouts"); $query .= " FROM items LEFT JOIN branches AS holding ON items.holdingbranch = holding.branchcode @@ -1311,7 +1311,7 @@ sub GetItemsInfo { LEFT JOIN itemtypes ON itemtypes.itemtype = " . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype'); $query .= " LEFT JOIN issues ON issues.itemnumber = items.itemnumber" - if C4::Context->preference("In-House Use"); + if C4::Context->preference("On-site checkouts"); $query .= " WHERE items.biblionumber = ? ORDER BY home.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ; my $sth = $dbh->prepare($query); $sth->execute($biblionumber); diff --git a/C4/Stats.pm b/C4/Stats.pm index 250c48c527..0e217fa585 100644 --- a/C4/Stats.pm +++ b/C4/Stats.pm @@ -87,7 +87,7 @@ sub UpdateStats { return () if ! defined $params; # change these arrays if new types of transaction or new parameters are allowed my @allowed_keys = qw (type branch amount other itemnumber itemtype borrowernumber accountno ccode); - my @allowed_circulation_types = qw (renew issue localuse return inhouse_use); + my @allowed_circulation_types = qw (renew issue localuse return onsite_checkout); my @allowed_accounts_types = qw (writeoff payment); my @circulation_mandatory_keys = qw (type branch borrowernumber itemnumber ccode itemtype); my @accounts_mandatory_keys = qw (type branch borrowernumber amount); diff --git a/circ/circulation.pl b/circ/circulation.pl index e617a364c2..e069bab231 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -336,7 +336,7 @@ if ($barcode) { } } - unless( $query->param('inhouse_use') and C4::Context->preference("In-House Use Force") ) { + unless( $query->param('onsite_checkout') and C4::Context->preference("On-site checkouts Force") ) { delete $question->{'DEBT'} if ($debt_confirmed); foreach my $impossible ( keys %$error ) { $template->param( @@ -361,14 +361,14 @@ if ($barcode) { getTitleMessageIteminfo => $getmessageiteminfo->{'title'}, getBarcodeMessageIteminfo => $getmessageiteminfo->{'barcode'}, NEEDSCONFIRMATION => 1, - inhouse_use => $query->param('inhouse_use'), + onsite_checkout => $query->param('onsite_checkout'), ); $confirm_required = 1; } } unless($confirm_required) { - my $inhouse_use = $query->param('inhouse_use'); - AddIssue( $borrower, $barcode, $datedue, $cancelreserve, undef, undef, { inhouse_use => $inhouse_use, auto_renew => $session->param('auto_renew') } ); + my $onsite_checkout = $query->param('onsite_checkout'); + AddIssue( $borrower, $barcode, $datedue, $cancelreserve, undef, undef, { onsite_checkout => $onsite_checkout, auto_renew => $session->param('auto_renew') } ); $session->clear('auto_renew'); $inprocess = 1; } @@ -601,8 +601,6 @@ $template->param( canned_bor_notes_loop => $canned_notes, debarments => GetDebarments({ borrowernumber => $borrowernumber }), todaysdate => dt_from_string()->set(hour => 23)->set(minute => 59), - inhouse_use_feature => C4::Context->preference("In-House Use"), - inhouse_use_forced => C4::Context->preference("In-House Use Force"), ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 5df2deaff2..865f930b62 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1128,7 +1128,7 @@ CREATE TABLE `issues` ( -- information related to check outs or issues `auto_renew` BOOLEAN default FALSE, -- automatic renewal `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched `issuedate` datetime default NULL, -- date the item was checked out or issued - `inhouse_use` int(1) NOT NULL default 0, -- in house use flag + `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag KEY `issuesborridx` (`borrowernumber`), KEY `itemnumber_idx` (`itemnumber`), KEY `branchcode_idx` (`branchcode`), @@ -1602,7 +1602,7 @@ CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r `auto_renew` BOOLEAN default FALSE, -- automatic renewal `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched `issuedate` datetime default NULL, -- date the item was checked out or issued - `inhouse_use` int(1) NOT NULL default 0, -- in house use flag + `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag KEY `old_issuesborridx` (`borrowernumber`), KEY `old_issuesitemidx` (`itemnumber`), KEY `branchcode_idx` (`branchcode`), diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index fb5582783e..32b0273f97 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -147,8 +147,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ImageLimit','5','','Limit images stored in the database by the Patron Card image manager to this number.','Integer'), ('IncludeSeeFromInSearches','0','','Include see-from references in searches.','YesNo'), ('IndependentBranches','0',NULL,'If ON, increases security between libraries','YesNo'), -('In-House use','0','','Enable/Disable the in-house use feature','YesNo'), -('In-House use Force','0','','Enable/Disable the in-house for all cases (Even if a user is debarred, etc.)','YesNo'), +('On-site checkouts','0','','Enable/Disable the on-site checkouts feature','YesNo'), +('On-site checkouts Force','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'), ('InProcessingToShelvingCart','0','','If set, when any item with a location code of PROC is \'checked in\', it\'s location code will be changed to CART.','YesNo'), ('INTRAdidyoumean',NULL,NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'), ('IntranetBiblioDefaultView','normal','normal|marc|isbd|labeled_marc','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','Choice'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e42237a199..6068b91361 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8957,20 +8957,20 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { $dbh->do(q{ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) - VALUES('In-House use','0','Enable/Disable the in-house use feature','','YesNo'); + VALUES('On-site checkouts','0','Enable/Disable the on-site checkouts feature','','YesNo'); }); $dbh->do(q{ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) - VALUES('In-House use Force','0','Enable/Disable the in-house for all cases (Even if a user is debarred, etc.)','','YesNo'); + VALUES('On-site checkouts Force','0','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','','YesNo'); }); $dbh->do(q{ - ALTER TABLE issues ADD COLUMN inhouse_use INT(1) NOT NULL DEFAULT 0 AFTER issuedate; + ALTER TABLE issues ADD COLUMN onsite_checkout INT(1) NOT NULL DEFAULT 0 AFTER issuedate; }); $dbh->do(q{ - ALTER TABLE old_issues ADD COLUMN inhouse_use INT(1) NOT NULL DEFAULT 0 AFTER issuedate; + ALTER TABLE old_issues ADD COLUMN onsite_checkout INT(1) NOT NULL DEFAULT 0 AFTER issuedate; }); - print "Upgrade to $DBversion done (Bug 10860: Add new system preference In-House use + fields [old_]issues.inhouse_use)\n"; + print "Upgrade to $DBversion done (Bug 10860: Add new system preference On-site checkouts + fields [old_]issues.onsite_checkout)\n"; SetVersion($DBversion); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index a256db3b9b..69f5dc5115 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -2715,16 +2715,16 @@ span.browse-button { color : #FFF; } -.inhouse_use-select { +.onsite_checkout-select { font-size : 85%; font-weight: normal; padding-top : .3em; } -#circ_circulation_issue .inhouse_use-select label, -.inhouse_use-select label { +#circ_circulation_issue .onsite_checkout-select label, +.onsite_checkout-select label { font-size : inherit; font-weight: normal; } -span.inhouse_use { +span.onsite_checkout { color: red; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc index eb75ac18c0..5542875719 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc @@ -26,6 +26,6 @@ var NOT_TRANSFERRED_YET = _("Item hasn't been transferred yet from %s"); var NO = _("No"); var YES = _("Yes"); - var INHOUSE_USE = _("In-house use"); + var INHOUSE_USE = _("On-site checkout"); //]]> diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js index 4c0ba36eef..65dab64851 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -215,9 +215,9 @@ $(document).ready(function() { title += " - " + oObj.itemnotes + "" } - var inhouse_use = ''; - if ( oObj.inhouse_use == 1 ) { - inhouse_use += " (" + INHOUSE_USE + ")"; + var onsite_checkout = ''; + if ( oObj.onsite_checkout == 1 ) { + onsite_checkout += " (" + INHOUSE_USE + ")"; } title += " " @@ -230,7 +230,7 @@ $(document).ready(function() { + "'>" + oObj.barcode + "" - + inhouse_use; + + onsite_checkout; return title; } @@ -311,7 +311,7 @@ $(document).ready(function() { + "" + ""; - if ( oObj.renewals_remaining && inhouse_use == 0 ) { + if ( oObj.renewals_remaining && onsite_checkout == 0 ) { content += "(" + RENEWALS_REMAINING.format( oObj.renewals_remaining, oObj.renewals_allowed ) + ")"; @@ -442,9 +442,9 @@ $(document).ready(function() { title += " - " + oObj.itemnotes + "" } - var inhouse_use = ''; - if ( oObj.inhouse_use == 1 ) { - inhouse_use += " ("+INHOUSE_USE+")"; + var onsite_checkout = ''; + if ( oObj.onsite_checkout == 1 ) { + onsite_checkout += " ("+INHOUSE_USE+")"; } title += " " @@ -457,7 +457,7 @@ $(document).ready(function() { + "'>" + oObj.barcode + "" - + inhouse_use; + + onsite_checkout; return title; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js index e6ac3e8eef..8ab4d17e5f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js @@ -46,9 +46,9 @@ $(document).ready(function() { return false; }); - toggle_inhouse_use(); - $("#inhouse_use").click(function(){ - toggle_inhouse_use(); + toggle_onsite_checkout(); + $("#onsite_checkout").click(function(){ + toggle_onsite_checkout(); }); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 07c86c5ca0..34078f5063 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -384,17 +384,17 @@ Circulation: - "it will be updated to the right-hand value. E.g. '-1: 0' will cause an item that was set to 'Ordered' to now be available for loan." - Each pair of values should be on a separate line. - - - pref: In-House use + - pref: On-site checkouts choices: yes: Enable no: Disable - - the in-house use feature. + - the on-site checkouts feature. - - - pref: In-House use Force + - pref: On-site checkouts Force choices: yes: Enable no: Disable - - the in-house for all cases (Even if a user is debarred, etc.). + - the on-site for all cases (Even if a user is debarred, etc.). Holds Policy: - - pref: AllowHoldPolicyOverride diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 68f2bcd6d5..89607efa86 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -586,13 +586,13 @@ function verify_images() { [% IF ( item.datedue ) %] - [% IF inhouse_use %] + [% IF onsite_checkout %] Currently in local use [% ELSE %] Checked out [% END %] [% UNLESS ( item.NOTSAMEBRANCH ) %] - [% IF inhouse_use %] + [% IF onsite_checkout %] by [% ELSE %] to diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index b506241dd4..4c7d3db6f4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -56,9 +56,9 @@ $(document).ready(function() { [% END %] }); -// In-house use -function toggle_inhouse_use(){ - if ( $("#inhouse_use").attr('checked') ) { +// On-site checkout +function toggle_onsite_checkout(){ + if ( $("#onsite_checkout").attr('checked') ) { $("#duedatespec").val("[% todaysdate | $KohaDates with_hours => 1%]") $("#duedatespec").datetimepicker('destroy'); } else { @@ -304,7 +304,7 @@ function toggle_inhouse_use(){ [% ELSE %] [% END %] - + [% END %] @@ -499,7 +499,7 @@ No patron matched [% message %] [% IF ( borrowernumber ) %]
-[% IF !noissues || inhouse_use_forced %] +[% IF !noissues || onsite_checkout_forced %] [% IF ( flagged ) %]
[% ELSE %] @@ -549,13 +549,13 @@ No patron matched [% message %]
[% END %] - [% IF inhouse_use_feature %] -
+ [% IF onsite_checkout_feature %] +
[% IF noissues %] - - + + [% ELSE %] - + [% END %]
[% END %] @@ -575,7 +575,7 @@ No patron matched [% message %] [% IF ( noissues ) %]
[% ELSE %]
[% END %] [% IF flagged %] - [% IF NOT noissues || ( noissues && inhouse_use_forced ) %] + [% IF NOT noissues || ( noissues && onsite_checkout_forced ) %]
[% ELSE %]

Checking out to [% INCLUDE 'patron-title.inc' %]

@@ -584,8 +584,8 @@ No patron matched [% message %]

[% IF noissues %] Cannot check out! - [% IF inhouse_use_forced %] - Only in-house use is allowed + [% IF onsite_checkout_forced %] + Only on-site checkouts is allowed [% END %] [% ELSE %] Attention: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt index 8cd23efc8e..33823a2ce4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt @@ -21,8 +21,8 @@ var id = $(ui.tab).attr("id"); if ( id == "tab_checkout" ) { table.fnFilter("checkout", 0); - } else if ( id == "tab_inhouse_use" ) { - table.fnFilter("inhouse_use", 0); + } else if ( id == "tab_onsite_checkout" ) { + table.fnFilter("onsite_checkout", 0); } else { // all table.fnFilter('', 0); } @@ -58,7 +58,7 @@
@@ -79,8 +79,8 @@ [% FOREACH issue IN loop_reading %] [% IF issue.returndate %][% ELSE %][% END %]
- [% IF issue.inhouse_use %] - inhouse_use + [% IF issue.onsite_checkout %] + onsite_checkout [% ELSE %] checkout [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc index faa38b1636..f9b27c06fb 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -19,7 +19,7 @@ not use an API to fetch items that populates item.datedue. [% END %] [% END %] [% ELSIF ( item.datedue || issue.date_due ) %] - [% IF inhouse_use %] + [% IF onsite_checkout %] [% IF ( OPACShowCheckoutName ) %] Currently in local use by [% item.cardnumber %] [% item.firstname %] [% item.surname %] [% ELSE %] diff --git a/svc/checkouts b/svc/checkouts index 9e56f64a49..9dc48812a5 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -63,7 +63,7 @@ my $sql = ' date_due < now() as date_due_overdue, issues.timestamp, - inhouse_use, + onsite_checkout, biblionumber, biblio.title, @@ -154,7 +154,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { date_due => $c->{date_due}, date_due_overdue => $c->{date_due_overdue} ? JSON::true : JSON::false, timestamp => $c->{timestamp}, - inhouse_use => $c->{inhouse_use}, + onsite_checkout => $c->{onsite_checkout}, renewals_count => $renewals_count, renewals_allowed => $renewals_allowed, renewals_remaining => $renewals_remaining, -- 2.39.5