From d819d427c303c74b31695131a2e73045675fddba Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Thu, 10 Feb 2022 16:46:19 +0100 Subject: [PATCH 1/7] FIX sort amount ht --- htdocs/compta/stats/cabyprodserv.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index ba09d7e6551..67267288b7a 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -375,7 +375,7 @@ if ($modecompta == 'CREANCES-DETTES') $_SERVER["PHP_SELF"], "amount", "", - $classslink, + $paramslink, 'class="right"', $sortfield, $sortorder From c32cc660a364617c2cac6412e270d70d80952530 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 18 Feb 2022 08:16:56 +0800 Subject: [PATCH 2/7] Update list.php --- htdocs/fourn/commande/list.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index eb13ead4fbd..72fc7a7439c 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1274,9 +1274,7 @@ if ($resql) { $projectstatic = new Project($db); $i = 0; - $totalarray = array(); - $totalarray['nbfield'] = 0; - $totalarray['val'] = array(); + $totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array()); $totalarray['val']['cf.total_ht'] = 0; $totalarray['val']['cf.total_ttc'] = 0; while ($i < min($num, $limit)) { From 3f109aa911e50c9f2f0257fc02131ed3d773863a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 18 Feb 2022 09:24:12 +0100 Subject: [PATCH 3/7] FIX Accountancy - On manual transaction with multicompany - Function transformTransaction can validate & delete transaction of an other entity --- .../accountancy/class/bookkeeping.class.php | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 43dcce8c646..5635df3c8e7 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -331,7 +331,7 @@ class BookKeeping extends CommonObject if (empty($this->piece_num)) { $sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum"; $sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element; - $sqlnum .= " WHERE entity = ".$conf->entity; // Do not use getEntity for accounting features + $sqlnum .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features $resqlnum = $this->db->query($sqlnum); if ($resqlnum) { @@ -736,7 +736,7 @@ class BookKeeping extends CommonObject $sql .= " t.date_validated as date_validation"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t'; $sql .= ' WHERE 1 = 1'; - $sql .= " AND entity IN (".getEntity('accountancy').")"; + $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features if (null !== $ref) { $sql .= " AND t.ref = '".$this->db->escape($ref)."'"; } else { @@ -881,7 +881,7 @@ class BookKeeping extends CommonObject } $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; $sql .= ' WHERE 1 = 1'; - $sql .= " AND entity IN (".getEntity('accountancy').")"; + $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features if (count($sqlwhere) > 0) { $sql .= ' AND '.implode(' '.$filtermode.' ', $sqlwhere); } @@ -1037,7 +1037,7 @@ class BookKeeping extends CommonObject } } } - $sql .= ' WHERE t.entity IN ('.getEntity('accountancy').')'; + $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features if ($showAlreadyExportMovements == 0) { $sql .= " AND t.date_export IS NULL"; } @@ -1157,7 +1157,7 @@ class BookKeeping extends CommonObject } } } - $sql .= ' WHERE entity IN ('.getEntity('accountancy').')'; + $sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features if (count($sqlwhere) > 0) { $sql .= ' AND '.implode(' '.$filtermode.' ', $sqlwhere); } @@ -1454,7 +1454,7 @@ class BookKeeping extends CommonObject */ public function deleteByYearAndJournal($delyear = 0, $journal = '', $mode = '', $delmonth = 0) { - global $langs; + global $conf, $langs; if (empty($delyear) && empty($journal)) { $this->error = 'ErrorOneFieldRequired'; @@ -1475,7 +1475,7 @@ class BookKeeping extends CommonObject if (!empty($journal)) { $sql .= " AND code_journal = '".$this->db->escape($journal)."'"; } - $sql .= " AND entity IN (".getEntity('accountancy').")"; + $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features // Exclusion of validated entries at the time of deletion $sql .= " AND date_validated IS NULL"; @@ -1514,7 +1514,7 @@ class BookKeeping extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE piece_num = ".(int) $piecenum; $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion - $sql .= " AND entity IN (".getEntity('accountancy').")"; + $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features $resql = $this->db->query($sql); @@ -1636,7 +1636,7 @@ class BookKeeping extends CommonObject } $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; $sql .= " WHERE piece_num = ".$piecenum; - $sql .= " AND entity IN (".getEntity('accountancy').")"; + $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features dol_syslog(__METHOD__, LOG_DEBUG); $result = $this->db->query($sql); @@ -1674,9 +1674,9 @@ class BookKeeping extends CommonObject global $conf; $sql = "SELECT MAX(piece_num)+1 as max FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; - $sql .= " WHERE entity IN (".getEntity('accountancy').")"; + $sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features - dol_syslog(get_class($this)."getNextNumMvt sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::getNextNumMvt sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -1717,7 +1717,7 @@ class BookKeeping extends CommonObject } $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; $sql .= " WHERE piece_num = ".$piecenum; - $sql .= " AND entity IN (".getEntity('accountancy').")"; + $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features dol_syslog(__METHOD__, LOG_DEBUG); $result = $this->db->query($sql); @@ -1780,7 +1780,7 @@ class BookKeeping extends CommonObject $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,"; $sql .= " date_validated as date_validation"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; - $sql .= " WHERE entity IN (".getEntity('accountancy').")"; + $sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features dol_syslog(get_class($this)."::export_bookkeeping", LOG_DEBUG); @@ -1836,6 +1836,8 @@ class BookKeeping extends CommonObject */ public function transformTransaction($direction = 0, $piece_num = '') { + global $conf; + $error = 0; $this->db->begin(); @@ -1855,14 +1857,14 @@ class BookKeeping extends CommonObject $sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,'; $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.$next_piecenum.", '".$this->db->idate($now)."'"; - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num); + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); $resql = $this->db->query($sql); if (!$resql) { $error++; $this->errors[] = 'Error '.$this->db->lasterror(); dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); } - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num); + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); $resql = $this->db->query($sql); if (!$resql) { $error++; @@ -1870,7 +1872,7 @@ class BookKeeping extends CommonObject dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); } } elseif ($direction == 1) { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num); + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); $resql = $this->db->query($sql); if (!$resql) { $error++; @@ -1885,14 +1887,14 @@ class BookKeeping extends CommonObject $sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,'; $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num'; - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num); + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); $resql = $this->db->query($sql); if (!$resql) { $error++; $this->errors[] = 'Error '.$this->db->lasterror(); dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); } - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num); + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); $resql = $this->db->query($sql); if (!$resql) { $error++; @@ -1947,7 +1949,7 @@ class BookKeeping extends CommonObject $sql .= " AND aa.active = 1"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = ".((int) $pcgver); - $sql .= " AND ab.entity IN (".getEntity('accountancy').")"; + $sql .= " AND ab.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features $sql .= " ORDER BY account_number ASC"; dol_syslog(get_class($this)."::select_account", LOG_DEBUG); @@ -2011,7 +2013,7 @@ class BookKeeping extends CommonObject $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as parent ON aa.account_parent = parent.rowid AND parent.active = 1"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as root ON parent.account_parent = root.rowid AND root.active = 1"; $sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'"; - $sql .= " AND aa.entity IN (".getEntity('accountancy').")"; + $sql .= " AND aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features dol_syslog(get_class($this)."::select_account sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); @@ -2051,7 +2053,7 @@ class BookKeeping extends CommonObject $sql .= " AND asy.rowid = ".((int) $pcgver); $sql .= " AND aa.active = 1"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as cat ON aa.fk_accounting_category = cat.rowid"; - $sql .= " WHERE aa.entity IN (".getEntity('accountancy').")"; + $sql .= " WHERE aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features dol_syslog(get_class($this)."::select_account sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); From 12c825ba84e4402b0ae329064db182423ed2cadc Mon Sep 17 00:00:00 2001 From: atm-greg Date: Fri, 18 Feb 2022 10:50:00 +0100 Subject: [PATCH 4/7] fix rounding for price and display currency --- htdocs/core/class/extrafields.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index f8e5726d344..c0dc9c6a96f 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1679,7 +1679,8 @@ class ExtraFields } elseif ($type == 'price') { //$value = price($value, 0, $langs, 0, 0, -1, $conf->currency); if ($value || $value == '0') { - $value = price($value, 0, $langs, 0, 0, -1); + $value = price($value, 0, $langs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1).' '.$langs->getCurrencySymbol($conf->currency); + } } elseif ($type == 'select') { $valstr = (!empty($param['options'][$value]) ? $param['options'][$value] : ''); From b5afa2777422e3ee8b207b79f9592925f9d89ce4 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 18 Feb 2022 10:09:38 +0000 Subject: [PATCH 5/7] Fixing style errors. --- htdocs/core/class/extrafields.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c0dc9c6a96f..7a449f3e7ea 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1680,7 +1680,6 @@ class ExtraFields //$value = price($value, 0, $langs, 0, 0, -1, $conf->currency); if ($value || $value == '0') { $value = price($value, 0, $langs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1).' '.$langs->getCurrencySymbol($conf->currency); - } } elseif ($type == 'select') { $valstr = (!empty($param['options'][$value]) ? $param['options'][$value] : ''); From 1107a60b58eb690902ebd14b4f52597ae051c077 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Fri, 18 Feb 2022 16:53:55 +0100 Subject: [PATCH 6/7] FIX compute rule in FEC import --- .../class/accountancyimport.class.php | 6 ++--- .../modules/import/import_csv.modules.php | 23 +++++++++++++++++++ .../modules/import/import_xlsx.modules.php | 23 +++++++++++++++++++ htdocs/imports/import.php | 7 +++--- 4 files changed, 53 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/class/accountancyimport.class.php b/htdocs/accountancy/class/accountancyimport.class.php index ece843515e2..ea88534b6ed 100644 --- a/htdocs/accountancy/class/accountancyimport.class.php +++ b/htdocs/accountancy/class/accountancyimport.class.php @@ -55,8 +55,8 @@ class AccountancyImport $fieldname = $fieldArr[1]; } - $debit = trim($arrayrecord[11]['val']); - $credit = trim($arrayrecord[12]['val']); + $debit = floatval(trim($arrayrecord[11]['val'])); + $credit = floatval(trim($arrayrecord[12]['val'])); if (!empty($debit)) { $amount = $debit; } else { @@ -86,7 +86,7 @@ class AccountancyImport $fieldname = $fieldArr[1]; } - $debit = trim($arrayrecord[11]['val']); + $debit = floatval(trim($arrayrecord[11]['val'])); if (!empty($debit)) { $sens = 'D'; } else { diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 35f0e4bc2f9..78c8f5e104f 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -736,6 +736,29 @@ class ImportCsv extends ModeleImports $tmp = explode('-', $val, 2); $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key); $listvalues[] = "'".$tmp[1]."'"; + } elseif (preg_match('/^rule-/', $val)) { + $fieldname = $key; + if (!empty($objimport->array_import_convertvalue[0][$fieldname])) { + if ($objimport->array_import_convertvalue[0][$fieldname]['rule'] == 'compute') { + $file = (empty($objimport->array_import_convertvalue[0][$fieldname]['classfile']) ? $objimport->array_import_convertvalue[0][$fieldname]['file'] : $objimport->array_import_convertvalue[0][$fieldname]['classfile']); + $class = $objimport->array_import_convertvalue[0][$fieldname]['class']; + $method = $objimport->array_import_convertvalue[0][$fieldname]['method']; + $resultload = dol_include_once($file); + if (empty($resultload)) { + dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); + break; + } + $classinstance = new $class($this->db); + $res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord, $fieldname, &$listfields, &$listvalues)); + if ($res < 0) { + if (!empty($objimport->array_import_convertvalue[0][$fieldname]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, end($listvalues), 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$fieldname]['dict'])); + else $this->errors[$error]['lib'] = 'ErrorFieldValueNotIn'; + $this->errors[$error]['type'] = 'FOREIGNKEY'; + $errorforthistable++; + $error++; + } + } + } } else { $this->errors[$error]['lib'] = 'Bad value of profile setup '.$val.' for array_import_fieldshidden'; $this->errors[$error]['type'] = 'Import profile setup'; diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index ed14ae31ebb..38c9cd8c56a 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -777,6 +777,29 @@ class ImportXlsx extends ModeleImports $tmp = explode('-', $val, 2); $listfields[] = preg_replace('/^' . preg_quote($alias, '/') . '\./', '', $key); $listvalues[] = "'" . $tmp[1] . "'"; + } elseif (preg_match('/^rule-/', $val)) { + $fieldname = $key; + if (!empty($objimport->array_import_convertvalue[0][$fieldname])) { + if ($objimport->array_import_convertvalue[0][$fieldname]['rule'] == 'compute') { + $file = (empty($objimport->array_import_convertvalue[0][$fieldname]['classfile']) ? $objimport->array_import_convertvalue[0][$fieldname]['file'] : $objimport->array_import_convertvalue[0][$fieldname]['classfile']); + $class = $objimport->array_import_convertvalue[0][$fieldname]['class']; + $method = $objimport->array_import_convertvalue[0][$fieldname]['method']; + $resultload = dol_include_once($file); + if (empty($resultload)) { + dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); + break; + } + $classinstance = new $class($this->db); + $res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord, $fieldname, &$listfields, &$listvalues)); + if ($res < 0) { + if (!empty($objimport->array_import_convertvalue[0][$fieldname]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, end($listvalues), 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$fieldname]['dict'])); + else $this->errors[$error]['lib'] = 'ErrorFieldValueNotIn'; + $this->errors[$error]['type'] = 'FOREIGNKEY'; + $errorforthistable++; + $error++; + } + } + } } else { $this->errors[$error]['lib'] = 'Bad value of profile setup ' . $val . ' for array_import_fieldshidden'; $this->errors[$error]['type'] = 'Import profile setup'; diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index ff9b839d1d5..c477df5eb77 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -141,6 +141,7 @@ $endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : ''); $updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array()); $separator = (GETPOST('separator', 'nohtml') ? GETPOST('separator', 'nohtml') : (!empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE) ? $conf->global->IMPORT_CSV_SEPARATOR_TO_USE : ',')); $enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); +$separator_used = str_replace('\t', "\t", $separator); $objimport = new Import($db); $objimport->load_arrays($user, ($step == 1 ? '' : $datatoimport)); @@ -773,7 +774,7 @@ if ($step == 4 && $datatoimport) { require_once $dir.$file; $obj = new $classname($db, $datatoimport); if ($model == 'csv') { - $obj->separator = $separator; + $obj->separator = $separator_used; $obj->enclosure = $enclosure; } if ($model == 'xlsx') { @@ -1334,7 +1335,7 @@ if ($step == 5 && $datatoimport) { require_once $dir.$file; $obj = new $classname($db, $datatoimport); if ($model == 'csv') { - $obj->separator = $separator; + $obj->separator = $separator_used; $obj->enclosure = $enclosure; } @@ -1783,7 +1784,7 @@ if ($step == 6 && $datatoimport) { require_once $dir.$file; $obj = new $classname($db, $datatoimport); if ($model == 'csv') { - $obj->separator = $separator; + $obj->separator = $separator_used; $obj->enclosure = $enclosure; } From 5eb4d3408c3c4fd3303002efe6a71e8032ddbc94 Mon Sep 17 00:00:00 2001 From: Romain DESCHAMPS Date: Fri, 18 Feb 2022 19:31:42 +0100 Subject: [PATCH 7/7] Update param_ihm.php --- htdocs/user/param_ihm.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 72f9b075be9..0d2729d904f 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -207,6 +207,9 @@ if (!empty($conf->adherent->enabled)) { if (!empty($conf->agenda->enabled)) { $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = 'Agenda'; } +if (!empty($conf->ticket->enabled)) { + $tmparray['ticket/list.php?mainmenu=ticket&leftmenu='] = 'Tickets'; +} $head = user_prepare_head($object);