Bugzilla – Attachment 69701 Details for
Bug 19560
Unable to delete library when branchcode contains special characters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19607: Move admin templates JavaScript to the footer: Basic parameters
Bug-19607-Move-admin-templates-JavaScript-to-the-f.patch (text/plain), 11.93 KB, created by
Owen Leonard
on 2017-12-11 18:13:56 UTC
(
hide
)
Description:
Bug 19607: Move admin templates JavaScript to the footer: Basic parameters
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2017-12-11 18:13:56 UTC
Size:
11.93 KB
patch
obsolete
>From 22a4a385b9d8a51cc815a7a3fab7b32d6605ac7d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 10 Nov 2017 13:23:43 +0000 >Subject: [PATCH] Bug 19607: Move admin templates JavaScript to the footer: > Basic parameters > >This patch modifies the staff client catalog-related administration >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 >each modified template: All button controls, DataTables functionality, >tabs, etc. > >Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com> > >Edit: Rebased on Bug 19560 >--- > .../prog/en/modules/admin/authorised_values.tt | 70 +++++++++--------- > .../prog/en/modules/admin/branches.tt | 86 +++++++++++----------- > .../prog/en/modules/admin/itemtypes.tt | 58 ++++++++------- > 3 files changed, 110 insertions(+), 104 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >index 8dd1d7b..fc6c559 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >@@ -1,3 +1,4 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Authorized values > [% IF op == 'add_form' %] >@@ -9,42 +10,6 @@ > [% INCLUDE 'doc-head-close.inc' %] > > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >-[% INCLUDE 'datatables.inc' %] >-<script type="text/javascript"> >-//<![CDATA[ >- $(document).ready(function() { >- $("#table_authorized_values").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, >- ], >- "aaSorting": [[ 1, "asc" ]], >- "sPaginationType": "four_button" >- })); >- >- if ( $("#branches option:selected").length < 1 ) { >- $("#branches option:first").attr("selected", "selected"); >- } >- $('#icons').tabs(); >- >- $("a.delete").click(function(){ >- return confirm(_("Are you sure you want to delete this authorized value?")); >- }); >-}); >-//]]> >-</script> >- >-[% IF op == 'list' %] >-<script type="text/javascript"> >-//<![CDATA[ >-$(document).ready(function() { >- $('#category').find("input:submit").hide(); >- $('#searchfield').change(function() { >- $('#category').submit(); >- }); >-}); >-//]]> >-</script> >-[% END %] > > <style type="text/css"> > fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; } >@@ -53,6 +18,7 @@ $(document).ready(function() { > fieldset.rows .ui-tabs-nav { margin-left : 10px; } > </style> > </head> >+ > <body id="admin_authorised_values" class="admin"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'prefs-admin-search.inc' %] >@@ -313,4 +279,36 @@ $(document).ready(function() { > [% INCLUDE 'admin-menu.inc' %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script> >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ $("#table_authorized_values").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "aaSorting": [[ 1, "asc" ]], >+ "sPaginationType": "four_button" >+ })); >+ >+ if ( $("#branches option:selected").length < 1 ) { >+ $("#branches option:first").attr("selected", "selected"); >+ } >+ $('#icons').tabs(); >+ >+ $("a.delete").click(function(){ >+ return confirm(_("Are you sure you want to delete this authorized value?")); >+ }); >+ [% IF op == 'list' %] >+ $('#category').find("input:submit").hide(); >+ $('#searchfield').change(function() { >+ $('#category').submit(); >+ }); >+ [% END %] >+ }); >+ </script> >+ >+[% END %] > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >index e0418bf..b7c681a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >@@ -1,3 +1,4 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Libraries and groups > [% IF op == 'editcategory' %] >@@ -12,48 +13,8 @@ > </title> > [% INCLUDE 'doc-head-close.inc' %] > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >-[% INCLUDE 'datatables.inc' %] >-<script type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce.js"></script> >-<script type="text/javascript"> >-//<![CDATA[ >- $(document).ready(function() { >- $("#branchest").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >- ], >- "iDisplayLength": 10, >- "sPaginationType": "four_button" >- })); >- >- [% UNLESS library %] >- $("#Aform").on("submit", function( event ) { >- if ( $("#branchcode").val().match(/\s/) ) { >- event.preventDefault(); >- alert(_("The library code entered contains whitespace characters. Please remove any whitespace characters from the library code")); >- return false; >- } else { >- return true; >- } >- }); >- [% END %] >- }); >-tinyMCE.init({ >- mode : "textareas", >- theme : "advanced", >- content_css : "[% interface %]/[% theme %]/css/tinymce.css", >- plugins : "table,save,advhr,advlink,contextmenu", >- theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,", >- theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap", >- // theme_advanced_buttons3 : "", >- theme_advanced_toolbar_location : "top", >- theme_advanced_toolbar_align : "left", >- theme_advanced_path_location : "bottom", >- theme_advanced_resizing : true, >- apply_source_formatting : true >-}); >-//]]> >-</script> > </head> >+ > <body id="admin_branches" class="admin"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'prefs-admin-search.inc' %] >@@ -407,4 +368,47 @@ tinyMCE.init({ > [% INCLUDE 'admin-menu.inc' %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce.js"></script> >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ $("#branchest").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "iDisplayLength": 10, >+ "sPaginationType": "four_button" >+ })); >+ >+ [% UNLESS library %] >+ $("#Aform").on("submit", function( event ) { >+ if ( $("#branchcode").val().match(/\s/) ) { >+ event.preventDefault(); >+ alert(_("The library code entered contains whitespace characters. Please remove any whitespace characters from the library code")); >+ return false; >+ } else { >+ return true; >+ } >+ }); >+ [% END %] >+ }); >+ tinyMCE.init({ >+ mode : "textareas", >+ theme : "advanced", >+ content_css : "[% interface %]/[% theme %]/css/tinymce.css", >+ plugins : "table,save,advhr,advlink,contextmenu", >+ theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,", >+ theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap", >+ // theme_advanced_buttons3 : "", >+ theme_advanced_toolbar_location : "top", >+ theme_advanced_toolbar_align : "left", >+ theme_advanced_path_location : "bottom", >+ theme_advanced_resizing : true, >+ apply_source_formatting : true >+ }); >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >index 3729d65..4062312 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >@@ -1,6 +1,7 @@ > [% USE Koha %] > [% USE AuthorisedValues %] > [% USE Price %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Item types [% IF op == 'add_form' %]› > [% IF ( itemtype ) %] >@@ -22,33 +23,6 @@ Data deleted > </title> > [% INCLUDE 'doc-head-close.inc' %] > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >-[% INCLUDE 'greybox.inc' %] >-[% INCLUDE 'datatables.inc' %] >-<script type="text/javascript"> >-//<![CDATA[ >- $(document).ready(function() { >- $('#icons').tabs(); >- $("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >- ], >- "aaSorting": [[ 2, "asc" ]], >- "iDisplayLength": 10, >- "sPaginationType": "four_button" >- })); >- $( "#itemtypeentry" ).validate({ >- rules: { >- itemtype: { required: true }, >- description: { required: true }, >- rentalcharge: { number: true } >- } >- }); >- $("#itemtype").on("blur",function(){ >- toUC(this); >- }); >- }); >-//]]> >-</script> > <style type="text/css"> > fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; } > fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; } >@@ -56,6 +30,7 @@ Data deleted > fieldset.rows .ui-tabs-nav { margin-left : 10px; } > </style> > </head> >+ > <body id="admin_itemtypes" class="admin"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'prefs-admin-search.inc' %] >@@ -418,4 +393,33 @@ Item types administration > [% INCLUDE 'admin-menu.inc' %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script> >+ [% INCLUDE 'greybox.inc' %] >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ $('#icons').tabs(); >+ $("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "aaSorting": [[ 2, "asc" ]], >+ "iDisplayLength": 10, >+ "sPaginationType": "four_button" >+ })); >+ $( "#itemtypeentry" ).validate({ >+ rules: { >+ itemtype: { required: true }, >+ description: { required: true }, >+ rentalcharge: { number: true } >+ } >+ }); >+ $("#itemtype").on("blur",function(){ >+ toUC(this); >+ }); >+ }); >+ </script> >+[% END %] > [% INCLUDE 'intranet-bottom.inc' %] >-- >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 19560
:
69062
|
69097
|
69130
|
69423
|
69490
|
69700
|
69701
|
69735
|
69736
|
69775