Bug 41578: serials - auto tidy
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
97442056fd
commit
5b8cd03010
|
|
@ -221,7 +221,6 @@
|
|||
var table_settings = [% TablesSettings.GetTableSettings( "serials", "claims", "claimst", "json" ) | $raw %];
|
||||
const vendor_id = "[% supplierid | html %]";
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var sTable;
|
||||
$(document).ready(function () {
|
||||
|
|
@ -231,8 +230,11 @@
|
|||
autowidth: false,
|
||||
order: [[7, "asc"]],
|
||||
paging: false,
|
||||
orderCellsTop: true
|
||||
}, table_settings, 1);
|
||||
orderCellsTop: true,
|
||||
},
|
||||
table_settings,
|
||||
1
|
||||
);
|
||||
|
||||
// Checkboxes : Select All / None
|
||||
$("span.checkall").html('<input type="checkbox" name="CheckAll"> ' + _("Check all") + "</input>");
|
||||
|
|
|
|||
|
|
@ -349,9 +349,9 @@
|
|||
function deleteIssues(subscriptionid) {
|
||||
var serialschecked = $("form[name='edition'] input[name='serialid']:checked");
|
||||
if (serialschecked.length > 0) {
|
||||
var location = 'serials-collection.pl?subscriptionid='+subscriptionid+'&op=delete_confirm';
|
||||
for (i=0; i < serialschecked.length; i++) {
|
||||
location += '&serialid=' + serialschecked[i].value;
|
||||
var location = "serials-collection.pl?subscriptionid=" + subscriptionid + "&op=delete_confirm";
|
||||
for (i = 0; i < serialschecked.length; i++) {
|
||||
location += "&serialid=" + serialschecked[i].value;
|
||||
}
|
||||
document.location = location;
|
||||
} else {
|
||||
|
|
@ -359,8 +359,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
if( $("#subscription_years .tab-pane.active").length < 1 ){
|
||||
$(document).ready(function () {
|
||||
if ($("#subscription_years .tab-pane.active").length < 1) {
|
||||
$("#subscription_years a:first").tab("show");
|
||||
}
|
||||
$(".subscription-year-table").kohaTable({
|
||||
|
|
@ -372,42 +372,42 @@
|
|||
searching: false,
|
||||
});
|
||||
|
||||
$(".CheckAll").on("click", function(e){
|
||||
$(".CheckAll").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
var years = $(this).data("year");
|
||||
$("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", true );
|
||||
$("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", true);
|
||||
});
|
||||
|
||||
$(".CheckNone").on("click", function(e){
|
||||
$(".CheckNone").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
var years = $(this).data("year");
|
||||
$("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", false );
|
||||
$("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", false);
|
||||
});
|
||||
|
||||
$(".generatenext").on("click", function(e){
|
||||
$(".generatenext").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
var subscriptionid = $(this).data("subscriptionid");
|
||||
generateNext( subscriptionid );
|
||||
generateNext(subscriptionid);
|
||||
});
|
||||
|
||||
$(".subscription_renew").on("click", function(e){
|
||||
$(".subscription_renew").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
var subscriptionid = $(this).data("subscriptionid");
|
||||
popup( subscriptionid );
|
||||
popup(subscriptionid);
|
||||
});
|
||||
|
||||
$(".print_list").on("click", function(e){
|
||||
$(".print_list").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
var url = $(this).attr("href");
|
||||
window.open( url,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
|
||||
window.open(url, "PrintSlip", "width=500,height=500,toolbar=no,scrollbars=yes");
|
||||
});
|
||||
|
||||
$('#multi_receiving').on('show', function () {
|
||||
$(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
|
||||
$("#multi_receiving").on("show", function () {
|
||||
$(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
|
||||
});
|
||||
|
||||
$("form[name='edition']").on('submit', function(e){
|
||||
if ( $(this).find("input[name='serialid']:checked").size() == 0 ) {
|
||||
$("form[name='edition']").on("submit", function (e) {
|
||||
if ($(this).find("input[name='serialid']:checked").size() == 0) {
|
||||
e.preventDefault();
|
||||
alert(_("You must select at least one serial to edit"));
|
||||
return 0;
|
||||
|
|
@ -416,7 +416,6 @@
|
|||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".delete-issues").on("click", function(e){
|
||||
|
|
|
|||
|
|
@ -287,75 +287,82 @@
|
|||
</script>
|
||||
[% Asset.js("js/serials-toolbar.js") | $raw %]
|
||||
<script>
|
||||
function itemSelectionBuildEditLink( tab ) {
|
||||
function itemSelectionBuildEditLink(tab) {
|
||||
var subscription_ids = new Array();
|
||||
$( "input:checkbox." + tab + ":checked" ).each(function() {
|
||||
subscription_ids.push( $(this).val() );
|
||||
$("input:checkbox." + tab + ":checked").each(function () {
|
||||
subscription_ids.push($(this).val());
|
||||
});
|
||||
|
||||
if (subscription_ids.length > 0) {
|
||||
var url = edit_action_link;
|
||||
url += '&subscriptionid=' + subscription_ids.join('&subscriptionid=');
|
||||
url += "&subscriptionid=" + subscription_ids.join("&subscriptionid=");
|
||||
location.href = url;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function enableCheckboxActions( tab ){
|
||||
function enableCheckboxActions(tab) {
|
||||
// Enable/disable controls if checkboxes are checked
|
||||
var checked_count = $("input:checkbox." + tab + ":checked").length;
|
||||
if( checked_count > 0 ){
|
||||
$(".itemselection_actions." + tab ).show();
|
||||
if (checked_count > 0) {
|
||||
$(".itemselection_actions." + tab).show();
|
||||
} else {
|
||||
$(".itemselection_actions." + tab ).hide();
|
||||
$(".itemselection_actions." + tab).hide();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var osrlt = $("#opened_panel table").kohaTable({
|
||||
pagingType: "full",
|
||||
order: [[2, "asc"]],
|
||||
}, null, true);
|
||||
$(document).ready(function () {
|
||||
var osrlt = $("#opened_panel table").kohaTable(
|
||||
{
|
||||
pagingType: "full",
|
||||
order: [[2, "asc"]],
|
||||
},
|
||||
null,
|
||||
true
|
||||
);
|
||||
|
||||
var csrlt = $("#closed_panel table").kohaTable({
|
||||
// FIXME sort function of additional_fields!
|
||||
order: [[2, "asc"]],
|
||||
pagingType: "full",
|
||||
}, null, true);
|
||||
var csrlt = $("#closed_panel table").kohaTable(
|
||||
{
|
||||
// FIXME sort function of additional_fields!
|
||||
order: [[2, "asc"]],
|
||||
pagingType: "full",
|
||||
},
|
||||
null,
|
||||
true
|
||||
);
|
||||
|
||||
var manarlt = $("#mana_results_datatable").kohaTable({
|
||||
pagingType: "full",
|
||||
});
|
||||
|
||||
$("#reopensub").click(function(){
|
||||
$("#reopensub").click(function () {
|
||||
return confirm(_("Are you sure you want to reopen this subscription?"));
|
||||
});
|
||||
|
||||
$('.select-all, .clear-all').on('click', function(e) {
|
||||
$(".select-all, .clear-all").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
var tab = $(this).data("tab");
|
||||
var checkboxes = $("input:checkbox." + tab );
|
||||
checkboxes.prop('checked', $(this).hasClass('select-all')).change();
|
||||
var checkboxes = $("input:checkbox." + tab);
|
||||
checkboxes.prop("checked", $(this).hasClass("select-all")).change();
|
||||
enableCheckboxActions(tab);
|
||||
});
|
||||
|
||||
enableCheckboxActions("opened");
|
||||
enableCheckboxActions("closed");
|
||||
|
||||
$("input[name='subscriptionid'][type='checkbox']").change(function() {
|
||||
$("input[name='subscriptionid'][type='checkbox']").change(function () {
|
||||
var tab = $(this).attr("class");
|
||||
enableCheckboxActions( tab );
|
||||
enableCheckboxActions(tab);
|
||||
});
|
||||
|
||||
$(".itemselection_action_modify").on("click", function(e){
|
||||
$(".itemselection_action_modify").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
var tab = $(this).data("tab");
|
||||
itemSelectionBuildEditLink( tab );
|
||||
itemSelectionBuildEditLink(tab);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
[% IF ( mana ) %]
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
|
|
|||
|
|
@ -454,13 +454,11 @@
|
|||
[% Asset.js("js/mana.js") | $raw %]
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
[% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
|
||||
|
||||
<script>
|
||||
var table_settings = [% TablesSettings.GetTableSettings( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
|
||||
const has_orders = [% orders_grouped.size ? 1 : 0 | html %];
|
||||
const print_routing_list_issue = "[% print_routing_list_issue | uri %]";
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// the english words used in display purposes
|
||||
var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose hemisphere:"),_("Northern"),_("Southern",
|
||||
|
|
|
|||
|
|
@ -337,36 +337,56 @@
|
|||
var firstacquidate = $("#firstacquidate").val();
|
||||
var error = 0;
|
||||
var error_msg = "";
|
||||
if(frequencyid == undefined || frequencyid == "") {
|
||||
if (frequencyid == undefined || frequencyid == "") {
|
||||
error_msg += _("- Frequency is not defined") + "\n";
|
||||
error ++;
|
||||
error++;
|
||||
}
|
||||
if(firstacquidate == undefined || firstacquidate == "") {
|
||||
if (firstacquidate == undefined || firstacquidate == "") {
|
||||
error_msg += _("- First publication date is not defined") + "\n";
|
||||
error ++;
|
||||
error++;
|
||||
}
|
||||
|
||||
if(error){
|
||||
alert(_("Cannot test prediction pattern for the following reason(s):") + "\n\n"
|
||||
+ error_msg);
|
||||
if (error) {
|
||||
alert(_("Cannot test prediction pattern for the following reason(s):") + "\n\n" + error_msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
var ajaxData = {
|
||||
'custompattern': true,
|
||||
custompattern: true,
|
||||
};
|
||||
var ajaxParams = [
|
||||
'firstacquidate', 'subtype', 'sublength', 'frequency', 'numberingmethod',
|
||||
'lastvalue1', 'lastvalue2', 'lastvalue3', 'add1', 'add2', 'add3',
|
||||
'every1', 'every2', 'every3', 'innerloop1', 'innerloop2', 'innerloop3',
|
||||
'setto1', 'setto2', 'setto3', 'numbering1', 'numbering2', 'numbering3',
|
||||
'whenmorethan1', 'whenmorethan2', 'whenmorethan3', 'locale'
|
||||
"firstacquidate",
|
||||
"subtype",
|
||||
"sublength",
|
||||
"frequency",
|
||||
"numberingmethod",
|
||||
"lastvalue1",
|
||||
"lastvalue2",
|
||||
"lastvalue3",
|
||||
"add1",
|
||||
"add2",
|
||||
"add3",
|
||||
"every1",
|
||||
"every2",
|
||||
"every3",
|
||||
"innerloop1",
|
||||
"innerloop2",
|
||||
"innerloop3",
|
||||
"setto1",
|
||||
"setto2",
|
||||
"setto3",
|
||||
"numbering1",
|
||||
"numbering2",
|
||||
"numbering3",
|
||||
"whenmorethan1",
|
||||
"whenmorethan2",
|
||||
"whenmorethan3",
|
||||
"locale",
|
||||
];
|
||||
for(i in ajaxParams) {
|
||||
for (i in ajaxParams) {
|
||||
var param = ajaxParams[i];
|
||||
var value = $("#"+param).val();
|
||||
if(value.length > 0)
|
||||
ajaxData[param] = value;
|
||||
var value = $("#" + param).val();
|
||||
if (value.length > 0) ajaxData[param] = value;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
|
|
@ -374,14 +394,13 @@
|
|||
data: ajaxData,
|
||||
async: false,
|
||||
dataType: "text",
|
||||
success: function(data) {
|
||||
success: function (data) {
|
||||
$("#predictionpattern").html(data);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
[% END %]
|
||||
|
||||
<script>
|
||||
function show_blocking_subs() {
|
||||
$("#blocking_subs").show();
|
||||
|
|
@ -391,21 +410,20 @@
|
|||
return confirm(_("Are you sure you want to delete this numbering pattern?"));
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$(document).ready(function () {
|
||||
$("#numberpatternst").kohaTable({
|
||||
pagingType: "full",
|
||||
});
|
||||
|
||||
$(".delete_pattern").on("click",function(){
|
||||
$(".delete_pattern").on("click", function () {
|
||||
return confirmDelete();
|
||||
});
|
||||
$("#show_blocking_subs").on("click",function(e){
|
||||
$("#show_blocking_subs").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
$("#blocking_subs").show();
|
||||
});
|
||||
$("#test_pattern").on("click",function(){
|
||||
testPattern();
|
||||
$("#test_pattern").on("click", function () {
|
||||
testPattern();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue