In some cases you want to hide a point-of-sale menu entry (web or POS app), or restrict the day strip (clock / today / following days / later), even though the user role still grants access.
Prefer roles and abilities first (user rights) in Kronos. Only use a custom script when rights cannot achieve the desired result.
Restrict advance sales (recommended)
To stop certain roles (e.g. cashiers) from selling showtimes too far in the future, the best approach is usually not to hide day tabs, but to configure contingents that forbid advance sales for those roles. Showtimes can stay visible as needed, while selling is actually blocked by business rules — unlike a UI-only hide.
Warning
- A custom script diverges from the standard behaviour and can make support harder.
- Hiding an entry with JavaScript or CSS is not a security measure: it hides the link or button but does not remove access rights. Anyone who knows the URL can still open the page.
Configure custom JavaScript
- Host a
.jsfile over HTTPS (e.g. on your site). - In Kronos → point of sale settings, set the URL in pos.additional_js.
- Reload the POS (on the mobile app: fully quit then reopen).
API TKT_POS_MENU
From the eshop, the script can call:
// Ids: vente | billets | releve_ventes | wallets | accounting
TKT_POS_MENU.hide('billets');
TKT_POS_MENU.show('billets');
The same call updates the web menu and the POS app hamburger menu.
Conditional example (classes already on <body>: user_…, role_…):
if (!document.body.classList.contains('role_admin')
&& !document.body.classList.contains('user_root')) {
TKT_POS_MENU.hide('billets');
TKT_POS_MENU.hide('releve_ventes');
TKT_POS_MENU.hide('wallets');
TKT_POS_MENU.hide('accounting');
}
If every entry is hidden (or fewer than two remain), the hamburger icon disappears in the app; the logo stays.
API TKT_POS_DAY_FILTERS
To restrict the showtime day strip (without CSS display:none):
// Modes: passed | today | weekdays | later
TKT_POS_DAY_FILTERS.hide('weekdays');
TKT_POS_DAY_FILTERS.hide('later');
TKT_POS_DAY_FILTERS.show('weekdays');
passed— clock button (past showtimes)today— todayweekdays— other days in the windowlater— “Later”
Example (cashiers: clock + today only):
if (!document.body.classList.contains('role_admin')
&& !document.body.classList.contains('user_root')) {
TKT_POS_DAY_FILTERS.hide('weekdays');
TKT_POS_DAY_FILTERS.hide('later');
}
Prefer this API over CSS: hidden tabs are not offered, and the “Today” label stays readable on small screens.
Reminder: to forbid advance sales (not just hide days), prefer role-aware contingents.
API TKT_POS_CHROME
To hide UI elements that are not menu entries (e.g. the magic search loupe):
// Keys: magic_search
TKT_POS_CHROME.hide('magic_search');
TKT_POS_CHROME.show('magic_search');
TKT_POS_MENU only covers navbar / hamburger menu ids. The loupe is not one of them: use TKT_POS_CHROME instead of CSS display:none.