diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index df8ce99fa10..07df2a91872 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -65,6 +65,8 @@ $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha'); $btn_changeaccount = GETPOST('changeaccount', 'alpha'); $btn_changetype = GETPOST('changetype', 'alpha'); +if (empty($accounting_product_mode)) $accounting_product_mode='ACCOUNTANCY_SELL'; + $limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); @@ -112,8 +114,6 @@ if ($action == 'update') { 'ACCOUNTANCY_BUY' ); - $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha'); - if (in_array($accounting_product_mode, $accounting_product_modes)) { if (! dolibarr_set_const($db, 'ACCOUNTING_PRODUCT_MODE', $accounting_product_mode, 'chaine', 0, '', $conf->entity)) { diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 56e5e68b2f7..ab3a07f2192 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1392,6 +1392,8 @@ class ActionComm extends CommonObject */ public function build_exportfile($format, $type, $cachedelay, $filename, $filters) { + global $hookmanager; + // phpcs:enable global $conf,$langs,$dolibarr_main_url_root,$mysoc; @@ -1457,6 +1459,11 @@ class ActionComm extends CommonObject $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; // Link to get author of event for export $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc"; + + $parameters=array('filters' => $filters); + $reshook=$hookmanager->executeHooks('printFieldListFrom', $parameters); // Note that $action and $object may have been modified by hook + $sql.=$hookmanager->resPrint; + // We must filter on assignement table if ($filters['logint']) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar"; $sql.= " WHERE a.fk_action=c.id"; @@ -1502,7 +1509,13 @@ class ActionComm extends CommonObject elseif ($result < 0 || $condition == '=') $sql.= " AND ar.fk_element = 0"; } } + $sql.= " AND a.datep IS NOT NULL"; // To exclude corrupted events and avoid errors in lightning/sunbird import + + $parameters=array('filters' => $filters); + $reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook + $sql.=$hookmanager->resPrint; + $sql.= " ORDER by datep"; //print $sql;exit; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 66cff43e562..31eeb08e0a6 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -78,7 +78,7 @@ class FormMail extends Form /** * @var int * @deprecated Fill withto with array before calling method. - * @see withto + * @see $withto */ public $withtosocid; @@ -1317,7 +1317,7 @@ class FormMail extends Form * @param CommonObject $object Object to use * @param Translate $outputlangs Object lang * @return void - * @see getCommonSubstitutionArray + * @see getCommonSubstitutionArray() */ public function setSubstitFromObject($object, $outputlangs) { diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index f4bb8a01a19..54726aefc83 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -106,6 +106,8 @@ if (empty($_GET["exportkey"]) || $conf->global->MAIN_AGENDA_XCAL_EXPORTKEY != $_ exit; } +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks +$hookmanager->initHooks(array('agendaexport')); // Define filename with prefix on filters predica (each predica set must have on cache file) $shortfilename='dolibarrcalendar';