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

Conflicts:
	htdocs/don/card.php
	htdocs/public/test/badges.php
	htdocs/public/test/test_exec.php
This commit is contained in:
Laurent Destailleur 2021-12-08 18:27:03 +01:00
commit 69cd7ae2ab
30 changed files with 85 additions and 80 deletions

View File

@ -327,7 +327,7 @@ if (empty($reshook)) {
$object->public = GETPOST("public", 'alpha');
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -180,7 +180,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) {
$object->vote = (boolean) trim($vote);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -159,7 +159,7 @@ if ($action == 'update' && $user->rights->asset->write) {
$object->note = trim($comment);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -105,7 +105,7 @@ if ($action == 'update' && $user->rights->categorie->creer) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
}
if (!$error && empty($object->error)) {
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -609,7 +609,7 @@ if (empty($reshook) && $action == 'update') {
}
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -697,6 +697,11 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
// Add HAVING from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : '';
$sql .= $db->order($sortfield, $sortorder);
$sql .= ', p.ref DESC';

View File

@ -630,6 +630,11 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
// Add HAVING from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : '';
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records

View File

@ -175,7 +175,7 @@ if (empty($reshook)) {
}
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if (!$error) {
$id = $object->create($user);

View File

@ -309,7 +309,7 @@ if (!empty($conf->category->enabled)) {
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier"));
}
print '<tr><td>'.$cat_label.'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1);
$cate_arbo = $form->select_all_categories($cat_type, null, 'parent', null, null, 1);
print img_picto('', 'category', 'class="pictofixedwidth"');
print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), 0, 0, 'widthcentpercentminusx maxwidth300');
//print $formother->select_categories($cat_type, $categ_id, 'categ_id', true);

View File

@ -437,7 +437,7 @@ if (empty($reshook)) {
$object->roles = GETPOST("roles", 'array'); // Note GETPOSTISSET("role") is null when combo is empty
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}
@ -867,7 +867,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Other attributes
$parameters = array('socid' => $socid, 'objsoc' => $objsoc, 'colspan' => ' colspan="3"', 'cols' => 3);
$parameters = array('socid' => $socid, 'objsoc' => $objsoc, 'colspan' => ' colspan="3"', 'cols' => 3, 'colspanvalue' => 3);
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
print "</table><br>";
@ -1169,7 +1169,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Other attributes
$parameters = array('colspan' => ' colspan="3"', 'cols'=> '3');
$parameters = array('colspan' => ' colspan="3"', 'cols'=> '3', 'colspanvalue'=> '3');
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
$object->load_ref_elements();

View File

@ -102,9 +102,12 @@ $search_roles = GETPOST("search_roles", 'array');
$search_level = GETPOST("search_level", "array");
$search_stcomm = GETPOST('search_stcomm', 'int');
if ($search_status == '') {
if ($search_status === '') {
$search_status = 1; // always display active customer first
}
if ($search_no_email === '') {
$search_no_email = -1;
}
$optioncss = GETPOST('optioncss', 'alpha');

View File

@ -1948,7 +1948,8 @@ class ExtraFields
if (!empty($onlykey) && $onlykey != '@GETPOSTISSET' && $key != $onlykey) {
continue;
}
if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key)) {
if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && $this->attributes[$object->table_element]['type'][$key] != 'boolean') {
//when unticking boolean field, it's not set in POST
continue;
}

View File

@ -2509,7 +2509,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if (empty($entity) || empty($conf->categorie->multidir_output[$entity])) {
return array('accessallowed'=>0, 'error'=>'Value entity must be provided');
}
if ($fuser->rights->categorie->{$lire}) {
if ($fuser->rights->categorie->{$lire} || $fuser->rights->takepos->run) {
$accessallowed = 1;
}
$original_file = $conf->categorie->multidir_output[$entity].'/'.$original_file;

View File

@ -185,7 +185,7 @@ if (empty($reshook)) {
$object->modepaymentid = (int) GETPOST('modepayment', 'int');
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -380,6 +380,11 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
// Add HAVING from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : '';
$sql .= $db->order($sortfield, $sortorder);
$nbtotalofrecords = '';

View File

@ -207,7 +207,7 @@ if (empty($reshook)) {
$object->fax = GETPOST("fax");
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -287,7 +287,7 @@ if (empty($reshook)) {
$object->usage_organize_event = (GETPOST('usage_organize_event', 'alpha') == 'on' ? 1 : 0);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -108,7 +108,7 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) {
$object->budget_amount = price2num(GETPOST('budget_amount', 'alphanohtml'));
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -26,7 +26,7 @@ require '../../main.inc.php';
// Security
if ($dolibarr_main_prod) {
accessforbidden();
accessforbidden('Access forbidden when $dolibarr_main_prod is set to 1');
}

View File

@ -1,45 +1,30 @@
<?php
if (!defined('NOREQUIRESOC')) {
define('NOREQUIRESOC', '1');
}
if (!defined('NOCSRFCHECK')) {
define('NOCSRFCHECK', 1);
}
if (!defined('NOTOKENRENEWAL')) {
define('NOTOKENRENEWAL', 1);
}
if (!defined('NOLOGIN')) {
define('NOLOGIN', 1); // File must be accessed by logon page so without login
}
if (!defined('NOREQUIREHTML')) {
define('NOREQUIREHTML', 1);
}
if (!defined('NOREQUIREAJAX')) {
define('NOREQUIREAJAX', '1');
}
//define("NOLOGIN",1); // This means this output page does not require to be logged.
define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
if (!defined('NOSESSION')) {
define('NOSESSION', '1');
}
if (!defined('NOREQUIREMENU')) {
define('NOREQUIREMENU', '1');
}
session_cache_limiter('public');
require_once '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
// Security
if ($dolibarr_main_prod) {
accessforbidden();
accessforbidden('Access forbidden when $dolibarr_main_prod is set to 1');
}
/*
* View
*/
llxHeader('', 'Documentation and examples for theme');
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Documentation and examples for theme.">
<link href="<?php echo DOL_URL_ROOT ?>/theme/eldy/style.css.php" rel="stylesheet">
</head>
<body class="docpage" style="padding: 20px;">
<main role="main" >
<h1 class="bd-title" id="content">Badges</h1>
<p class="bd-lead">Documentation and examples for badges, our small count and labeling component.</p>
@ -339,4 +324,5 @@ llxHeader('', 'Documentation and examples for theme');
</main>
<?php llxFooter();
</body>
</html>

View File

@ -54,7 +54,7 @@ require '../../main.inc.php';
// Security
if ($dolibarr_main_prod) {
accessforbidden();
accessforbidden('Access forbidden when $dolibarr_main_prod is set to 1');
}

View File

@ -10,7 +10,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
// Security
if ($dolibarr_main_prod) {
accessforbidden();
accessforbidden('Access forbidden when $dolibarr_main_prod is set to 1');
}

View File

@ -143,7 +143,7 @@ if (empty($reshook)) {
$object->country_id = $country_id;
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -917,7 +917,7 @@ if (empty($reshook)) {
// Actions to build doc
$id = $socid;
$upload_dir = $conf->societe->dir_output;
$upload_dir = $conf->societe->multidir_output[$object->entity];
$permissiontoadd = $user->rights->societe->creer;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
}
@ -3006,7 +3006,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Presend form
$modelmail = 'thirdparty';
$defaulttopic = 'Information';
$diroutput = $conf->societe->dir_output;
$diroutput = $conf->societe->multidir_output[$object->entity];
$trackid = 'thi'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';

View File

@ -159,7 +159,7 @@ if (empty($reshook)) {
$objectlabel = 'WebsiteAccount';
$permissiontoread = $user->rights->societe->lire;
$permissiontodelete = $user->rights->societe->supprimer;
$uploaddir = $conf->societe->dir_output;
$uploaddir = $conf->societe->multidir_output[$object->entity];
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}

View File

@ -890,7 +890,8 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
<div class="login_block_other">
<input type="text" id="search" name="search" onkeyup="Search2(<?php echo $keyCodeForEnter; ?>);" placeholder="<?php echo $langs->trans("Search"); ?>" autofocus>
<a onclick="ClearSearch();"><span class="fa fa-backspace"></span></a>
<a onclick="window.location.href='<?php echo DOL_URL_ROOT.'/'; ?>';"><span class="fas fa-home"></span></a>
<a href="<?php echo DOL_URL_ROOT.'/'; ?>" target="backoffice" rel="opener"><!-- we need rel="opener" here, we are on same domain and we need to be able to reuse this tab several times -->
<span class="fas fa-home"></span></a>
<?php if (empty($conf->dol_use_jmobile)) { ?>
<a class="hideonsmartphone" onclick="FullScreen();"><span class="fa fa-expand-arrows-alt"></span></a>
<?php } ?>

View File

@ -331,15 +331,15 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
color: #b06080 !important;
}
/* Color for customer object */
.infobox-propal:not(.pictotitle),
.infobox-facture:not(.pictotitle),
.infobox-commande:not(.pictotitle) {
.infobox-propal:not(.pictotitle):not(.error),
.infobox-facture:not(.pictotitle):not(.error),
.infobox-commande:not(.pictotitle):not(.error) {
color: #65953d !important;
}
/* Color for vendor object */
.infobox-supplier_proposal:not(.pictotitle),
.infobox-invoice_supplier:not(.pictotitle),
.infobox-order_supplier:not(.pictotitle){
.infobox-supplier_proposal:not(.pictotitle):not(.error),
.infobox-invoice_supplier:not(.pictotitle):not(.error),
.infobox-order_supplier:not(.pictotitle):not(.error) {
color: #599caf !important;
}
.infobox-contrat, .infobox-ticket{

View File

@ -28,7 +28,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
?>
.customer-back {
background-color: #99a17d !important;
background-color: #65953d !important;
color: #FFF !important;
padding: 2px;
margin: 2px;
@ -56,15 +56,11 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
.bg-infobox-action{
<?php echo $prefix; ?>color: #a47080 !important;
}
.bg-infobox-propal,
.bg-infobox-facture,
.bg-infobox-commande{
<?php echo $prefix; ?>color: #99a17d !important;
.bg-infobox-propal, .bg-infobox-facture, .bg-infobox-commande {
<?php echo $prefix; ?>color: #65953d !important;
}
.bg-infobox-supplier_proposal,
.bg-infobox-invoice_supplier,
.bg-infobox-order_supplier{
<?php echo $prefix; ?>color: #599caf !important;
.bg-infobox-supplier_proposal, .bg-infobox-invoice_supplier, .bg-infobox-order_supplier {
<?php echo $prefix; ?>color: #599caf !important;
}
.bg-infobox-contrat, .bg-infobox-ticket{
<?php echo $prefix; ?>color: #46a676 !important;
@ -92,16 +88,19 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
.infobox-action{
color: #a47080 !important;
}
.infobox-propal,
.infobox-facture,
.infobox-commande{
color: #99a17d !important;
/* Color for customer object */
.infobox-propal:not(.pictotitle):not(.error),
.infobox-facture:not(.pictotitle):not(.error),
.infobox-commande:not(.pictotitle):not(.error) {
color: #65953d !important;
}
.infobox-supplier_proposal,
.infobox-invoice_supplier,
.infobox-order_supplier{
/* Color for vendor object */
.infobox-supplier_proposal:not(.pictotitle):not(.error),
.infobox-invoice_supplier:not(.pictotitle):not(.error),
.infobox-order_supplier:not(.pictotitle):not(.error) {
color: #599caf !important;
}
.infobox-contrat, .infobox-ticket{
color: #46a676 !important;
}

View File

@ -478,7 +478,7 @@ if (empty($reshook)) {
}
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -210,7 +210,7 @@ if (empty($reshook)) {
$object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml')));
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}