@@ -, +, @@ footer --- .../en/includes/rotating-collections-toolbar.inc | 46 ++++++++-------------- .../en/modules/rotating_collections/addItems.tt | 15 +++---- .../rotating_collections/editCollections.tt | 7 ++++ .../rotating_collections/rotatingCollections.tt | 30 +++++--------- .../rotating_collections/transferCollection.tt | 7 ++++ .../intranet-tmpl/prog/js/rotating-collections.js | 27 +++++++++++++ 6 files changed, 74 insertions(+), 58 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js --- a/koha-tmpl/intranet-tmpl/prog/en/includes/rotating-collections-toolbar.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/rotating-collections-toolbar.inc @@ -1,31 +1,17 @@ - +
+
+ New collection +
-
- - - [% IF ( colId ) %] - -
- Edit -
-
- Delete -
- [% END %] -
+ [% IF ( colId ) %] +
+ Transfer +
+
+ Edit +
+
+ Delete +
+ [% END %] +
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tt @@ -1,14 +1,9 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Rotating collections › Collection [% colTitle %] ’ Add or remove items [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -124,4 +119,10 @@ [% INCLUDE 'tools-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt @@ -1,3 +1,4 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Rotating collections › [%- IF ( action == "new" ) %] @@ -134,4 +135,10 @@ [% INCLUDE 'tools-menu.inc' %] </div> </div> <!-- /#bd --> + +[% MACRO jsinclude BLOCK %] + <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script> + <script type="text/javascript" src="[% interface %]/[% theme %]/js/rotating-collections.js"></script> +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tt @@ -1,30 +1,11 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] <title>Koha › Tools › Rotating collections [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -83,4 +64,11 @@ [% INCLUDE 'tools-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'datatables.inc' %] + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tt @@ -1,4 +1,5 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Rotating collections › Transfer collection [% INCLUDE 'doc-head-close.inc' %] @@ -56,4 +57,10 @@ [% INCLUDE 'tools-menu.inc' %] + +[% MACRO jsinclude BLOCK %] + + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] --- a/koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js +++ a/koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js @@ -0,0 +1,27 @@ +/* global _ dataTablesDefaults */ + +$(document).ready(function(){ + $("#barcode").focus(); + + $(".confirmdelete").click(function(){ + $(this).parents('tr').addClass("warn"); + if(confirm(_("Are you sure you want to delete this rotating collection?"))){ + return true; + } else { + $(this).parents('tr').removeClass("warn"); + return false; + } + }); + + if( $('#rotating-collections-table').length > 0 ){ + $('#rotating-collections-table').dataTable($.extend(true, {}, dataTablesDefaults, { + "autoWidth": false, + "aoColumnDefs": [ + { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, + ], + "sPaginationType": "four_button" + } )); + } + + +}); --