Owen Leonard
65b2da08c9
This patch updates the style of progress bars to make them a little nicer. Progress bars in the staff client are not built in a consisten way. Some have been updated to use the <progress> element and some have not. This patch improves some styling common to both kinds. Other changes: - Redundant in-page CSS has been removed from many pages. - An invalid "min" attribute has been removed from several instances of <progress>. - Corrected capitalization. - Fixed incorrectly quoted attributes. - Added missing form "action" attributes. To test, clear your browser cache if necessary. Apply the patch and test uploads on the following pages: - Circulation -> Offline circulation file upload - Tools -> Batch item modification - Tools -> Batch record modification - Tools -> Stage MARC records for import - Tools -> Manage staged MARC records - Tools -> Upload local cover image - Tools -> Upload In all cases, progress bars should look improved and work correctly. Test Tools -> Batch item deletion. Unused background job handling markup has been removed. Deletion processing should work correctly. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
129 lines
6.7 KiB
Text
129 lines
6.7 KiB
Text
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Circulation › Offline circulation file upload</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
|
|
<script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar.js"></script>
|
|
<script type="text/javascript" src="[% interface %]/[% theme %]/js/file-upload.js"></script>
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
var xhr;
|
|
$(document).ready(function(){
|
|
$("#enqueuefile").hide();
|
|
$("#processfile").hide();
|
|
$("#upload_file").on("click",function(){
|
|
StartUpload();
|
|
});
|
|
$("#queueformsubmit").on("click",function(){
|
|
var processfile = document.getElementById("processfile");
|
|
return CheckForm( processfile );
|
|
});
|
|
$("#mainformsubmit").on("click",function(){
|
|
var enqueuefile = document.getElementById("enqueuefile");
|
|
return CheckForm( enqueuefile );
|
|
});
|
|
});
|
|
|
|
function StartUpload() {
|
|
if( $('#fileToUpload').prop('files').length == 0 ) return;
|
|
$('#fileuploadform input.submit').prop('disabled',true);
|
|
$("#fileuploadfailed").hide();
|
|
$("#processfile").hide();
|
|
$("#fileuploadstatus").show();
|
|
$("form#processfile #uploadedfileid").val('');
|
|
$("form#enqueuefile #uploadedfileid").val('');
|
|
xhr= AjaxUpload( $('#fileToUpload'), $('#fileuploadprogress'), 'temp=1', cbUpload );
|
|
}
|
|
|
|
function cbUpload( status, fileid ) {
|
|
if( status=='done' ) {
|
|
$("form#processfile #uploadedfileid").val( fileid );
|
|
$("form#enqueuefile #uploadedfileid").val( fileid );
|
|
$('#fileToUpload').prop('disabled',true);
|
|
$("#processfile").show();
|
|
$("#enqueuefile").show();
|
|
} else {
|
|
$("#fileuploadstatus").hide();
|
|
$("#fileuploadfailed").show();
|
|
$("#fileuploadfailed").text( _("Upload status: ") +
|
|
( status=='failed'? _("Failed"):
|
|
( status=='denied'? _("Denied"): status ))
|
|
);
|
|
}
|
|
}
|
|
|
|
function CheckForm(f) {
|
|
if (f.uploadedfileid.value == '') {
|
|
alert(_("Please upload a file first."));
|
|
} else {
|
|
$("#fileuploadstatus").hide();
|
|
$("#fileuploadform").slideUp();
|
|
$("#mainformsubmit").prop('disabled',true);
|
|
$("#queueformsubmit").prop('disabled',true);
|
|
return submitBackgroundJob(f);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
//]]>
|
|
</script>
|
|
</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> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> › [% IF ( transactions_loaded ) %] <a href="/cgi-bin/koha/offline_circ/process_koc.pl">Offline circulation file upload</a> › 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="/cgi-bin/koha/offline_circ/process_koc.pl" enctype="multipart/form-data" class="validated">
|
|
<fieldset class="brief">
|
|
<ol><li><label for="fileToUpload">Choose .koc file: </label>
|
|
<input class="required" required="required" type="file" id="fileToUpload" size="50" name="fileToUpload" />
|
|
<span class="required">Required</span>
|
|
</li></ol>
|
|
<fieldset class="action"><input type="button" class="submit" value="Upload file" id="upload_file" /></fieldset>
|
|
</fieldset>
|
|
</form>
|
|
<div id="fileuploadstatus" class="progress_panel" style="display:none">Upload progress: <progress id="fileuploadprogress" max="100" value="0"></progress> <span class="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' %]
|