Bug 10860 - Change "in-house use" to "on-site checkout"

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Kyle Hall 2014-10-22 01:04:25 -04:00 committed by Tomas Cohen Arazi
parent 2e72eb8880
commit ca13806073
17 changed files with 66 additions and 68 deletions

View file

@ -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'},

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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`),

View file

@ -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'),

View file

@ -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);
}

View file

@ -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;
}

View file

@ -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");
//]]>
</script>

View file

@ -215,9 +215,9 @@ $(document).ready(function() {
title += " - <span class='" + span_class + "'>" + oObj.itemnotes + "</span>"
}
var inhouse_use = '';
if ( oObj.inhouse_use == 1 ) {
inhouse_use += " <span class='inhouse_use'>(" + INHOUSE_USE + ")</span>";
var onsite_checkout = '';
if ( oObj.onsite_checkout == 1 ) {
onsite_checkout += " <span class='onsite_checkout'>(" + INHOUSE_USE + ")</span>";
}
title += " "
@ -230,7 +230,7 @@ $(document).ready(function() {
+ "'>"
+ oObj.barcode
+ "</a>"
+ inhouse_use;
+ onsite_checkout;
return title;
}
@ -311,7 +311,7 @@ $(document).ready(function() {
+ "<input type='checkbox' class='renew' id='renew_" + oObj.itemnumber + "' name='renew' value='" + oObj.itemnumber +"'/>"
+ "</span>";
if ( oObj.renewals_remaining && inhouse_use == 0 ) {
if ( oObj.renewals_remaining && onsite_checkout == 0 ) {
content += "<span class='renewals'>("
+ RENEWALS_REMAINING.format( oObj.renewals_remaining, oObj.renewals_allowed )
+ ")</span>";
@ -442,9 +442,9 @@ $(document).ready(function() {
title += " - <span class='" + span_class + "'>" + oObj.itemnotes + "</span>"
}
var inhouse_use = '';
if ( oObj.inhouse_use == 1 ) {
inhouse_use += " <span class='inhouse_use'>("+INHOUSE_USE+")</span>";
var onsite_checkout = '';
if ( oObj.onsite_checkout == 1 ) {
onsite_checkout += " <span class='onsite_checkout'>("+INHOUSE_USE+")</span>";
}
title += " "
@ -457,7 +457,7 @@ $(document).ready(function() {
+ "'>"
+ oObj.barcode
+ "</a>"
+ inhouse_use;
+ onsite_checkout;
return title;
}

View file

@ -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();
});
});

View file

@ -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

View file

@ -586,13 +586,13 @@ function verify_images() {
<td class="status">
[% IF ( item.datedue ) %]
[% IF inhouse_use %]
[% IF onsite_checkout %]
<span>Currently in local use
[% ELSE %]
<span class="datedue">Checked out
[% END %]
[% UNLESS ( item.NOTSAMEBRANCH ) %]
[% IF inhouse_use %]
[% IF onsite_checkout %]
by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber %]">
[% ELSE %]
to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber %]">

View file

@ -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 %]
<input type="submit" class="approve" value="Yes, check out (Y)" accesskey="y" />
[% END %]
<input type="hidden" name="inhouse_use" value="[% inhouse_use %]" />
<input type="hidden" name="onsite_checkout" value="[% onsite_checkout %]" />
</form>
[% END %]
@ -499,7 +499,7 @@ No patron matched <span class="ex">[% message %]</span>
[% IF ( borrowernumber ) %]
<div class="yui-g">
[% IF !noissues || inhouse_use_forced %]
[% IF !noissues || onsite_checkout_forced %]
[% IF ( flagged ) %]
<div class="yui-u first">
[% ELSE %]
@ -549,13 +549,13 @@ No patron matched <span class="ex">[% message %]</span>
<button class="btn btn-small action" id="cleardate" name="cleardate" onclick="this.checked = false; this.form.duedatespec.value = ''; this.form.stickyduedate.checked = false; this.form.barcode.focus(); return false;" >Clear</button>
</div>[% END %]
[% IF inhouse_use_feature %]
<div class="inhouse_use-select">
[% IF onsite_checkout_feature %]
<div class="onsite_checkout-select">
[% IF noissues %]
<input type="checkbox" id="inhouse_use" name="inhouse_use_forced" checked="checked" disabled="disabled" /> <label for="inhouse_use">In-house use</label>
<input type="hidden" name="inhouse_use" checked="checked" value="1" />
<input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkout</label>
<input type="hidden" name="onsite_checkout" checked="checked" value="1" />
[% ELSE %]
<input type="checkbox" id="inhouse_use" name="inhouse_use" /> <label for="inhouse_use">In-house use</label>
<input type="checkbox" id="onsite_checkout" name="onsite_checkout" /> <label for="onsite_checkout">On-site checkout</label>
[% END %]
</div>
[% END %]
@ -575,7 +575,7 @@ No patron matched <span class="ex">[% message %]</span>
[% IF ( noissues ) %]<div>[% ELSE %]<div class="yui-u">[% END %]
[% IF flagged %]
[% IF NOT noissues || ( noissues && inhouse_use_forced ) %]
[% IF NOT noissues || ( noissues && onsite_checkout_forced ) %]
<div id="circmessages" class="circmessage attention">
[% ELSE %]
<h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
@ -584,8 +584,8 @@ No patron matched <span class="ex">[% message %]</span>
<h3>
[% IF noissues %]
Cannot check out!
[% IF inhouse_use_forced %]
<span style="color:red;">Only in-house use is allowed</span>
[% IF onsite_checkout_forced %]
<span style="color:red;">Only on-site checkouts is allowed</span>
[% END %]
[% ELSE %]
Attention:

View file

@ -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 @@
<ul>
<li><a href="#readingrec" id="tab_all">All</a></li>
<li><a href="#readingrec" id="tab_checkout">Checkouts</a></li>
<li><a href="#readingrec" id="tab_inhouse_use">In-house use</a></li>
<li><a href="#readingrec" id="tab_onsite_checkout">On-site checkout</a></li>
</ul>
<div id="readingrec" style="overflow:hidden">
<table id="table_readingrec">
@ -79,8 +79,8 @@
[% FOREACH issue IN loop_reading %]
[% IF issue.returndate %]<tr>[% ELSE %]<tr class="onissue">[% END %]
<td style="display:none;">
[% IF issue.inhouse_use %]
inhouse_use
[% IF issue.onsite_checkout %]
onsite_checkout
[% ELSE %]
checkout
[% END %]

View file

@ -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 %]

View file

@ -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,