|
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 + |
| 179 |
":" + |
| 180 |
data.order[0].dir; |
| 181 |
} |
| 182 |
|
| 177 |
//This is why the kohaTables data function is overwritten, to allow passing the search query as a string. |
183 |
//This is why the kohaTables data function is overwritten, to allow passing the search query as a string. |
| 178 |
if (data.search) { |
184 |
if (data.search) { |
| 179 |
dataSet.q = data.search.value; |
185 |
dataSet.q = data.search.value; |
|
Lines 184-190
$(document).ready(function () {
Link Here
|
| 184 |
createdRow: function (row, data, dataIndex) { |
190 |
createdRow: function (row, data, dataIndex) { |
| 185 |
let template = $("#report-details-template")[0]; |
191 |
let template = $("#report-details-template")[0]; |
| 186 |
const clone = document.importNode(template.content, true); |
192 |
const clone = document.importNode(template.content, true); |
| 187 |
//changer id de la row |
|
|
| 188 |
const title = clone.querySelector("span"); |
193 |
const title = clone.querySelector("span"); |
| 189 |
const description = clone.querySelectorAll("td")[1]; |
194 |
const description = clone.querySelectorAll("td")[1]; |
| 190 |
const nbofuser_place = clone.querySelector(".report_info"); |
195 |
const nbofuser_place = clone.querySelector(".report_info"); |
|
Lines 215-220
$(document).ready(function () {
Link Here
|
| 215 |
{ data: "nbofusers" }, |
220 |
{ data: "nbofusers" }, |
| 216 |
{ data: "lastimport" }, |
221 |
{ data: "lastimport" }, |
| 217 |
], |
222 |
], |
|
|
223 |
dom: '<"dt-info"i><"top pager"<"table_entries"lp><"table_controls"fB>>tr<"bottom pager"ip>', |
| 224 |
buttons: [ |
| 225 |
{ |
| 226 |
extend: "collection", |
| 227 |
text: '<i class="fa-solid fa-arrow-down-short-wide" style="margin-right: 5px;"></i>Sort by', |
| 228 |
attr: { id: "sort-by-button" }, |
| 229 |
align: "button-right", |
| 230 |
buttons: [ |
| 231 |
{ |
| 232 |
text: __("Name (A-Z)"), |
| 233 |
action: function (e, dt, node, config) { |
| 234 |
dt.order([1, "asc"]).draw(); |
| 235 |
$(".dt-button-background").trigger("click"); |
| 236 |
}, |
| 237 |
}, |
| 238 |
{ |
| 239 |
text: __("Name (Z-A)"), |
| 240 |
action: function (e, dt, node, config) { |
| 241 |
dt.order([1, "desc"]).draw(); |
| 242 |
$(".dt-button-background").trigger("click"); |
| 243 |
}, |
| 244 |
}, |
| 245 |
{ |
| 246 |
text: __("Date (from newest)"), |
| 247 |
action: function (e, dt, node, config) { |
| 248 |
dt.order([4, "desc"]).draw(); |
| 249 |
$(".dt-button-background").trigger("click"); |
| 250 |
}, |
| 251 |
}, |
| 252 |
{ |
| 253 |
text: __("Date (from oldest)"), |
| 254 |
action: function (e, dt, node, config) { |
| 255 |
dt.order([4, "asc"]).draw(); |
| 256 |
$(".dt-button-background").trigger("click"); |
| 257 |
}, |
| 258 |
}, |
| 259 |
{ |
| 260 |
text: __("Popularity"), |
| 261 |
action: function (e, dt, node, config) { |
| 262 |
dt.order([3, "desc"]).draw(); |
| 263 |
$(".dt-button-background").trigger("click"); |
| 264 |
}, |
| 265 |
}, |
| 266 |
], |
| 267 |
}, |
| 268 |
], |
| 218 |
}); |
269 |
}); |
| 219 |
|
270 |
|
| 220 |
let thead = $("#mana_results_datatable thead"); |
271 |
let thead = $("#mana_results_datatable thead"); |
| 221 |
- |
|
|