From cd0b8ceab5911d3e8f8f4ed134751ce7fd6da3ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Jan 2026 16:21:35 +0100 Subject: [PATCH] Debug v23 --- htdocs/core/lib/ajax.lib.php | 17 +++++++++++++---- htdocs/website/index.php | 23 +++++++++++++---------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 68923e65fec..2133155550b 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -782,10 +782,11 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof * @param string $htmlname Name of HTML component. Keep '' or use a different value if you need to use this component several time on the same page for the same field. * @param int $forcenojs Force the component to work as link post (without javascript) instead of ajax call * @param string $moreparam When $forcenojs=1 then we can add more parameters to the backtopage URL. String must url encoded. Example: 'abc=def&fgh=ijk' + * @param int $readonly Use 1 if button not allowed. * @return string html for button on/off * @see ajax_constantonoff() to update that value of a constant */ -function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input = array(), $morecss = '', $htmlname = '', $forcenojs = 0, $moreparam = '') +function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input = array(), $morecss = '', $htmlname = '', $forcenojs = 0, $moreparam = '', $readonly = 0) { global $conf, $langs; @@ -795,7 +796,7 @@ function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input = $out = ''; - if (!empty($conf->use_javascript_ajax) && empty($forcenojs)) { + if (!empty($conf->use_javascript_ajax) && empty($forcenojs) && empty($readonly)) { $out .= '