diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 27130244d00..1c6716408b7 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -227,6 +227,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/variants +%_datadir/dolibarr/htdocs/webhook %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/workstation diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index aeddd5526f8..97d88babdaa 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -54,7 +54,7 @@ BuildRequires: desktop-file-utils Group: Applications/Productivity Requires: apache-base, apache-mod_php, php-cgi, php-cli, php-bz2, php-gd, php-ldap, php-imap, php-mysqli, php-openssl, fonts-ttf-dejavu Requires: mysql, mysql-client -%else%_datadir/dolibarr/htdocs/datapolicy +%else %if 0%{?suse_version} # Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros Group: Productivity/Office/Management @@ -125,7 +125,7 @@ cui hai bisogno ed essere facile da usare. %if 0%{?sles_version} %{__rm} -rf $RPM_BUILD_ROOT -%{__mkdir} $RPM_BUILD_ROOT%_datadir/dolibarr/htdocs/datapolicy +%{__mkdir} $RPM_BUILD_ROOT% %{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir} %{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir}/%{name} %else @@ -308,6 +308,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/variants +%_datadir/dolibarr/htdocs/webhook %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/workstation diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index a1e4dffc781..a371e3ab02f 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -224,6 +224,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/variants +%_datadir/dolibarr/htdocs/webhook %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/workstation diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index aed2d76ed29..bd6834582ac 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -66,7 +66,7 @@ ed essere facile da usare. Programmo web, progettato per poter fornire solo ciò di cui hai bisogno ed essere facile da usare. - +%_datadir/dolibarr/htdocs/webhook #---- prep %prep @@ -235,6 +235,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/ticket %_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/variants +%_datadir/dolibarr/htdocs/webhook %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/workstation diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 709b60068f7..b23a35442ef 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -58,7 +58,7 @@ if ($action == 'set_default') { } elseif ($action == 'del_default') { $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->USERGROUP_ADDON_PDF_ODT == "$value") { + if (getDolGlobalString('USERGROUP_ADDON_PDF_ODT') == "$value") { dolibarr_del_const($db, 'USERGROUP_ADDON_PDF_ODT', $conf->entity); } } @@ -202,7 +202,7 @@ foreach ($dirmodels as $reldir) { // Defaut print ''; - if ($conf->global->USERGROUP_ADDON_PDF == $name) { + if (getDolGlobalString('USERGROUP_ADDON_PDF') == $name) { print img_picto($langs->trans("Default"), 'on'); } else { print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index dad25199566..bcfa5c541fd 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -827,7 +827,7 @@ class Categorie extends CommonObject /** * Return list of fetched instance of elements having this category * - * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member', 'knowledge_management' ...) + * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member', 'knowledge_management', ...) * @param int $onlyids Return only ids of objects (consume less memory) * @param int $limit Limit * @param int $offset Offset @@ -1215,9 +1215,10 @@ class Categorie extends CommonObject while ((empty($protection) || $i < $protection) && !empty($this->motherof[$cursor_categ])) { //print '  cursor_categ='.$cursor_categ.' i='.$i.' '.$this->motherof[$cursor_categ].'
'."\n"; $this->cats[$id_categ]['fullpath'] = '_'.$this->motherof[$cursor_categ].$this->cats[$id_categ]['fullpath']; - $this->cats[$id_categ]['fulllabel'] = $this->cats[$this->motherof[$cursor_categ]]['label'].' >> '.$this->cats[$id_categ]['fulllabel']; + $this->cats[$id_categ]['fulllabel'] = (empty($this->cats[$this->motherof[$cursor_categ]]) ? 'NotFound' : $this->cats[$this->motherof[$cursor_categ]]['label']).' >> '.$this->cats[$id_categ]['fulllabel']; //print '  Result for id_categ='.$id_categ.' : '.$this->cats[$id_categ]['fullpath'].' '.$this->cats[$id_categ]['fulllabel'].'
'."\n"; - $i++; $cursor_categ = $this->motherof[$cursor_categ]; + $i++; + $cursor_categ = $this->motherof[$cursor_categ]; } //print 'Result for id_categ='.$id_categ.' : '.$this->cats[$id_categ]['fullpath'].'
'."\n"; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 238329a3486..7e8a1252095 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -381,7 +381,7 @@ if ($cats < 0) { $fulltree = $categstatic->get_full_arbo($type, $object->id, 1); // Load possible missing includes - if ($conf->global->CATEGORY_SHOW_COUNTS) { + if (getDolGlobalString('CATEGORY_SHOW_COUNTS')) { if ($type == Categorie::TYPE_MEMBER) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } @@ -407,11 +407,9 @@ if ($cats < 0) { $desc = dol_htmlcleanlastbr($val['description']); $counter = ''; - if ($conf->global->CATEGORY_SHOW_COUNTS) { + if (getDolGlobalString('CATEGORY_SHOW_COUNTS')) { // we need only a count of the elements, so it is enough to consume only the id's from the database - $elements = $type == Categorie::TYPE_ACCOUNT - ? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account" - : $categstatic->getObjectsInCateg($type, 1); + $elements = $categstatic->getObjectsInCateg($type, 1); $counter = "".(is_array($elements) ? count($elements) : '0').""; } diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 57f2662bcfc..173ee8a6510 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1035,7 +1035,7 @@ if ($object->id > 0) { $sql .= " WHERE e.fk_soc = s.rowid AND s.rowid = ".((int) $object->id); $sql .= " AND e.entity IN (".getEntity('expedition').")"; $sql .= ' GROUP BY e.rowid'; - $sql .= ', e.ref'; + $sql .= ', e.ref, e.entity'; $sql .= ', e.date_creation'; $sql .= ', e.fk_statut'; $sql .= ', s.nom'; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 7a7097ecb71..21a082e9491 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -2390,7 +2390,7 @@ class AccountLine extends CommonObject $result = ''; - $label = img_picto('', $this->picto).' '.$langs->trans("Transaction").':
'; + $label = img_picto('', $this->picto).' '.$langs->trans("BankTransactionLine").':
'; $label .= ''.$langs->trans("Ref").': '.$this->ref; $linkstart = ''; diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 8bad5dbebd0..48ea553abf0 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -606,45 +606,20 @@ class PaymentVarious extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - global $langs; - - if ($mode == 0) { - return $langs->trans($this->statuts[$status]); - } elseif ($mode == 1) { - return $langs->trans($this->statuts_short[$status]); - } elseif ($mode == 2) { - if ($status == 0) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]); - } elseif ($status == 1) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]); - } elseif ($status == 2) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]); - } - } elseif ($mode == 3) { - if ($status == 0 && !empty($this->statuts_short[$status])) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut0'); - } elseif ($status == 1 && !empty($this->statuts_short[$status])) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut4'); - } elseif ($status == 2 && !empty($this->statuts_short[$status])) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut6'); - } - } elseif ($mode == 4) { - if ($status == 0 && !empty($this->statuts_short[$status])) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]); - } elseif ($status == 1 && !empty($this->statuts_short[$status])) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]); - } elseif ($status == 2 && !empty($this->statuts_short[$status])) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]); - } - } elseif ($mode == 5) { - if ($status == 0 && !empty($this->statuts_short[$status])) { - return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut0'); - } elseif ($status == 1 && !empty($this->statuts_short[$status])) { - return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4'); - } elseif ($status == 2 && !empty($this->statuts_short[$status])) { - return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6'); - } + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { + global $langs; + //$langs->load("mymodule@mymodule"); + /*$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');*/ } + + $statusType = 'status'.$status; + + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 601ef04de45..cbcb2fd5417 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -588,6 +588,8 @@ if ($id) { $morehtmlref .= ''; $linkback = ''.$langs->trans("BackToList").''; + $morehtmlright = ''; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); print '
'; @@ -617,7 +619,7 @@ if ($id) { } print ''.$langs->trans("Sens").''.$sens.''; - print ''.$langs->trans("Amount").''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).''; + print ''.$langs->trans("Amount").''.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).''; // Accountancy code print ''; diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index f56e21a2fe2..fdebf7f795c 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -537,6 +537,8 @@ if ($resql) { $totalarray = array(); $totalarray['nbfield'] = 0; $totalarray['val']['total_cred'] = 0; + $totalarray['val']['total_deb'] = 0; + while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index 226c4bc350e..fa812a14c3d 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -100,6 +100,8 @@ class Deplacement extends CommonObject public $statuts = array(); public $statuts_short = array(); + public $statuts_logo = array(); + /** * Draft status @@ -127,6 +129,7 @@ class Deplacement extends CommonObject $this->statuts_short = array(0 => 'Draft', 1 => 'Validated', 2 => 'Refunded'); $this->statuts = array(0 => 'Draft', 1 => 'Validated', 2 => 'Refunded'); + $this->statuts_logo = array(0 => 'status0', 1=>'status4', 2 => 'status1', 4 => 'status6', 5 => 'status4', 6 => 'status6', 99 => 'status5'); } /** @@ -358,43 +361,12 @@ class Deplacement extends CommonObject // phpcs:enable global $langs; - if ($mode == 0) { - return $langs->trans($this->statuts[$status]); - } elseif ($mode == 1) { - return $langs->trans($this->statuts_short[$status]); - } elseif ($mode == 2) { - if ($status == 0) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]); - } elseif ($status == 1) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]); - } elseif ($status == 2) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]); - } - } elseif ($mode == 3) { - if ($status == 0 && !empty($this->statuts_short[$status])) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut0'); - } elseif ($status == 1 && !empty($this->statuts_short[$status])) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut4'); - } elseif ($status == 2 && !empty($this->statuts_short[$status])) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut6'); - } - } elseif ($mode == 4) { - if ($status == 0 && !empty($this->statuts_short[$status])) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]); - } elseif ($status == 1 && !empty($this->statuts_short[$status])) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]); - } elseif ($status == 2 && !empty($this->statuts_short[$status])) { - return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]); - } - } elseif ($mode == 5) { - if ($status == 0 && !empty($this->statuts_short[$status])) { - return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut0'); - } elseif ($status == 1 && !empty($this->statuts_short[$status])) { - return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4'); - } elseif ($status == 2 && !empty($this->statuts_short[$status])) { - return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6'); - } - } + $labelStatus = $langs->transnoentitiesnoconv($this->statuts[$status]); + $labelStatusShort = $langs->transnoentitiesnoconv($this->statuts_short[$status]); + + $statusType = $this->statuts_logo[$status]; + + return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); } /** diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ad31e42a625..01665e99ca5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -588,6 +588,10 @@ abstract class CommonObject public $alreadypaid; + private $labelStatus; + private $labelStatusShort; + + /** * @var array List of child tables. To test if we can delete object. */ @@ -6868,7 +6872,7 @@ abstract class CommonObject $out = ''; } elseif (preg_match('/varchar/', $type)) { $out = ' 0 ? ' maxlength="'.$size.'"' : '').' value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>'; - } elseif (in_array($type, array('mail', 'phone', 'url', 'ip'))) { + } elseif (in_array($type, array('email', 'mail', 'phone', 'url', 'ip'))) { $out = ''; } elseif (preg_match('/^text/', $type)) { if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index dda61ae72d4..d31cdda5770 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9387,7 +9387,8 @@ class Form $ret .= ''; // gravatar need md5 hash } else { if ($nophoto == 'company') { - $ret .= '
'.img_picto('', 'company').'
'; + $ret .= '
'.img_picto('', 'company').'
'; + $ret .= '
'; } else { $ret .= ''; } diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 597031945f1..c4be69675bb 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -121,10 +121,19 @@ print ' display: none; } + ul li.lilevel2 { + padding-left: 42px; + } + a.alilevel0, span.spanlilevel0 { background-image: url(\''.DOL_URL_ROOT.'/theme/'.urlencode($conf->theme).'/img/next.png\') !important; - background-repeat: no-repeat !important; - background-position-x: 10px; + background-repeat: no-repeat !important;'; +if ($langs->trans("DIRECTION") == 'rtl') { + print 'background-position: right;'; +} else { + print 'background-position-x: 10px;'; +} + print ' background-position-y: 16px; padding: 1em 15px 1em 40px; display: block; @@ -152,6 +161,18 @@ print ' li.lilevel1 a { padding-bottom: 5px; } + li.lilevel1 > a, li.lilevel1 > i { + /* background-image: url(\''.DOL_URL_ROOT.'/theme/'.urlencode($conf->theme).'/img/puce.png\') !important; */ + background-repeat: no-repeat !important;'; +if ($langs->trans("DIRECTION") == 'rtl') { + print 'background-position: right;'; +} else { + print 'background-position-x: 10px;'; +} + print 'background-position-y: 1px;'; + print 'padding-left: 20px;'; + print ' + } li.lilevel1 a, li.lilevel1 { color: #000; cursor: pointer; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 10866b4f24b..8e59e688e2c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2196,7 +2196,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi } if ($showbarcode) { - $morehtmlleft .= '
'.$form->showbarcode($object, 100, 'photoref').'
'; + $morehtmlleft .= '
'.$form->showbarcode($object, 100, 'photoref valignmiddle').'
'; } if ($object->element == 'societe') { @@ -5001,7 +5001,7 @@ function dol_print_error_email($prefixcode, $errormessage = '', $errormessages = * @param string $field Field to use for new sorting * @param string $begin ("" by defaut) * @param string $moreparam Add more parameters on sort url links ("" by default) - * @param string $moreattrib Options of attribute td ("" by defaut, example: 'align="center"') + * @param string $moreattrib Options of attribute td ("" by defaut) * @param string $sortfield Current field used to sort * @param string $sortorder Current sort order * @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag. @@ -5023,7 +5023,7 @@ function print_liste_field_titre($name, $file = "", $field = "", $begin = "", $m * @param string $field Field to use for new sorting. Empty if this field is not sortable. Example "t.abc" or "t.abc,t.def" * @param string $begin ("" by defaut) * @param string $moreparam Add more parameters on sort url links ("" by default) - * @param string $moreattrib Add more attributes on th ("" by defaut, example: 'align="center"'). To add more css class, use param $prefix. + * @param string $moreattrib Add more attributes on th ("" by defaut). To add more css class, use param $prefix. * @param string $sortfield Current field used to sort (Ex: 'd.datep,d.id') * @param string $sortorder Current sort order (Ex: 'asc,desc') * @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag, for example 'mycss '. diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 273922ff615..776d0f0776f 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -824,10 +824,13 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } } + // Budget task if (count($arrayfields) > 0 && !empty($arrayfields['t.budget_amount']['checked'])) { print ''; - print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); - $total_budget_amount += $lines[$i]->budget_amount; + if ($lines[$i]->budget_amount) { + print ''.price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; + $total_budget_amount += $lines[$i]->budget_amount; + } print ''; } @@ -982,7 +985,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } - // resume + // Progress if (count($arrayfields) > 0 && !empty($arrayfields['t.progress_summary']['checked'])) { print ''; if ($total_projectlinesa_planned) { @@ -1008,9 +1011,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } } + // Budget task if (count($arrayfields) > 0 && !empty($arrayfields['t.budget_amount']['checked'])) { print ''; - print price($total_budget_amount, 0, $langs, 1, 0, 0, $conf->currency); + if (strcmp($total_budget_amount, '')) { + print price($total_budget_amount, 0, $langs, 1, 0, 0, $conf->currency); + } print ''; } diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index adc4f8d487c..71f399497c7 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2022 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -72,6 +72,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout $num = count($newTabMenu); for ($i = 0; $i < $num; $i++) { + //var_dump($type_user.' '.$newTabMenu[$i]['url'].' '.$showmode.' '.$newTabMenu[$i]['perms']); $idsel = (empty($newTabMenu[$i]['mainmenu']) ? 'none' : $newTabMenu[$i]['mainmenu']); $shorturl = ''; @@ -80,9 +81,9 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout if ($showmode == 1) { $newTabMenu[$i]['url'] = make_substitutions($newTabMenu[$i]['url'], $substitarray); + // url = url from host, shorturl = relative path into dolibarr sources $url = $shorturl = $newTabMenu[$i]['url']; - - if (!preg_match("/^(http:\/\/|https:\/\/)/i", $newTabMenu[$i]['url'])) { + if (!preg_match("/^(http:\/\/|https:\/\/)/i", $newTabMenu[$i]['url'])) { // Do not change url content for external links $tmp = explode('?', $newTabMenu[$i]['url'], 2); $url = $shorturl = $tmp[0]; $param = (isset($tmp[1]) ? $tmp[1] : ''); @@ -235,11 +236,11 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla $classnametxt = str_replace('class="', 'class="tmenulabel ', $classname); if ($showmode == 1) { - print ''; - print '
'; + print '
'; + print '
'; print '
'; if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) { - print ''; + print ''; print ''; print $text; print ''; @@ -300,11 +301,13 @@ function print_end_menu_array_auguria() * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all). If value come being '', we change it to value in session and 'none' if not defined in session. * @param array $moredata An array with more data to output + * @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @return int Nb of menu entries */ -function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu = '', $forceleftmenu = '', $moredata = null) +function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu = '', $forceleftmenu = '', $moredata = null, $type_user = 0) { - global $user, $conf, $langs, $dolibarr_main_db_name, $mysoc; + global $user, $conf, $langs, $hookmanager; + global $dolibarr_main_db_name, $mysoc; $newmenu = $menu; @@ -472,6 +475,29 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t return 0; } + // Allow the $menu_array of the menu to be manipulated by modules + $parameters = array( + 'mainmenu' => $mainmenu, + ); + $hook_items = $menu_array; + $reshook = $hookmanager->executeHooks('menuLeftMenuItems', $parameters, $hook_items); // Note that $action and $object may have been modified by some hooks + + if (is_numeric($reshook)) { + if ($reshook == 0 && !empty($hookmanager->results)) { + $menu_array[] = $hookmanager->results; // add + } elseif ($reshook == 1) { + $menu_array = $hookmanager->results; // replace + } + + // @todo Sort menu items by 'position' value + // $position = array(); + // foreach ($menu_array as $key => $row) { + // $position[$key] = $row['position']; + // } + // $array1_sort_order = SORT_ASC; + // array_multisort($position, $array1_sort_order, $menu_array); + } + // Show menu $invert = empty($conf->global->MAIN_MENU_INVERT) ? "" : "invert"; if (empty($noout)) { @@ -542,7 +568,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t if ($menu_array[$i]['enabled']) { // Enabled so visible print ''."\n"; $lastlevel0 = 'enabled'; } elseif ($showmenu) { // Not enabled but visible (so greyed) - print ''."\n"; + print ''."\n"; $lastlevel0 = 'greyed'; } else { $lastlevel0 = 'hidden'; @@ -572,10 +602,12 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/', '', $menu_array[$i]['url'])); } - if ($menu_array[$i]['enabled'] && $lastlevel0 == 'enabled') { // Enabled so visible, except if parent was not enabled. - print '