I wanted to show all kanban cards that was not updated for a while in another color. So I wrote this script which works great, marking all cards not updated for 30 days in red:
Now I run it via the inspector but would love to add it permanently for all users.
I put it in a file here: /var/www/html/client/custom/js/markoldcards.js
Then I added
to /var/www/html/application/Espo/Resources/metadata/app/jsLibs.json
But nothing seem to happen.
Is there a guide somewhere on how to add custom javascript?
I found this, but I dont really understand it:
https://forum.espocrm.com/forum/deve...tom-javascript
Merry Christmas
Kind regards
Jens
Code:
$("div[data-name=Qualification] .ui-sortable-handle, div[data-name=Proposal] .ui-sortable-handle, div[data-name=Negotiation] .ui-sortable-handle").each(function() {
modifiedAt = $("div[data-name=modifiedAt]", this).text();
date = new Date(modifiedAt);
now = new Date();
if (date.getMonth() <= now.getMonth())
date.setFullYear(now.getFullYear());
else
date.setFullYear(now.getFullYear()-1);
age = (now.getTime() - date.getTime()) / 60 / 60 / 24 / 1000;
if (age > 30)
$(".panel-body", this).css('background-color', '#660000');
})
I put it in a file here: /var/www/html/client/custom/js/markoldcards.js
Then I added
Code:
"markoldcards": {
"path": "client/custom/js/markoldcards.js",
"exportsTo": "window",
"exportsAs": "markoldcards"
}
But nothing seem to happen.
Is there a guide somewhere on how to add custom javascript?
I found this, but I dont really understand it:
https://forum.espocrm.com/forum/deve...tom-javascript
Merry Christmas
Kind regards
Jens

Comment