Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2023-01-04 15:38:57 +01:00
commit 566fb52fb8
42 changed files with 164 additions and 117 deletions

View File

@ -51,10 +51,10 @@ $type = 'bom';
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstbom = GETPOST('maskconstBom', 'alpha');
$maskconstbom = GETPOST('maskconstBom', 'aZ09');
$maskbom = GETPOST('maskBom', 'alpha');
if ($maskconstbom) {
if ($maskconstbom && preg_match('/_MASK$/', $maskconstbom)) {
$res = dolibarr_set_const($db, $maskconstbom, $maskbom, 'chaine', 0, '', $conf->entity);
}

View File

@ -54,9 +54,9 @@ if (empty($conf->global->CHEQUERECEIPTS_ADDON)) {
*/
if ($action == 'updateMask') {
$maskconstchequereceipts = GETPOST('maskconstchequereceipts', 'alpha');
$maskconstchequereceipts = GETPOST('maskconstchequereceipts', 'aZ09');
$maskchequereceipts = GETPOST('maskchequereceipts', 'alpha');
if ($maskconstchequereceipts) {
if ($maskconstchequereceipts && preg_match('/_MASK$/', $maskconstchequereceipts)) {
$res = dolibarr_set_const($db, $maskconstchequereceipts, $maskchequereceipts, 'chaine', 0, '', $conf->entity);
}

View File

@ -61,10 +61,10 @@ $type = 'order';
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstorder = GETPOST('maskconstorder', 'alpha');
$maskconstorder = GETPOST('maskconstorder', 'aZ09');
$maskorder = GETPOST('maskorder', 'alpha');
if ($maskconstorder) {
if ($maskconstorder && preg_match('/_MASK$/', $maskconstorder)) {
$res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity);
}

View File

@ -58,9 +58,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
$error=0;
if ($action == 'updateMask') {
$maskconst = GETPOST('maskconstcontract', 'alpha');
$maskconst = GETPOST('maskconstcontract', 'aZ09');
$maskvalue = GETPOST('maskcontract', 'alpha');
if ($maskconst) {
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
}

View File

@ -90,9 +90,9 @@ if ($action == 'activate_delivery') {
}
if ($action == 'updateMask') {
$maskconstdelivery = GETPOST('maskconstdelivery', 'alpha');
$maskconstdelivery = GETPOST('maskconstdelivery', 'aZ09');
$maskdelivery = GETPOST('maskdelivery', 'alpha');
if ($maskconstdelivery) {
if ($maskconstdelivery && preg_match('/_MASK$/', $maskconstdelivery)) {
$res = dolibarr_set_const($db, $maskconstdelivery, $maskdelivery, 'chaine', 0, '', $conf->entity);
}

View File

@ -86,10 +86,10 @@ if ($cancel) {
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstorder = GETPOST('maskconstorder', 'alpha');
$maskconstorder = GETPOST('maskconstorder', 'aZ09');
$maskorder = GETPOST('maskorder', 'alpha');
if ($maskconstorder) {
if ($maskconstorder && preg_match('/_MASK$/', $maskconstorder)) {
$res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;

View File

@ -62,9 +62,9 @@ if (empty($conf->global->EXPEDITION_ADDON_NUMBER)) {
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconst = GETPOST('maskconstexpedition', 'alpha');
$maskconst = GETPOST('maskconstexpedition', 'aZ09');
$maskvalue = GETPOST('maskexpedition', 'alpha');
if (!empty($maskconst)) {
if (!empty($maskconst) && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
}

View File

@ -58,9 +58,9 @@ $type = 'expensereport';
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconst = GETPOST('maskconst', 'alpha');
$maskconst = GETPOST('maskconst', 'aZ09');
$maskvalue = GETPOST('maskvalue', 'alpha');
if ($maskconst) {
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
}

View File

@ -58,24 +58,24 @@ $type = 'invoice';
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstinvoice = GETPOST('maskconstinvoice', 'alpha');
$maskconstreplacement = GETPOST('maskconstreplacement', 'alpha');
$maskconstcredit = GETPOST('maskconstcredit', 'alpha');
$maskconstdeposit = GETPOST('maskconstdeposit', 'alpha');
$maskconstinvoice = GETPOST('maskconstinvoice', 'aZ09');
$maskconstreplacement = GETPOST('maskconstreplacement', 'aZ09');
$maskconstcredit = GETPOST('maskconstcredit', 'aZ09');
$maskconstdeposit = GETPOST('maskconstdeposit', 'aZ09');
$maskinvoice = GETPOST('maskinvoice', 'alpha');
$maskreplacement = GETPOST('maskreplacement', 'alpha');
$maskcredit = GETPOST('maskcredit', 'alpha');
$maskdeposit = GETPOST('maskdeposit', 'alpha');
if ($maskconstinvoice) {
if ($maskconstinvoice && preg_match('/_MASK_/', $maskconstinvoice)) {
$res = dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 'chaine', 0, '', $conf->entity);
}
if ($maskconstreplacement) {
if ($maskconstreplacement && preg_match('/_MASK_/', $maskconstreplacement)) {
$res = dolibarr_set_const($db, $maskconstreplacement, $maskreplacement, 'chaine', 0, '', $conf->entity);
}
if ($maskconstcredit) {
if ($maskconstcredit && preg_match('/_MASK_/', $maskconstcredit)) {
$res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity);
}
if ($maskconstdeposit) {
if ($maskconstdeposit && preg_match('/_MASK_/', $maskconstdeposit)) {
$res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity);
}

View File

@ -58,9 +58,9 @@ $type = 'ficheinter';
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconst = GETPOST('maskconst', 'alpha');
$maskconst = GETPOST('maskconst', 'aZ09');
$maskvalue = GETPOST('maskvalue', 'alpha');
if ($maskconst) {
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
}

View File

@ -58,9 +58,9 @@ if (empty($conf->global->HOLIDAY_ADDON)) {
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconst = GETPOST('maskconstholiday', 'alpha');
$maskconst = GETPOST('maskconstholiday', 'aZ09');
$maskvalue = GETPOST('maskholiday', 'alpha');
if ($maskconst) {
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
}

View File

@ -53,7 +53,7 @@ $label = GETPOST('label', 'alpha');
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
$scandir = GETPOST('scan_dir', 'alpha');
$type = 'myobject';
$type = 'evaluation';
$arrayofparameters = array(
'HRM_MAXRANK'=>array('type'=>'integer','enabled'=>1),
@ -89,11 +89,11 @@ if ($action == 'update') {
}
}
} elseif ($action == 'updateMask') {
$maskconstorder = GETPOST('maskconstorder', 'alpha');
$maskorder = GETPOST('maskorder', 'alpha');
$maskconst = GETPOST('maskconstEvaluation', 'aZ09');
$maskvalue = GETPOST('maskEvaluation', 'alpha');
if ($maskconstorder) {
$res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity);
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}
@ -208,10 +208,10 @@ print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "hrm"
$moduledir = 'hrm';
$myTmpObjects = array();
$myTmpObjects['evaluation'] = array('includerefgeneration'=>1, 'includedocgeneration'=>0);
$myTmpObjects['evaluation'] = array('label'=>'Evaluation', 'includerefgeneration'=>1, 'includedocgeneration'=>0);
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($myTmpObjectKey == 'MyObject') {
if ($myTmpObjectKey != $type) {
continue;
}
if ($myTmpObjectArray['includerefgeneration']) {
@ -220,7 +220,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
*/
$setupnotempty++;
print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', '');
print load_fiche_titre($langs->trans("NumberingModules").' ('.$myTmpObjectArray['label'].')', '', '');
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';

View File

@ -69,11 +69,11 @@ if (!$user->admin) {
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstorder = GETPOST('maskconstorder', 'alpha');
$maskconst = GETPOST('maskconst', 'aZ09');
$maskorder = GETPOST('maskorder', 'alpha');
if ($maskconstorder) {
$res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity);
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskorder, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}

View File

@ -52,10 +52,10 @@ $type = 'mrp';
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstmrp = GETPOST('maskconstMo', 'alpha');
$maskconstmrp = GETPOST('maskconstMo', 'aZ09');
$maskmrp = GETPOST('maskMo', 'alpha');
if ($maskconstmrp) {
if ($maskconstmrp && preg_match('/_MASK$/', $maskconstmrp)) {
$res = dolibarr_set_const($db, $maskconstmrp, $maskmrp, 'chaine', 0, '', $conf->entity);
}

View File

@ -51,9 +51,9 @@ if (empty($conf->global->PAYMENT_ADDON)) {
*/
if ($action == 'updateMask') {
$maskconstpayment = GETPOST('maskconstpayment', 'alpha');
$maskconstpayment = GETPOST('maskconstpayment', 'aZ09');
$maskpayment = GETPOST('maskpayment', 'alpha');
if ($maskconstpayment) {
if ($maskconstpayment && preg_match('/_MASK$/', $maskconstpayment)) {
$res = dolibarr_set_const($db, $maskconstpayment, $maskpayment, 'chaine', 0, '', $conf->entity);
}

View File

@ -58,9 +58,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
$error = 0;
if ($action == 'updateMask') {
$maskconstpropal = GETPOST('maskconstpropal', 'alpha');
$maskconstpropal = GETPOST('maskconstpropal', 'aZ09');
$maskpropal = GETPOST('maskpropal', 'alpha');
if ($maskconstpropal) {
if ($maskconstpropal && preg_match('/_MASK$/', $maskconstpropal)) {
$res = dolibarr_set_const($db, $maskconstpropal, $maskpropal, 'chaine', 0, '', $conf->entity);
}

View File

@ -65,9 +65,9 @@ if (empty($conf->global->RECEPTION_ADDON_NUMBER)) {
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconst = GETPOST('maskconstreception', 'alpha');
$maskconst = GETPOST('maskconstreception', 'aZ09');
$maskvalue = GETPOST('maskreception', 'alpha');
if (!empty($maskconst)) {
if (!empty($maskconst) && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
}

View File

@ -64,10 +64,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconststocktransfer = GETPOST('maskconststocktransfer', 'alpha');
$maskconststocktransfer = GETPOST('maskconststocktransfer', 'aZ09');
$maskstocktransfer = GETPOST('maskStockTransfer', 'alpha');
if ($maskconststocktransfer) {
if ($maskconststocktransfer && preg_match('/_MASK$/', $maskconststocktransfer)) {
$res = dolibarr_set_const($db, $maskconststocktransfer, $maskstocktransfer, 'chaine', 0, '', $conf->entity);
if ($res <= 0) $error++;
}

View File

@ -38,10 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "other", "orders"));
if (!$user->admin) {
accessforbidden();
}
$type = GETPOST('type', 'alpha');
$value = GETPOST('value', 'alpha');
$action = GETPOST('action', 'aZ09');
@ -52,6 +48,12 @@ $scandir = GETPOST('scan_dir', 'alpha');
$specimenthirdparty = new Societe($db);
$specimenthirdparty->initAsSpecimen();
$error = 0;
if (!$user->admin) {
accessforbidden();
}
/*
* Actions
@ -60,20 +62,20 @@ $specimenthirdparty->initAsSpecimen();
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstinvoice = GETPOST('maskconstinvoice', 'alpha');
$maskconstcredit = GETPOST('maskconstcredit', 'alpha');
$maskconstdeposit = GETPOST('maskconstdeposit', 'alpha');
$maskconstinvoice = GETPOST('maskconstinvoice', 'aZ09');
$maskconstcredit = GETPOST('maskconstcredit', 'aZ09');
$maskconstdeposit = GETPOST('maskconstdeposit', 'aZ09');
$maskinvoice = GETPOST('maskinvoice', 'alpha');
$maskcredit = GETPOST('maskcredit', 'alpha');
$maskdeposit = GETPOST('maskdeposit', 'alpha');
if ($maskconstinvoice) {
if ($maskconstinvoice && preg_match('/_MASK$/', $maskconstinvoice)) {
$res = dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 'chaine', 0, '', $conf->entity);
}
if ($maskconstcredit) {
if ($maskconstcredit && preg_match('/_MASK$/', $maskconstcredit)) {
$res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity);
}
if ($maskconstdeposit) {
if ($maskconstdeposit && preg_match('/_MASK$/', $maskconstdeposit)) {
$res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity);
}

View File

@ -61,10 +61,10 @@ $specimenthirdparty->initAsSpecimen();
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstorder = GETPOST('maskconstorder', 'alpha');
$maskconstorder = GETPOST('maskconstorder', 'aZ09');
$maskvalue = GETPOST('maskorder', 'alpha');
if ($maskconstorder) {
if ($maskconstorder && preg_match('/_MASK$/', $maskconstorder)) {
$res = dolibarr_set_const($db, $maskconstorder, $maskvalue, 'chaine', 0, '', $conf->entity);
}

View File

@ -52,9 +52,9 @@ $type = 'supplier_payment';
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstsupplierpayment = GETPOST('maskconstsupplierpayment', 'alpha');
$maskconstsupplierpayment = GETPOST('maskconstsupplierpayment', 'aZ09');
$masksupplierpayment = GETPOST('masksupplierpayment', 'alpha');
if ($maskconstsupplierpayment) {
if ($maskconstsupplierpayment && preg_match('/_MASK$/', $maskconstsupplierpayment)) {
$res = dolibarr_set_const($db, $maskconstsupplierpayment, $masksupplierpayment, 'chaine', 0, '', $conf->entity);
}

View File

@ -55,9 +55,9 @@ $error = 0;
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstsupplier_proposal = GETPOST('maskconstsupplier_proposal', 'alpha');
$maskconstsupplier_proposal = GETPOST('maskconstsupplier_proposal', 'aZ09');
$masksupplier_proposal = GETPOST('masksupplier_proposal', 'alpha');
if ($maskconstsupplier_proposal) {
if ($maskconstsupplier_proposal && preg_match('/_MASK$/', $maskconstsupplier_proposal)) {
$res = dolibarr_set_const($db, $maskconstsupplier_proposal, $masksupplier_proposal, 'chaine', 0, '', $conf->entity);
}

View File

@ -47,7 +47,7 @@ $scandir = GETPOST('scandir', 'alpha');
$type = 'ticket';
$error = 0;
$reg = array();
/*
* Actions
@ -56,10 +56,10 @@ $error = 0;
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstticket = GETPOST('maskconstticket', 'alpha');
$maskconstticket = GETPOST('maskconstticket', 'aZ09');
$maskticket = GETPOST('maskticket', 'alpha');
if ($maskconstticket) {
if ($maskconstticket && preg_match('/_MASK$/', $maskconstticket)) {
$res = dolibarr_set_const($db, $maskconstticket, $maskticket, 'chaine', 0, '', $conf->entity);
}
@ -484,7 +484,7 @@ foreach ($dirmodels as $reldir) {
// Preview
print '<td class="center">';
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
@ -526,7 +526,7 @@ if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $formcategory->selectarray("TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND", $arrval, $conf->global->TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND);
print $formcategory->selectarray("TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND", $arrval, getDolGlobalString('TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND'));
}
print '</td>';
print '<td class="center">';
@ -542,7 +542,7 @@ if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_AUTO_ASSIGN_USER_CREATE');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $formcategory->selectarray("TICKET_AUTO_ASSIGN_USER_CREATE", $arrval, $conf->global->TICKET_AUTO_ASSIGN_USER_CREATE);
print $formcategory->selectarray("TICKET_AUTO_ASSIGN_USER_CREATE", $arrval, getDolGlobalString('TICKET_AUTO_ASSIGN_USER_CREATE'));
}
print '</td>';
print '<td class="center">';
@ -557,7 +557,7 @@ if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_NOTIFY_AT_CLOSING');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $formcategory->selectarray("TICKET_NOTIFY_AT_CLOSING", $arrval, $conf->global->TICKET_NOTIFY_AT_CLOSING);
print $formcategory->selectarray("TICKET_NOTIFY_AT_CLOSING", $arrval, getDolGlobalString('TICKET_NOTIFY_AT_CLOSING'));
}
print '</td>';
print '<td class="center">';
@ -569,7 +569,7 @@ if (isModEnabled('product')) {
$htmlname = "product_category_id";
print '<tr class="oddeven"><td>'.$langs->trans("TicketChooseProductCategory").'</td>';
print '<td class="left">';
$formcategory->selectProductCategory($conf->global->TICKET_PRODUCT_CATEGORY, $htmlname);
$formcategory->selectProductCategory(getDolGlobalString('TICKET_PRODUCT_CATEGORY'), $htmlname);
if ($conf->use_javascript_ajax) {
print ajax_combobox('select_'.$htmlname);
}
@ -583,7 +583,7 @@ if (isModEnabled('product')) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("TicketsDelayBeforeFirstAnswer")."</td>";
print '<td class="left">
<input type="number" value="'.$conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE.'" name="delay_first_response" class="width50">
<input type="number" value="'.getDolGlobalString('TICKET_DELAY_BEFORE_FIRST_RESPONSE').'" name="delay_first_response" class="width50">
</td>';
print '<td class="center">';
print $formcategory->textwithpicto('', $langs->trans("TicketsDelayBeforeFirstAnswerHelp"), 1, 'help');
@ -593,7 +593,7 @@ print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("TicketsDelayBetweenAnswers")."</td>";
print '<td class="left">
<input type="number" value="'.$conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE.'" name="delay_between_responses" class="width50">
<input type="number" value="'.getDolGlobalString('TICKET_DELAY_SINCE_LAST_RESPONSE').'" name="delay_between_responses" class="width50">
</td>';
print '<td class="center">';
print $formcategory->textwithpicto('', $langs->trans("TicketsDelayBetweenAnswersHelp"), 1, 'help');

View File

@ -150,10 +150,10 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconst = GETPOST('maskconst', 'alpha');
$maskconst = GETPOST('maskconst', 'aZ09');
$maskvalue = GETPOST('maskvalue', 'alpha');
if ($maskconst) {
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;

View File

@ -63,11 +63,11 @@ if (!$user->admin) {
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstorder = GETPOST('maskconstWorkstation', 'alpha');
$maskconst = GETPOST('maskconstWorkstation', 'aZ09');
$maskorder = GETPOST('maskWorkstation', 'alpha');
if ($maskconstorder) {
$res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity);
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskorder, 'chaine', 0, '', $conf->entity);
}
if (!($res > 0)) {

View File

@ -74,7 +74,7 @@ if ($action == 'updateMask') {
$maskconst = GETPOST('maskconst', 'alpha');
$mask = GETPOST('mask', 'alpha');
if ($maskconst) {
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $mask, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;

View File

@ -153,10 +153,10 @@ if ( versioncompare(explode('.', DOL_VERSION), array(15)) < 0 && $action == 'upd
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconst = GETPOST('maskconst', 'alpha');
$maskconst = GETPOST('maskconst', 'aZ09');
$maskvalue = GETPOST('maskvalue', 'alpha');
if ($maskconst) {
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;

View File

@ -324,7 +324,7 @@ if ($modecompta == 'CREANCES-DETTES') {
}
if ($selected_cat === -2) { // Without any category
$sql .= " AND cp.fk_product is null";
} elseif ($selected_cat) { // Into a specific category
} elseif ($selected_cat > 0) { // Into a specific category
if ($subcat) {
$TListOfCats = $categorie->get_full_arbo('product', $selected_cat, 1);

View File

@ -73,6 +73,7 @@ $search_firstlast_only = GETPOST("search_firstlast_only", 'alpha');
$search_lastname = GETPOST("search_lastname", 'alpha');
$search_firstname = GETPOST("search_firstname", 'alpha');
$search_societe = GETPOST("search_societe", 'alpha');
$search_societe_alias = GETPOST("search_societe_alias", 'alpha');
$search_poste = GETPOST("search_poste", 'alpha');
$search_phone_perso = GETPOST("search_phone_perso", 'alpha');
$search_phone_pro = GETPOST("search_phone_pro", 'alpha');
@ -193,6 +194,7 @@ foreach ($object->fields as $key => $val) {
// Add none object fields for "search in all"
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
$fieldstosearchall['s.nom'] = "ThirdParty";
$fieldstosearchall['s.name_alias'] = "AliasNames";
}
// Definition of fields for list
@ -214,6 +216,7 @@ foreach ($object->fields as $key => $val) {
$arrayfields['country.code_iso'] = array('label'=>"Country", 'position'=>66, 'checked'=>0);
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
$arrayfields['s.nom'] = array('label'=>"ThirdParty", 'position'=>113, 'checked'=> 1);
$arrayfields['s.name_alias'] = array('label'=>"AliasNameShort", 'position'=>114, 'checked'=> 1);
}
$arrayfields['unsubscribed'] = array(
@ -278,6 +281,7 @@ if (empty($reshook)) {
$search_lastname = "";
$search_firstname = "";
$search_societe = "";
$search_societe_alias = "";
$search_town = "";
$search_address = "";
$search_zip = "";
@ -373,7 +377,7 @@ if ($resql) {
dol_print_error($db);
}
$sql = "SELECT s.rowid as socid, s.nom as name,";
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias as alias,";
$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email,";
$sql .= " p.socialnetworks, p.photo,";
$sql .= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,";
@ -545,8 +549,15 @@ if ($search_lastname) {
if ($search_firstname) {
$sql .= natural_search('p.firstname', $search_firstname);
}
if ($search_societe) {
$sql .= natural_search(empty($conf->global->SOCIETE_DISABLE_CONTACTS) ? 's.nom' : 'p.fk_soc', $search_societe);
if (empty($arrayfields['s.name_alias']['checked']) && $search_societe) {
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_societe);
} else {
if ($search_societe) {
$sql .= natural_search('s.nom', $search_societe);
}
if ($search_societe_alias) {
$sql .= natural_search('s.name_alias', $search_societe_alias);
}
}
if ($search_country) {
$sql .= " AND p.fk_pays IN (".$db->sanitize($search_country).')';
@ -677,6 +688,9 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && (
exit;
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas';
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');
@ -716,6 +730,9 @@ if ($search_firstname != '') {
if ($search_societe != '') {
$param .= '&search_societe='.urlencode($search_societe);
}
if ($search_societe_alias != '') {
$param .= '&search_societe_alias='.urlencode($search_societe_alias);
}
if ($search_address != '') {
$param .= '&search_address='.urlencode($search_address);
}
@ -993,6 +1010,12 @@ if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom'][
print '<input class="flat" type="text" name="search_societe" size="8" value="'.dol_escape_htmltag($search_societe).'">';
print '</td>';
}
// Alias
if (!empty($arrayfields['s.name_alias']['checked'])) {
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth100" type="text" name="search_societe_alias" value="'.dol_escape_htmltag($search_societe_alias).'">';
print '</td>';
}
if (!empty($arrayfields['p.priv']['checked'])) {
print '<td class="liste_titre center">';
$selectarray = array('0'=>$langs->trans("ContactPublic"), '1'=>$langs->trans("ContactPrivate"));
@ -1114,6 +1137,9 @@ if (!empty($arrayfields['p.fk_soc']['checked'])) {
if (!empty($arrayfields['s.nom']['checked'])) {
print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", $begin, $param, '', $sortfield, $sortorder);
}
if (!empty($arrayfields['s.name_alias']['checked'])) {
print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], "s.name_alias", $begin, $param, '', $sortfield, $sortorder);
}
if (!empty($arrayfields['p.priv']['checked'])) {
print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, '', $sortfield, $sortorder, 'center ');
}
@ -1357,6 +1383,16 @@ while ($i < min($num, $limit)) {
}
}
// Alias name
if (!empty($arrayfields['s.name_alias']['checked'])) {
print '<td class="nocellnopadd">';
print dol_escape_htmltag($obj->alias);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Private/Public
if (!empty($arrayfields['p.priv']['checked'])) {
print '<td class="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>';

View File

@ -68,7 +68,7 @@ class mod_evaluation_advanced extends ModeleNumRefEvaluation
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
$texte .= '<input type="hidden" name="action" value="updateMask">';
$texte .= '<input type="hidden" name="maskconstBom" value="HRM_EVALUATION_ADVANCED_MASK">';
$texte .= '<input type="hidden" name="maskconstEvaluation" value="HRM_EVALUATION_ADVANCED_MASK">';
$texte .= '<table class="nobordernopadding" width="100%">';
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Evaluation"), $langs->transnoentities("Evaluation"));

View File

@ -122,7 +122,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket
// List of directories area
$texte .= '<tr><td>';
$texttitle = $langs->trans("ListOfDirectories");
$listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->TICKET_ADDON_PDF_ODT_PATH)));
$listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString('TICKET_ADDON_PDF_ODT_PATH'))));
$listoffiles = array();
foreach ($listofdir as $key => $tmpdir) {
$tmpdir = trim($tmpdir);
@ -148,7 +148,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket
$texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1);
$texte .= '<div><div style="display: inline-block; min-width: 100px; vertical-align: middle;">';
$texte .= '<textarea class="flat" cols="60" name="value1">';
$texte .= $conf->global->TICKET_ADDON_PDF_ODT_PATH;
$texte .= getDolGlobalString('TICKET_ADDON_PDF_ODT_PATH');
$texte .= '</textarea>';
$texte .= '</div><div style="display: inline-block; vertical-align: middle;">';
$texte .= '<input type="submit" class="button small reposition" name="modify" value="'.$langs->trans("Modify").'">';

View File

@ -68,7 +68,7 @@ class mod_knowledgerecord_advanced extends ModeleNumRefKnowledgeRecord
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
$texte .= '<input type="hidden" name="action" value="updateMask">';
$texte .= '<input type="hidden" name="maskconstBom" value="KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADVANCED_MASK">';
$texte .= '<input type="hidden" name="maskconst" value="KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADVANCED_MASK">';
$texte .= '<table class="nobordernopadding" width="100%">';
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("KnowledgeRecord"), $langs->transnoentities("KnowledgeRecord"));

View File

@ -181,10 +181,10 @@ if ( versioncompare(explode('.', DOL_VERSION), array(15)) < 0 && $action == 'upd
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconst = GETPOST('maskconst', 'alpha');
$maskconst = GETPOST('maskconst', 'aZ09');
$maskvalue = GETPOST('maskvalue', 'alpha');
if ($maskconst) {
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
@ -318,11 +318,12 @@ if ($action == 'edit') {
$moduledir = 'mymodule';
$myTmpObjects = array();
$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
// TODO Scan list of objects
$myTmpObjects['myobject'] = array('label'=>'MyObject', 'includerefgeneration'=>0, 'includedocgeneration'=>0);
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($myTmpObjectKey == 'MyObject') {
if ($myTmpObjectKey != $type) {
continue;
}
if ($myTmpObjectArray['includerefgeneration']) {
@ -331,7 +332,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
*/
$setupnotempty++;
print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', '');
print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectArray['label']), '', '');
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';

View File

@ -68,7 +68,7 @@ class mod_partnership_advanced extends ModeleNumRefPartnership
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
$texte .= '<input type="hidden" name="action" value="updateMask">';
$texte .= '<input type="hidden" name="maskconstBom" value="PARTNERSHIP_ADVANCED_MASK">';
$texte .= '<input type="hidden" name="maskconst" value="PARTNERSHIP_ADVANCED_MASK">';
$texte .= '<table class="nobordernopadding" width="100%">';
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Partnership"), $langs->transnoentities("Partnership"));

View File

@ -47,10 +47,10 @@ $error = 0;
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMaskLot') {
$maskconstbatch = GETPOST('maskconstLot', 'alpha');
$maskconstbatch = GETPOST('maskconstLot', 'aZ09');
$maskbatch = GETPOST('maskLot', 'alpha');
if ($maskconstbatch) {
if ($maskconstbatch && preg_match('/_MASK$/', $maskconstbatch)) {
$res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity);
if ($res <= 0) $error++;
}
@ -61,10 +61,10 @@ if ($action == 'updateMaskLot') {
setEventMessages($langs->trans("Error"), null, 'errors');
}
} elseif ($action == 'updateMaskSN') {
$maskconstbatch = GETPOST('maskconstSN', 'alpha');
$maskconstbatch = GETPOST('maskconstSN', 'aZ09');
$maskbatch = GETPOST('maskSN', 'alpha');
if ($maskconstbatch) {
if ($maskconstbatch && preg_match('/_MASK$/', $maskconstbatch)) {
$res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity);
if ($res <= 0) $error++;
}

View File

@ -1463,6 +1463,14 @@ class Product extends CommonObject
}
}
// Delete record into ECM index and physically
if (!$error) {
$res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive
if (!$res) {
$error++;
}
}
if (!$error) {
// We remove directory
$ref = dol_sanitizeFileName($this->ref);

View File

@ -55,10 +55,10 @@ $type = 'project';
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstproject = GETPOST('maskconstproject', 'alpha');
$maskconstproject = GETPOST('maskconstproject', 'aZ09');
$maskproject = GETPOST('maskproject', 'alpha');
if ($maskconstproject) {
if ($maskconstproject && preg_match('/_MASK$/', $maskconstproject)) {
$res = dolibarr_set_const($db, $maskconstproject, $maskproject, 'chaine', 0, '', $conf->entity);
}
@ -74,10 +74,10 @@ if ($action == 'updateMask') {
}
if ($action == 'updateMaskTask') {
$maskconstmasktask = GETPOST('maskconsttask', 'alpha');
$maskconstmasktask = GETPOST('maskconsttask', 'aZ09');
$masktaskt = GETPOST('masktask', 'alpha');
if ($maskconstmasktask) {
if ($maskconstmasktask && preg_match('/_MASK$/', $maskconstmasktask)) {
$res = dolibarr_set_const($db, $maskconstmasktask, $masktaskt, 'chaine', 0, '', $conf->entity);
}

View File

@ -90,11 +90,11 @@ $setupnotempty = 0;
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstjob = GETPOST('maskconstjob', 'alpha');
$maskjob = GETPOST('maskjob', 'alpha');
$maskconst = GETPOST('maskconstjob', 'alpha');
$maskvalue = GETPOST('maskjob', 'alpha');
if ($maskconstjob) {
$res = dolibarr_set_const($db, $maskconstjob, $maskjob, 'chaine', 0, '', $conf->entity);
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
}
if (!($res > 0)) {

View File

@ -90,11 +90,11 @@ $setupnotempty = 0;
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstcand = GETPOST('maskconstcand', 'alpha');
$maskcand = GETPOST('maskcand', 'alpha');
$maskconst = GETPOST('maskconstcand', 'aZ09');
$maskvalue = GETPOST('maskcand', 'alpha');
if ($maskconstcand) {
$res = dolibarr_set_const($db, $maskconstcand, $maskcand, 'chaine', 0, '', $conf->entity);
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
}
if (!($res > 0)) {

View File

@ -69,7 +69,7 @@ class mod_recruitmentcandidature_advanced extends ModeleNumRefRecruitmentCandida
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
$texte .= '<input type="hidden" name="action" value="updateMask">';
$texte .= '<input type="hidden" name="maskconstcand" value="RECRUITMENT_RECRUITMENTCANDIDATURE_ADVANCED_MASK">';
$texte .= '<table class="nobordernopadding" width="100%">';
$texte .= '<table class="nobordernopadding centpercent">';
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("RecruitmentCandidature"), $langs->transnoentities("RecruitmentCandidature"));
$tooltip .= $langs->trans("GenericMaskCodes2");

View File

@ -69,7 +69,7 @@ class mod_recruitmentjobposition_advanced extends ModeleNumRefRecruitmentJobPosi
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
$texte .= '<input type="hidden" name="action" value="updateMask">';
$texte .= '<input type="hidden" name="maskconstjob" value="RECRUITMENT_RECRUITMENTJOBPOSITION_ADVANCED_MASK">';
$texte .= '<table class="nobordernopadding" width="100%">';
$texte .= '<table class="nobordernopadding centpercent">';
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("RecruitmentJobPosition"), $langs->transnoentities("RecruitmentJobPosition"));
$tooltip .= $langs->trans("GenericMaskCodes2");

View File

@ -100,9 +100,9 @@ if ($action == 'set') {
$db->rollback();
}
} elseif ($action == 'updateMask') {
$maskconst = GETPOST('maskconst', 'alpha');
$maskconst = GETPOST('maskconst', 'aZ09');
$maskvalue = GETPOST('maskvalue', 'alpha');
if ($maskconst) {
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
}
if (!($res > 0)) {