diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index bba319e4496..9dcb514cc36 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -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++;
}
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index 97307ffe23f..628313d5fe9 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -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++;
}
diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php
index 2413364426f..0bef6b25609 100644
--- a/htdocs/asset/type.php
+++ b/htdocs/asset/type.php
@@ -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++;
}
diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php
index 91d32736cbc..2b3ffc95c41 100644
--- a/htdocs/categories/edit.php
+++ b/htdocs/categories/edit.php
@@ -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++;
}
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 203a46621d9..7d29e9f1dc7 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -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++;
}
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index a2358c06552..c9566b73e62 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -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';
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index a6d76c14211..e03438b4e3b 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -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
diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php
index 53429ffac4e..fddd0ee2493 100644
--- a/htdocs/compta/bank/card.php
+++ b/htdocs/compta/bank/card.php
@@ -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);
diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php
index 98337746090..6ee1a057664 100644
--- a/htdocs/compta/facture/stats/index.php
+++ b/htdocs/compta/facture/stats/index.php
@@ -309,7 +309,7 @@ if (!empty($conf->category->enabled)) {
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier"));
}
print '
| '.$cat_label.' | ';
- $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);
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 39c9b2ad2de..45923910633 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -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 " ";
@@ -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();
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 7cbf6f02348..ec886ce1d4e 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -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');
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index e73f83d1340..9d327f45298 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -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;
}
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 7312faf6b5e..7b5cc92c75d 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -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;
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index 7aa7ea802ce..19da17f2be2 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -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++;
}
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 6866c8a5039..39f73a68844 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -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 = '';
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index c20b6eede3e..ffa593639b5 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -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++;
}
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 8054bce08ed..cecf6296735 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -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++;
}
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 62714c72216..8feb682f023 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -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++;
}
diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php
index 765a1522bc6..9b38a98ec38 100644
--- a/htdocs/public/test/test_arrays.php
+++ b/htdocs/public/test/test_arrays.php
@@ -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');
}
diff --git a/htdocs/public/test/badges.php b/htdocs/public/test/test_badges.php
similarity index 96%
rename from htdocs/public/test/badges.php
rename to htdocs/public/test/test_badges.php
index 1090da5445a..64ccf82345b 100644
--- a/htdocs/public/test/badges.php
+++ b/htdocs/public/test/test_badges.php
@@ -1,45 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
Badges
Documentation and examples for badges, our small count and labeling component.
@@ -339,4 +324,5 @@ llxHeader('', 'Documentation and examples for theme');
-
+
\ No newline at end of file
diff --git a/htdocs/public/test/test_exec.php b/htdocs/public/test/test_exec.php
index f805cc19b5c..732bfefa824 100644
--- a/htdocs/public/test/test_exec.php
+++ b/htdocs/public/test/test_exec.php
@@ -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');
}
diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php
index c025151bdb9..47d827cbaf5 100644
--- a/htdocs/public/test/test_forms.php
+++ b/htdocs/public/test/test_forms.php
@@ -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');
}
diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php
index f89e16da3f9..4ffbe1eb0a7 100644
--- a/htdocs/resource/card.php
+++ b/htdocs/resource/card.php
@@ -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++;
}
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 2004049ade9..5bef2737ed8 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -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';
diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php
index d093af10dbb..108a4bdf34a 100644
--- a/htdocs/societe/website.php
+++ b/htdocs/societe/website.php
@@ -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';
}
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index 87f89362f6f..992f76a0289 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -890,7 +890,8 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
" autofocus>
-
+
+
dol_use_jmobile)) { ?>
diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php
index d1d47c568c5..1e2263dde7f 100644
--- a/htdocs/theme/eldy/info-box.inc.php
+++ b/htdocs/theme/eldy/info-box.inc.php
@@ -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{
diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php
index a4af0081aeb..cedfab31df8 100644
--- a/htdocs/theme/md/info-box.inc.php
+++ b/htdocs/theme/md/info-box.inc.php
@@ -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{
color: #a47080 !important;
}
-.bg-infobox-propal,
-.bg-infobox-facture,
-.bg-infobox-commande{
- color: #99a17d !important;
+.bg-infobox-propal, .bg-infobox-facture, .bg-infobox-commande {
+ color: #65953d !important;
}
-.bg-infobox-supplier_proposal,
-.bg-infobox-invoice_supplier,
-.bg-infobox-order_supplier{
- color: #599caf !important;
+.bg-infobox-supplier_proposal, .bg-infobox-invoice_supplier, .bg-infobox-order_supplier {
+ color: #599caf !important;
}
.bg-infobox-contrat, .bg-infobox-ticket{
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;
}
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index cb46a33f594..15ac7996824 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -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++;
}
diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php
index f24c4232a8e..c3e0e00fdf6 100644
--- a/htdocs/user/group/card.php
+++ b/htdocs/user/group/card.php
@@ -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++;
}
|