Koha/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt
Kyle M Hall 7224e47dfe Bug 8220 - Allow koc uploads to go to process queue instead of being applied directly.
The primary advantage to the Firefox offline cirulation plugin when compared
to the offline circulation desktop application, is the ability to add offline
circulation actions to a queue so that multiple machines running offline
circ can have their circ actions combined and ordered chronologically before
being executed. This commit adds the ability to put actions from uploaded
KOC files into this queue. In this way, both the FF plugina and the desktop
application can be run side by side with no ill effects.

Signed-off-by: Bob Birchall <bob@calyx.net.au>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-21 20:35:37 -04:00

97 lines
5.3 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Circulation &rsaquo; Offline circulation file upload</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'file-upload.inc' %]
<script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
$("#enqueuefile").hide();
$("#processfile").hide();
});
function CheckUpload(f){
if (f.fileToUpload.value == ""){
alert(_("Please choose a file to upload"));
} else {
return ajaxFileUpload()
}
return false;
}
function CheckForm(f) {
if (f.uploadedfileid.value == '') {
alert(_("Please upload a file first."));
} else {
$("#fileuploadstatus").hide();
$("#fileuploadform").slideUp();
return submitBackgroundJob(f);
}
return false;
}
//]]>
</script>
<style type="text/css">
#fileuploadstatus,#jobstatus { margin:.4em; }
#fileuploadprogress,#jobprogress{ width:200px;height:10px;border:1px solid #666;background:url('/intranet-tmpl/prog/img/progress.png') -300px 0px no-repeat; }
</style>
</head>
<body id="ocirc_process_koc" class="circ ocirc">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; [% IF ( transactions_loaded ) %] <a href="/cgi-bin/koha/offline_circ/process_koc.pl">Offline circulation file upload</a> &rsaquo; Results[% ELSE %] Offline circulation file upload[% END %]</div>
<div id="doc" class="yui-t7">
<div id="bd">
[% IF ( transactions_loaded ) %]
<h2>Koha offline circulation</h2>
<p>Your data was processed. Here are the results:</p>
[% FOREACH message IN messages %]
[% IF ( message.message ) %]
<div class="dialog alert">
[% IF ( message.ERROR_file_version ) %]<p>Warning: This file is version [% message.upload_version %], but I only know how to import version [% message.current_version %]. I'll try my best.</p>[% END %]
</div>
[% END %]
[% IF ( message.ERROR_no_borrower_from_item ) %]<p>Warning: Unable to determine patron from item barcode ([% message.badbarcode %]). Cannot check in.</p>[% END %]
[% IF ( message.issue ) %]<p>Checked out <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% message.biblionumber %]">[% message.title |html %]</a> ([% message.barcode %]) to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% message.borrowernumber %]">[% message.firstname %] [% message.surname %]</a> ([% message.cardnumber %]): [% message.datetime %]</p>[% END %]
[% IF ( message.renew ) %]<p>Renewed <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% message.biblionumber %]">[% message.title |html %]</a> ([% message.barcode %]) for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% message.borrowernumber %]">[% message.firstname %] [% message.surname %]</a> ([% message.cardnumber %]): [% message.datetime %]</p>[% END %]
[% IF ( message.return ) %]<p>Checked in <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% message.biblionumber %]">[% message.title |html %]</a> ([% message.barcode %]) from <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% message.borrowernumber %]">[% message.firstname %] [% message.surname %]</a> ([% message.cardnumber %]): [% message.datetime %]</p>[% END %]
[% IF ( message.payment ) %]<p>Accepted payment ([% message.amount %]) from <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% message.borrowernumber %]">[% message.firstname %] [% message.surname %]</a> ([% message.cardnumber %]): [% message.datetime %]</p>[% END %]
[% END %]
[% ELSE %]
<h2>Upload offline circulation data</h2>
<div id="fileuploadform">
<form method="post" action="[% SCRIPT_NAME %]" enctype="multipart/form-data">
<fieldset class="brief">
<ol><li><label for="fileToUpload">Choose .koc file: </label>
<input type="file" id="fileToUpload" size="50" name="fileToUpload" /></li></ol>
<fieldset class="action"><input type="button" class="submit" value="Upload file" onclick="CheckUpload(this.form);" /></fieldset>
</fieldset>
</form>
<div id="fileuploadstatus" style="display:none">Upload progress: <div id="fileuploadprogress"></div> <span id="fileuploadpercent">0</span>%</div>
<div id="fileuploadfailed" style="display:none"></div>
</div>
<form action="enqueue_koc.pl" id="processfile" method="post" enctype="multipart/form-data">
<input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
<input type="submit" value="Add to offline circulation queue" onclick="return CheckForm(this.form);" id="queueformsubmit" />
</form>
<form action="process_koc.pl" id="enqueuefile" method="post" enctype="multipart/form-data">
<input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
<input type="hidden" name="runinbackground" id="runinbackground" value="" />
<input type="hidden" name="completedJobID" id="completedJobID" value="" />
<input type="submit" value="Apply directly" onclick="return CheckForm(this.form);" id="mainformsubmit" />
<div id="jobstatus" style="display:none">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
<div id="jobfailed" style="display:none"></div>
</form>
[% END %]
</div>
[% INCLUDE 'intranet-bottom.inc' %]