Merge pull request #28897 from frederic34/knowledgerecord

fix knowledgerecord can't set mask
This commit is contained in:
Laurent Destailleur 2024-03-16 16:04:24 +01:00 committed by GitHub
commit cbacbba6e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,10 +77,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconst = GETPOST('maskconst', 'aZ09');
$maskorder = GETPOST('maskorder', 'alpha');
$maskdata = GETPOST('maskKnowledgeRecord', 'alpha');
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskorder, 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, $maskconst, $maskdata, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}
@ -404,11 +404,11 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print '</td>'."\n";
print '<td class="center">';
$constforvar = 'KNOWLEDGEMANAGEMENT_'.strtoupper($myTmpObjectKey).'_ADDON';
$constforvar = 'KNOWLEDGEMANAGEMENT_'.strtoupper($myTmpObjectArray['class']).'_ADDON';
if (getDolGlobalString($constforvar) == $file) {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectArray['class']).'&value='.urlencode($file).'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
}