Bugzilla – Attachment 84897 Details for
Bug 22175
Make stock rotation table sortable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22175: Make stock rotation table sortable
Bug-22175-Make-stock-rotation-table-sortable.patch (text/plain), 9.07 KB, created by
José-Mario Monteiro-Santos
on 2019-02-08 20:11:47 UTC
(
hide
)
Description:
Bug 22175: Make stock rotation table sortable
Filename:
MIME Type:
Creator:
José-Mario Monteiro-Santos
Created:
2019-02-08 20:11:47 UTC
Size:
9.07 KB
patch
obsolete
>From 3fcede5f5dc21455d78dc8207186f067a4d6dc5b Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 25 Jan 2019 14:02:01 +0000 >Subject: [PATCH] Bug 22175: Make stock rotation table sortable > >This patch adds sorting and column configuration to the stock >rotation tables, both rotas and items. No new defaults for the table are >defined. > >To test, apply the patch and clear your browser cache if necessary. > > - Go to Tools -> Stock rotation. > - In the table of rotas test that sorting works correctly. > - Test that the "Column visibility" button works to show and hide > columns. The "actions" column should be excluded. > - Test that export options (Excel, CSV, etc) exclude the "actions" > column. > - Choose a rota with multiple items on it and select manage -> > items. Repeat the above DataTables functionality tests. > > - Go to Administration -> Columns settings and edit the default > configuration of the stock rotation tables. Confirm that these > changes are reflected in the corresponding tables. > >Signed-off-by: Jose-Mario Monteiro-Santos <jose-mario.monteiro-santos@inLibro.com> >--- > admin/columns_settings.yml | 35 ++++++++++++++++++ > .../prog/en/modules/tools/stockrotation.tt | 42 ++++++++++------------ > .../intranet-tmpl/prog/js/pages/stockrotation.js | 23 ++++++++++++ > 3 files changed, 76 insertions(+), 24 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 6bc5c55..795926b 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -858,3 +858,38 @@ modules: > columnname: actions > cannot_be_toggled: 1 > cannot_be_modified: 1 >+ >+ stockrotation: >+ stock_rotation: >+ - >+ columnname: name >+ - >+ columnname: cyclical >+ - >+ columnname: active >+ - >+ columnname: description >+ - >+ columnname: number_of_items >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ >+ stock_rotation_manage_items: >+ - >+ columnname: barcode >+ - >+ columnname: title >+ - >+ columnname: author >+ - >+ columnname: call_number >+ - >+ columnname: in_transit >+ - >+ columnname: stages >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt >index 7cbf98f..027b199 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt >@@ -3,6 +3,7 @@ > [% USE Koha %] > [% USE Branches %] > [% USE KohaDates %] >+[% USE ColumnsSettings %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Stock rotation</title> >@@ -56,15 +57,15 @@ > <h2>Stock rotation</h2> > > [% IF existing_rotas.size > 0 %] >- <table class="rotas_table" role="grid"> >+ <table id="stock_rotation" class="rotas_table" role="grid"> > <thead> > <tr> >- <th>Name</th> >+ <th class="anti-the">Name</th> > <th>Cyclical</th> > <th>Active</th> > <th>Description</th> > <th>Number of items</th> >- <th> </th> >+ <th class="NoSort"> </th> > </tr> > </thead> > <tbody> >@@ -80,12 +81,12 @@ > <i class="fa fa-pencil"></i> > Edit > </a> >- <div class="btn-group" role="group"> >+ <div class="btn-group dropup" role="group"> > <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> > Manage > <i class="fa fa-caret-down"></i> > </button> >- <ul class="dropdown-menu"> >+ <ul class="dropdown-menu pull-right"> > <li><a href="?op=manage_stages&rota_id=[% rota.rota_id | uri %]">Stages</a></li> > [% IF CAN_user_stockrotation_manage_rota_items && rota.stockrotationstages.count > 0 %] > <li><a href="?op=manage_items&rota_id=[% rota.rota_id | uri %]">Items</a></li> >@@ -364,16 +365,16 @@ > > [% IF items.count > 0 %] > <h3>Manage items assigned to "[% rota.title | html %]"</h3> >- <table id="sr_manage_items" class="items_table" role="grid"> >+ <table id="stock_rotation_manage_items" class="items_table" role="grid"> > <thead> > <tr> >- <th>Barcode</th> >- <th>Title</th> >- <th>Author</th> >- <th>Callnumber</th> >- <th class="NoSearch">In transit</th> >- <th class="NoSort">Stages & duration in days<br>(current stage highlighted)</th> >- <th class="NoSort"> </th> >+ <th>Barcode</th> >+ <th>Title</th> >+ <th>Author</th> >+ <th>Call number</th> >+ <th class="NoSearch">In transit</th> >+ <th class="NoSort">Stages & duration in days<br>(current stage highlighted)</th> >+ <th class="NoSort"> </th> > </tr> > </thead> > <tbody> >@@ -498,6 +499,7 @@ > > [% END %] > </div> >+ > </main> > </div> <!-- /.col-sm-10.col-sm-push-2 --> > >@@ -508,22 +510,14 @@ > </div> <!-- /.col-sm-2.col-sm-pull-10 --> > </div> <!-- /.row --> > >- > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/tools-menu.js") | $raw %] > [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] > [% Asset.js("js/pages/stockrotation.js") | $raw %] > <script> >- $(document).ready(function() { >- $('#sr_manage_items').dataTable($.extend(true, {}, dataTablesDefaults, { >- "autoWidth": false, >- "aoColumnDefs": [ >- { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, >- { "bSortable": true, "bSearchable": false, 'aTargets': [ 'NoSearch' ] } >- ], >- "sPaginationType": "four_button" >- })); >- }); >+ var stock_rotation_items_columns_settings = [% ColumnsSettings.GetColumns( 'tools', 'stockrotation', 'stock_rotation_manage_items', 'json' ) | $raw %]; >+ var stock_rotation_columns_settings = [% ColumnsSettings.GetColumns( 'tools', 'stockrotation', 'stock_rotation', 'json' ) | $raw %]; > </script> > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js b/koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js >index 2763945..b9493df 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js >@@ -1,3 +1,5 @@ >+/* global KohaTable columns_settings */ >+ > function init() { > $('#ajax_status').hide(); > $('#ajax_saving_msg').hide(); >@@ -62,4 +64,25 @@ $(document).ready(function() { > }) > } > }); >+ >+ KohaTable("stock_rotation_manage_items", { >+ "aoColumnDefs": [ >+ { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, >+ { "sType": "anti-the", "aTargets": [ "anti-the" ] } >+ ], >+ "sPaginationType": "four_button", >+ "autoWidth": false, >+ "exportColumns": [0,1,2,3,4,5] >+ }, stock_rotation_items_columns_settings); >+ >+ KohaTable("stock_rotation", { >+ "aoColumnDefs": [ >+ { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, >+ { "sType": "anti-the", "aTargets": [ "anti-the" ] } >+ ], >+ "sPaginationType": "four_button", >+ "autoWidth": false, >+ "exportColumns": [0,1,2,3,4] >+ }, stock_rotation_columns_settings); >+ > }); >-- >2.7.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 22175
:
84406
|
84421
|
84637
|
84897
|
87807
|
87847
|
87848