diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index ac21db8cff8..d9557845492 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -678,8 +678,9 @@ if ($object->fetch($id) >= 0) { // Search Icon print ''; + print ''; if ($obj->statut == 0) { // Not sent yet - if ($user->rights->mailing->creer && $allowaddtarget) { + if (!empty($user->rights->mailing->creer) && $allowaddtarget) { print ''.img_delete($langs->trans("RemoveRecipient")).''; } } diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 0d29c0d1323..a868c99a66f 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -1,5 +1,9 @@ 'agenda', 'position' => 170, 'perms' => '$user->rights->agenda->allactions->read', - 'enabled' => '$conf->categorie->enabled&&$conf->categorie->enabled', + 'enabled' => '$conf->categorie->enabled', 'target' => '', 'user' => 2 ); @@ -456,8 +456,12 @@ class modAgenda extends DolibarrModules 'p.ref' => 'project', ); + $keyforselect = 'actioncomm'; $keyforelement = 'action'; $keyforaliasextra = 'extra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'actioncomm as ac'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_extrafields as extra ON ac.id = extra.fk_object'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_actioncomm as cac on ac.fk_action = cac.id'; if (!empty($user) && empty($user->rights->agenda->allactions->read)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_resources acr on ac.id = acr.fk_actioncomm'; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 9c34fe4b39f..ee9edc6694b 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -293,6 +293,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +// Add GroupBy from hooks +$parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); // Count total nb of records diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index e8c6db0cfff..0a77a39a0df 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -109,7 +109,7 @@ if (empty($reshook)) { $object->fk_project = GETPOST('projectid', 'int'); $object->label = (string) GETPOST("libelle", "alpha"); $object->description = (string) GETPOST("desc", "alpha"); - $object->statut = GETPOST("statut"); + $object->statut = GETPOST("statut", "int"); $object->lieu = (string) GETPOST("lieu", "alpha"); $object->address = (string) GETPOST("address", "alpha"); $object->zip = (string) GETPOST("zipcode", "alpha"); @@ -166,9 +166,9 @@ if (empty($reshook)) { } // Modification entrepot - if ($action == 'update' && $cancel <> $langs->trans("Cancel")) { + if ($action == 'update' && !$cancel) { if ($object->fetch($id)) { - $object->label = GETPOST("libelle"); + $object->label = GETPOST("libelle"); $object->fk_parent = GETPOST("fk_parent"); $object->fk_project = GETPOST('projectid'); $object->description = GETPOST("desc"); @@ -178,8 +178,8 @@ if (empty($reshook)) { $object->zip = GETPOST("zipcode"); $object->town = GETPOST("town"); $object->country_id = GETPOST("country_id"); - $object->phone = GETPOST("phone"); - $object->fax = GETPOST("fax"); + $object->phone = GETPOST("phone"); + $object->fax = GETPOST("fax"); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object);