|
Lines 306-357
Link Here
|
| 306 |
let status = ""; |
306 |
let status = ""; |
| 307 |
let priority = ""; |
307 |
let priority = ""; |
| 308 |
|
308 |
|
| 309 |
if (!row._status) row._status = []; |
309 |
if (!row._status) return; |
| 310 |
|
310 |
|
| 311 |
if (row.withdrawn != 0) { |
311 |
if (row.withdrawn != 0) { |
| 312 |
status = _("Withdrawn"); |
312 |
status = av_withdrawn.get(row.withdrawn.toString()) || _("Withdrawn"); |
| 313 |
priority = "10"; |
313 |
priority = "11"; |
| 314 |
} else if (row.lost_status != 0) { |
314 |
} |
|
|
315 |
else if (row.lost_status != 0) { |
| 315 |
let lost_text = av_lost.get(row.lost_status.toString()) || _("Lost"); |
316 |
let lost_text = av_lost.get(row.lost_status.toString()) || _("Lost"); |
| 316 |
status = lost_text; |
317 |
status = lost_text; |
| 317 |
if (forSort) { |
318 |
if (forSort) { |
| 318 |
if (lost_text.toLowerCase().includes("paid")) priority = "09c"; |
319 |
if (lost_text.toLowerCase().includes("paid")) priority = "10c"; |
| 319 |
else if (lost_text.toLowerCase().includes("overdue")) priority = "09b"; |
320 |
else if (lost_text.toLowerCase().includes("overdue")) priority = "10b"; |
| 320 |
else priority = "09a"; |
321 |
else priority = "10a"; |
| 321 |
} else { |
322 |
} else { |
| 322 |
priority = "09"; |
323 |
priority = "10"; |
| 323 |
} |
324 |
} |
| 324 |
} |
325 |
} |
| 325 |
else if (row.damaged_status != 0) { |
326 |
else if (row.restricted_status != null && row.restricted_status != 0) { |
| 326 |
status = _("Damaged"); |
327 |
status = av_restricted.get(row.restricted_status.toString()) || _("Restricted access"); |
|
|
328 |
priority = "09"; |
| 329 |
} |
| 330 |
else if (row.damaged_status != 0) { |
| 331 |
status = av_damaged.get(row.damaged_status.toString()) || _("Damaged"); |
| 327 |
priority = "08"; |
332 |
priority = "08"; |
| 328 |
} |
333 |
} |
| 329 |
else if (row.not_for_loan_status == 3) { |
334 |
else if (row.not_for_loan_status == 3) { |
| 330 |
status = _("In bundle"); |
335 |
status = _("In bundle"); |
| 331 |
priority = "07"; |
336 |
priority = "07"; |
| 332 |
} else if (row.not_for_loan_status != 0) { |
337 |
} |
| 333 |
status = _("Not for loan"); |
338 |
else if (row.not_for_loan_status != 0) { |
|
|
339 |
status = av_not_for_loan.get(row.not_for_loan_status.toString()) || _("Not for loan"); |
| 334 |
priority = "06"; |
340 |
priority = "06"; |
| 335 |
} |
341 |
} |
| 336 |
else if (row._status.includes('local_use')) { |
342 |
else if (row._status.includes('local_use')) { |
| 337 |
status = _("Local use"); |
343 |
status = _("Local use"); |
| 338 |
priority = "05"; |
344 |
priority = "05"; |
| 339 |
} |
345 |
} |
|
|
346 |
else if (row._status.includes('recalled')) { |
| 347 |
status = _("Recalled"); |
| 348 |
priority = "04"; |
| 349 |
} |
| 340 |
else if (row._status.includes('checked_out')) { |
350 |
else if (row._status.includes('checked_out')) { |
| 341 |
status = _("Checked out"); |
351 |
status = _("Checked out"); |
| 342 |
priority = "04"; |
352 |
priority = "03"; |
| 343 |
} |
353 |
} |
| 344 |
else if (row._status.includes('in_transit')) { |
354 |
else if (row._status.includes('in_transit')) { |
| 345 |
status = _("In transit"); |
355 |
status = _("In transit"); |
| 346 |
priority = "03"; |
356 |
priority = "02"; |
| 347 |
} |
357 |
} |
| 348 |
else if (row._status.includes('on_hold') || row._status.includes('waiting')) { |
358 |
else if (row._status.includes('on_hold') || row._status.includes('waiting')) { |
| 349 |
status = _("On hold"); |
359 |
status = _("On hold"); |
| 350 |
priority = "02"; |
360 |
priority = "01"; |
| 351 |
} |
361 |
} |
| 352 |
else if (row._status.includes('available') || (row.lost_status == 0 && row.withdrawn == 0)) { |
362 |
else if (row._status.includes('available') |
|
|
363 |
|| (row.lost_status == 0 && row.withdrawn == 0) |
| 364 |
&& (row.restricted_status == null || row.restricted_status == 0)) { |
| 353 |
status = _("Available"); |
365 |
status = _("Available"); |
| 354 |
priority = "01"; |
366 |
priority = "00"; |
| 355 |
} |
367 |
} |
| 356 |
else { |
368 |
else { |
| 357 |
status = _("Undefined"); |
369 |
status = _("Undefined"); |
|
Lines 361-368
Link Here
|
| 361 |
status = status.trim(); |
373 |
status = status.trim(); |
| 362 |
|
374 |
|
| 363 |
if (forSort) { |
375 |
if (forSort) { |
| 364 |
if (priority.startsWith("09")) { |
376 |
if (priority.startsWith("10")) { |
| 365 |
return "09_" + _("Lost"); |
377 |
return "10_" + _("Lost"); |
| 366 |
} |
378 |
} |
| 367 |
return priority + "_" + status; |
379 |
return priority + "_" + status; |
| 368 |
} |
380 |
} |
|
Lines 391-399
Link Here
|
| 391 |
|
403 |
|
| 392 |
let groupColor = "#007bff"; |
404 |
let groupColor = "#007bff"; |
| 393 |
|
405 |
|
| 394 |
if (group.startsWith("01")) { |
406 |
if (group.startsWith("00")) { |
| 395 |
groupColor = "#28a745"; |
407 |
groupColor = "#28a745"; |
| 396 |
} else if (group.startsWith("08") || group.startsWith("09") || group.startsWith("10")) { |
408 |
}else if (group.startsWith("08") || group.startsWith("09")){ |
|
|
409 |
groupColor = "#FFEB3B"; |
| 410 |
}else if (group.startsWith("10") || group.startsWith("11")) { |
| 397 |
groupColor = "#dc3545"; |
411 |
groupColor = "#dc3545"; |
| 398 |
} |
412 |
} |
| 399 |
|
413 |
|
|
Lines 634-642
Link Here
|
| 634 |
searchable: false, |
648 |
searchable: false, |
| 635 |
orderable: false, |
649 |
orderable: false, |
| 636 |
render: function (data, type, row, meta) { |
650 |
render: function (data, type, row, meta) { |
| 637 |
if (type === 'sort' || type === 'filter' || type === 'type') { |
|
|
| 638 |
return get_display_status(row, true); |
| 639 |
} |
| 640 |
let nodes = ""; |
651 |
let nodes = ""; |
| 641 |
row._status.forEach( status => { |
652 |
row._status.forEach( status => { |
| 642 |
if ( status == 'checked_out' || status == 'local_use') { |
653 |
if ( status == 'checked_out' || status == 'local_use') { |
| 643 |
- |
|
|