Bugzilla – Attachment 69560 Details for
Bug 19755
Move template JavaScript to the footer: Acquisitions, part 3
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19755: Move template JavaScript to the footer: Acquisitions, part 3
Bug-19755-Move-template-JavaScript-to-the-footer-A.patch (text/plain), 35.17 KB, created by
Owen Leonard
on 2017-12-06 15:29:36 UTC
(
hide
)
Description:
Bug 19755: Move template JavaScript to the footer: Acquisitions, part 3
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2017-12-06 15:29:36 UTC
Size:
35.17 KB
patch
obsolete
>From d285e87e1ed6ad90f7f751df96895b1a82b4203f Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 5 Dec 2017 18:30:08 +0000 >Subject: [PATCH] Bug 19755: Move template JavaScript to the footer: > Acquisitions, part 3 > >This patch modifies even more staff client acquisitions templates so >that JavaScript is included in the footer instead of the header. > >To test, apply the patch and test the JavaScript-driven features of the >modified templates: All button controls, DataTables functionality, tabs, >etc. > >- Acquisitions -> Vendor -> Vendor details > - Contracts datatable > - Edit vendor > - Add contacts, form validation >- Acquisitions -> Vendor -> Invoices -> Invoice -> "Go to receipt" > - Datatables, MARC and Card previews > - Transfer > - Confirmation of transfer, window closes >- Acquisitions -> Vendor -> Receive shipments > - Datatables, date pickers >- Acquisitions -> Available funds table -> Spent report > - Datatables >- Acquisitions -> Vendor -> Uncertain prices > - Datatables, form validation >- Acquisitions -> Vendor -> Basket -> Add to basket from external source > - Select and clear all on search form > - Search results > - Datatables, MARC and Card previews, in-table pop-up controls > (click any table cell) >--- > .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 267 ++++++++++----------- > .../intranet-tmpl/prog/en/modules/acqui/parcels.tt | 61 ++--- > .../intranet-tmpl/prog/en/modules/acqui/spent.tt | 33 +-- > .../prog/en/modules/acqui/supplier.tt | 154 ++++++------ > .../prog/en/modules/acqui/transferorder.tt | 47 ++-- > .../prog/en/modules/acqui/uncertainprice.tt | 45 ++-- > .../prog/en/modules/acqui/z3950_search.tt | 78 +++--- > 7 files changed, 350 insertions(+), 335 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >index ee4d8d6..f805193 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -2,146 +2,14 @@ > [% USE KohaDates %] > [% USE Price %] > [% USE currency = format('%.2f') -%] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › [% IF ( date ) %] > Receipt summary for [% name %] [% IF ( invoice ) %]invoice [% invoice %][% END %] on [% datereceived | $KohaDates %][% ELSE %]Receive orders from [% name %][% END %]</title> > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> > [% INCLUDE 'doc-head-close.inc' %] >-[% INCLUDE 'datatables.inc' %] >-<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script> >-<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script> >-<style type="text/css">#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style> >-<script type="text/javascript"> >-//<![CDATA[ >- >- dt_overwrite_html_sorting_localeCompare(); >- >- var sticky_filters = [% sticky_filters %]; >- >- $(document).ready(function(){ >- if ( $("#pendingt").length ) { >- var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, { >- "bStateSave": true, >- "iCookieDuration": 60*60*24*1000, // 1000 days >- "iDisplayLength": 10, >- "aLengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]], >- "aoColumnDefs": [ >- { "aTargets": [ 4, 9, 10 ], "bSortable": false, "bSearchable": false }, >- ], >- "aoColumns": [ >- { "sType": "html" }, >- { "sType": "html" }, >- { "sType": "num-html" }, >- { "sType": "anti-the" }, >- null, >- null, >- null, >- null, >- null, >- null, >- null, >- ], >- 'bAutoWidth': false, >- "sPaginationType": "four_button" >- } ) >- ).columnFilter({ >- sPlaceHolder: "head:after", >- aoColumns: [ >- { type: "text" }, >- { type: "text" }, >- { type: "text" }, >- { type: "text" }, >- null, >- { type: "text" }, >- { type: "text" }, >- { type: "text" }, >- { type: "text" }, >- null, >- null >- ] >- }); >- } >- >- if ( $("#receivedt").length ) { >- var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, { >- "bStateSave": true, >- "iCookieDuration": 60*60*24*1000, // 1000 days >- "iDisplayLength": 10, >- "aLengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]], >- "aoColumnDefs": [ >- { "aTargets": [ 5, -1 ], "bSortable": false, "bSearchable": false }, >- ], >- "aoColumns": [ >- { "sType": "html" }, >- { "sType": "html" }, >- { "sType": "html" }, >- { "sType": "num-html" }, >- { "sType": "anti-the" }, >- null, >- null, >- null, >- null, >- null, >- null, >- null >- ], >- "sPaginationType": "four_button" >- } ) ); >- } >- >- // Keep filters from finishreceive.pl to parcel.pl >- $.cookie("filter_parcel_summary", $("#summaryfilter").val()); >- $.cookie("filter_parcel_basketname", $("#basketfilter").val()); >- $.cookie("filter_parcel_orderno", $("#orderfilter").val()); >- $.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val()); >- $.cookie("filter_parcel_ean", $("#eanfilter").val()); >- >- $("#filterform").on('submit', function(){ >- $.cookie("filter_parcel_summary", $("#summaryfilter").val()); >- $.cookie("filter_parcel_basketname", $("#basketfilter").val()); >- $.cookie("filter_parcel_orderno", $("#orderfilter").val()); >- $.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val()); >- $.cookie("filter_parcel_ean", $("#eanfilter").val()); >- }); >- >- $(".previewData").on("click", function(e){ >- e.preventDefault(); >- var ltitle = $(this).text(); >- var page = $(this).attr("href"); >- $("#dataPreviewLabel").text(ltitle); >- $("#dataPreview .modal-body").load(page + " div"); >- $('#dataPreview').modal({show:true}); >- }); >- $("#dataPreview").on("hidden", function(){ >- $("#dataPreviewLabel").html(""); >- $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); >- }); >- >- }); >- >- // Case-insensitive version of jquery's contains function >- jQuery.extend(jQuery.expr[':'], { >- icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0" >- }); >- >- // Contains exactly function >- jQuery.extend(jQuery.expr[':'], { >- containsExactly: "$(a).text() == m[3]" >- }); >- >-//]]> >-</script> >-<script type="text/javascript"> >-//<![CDATA[ >- function transfer_order_popup(ordernumber) { >- var url = "/cgi-bin/koha/acqui/transferorder.pl?" >- + "ordernumber=" + ordernumber >- window.open(url, 'TransferOrder'); >- } >- >-//]]> >-</script> > </head> >+ > <body id="acq_parcel" class="acq"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'acquisitions-search.inc' %] >@@ -546,4 +414,135 @@ > [% INCLUDE 'acquisitions-menu.inc' %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu.js"></script> >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script> >+ <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script> >+ <style type="text/css">#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style> >+ <script type="text/javascript"> >+ >+ dt_overwrite_html_sorting_localeCompare(); >+ var sticky_filters = [% sticky_filters %]; >+ >+ $(document).ready(function(){ >+ if ( $("#pendingt").length ) { >+ var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "bStateSave": true, >+ "iCookieDuration": 60*60*24*1000, // 1000 days >+ "iDisplayLength": 10, >+ "aLengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]], >+ "aoColumnDefs": [ >+ { "aTargets": [ 4, 9, 10 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "aoColumns": [ >+ { "sType": "html" }, >+ { "sType": "html" }, >+ { "sType": "num-html" }, >+ { "sType": "anti-the" }, >+ null, >+ null, >+ null, >+ null, >+ null, >+ null, >+ null, >+ ], >+ 'bAutoWidth': false, >+ "sPaginationType": "four_button" >+ }) >+ ).columnFilter({ >+ sPlaceHolder: "head:after", >+ aoColumns: [ >+ { type: "text" }, >+ { type: "text" }, >+ { type: "text" }, >+ { type: "text" }, >+ null, >+ { type: "text" }, >+ { type: "text" }, >+ { type: "text" }, >+ { type: "text" }, >+ null, >+ null >+ ] >+ }); >+ } >+ >+ if ( $("#receivedt").length ) { >+ var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "bStateSave": true, >+ "iCookieDuration": 60*60*24*1000, // 1000 days >+ "iDisplayLength": 10, >+ "aLengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]], >+ "aoColumnDefs": [ >+ { "aTargets": [ 5, -1 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "aoColumns": [ >+ { "sType": "html" }, >+ { "sType": "html" }, >+ { "sType": "html" }, >+ { "sType": "num-html" }, >+ { "sType": "anti-the" }, >+ null, >+ null, >+ null, >+ null, >+ null, >+ null, >+ null >+ ], >+ "sPaginationType": "four_button" >+ })); >+ } >+ >+ // Keep filters from finishreceive.pl to parcel.pl >+ $.cookie("filter_parcel_summary", $("#summaryfilter").val()); >+ $.cookie("filter_parcel_basketname", $("#basketfilter").val()); >+ $.cookie("filter_parcel_orderno", $("#orderfilter").val()); >+ $.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val()); >+ $.cookie("filter_parcel_ean", $("#eanfilter").val()); >+ >+ $("#filterform").on('submit', function(){ >+ $.cookie("filter_parcel_summary", $("#summaryfilter").val()); >+ $.cookie("filter_parcel_basketname", $("#basketfilter").val()); >+ $.cookie("filter_parcel_orderno", $("#orderfilter").val()); >+ $.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val()); >+ $.cookie("filter_parcel_ean", $("#eanfilter").val()); >+ }); >+ >+ $(".previewData").on("click", function(e){ >+ e.preventDefault(); >+ var ltitle = $(this).text(); >+ var page = $(this).attr("href"); >+ $("#dataPreviewLabel").text(ltitle); >+ $("#dataPreview .modal-body").load(page + " div"); >+ $('#dataPreview').modal({show:true}); >+ }); >+ $("#dataPreview").on("hidden", function(){ >+ $("#dataPreviewLabel").html(""); >+ $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); >+ }); >+ >+ }); >+ >+ // Case-insensitive version of jquery's contains function >+ jQuery.extend(jQuery.expr[':'], { >+ icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0" >+ }); >+ >+ // Contains exactly function >+ jQuery.extend(jQuery.expr[':'], { >+ containsExactly: "$(a).text() == m[3]" >+ }); >+ >+ function transfer_order_popup(ordernumber) { >+ var url = "/cgi-bin/koha/acqui/transferorder.pl?" >+ + "ordernumber=" + ordernumber >+ window.open(url, 'TransferOrder'); >+ } >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt >index 33e7a8d..50a8496 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt >@@ -1,37 +1,11 @@ > [% USE KohaDates %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › Receive shipment from vendor [% name %]</title> > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> > [% INCLUDE 'doc-head-close.inc' %] >-[% INCLUDE 'calendar.inc' %] >-[% INCLUDE 'datatables.inc' %] >-<script type="text/javascript"> >-//<![CDATA[ >- $(document).ready(function() { >- var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "sType": "title-string", "aTargets" : [ "title-string" ] } >- ], >- 'bPaginate': false, >- } ) ); >- >- //keep a copy of all budgets before removing the inactives >- var budgetId = $("#shipmentcost_budgetid"); >- var disabledBudgetsCopy = budgetId.html(); >- $('.b_inactive').remove(); >- >- $('#showallfunds').click(function() { >- if ($(this).is(":checked")) { >- budgetId.html(disabledBudgetsCopy); //Puts back all the funds >- } >- else { >- $('.b_inactive').remove(); >- } >- }); >- }); >- //]]> >-</script> > </head> >+ > <body id="acq_parcels" class="acq"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'acquisitions-search.inc' %] >@@ -225,4 +199,35 @@ > </form>[% END %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu.js"></script> >+ [% INCLUDE 'calendar.inc' %] >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "sType": "title-string", "aTargets" : [ "title-string" ] } >+ ], >+ 'bPaginate': false, >+ })); >+ >+ //keep a copy of all budgets before removing the inactives >+ var budgetId = $("#shipmentcost_budgetid"); >+ var disabledBudgetsCopy = budgetId.html(); >+ $('.b_inactive').remove(); >+ >+ $('#showallfunds').click(function() { >+ if ($(this).is(":checked")) { >+ budgetId.html(disabledBudgetsCopy); //Puts back all the funds >+ } >+ else { >+ $('.b_inactive').remove(); >+ } >+ }); >+ }); >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt >index 0b1bdc6..94810fc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt >@@ -1,24 +1,12 @@ > [% USE KohaDates %] > [% USE ItemTypes %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › Spent</title> > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> > [% INCLUDE 'doc-head-close.inc' %] >-[% INCLUDE 'datatables.inc' %] >-<script type="text/javascript"> >-//<![CDATA[ >- $(document).ready(function() { >- $("#spent").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "sType": "anti-the", "aTargets" : [ "anti-the" ] }, >- { "sType": "title-string", "aTargets" : [ "title-string" ] } >- ], >- "sPaginationType": "four_button" >- } ) ); >- }); >- //]]> >-</script> > </head> >+ > <body id="acq_spent" class="acq"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'acquisitions-search.inc' %] >@@ -114,4 +102,21 @@ > [% INCLUDE 'acquisitions-menu.inc' %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu.js"></script> >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ $("#spent").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "sType": "anti-the", "aTargets" : [ "anti-the" ] }, >+ { "sType": "title-string", "aTargets" : [ "title-string" ] } >+ ], >+ "sPaginationType": "four_button" >+ } ) ); >+ }); >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >index 085875f..a88e9f6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >@@ -85,86 +85,13 @@ > [% END %] > [% END %] > >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Vendor [% name %]</title> > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> > [% INCLUDE 'doc-head-close.inc' %] >-[% INCLUDE 'datatables.inc' %] >- >-<script type="text/javascript"> >-//<![CDATA[ >-function confirm_deletion() { >- if (confirm(_("Confirm deletion of this vendor ?"))) { >- window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]&op=delete"; >- } >-} >- >-function add_contact() { >- var new_contact = $('#contact-template').clone(); >- var timestamp = new Date().getTime(); >- $(new_contact).removeAttr('id'); >- $('input, textarea', new_contact).each(function () { >- $(this).attr('id', $(this).attr('id') + '_' + timestamp); >- }); >- $('label', new_contact).each(function () { >- $(this).attr('for', $(this).attr('for') + '_' + timestamp); >- }); >- $(new_contact).insertBefore(this); >- if ($('.supplier-contact').length === 2) { // First contact >- $.each(['.contact_acqprimary', '.contact_serialsprimary', '.contact_orderacquisition', '.contact_claimacquisition', '.contact_claimissues'], function (idx, checkbox) { >- $(checkbox, new_contact).click(); >- }); >- } >- $('input[name="contact_name"]', new_contact).focus(); >- return false; >-} >- >-function delete_contact(ev) { >- $(this).parents('.supplier-contact').remove(); >- ev.preventDefault(); >-} >- >- $(document).ready(function() { >- var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >- { "sType": "title-string", "aTargets" : [ "title-string" ] } >- ], >- 'sDom': 't' >- } ) ); >- $('body').on('click', '.delete-contact', null, delete_contact); >- $('#add-contact').click(add_contact); >- $('body').on('click', '.contact_acqprimary', null, function () { >- if ($(this).is(':checked')) { >- $('.contact_acqprimary').filter(':checked').not(this).prop('checked', false); >- $('.contact_acqprimary_hidden').each(function () { >- $(this).val('0'); >- }); >- } >- $(this).next('.contact_acqprimary_hidden').val('1'); >- }); >- $('body').on('click', '.contact_serialsprimary', null, function () { >- if ($(this).is(':checked')) { >- $('.contact_serialsprimary').filter(':checked').not(this).prop('checked', false); >- $('.contact_serialsprimary_hidden').each(function () { >- $(this).val('0'); >- }); >- } >- $(this).next('.contact_serialsprimary_hidden').val($(this).is(':checked') ? '1' : '0'); >- }); >- $('body').on('click', '.contact_orderacquisition', null, function () { >- $(this).next('.contact_orderacquisition_hidden').val($(this).is(':checked') ? '1' : '0'); >- }); >- $('body').on('click', '.contact_claimacquisition', null, function () { >- $(this).next('.contact_claimacquisition_hidden').val($(this).is(':checked') ? '1' : '0'); >- }); >- $('body').on('click', '.contact_claimissues', null, function () { >- $(this).next('.contact_claimissues_hidden').val($(this).is(':checked') ? '1' : '0'); >- }); >- }); >-//]]> >-</script> > </head> >+ > <body id="acq_supplier" class="acq"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'acquisitions-search.inc' %] >@@ -422,4 +349,81 @@ function delete_contact(ev) { > [% INCLUDE 'vendor-menu.inc' %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu.js"></script> >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript"> >+ function confirm_deletion() { >+ if (confirm(_("Confirm deletion of this vendor ?"))) { >+ window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]&op=delete"; >+ } >+ } >+ >+ function add_contact() { >+ var new_contact = $('#contact-template').clone(); >+ var timestamp = new Date().getTime(); >+ $(new_contact).removeAttr('id'); >+ $('input, textarea', new_contact).each(function () { >+ $(this).attr('id', $(this).attr('id') + '_' + timestamp); >+ }); >+ $('label', new_contact).each(function () { >+ $(this).attr('for', $(this).attr('for') + '_' + timestamp); >+ }); >+ $(new_contact).insertBefore(this); >+ if ($('.supplier-contact').length === 2) { // First contact >+ $.each(['.contact_acqprimary', '.contact_serialsprimary', '.contact_orderacquisition', '.contact_claimacquisition', '.contact_claimissues'], function (idx, checkbox) { >+ $(checkbox, new_contact).click(); >+ }); >+ } >+ $('input[name="contact_name"]', new_contact).focus(); >+ return false; >+ } >+ >+ function delete_contact(ev) { >+ $(this).parents('.supplier-contact').remove(); >+ ev.preventDefault(); >+ } >+ >+ $(document).ready(function() { >+ var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >+ { "sType": "title-string", "aTargets" : [ "title-string" ] } >+ ], >+ 'sDom': 't' >+ } ) ); >+ $('body').on('click', '.delete-contact', null, delete_contact); >+ $('#add-contact').click(add_contact); >+ $('body').on('click', '.contact_acqprimary', null, function () { >+ if ($(this).is(':checked')) { >+ $('.contact_acqprimary').filter(':checked').not(this).prop('checked', false); >+ $('.contact_acqprimary_hidden').each(function () { >+ $(this).val('0'); >+ }); >+ } >+ $(this).next('.contact_acqprimary_hidden').val('1'); >+ }); >+ $('body').on('click', '.contact_serialsprimary', null, function () { >+ if ($(this).is(':checked')) { >+ $('.contact_serialsprimary').filter(':checked').not(this).prop('checked', false); >+ $('.contact_serialsprimary_hidden').each(function () { >+ $(this).val('0'); >+ }); >+ } >+ $(this).next('.contact_serialsprimary_hidden').val($(this).is(':checked') ? '1' : '0'); >+ }); >+ $('body').on('click', '.contact_orderacquisition', null, function () { >+ $(this).next('.contact_orderacquisition_hidden').val($(this).is(':checked') ? '1' : '0'); >+ }); >+ $('body').on('click', '.contact_claimacquisition', null, function () { >+ $(this).next('.contact_claimacquisition_hidden').val($(this).is(':checked') ? '1' : '0'); >+ }); >+ $('body').on('click', '.contact_claimissues', null, function () { >+ $(this).next('.contact_claimissues_hidden').val($(this).is(':checked') ? '1' : '0'); >+ }); >+ }); >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt >index 9d06740..d36bc18 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt >@@ -1,3 +1,4 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › Transfer order</title> > [%- USE KohaDates -%] >@@ -5,29 +6,8 @@ > <style type="text/css"> > #custom-doc { width:44.46em;*width:43.39em;min-width:578px; margin:auto; text-align:left; } > </style> >-[% IF transferred %] >- <script type="text/javascript"> >- //<![CDATA[ >- opener.location.reload(); >- window.close(); >- //]]> >- </script> >-[% END %] >- >-[% IF ( bookselleridfrom ) %] >- <script type="text/javascript"> >- //<![CDATA[ >- $(document).ready(function(){ >- $(".confirm_transfer").on("click",function(){ >- return confirm( _("Transfer order to this basket?") ); >- }); >- }); >- //]]> >- </script> >-[% END %] >- >- > </head> >+ > <body id="acq_transferorder" class="acq"> > <div id="custom-doc" class="yui-t7"> > <div id="bd"> >@@ -149,5 +129,24 @@ > > </div> > </div> >-</body> >-</html> >+ >+[% MACRO jsinclude BLOCK %] >+ [% IF transferred %] >+ <script type="text/javascript"> >+ opener.location.reload(); >+ window.close(); >+ </script> >+ [% END %] >+ >+ [% IF ( bookselleridfrom ) %] >+ <script type="text/javascript"> >+ $(document).ready(function(){ >+ $(".confirm_transfer").on("click",function(){ >+ return confirm( _("Transfer order to this basket?") ); >+ }); >+ }); >+ </script> >+ [% END %] >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >index d916c80..47190da 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >@@ -1,29 +1,11 @@ > [% USE Koha %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › [% IF ( booksellername ) %]Orders with uncertain prices for vendor [% booksellername %][% ELSE %]Orders with uncertain prices[% END %]</title> > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> > [% INCLUDE 'doc-head-close.inc' %] >-[% INCLUDE 'datatables.inc' %] >-<script type="text/javascript"> >-//<![CDATA[ >- $(document).ready(function() { >- var uncertainpricet = $("#uncertainpricet").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false }, >- ], >- "sPaginationType": "four_button" >- } ) ); >- $(".check_uncertain").on("change",function(){ >- var form = document.getElementById("uncertainprices"); >- var ordernumber = $(this).data("ordernumber"); >- uncheckbox( form, ordernumber ); >- }); >- }); >-var MSG_INVALIDPRICE = _("ERROR: Price is not a valid number, please check the price and try again!"); >- //]]> >-</script> >-<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script> > </head> >+ > <body id="acq_uncertainprice" class="acq"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'acquisitions-search.inc' %] >@@ -154,4 +136,27 @@ var MSG_INVALIDPRICE = _("ERROR: Price is not a valid number, please check the p > [% INCLUDE 'vendor-menu.inc' %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu.js"></script> >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ var uncertainpricet = $("#uncertainpricet").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "sPaginationType": "four_button" >+ })); >+ $(".check_uncertain").on("change",function(){ >+ var form = document.getElementById("uncertainprices"); >+ var ordernumber = $(this).data("ordernumber"); >+ uncheckbox( form, ordernumber ); >+ }); >+ }); >+ var MSG_INVALIDPRICE = _("ERROR: Price is not a valid number, please check the price and try again!"); >+ </script> >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >index ddf104a..98ff748 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >@@ -1,45 +1,8 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › [% IF ( opsearch ) %]Order from external source[% ELSE %]Order from external source › Search results[% END %]</title> > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> > [% INCLUDE 'doc-head-close.inc' %] >-[% INCLUDE 'datatables.inc' %] >- >-<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> >-<script type="text/javascript"> >-//<![CDATA[ >- $(document).ready(function(){ >- >- var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, >- { "aTargets": [ 1 ], "sType": "nsb-nse" }, >- ], >- "aaSorting": [[ 1, "asc" ]], >- "bPaginate": false >- } ) ); >- /* Inline edit/delete links */ >- $("td").click(function(event){ >- var $tgt = $(event.target); >- var row = $(this).parent(); >- $(".linktools").hide(); >- $("tr").removeClass("selected"); >- row.addClass("selected"); >- if($tgt.is("a")||$tgt.is(":nth-child(6)")||$tgt.is(":nth-child(7)")){ >- //Don't show inline links for cells containing links of their own. >- } else { >- var position = $(this).offset(); >- var top = position.top+5; >- var left = position.left+5; >- $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left); >- } >- }); >- >-}); >- >-//]]> >-</script> >-[% INCLUDE 'z3950_search.inc' %] >-<script type="text/javascript" src="[% interface %]/[% theme %]/js/z3950_search.js"></script> > <style type="text/css"> > .linktools { background-color:#FFF;border-top:1px solid #DDD; border-left: 1px solid #DDD; border-right: 1px solid #666; border-bottom:1px solid #666;display: none; white-space: nowrap;} > .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;} >@@ -47,6 +10,7 @@ > tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent !important; } #dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } } > </style> > </head> >+ > <body id="acq_z3950_search" class="acq"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'acquisitions-search.inc' %] >@@ -222,6 +186,40 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > </div> > [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %] > >-</body> >-</html> >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu.js"></script> >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> >+ <script type="text/javascript"> >+ $(document).ready(function(){ >+ var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, >+ { "aTargets": [ 1 ], "sType": "nsb-nse" }, >+ ], >+ "aaSorting": [[ 1, "asc" ]], >+ "bPaginate": false >+ })); >+ /* Inline edit/delete links */ >+ $("td").click(function(event){ >+ var $tgt = $(event.target); >+ var row = $(this).parent(); >+ $(".linktools").hide(); >+ $("tr").removeClass("selected"); >+ row.addClass("selected"); >+ if($tgt.is("a")||$tgt.is(":nth-child(6)")||$tgt.is(":nth-child(7)")){ >+ //Don't show inline links for cells containing links of their own. >+ } else { >+ var position = $(this).offset(); >+ var top = position.top+5; >+ var left = position.left+5; >+ $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left); >+ } >+ }); >+ }); >+ </script> >+ [% INCLUDE 'z3950_search.inc' %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/z3950_search.js"></script> >+[% END %] > >+[% INCLUDE 'intranet-bottom.inc' %] >\ No newline at end of file >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19755
:
69560
|
70873
|
71326
|
71476