|
Lines 171-179
$(document).ready(function () {
Link Here
|
| 171 |
var dataSet = { |
171 |
var dataSet = { |
| 172 |
_page: Math.floor(start / length) + 1, |
172 |
_page: Math.floor(start / length) + 1, |
| 173 |
_per_page: length, |
173 |
_per_page: length, |
| 174 |
_order_by: "", |
|
|
| 175 |
}; |
174 |
}; |
| 176 |
|
175 |
|
|
|
176 |
if (data.order[0]) { |
| 177 |
dataSet._order_by = |
| 178 |
data.columns[data.order[0].column].data + ":" + data.order[0].dir; |
| 179 |
} |
| 180 |
|
| 177 |
//This is why the kohaTables data function is overwritten, to allow passing the search query as a string. |
181 |
//This is why the kohaTables data function is overwritten, to allow passing the search query as a string. |
| 178 |
if (data.search) { |
182 |
if (data.search) { |
| 179 |
dataSet.q = data.search.value; |
183 |
dataSet.q = data.search.value; |
|
Lines 215-220
$(document).ready(function () {
Link Here
|
| 215 |
{ data: "nbofusers" }, |
219 |
{ data: "nbofusers" }, |
| 216 |
{ data: "lastimport" }, |
220 |
{ data: "lastimport" }, |
| 217 |
], |
221 |
], |
|
|
222 |
dom: '<"dt-info"i><"top pager"<"table_entries"lp><"table_controls"fB>>tr<"bottom pager"ip>', |
| 223 |
buttons: [ |
| 224 |
{ |
| 225 |
extend: "collection", |
| 226 |
text: '<i class="fa-solid fa-arrow-down-short-wide" style="margin-right: 5px;"></i>Sort by', |
| 227 |
attr: {id: 'sort-by-button'}, |
| 228 |
align: 'button-right', |
| 229 |
buttons: [ |
| 230 |
{ |
| 231 |
text: __("Name (A-Z)"), |
| 232 |
action: function (e, dt, node, config) { |
| 233 |
dt.order([1, "asc"]).draw(); |
| 234 |
$(".dt-button-background").trigger("click"); |
| 235 |
}, |
| 236 |
}, |
| 237 |
{ |
| 238 |
text: __("Name (Z-A)"), |
| 239 |
action: function (e, dt, node, config) { |
| 240 |
dt.order([1, "desc"]).draw(); |
| 241 |
$(".dt-button-background").trigger("click"); |
| 242 |
}, |
| 243 |
}, |
| 244 |
{ |
| 245 |
text: __("Date (from newest)"), |
| 246 |
action: function (e, dt, node, config) { |
| 247 |
dt.order([4, "desc"]).draw(); |
| 248 |
$(".dt-button-background").trigger("click"); |
| 249 |
}, |
| 250 |
}, |
| 251 |
{ |
| 252 |
text: __("Date (from oldest)"), |
| 253 |
action: function (e, dt, node, config) { |
| 254 |
dt.order([4, "asc"]).draw(); |
| 255 |
$(".dt-button-background").trigger("click"); |
| 256 |
}, |
| 257 |
}, |
| 258 |
{ |
| 259 |
text: __('Popularity'), |
| 260 |
action: function (e, dt, node, config) { |
| 261 |
dt.order([3, "desc"]).draw(); |
| 262 |
$(".dt-button-background").trigger("click"); |
| 263 |
}, |
| 264 |
}, |
| 265 |
|
| 266 |
], |
| 267 |
}, |
| 268 |
], |
| 218 |
}); |
269 |
}); |
| 219 |
|
270 |
|
| 220 |
let thead = $("#mana_results_datatable thead"); |
271 |
let thead = $("#mana_results_datatable thead"); |
| 221 |
- |
|
|