Fix button to save must be hidden if in readonly mode

This commit is contained in:
Laurent Destailleur 2024-06-09 17:08:19 +02:00
parent 699d5047b1
commit dea7edc22a

View File

@ -94,13 +94,13 @@ if (getDolGlobalString('CRON_DISABLE_KEY_CHANGE')) {
}
print '<td>';
if (!getDolGlobalString('CRON_DISABLE_KEY_CHANGE')) {
print '<input type="text" class="flat minwidth300"'.$disabled.' id="CRON_KEY" name="CRON_KEY" value="'.(GETPOST('CRON_KEY') ? GETPOST('CRON_KEY') : (getDolGlobalString('CRON_KEY') ? $conf->global->CRON_KEY : '')).'">';
print '<input type="text" class="flat minwidth300 widthcentpercentminusx"'.$disabled.' id="CRON_KEY" name="CRON_KEY" value="'.(GETPOST('CRON_KEY') ? GETPOST('CRON_KEY') : getDolGlobalString('CRON_KEY')).'">';
if (!empty($conf->use_javascript_ajax)) {
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
}
} else {
print(getDolGlobalString('CRON_KEY') ? $conf->global->CRON_KEY : '');
print '<input type="hidden" id="CRON_KEY" name="CRON_KEY" value="'.(GETPOST('CRON_KEY') ? GETPOST('CRON_KEY') : (getDolGlobalString('CRON_KEY') ? $conf->global->CRON_KEY : '')).'">';
print getDolGlobalString('CRON_KEY');
print '<input type="hidden" id="CRON_KEY" name="CRON_KEY" value="'.(GETPOST('CRON_KEY') ? GETPOST('CRON_KEY') : getDolGlobalString('CRON_KEY')).'">';
}
print '</td>';
print '<td>&nbsp;</td>';
@ -110,7 +110,9 @@ print '</table>';
print dol_get_fiche_end();
print $form->buttonsSaveCancel("Save", '');
if (!getDolGlobalString('CRON_DISABLE_KEY_CHANGE')) {
print $form->buttonsSaveCancel("Save", '');
}
print '</form>';
@ -119,7 +121,7 @@ print '<br><br><br>';
//print $langs->trans("UseMenuModuleToolsToAddCronJobs", dol_buildpath('/cron/list.php?leftmenu=admintools', 1)).'<br>';
if (getDolGlobalString('CRON_WARNING_DELAY_HOURS')) {
print info_admin($langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS)).'<br>';
print info_admin($langs->trans("WarningCronDelayed", getDolGlobalString('CRON_WARNING_DELAY_HOURS'))).'<br>';
}
print '<br>';