diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 747bb75433c..8f71447ab0b 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -79,7 +79,7 @@ class PropaleStats extends Stats $this->field = 'total_ht'; $this->field_line = 'total_ht'; - $this->where .= " p.fk_statut > 0"; + //$this->where .= " p.fk_statut > 0"; } if ($mode == 'supplier') { @@ -91,10 +91,10 @@ class PropaleStats extends Stats $this->field = 'total_ht'; $this->field_line = 'total_ht'; - $this->where .= " p.fk_statut > 0"; // Validated, accepted, refused and closed + //$this->where .= " p.fk_statut > 0"; // Validated, accepted, refused and closed } //$this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity; - $this->where .= " AND p.entity IN (".getEntity('propal').")"; + $this->where .= ($this->where ? ' AND ' : '')."p.entity IN (".getEntity('propal').")"; if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; if ($this->socid) { diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 49e1141fec1..a59896c8ab6 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -86,7 +86,7 @@ if ($mode == 'customer') if ($mode == 'supplier') { $picto = 'supplier_proposal'; - $title = $langs->trans("ProposalsStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")"; + $title = $langs->trans("ProposalsStatisticsSuppliers"); $dir = $conf->supplier_proposal->dir_temp; $cat_type = Categorie::TYPE_SUPPLIER; $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 5af5fb23060..c9dc5eaffa8 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -77,7 +77,7 @@ class CommandeStats extends Stats $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl"; $this->field = 'total_ht'; $this->field_line = 'total_ht'; - $this->where .= " c.fk_statut > 0"; // Not draft and not cancelled + //$this->where .= " c.fk_statut > 0"; // Not draft and not cancelled } elseif ($mode == 'supplier') { $object = new CommandeFournisseur($this->db); @@ -85,10 +85,10 @@ class CommandeStats extends Stats $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl"; $this->field = 'total_ht'; $this->field_line = 'total_ht'; - $this->where .= " c.fk_statut > 2"; // Only approved & ordered + //$this->where .= " c.fk_statut > 2"; // Only approved & ordered } //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; - $this->where .= ' AND c.entity IN ('.getEntity('commande').')'; + $this->where .= ($this->where ? ' AND ' : ''). 'c.entity IN ('.getEntity('commande').')'; if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; if ($this->socid) diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 346b5549bfd..2b2402fd9de 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -81,7 +81,7 @@ $dir = $conf->commande->dir_temp; if ($mode == 'supplier') { $picto = 'supplier_order'; - $title = $langs->trans("OrdersStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")"; + $title = $langs->trans("OrdersStatisticsSuppliers"); $dir = $conf->fournisseur->commande->dir_temp; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 31d6de721b2..c875ad32803 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2052,7 +2052,6 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang * @param boolean $fast Fast mode. deprecated. * @param string $forcetimezone '' to use the PHP server timezone. Or use a form like 'Europe/Paris' or '+0200' to force timezone. * @return array Array of informations - * If no fast mode: * 'seconds' => $secs, * 'minutes' => $min, * 'hours' => $hour, @@ -2061,6 +2060,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang * 'mon' => $month, * 'year' => $year, * 'yday' => floor($secsInYear/$_day_power) + * '0' => original timestamp * @see dol_print_date(), dol_stringtotime(), dol_mktime() */ function dol_getdate($timestamp, $fast = false, $forcetimezone = '') @@ -2080,7 +2080,8 @@ function dol_getdate($timestamp, $fast = false, $forcetimezone = '') 'yday'=>((int) date_format($datetimeobj, 'z')), 'hours'=>((int) date_format($datetimeobj, 'H')), 'minutes'=>((int) date_format($datetimeobj, 'i')), - 'seconds'=>((int) date_format($datetimeobj, 's')) + 'seconds'=>((int) date_format($datetimeobj, 's')), + '0'=>$timestamp ); } else { // PHP getdate is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 324f7c83fd0..5bc041fd7b5 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -230,7 +230,7 @@ class pdf_einstein extends ModelePDFCommandes $outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE); $outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries")); } - + $nblines = count($object->lines); if ($conf->commande->multidir_output[$conf->entity]) @@ -794,7 +794,7 @@ class pdf_einstein extends ModelePDFCommandes if (!empty($conf->global->FACTURE_CHQ_NUMBER)) { $diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE); - + if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); @@ -879,7 +879,7 @@ class pdf_einstein extends ModelePDFCommandes $outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal")); $default_font_size--; } - + $tab2_top = $posy; $tab2_hl = 4; $pdf->SetFont('', '', $default_font_size - 1); @@ -1031,7 +1031,7 @@ class pdf_einstein extends ModelePDFCommandes } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : ''); $totalvat .= ' '; - + $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -1065,7 +1065,7 @@ class pdf_einstein extends ModelePDFCommandes } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : ''); $totalvat .= ' '; - + $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1161,7 +1161,7 @@ class pdf_einstein extends ModelePDFCommandes if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { $titre .= ' - '.$outputlangsbis->transnoentities("AmountInCurrency", $outputlangsbis->transnoentitiesnoconv("Currency".$currency)); } - + $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); @@ -1271,7 +1271,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('', 'B', $default_font_size + 3); $w = 100; - + $posy = $this->marge_haute; $posx = $this->page_largeur - $this->marge_droite - $w; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index bfbc798d4bb..01ee9b0ec98 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -124,8 +124,8 @@ class pdf_eratosthene extends ModelePDFCommandes * @var array of document table collumns */ public $cols; - - + + /** * Constructor * @@ -176,7 +176,7 @@ class pdf_eratosthene extends ModelePDFCommandes $this->tabTitleHeight = 5; // default height // Use new system for position of columns, view $this->defineColumnField() - + $this->tva = array(); $this->localtax1 = array(); $this->localtax2 = array(); @@ -364,7 +364,7 @@ class pdf_eratosthene extends ModelePDFCommandes $this->atleastonediscount++; } } - + // New page $pdf->AddPage(); @@ -425,7 +425,7 @@ class pdf_eratosthene extends ModelePDFCommandes if ($notetoshow) { $tab_top -= 2; - + $tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite; $pageposbeforenote = $pagenb; @@ -709,7 +709,7 @@ class pdf_eratosthene extends ModelePDFCommandes $this->printStdColumnContent($pdf, $curY, 'totalincltax', $total_incl_tax); $nexY = max($pdf->GetY(), $nexY); } - + // Extrafields if (!empty($object->lines[$i]->array_options)) { foreach ($object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue) { @@ -1011,7 +1011,7 @@ class pdf_eratosthene extends ModelePDFCommandes if (!empty($conf->global->FACTURE_CHQ_NUMBER)) { $diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE); - + if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); @@ -1094,7 +1094,7 @@ class pdf_eratosthene extends ModelePDFCommandes $outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal")); $default_font_size--; } - + $tab2_top = $posy; $tab2_hl = 4; $pdf->SetFont('', '', $default_font_size - 1); @@ -1374,7 +1374,7 @@ class pdf_eratosthene extends ModelePDFCommandes if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { $titre .= ' - '.$outputlangsbis->transnoentities("AmountInCurrency", $outputlangsbis->transnoentitiesnoconv("Currency".$currency)); } - + $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); @@ -1433,7 +1433,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFont('', 'B', $default_font_size + 3); $w = 100; - + $posy = $this->marge_haute; $posx = $this->page_largeur - $this->marge_droite - $w; @@ -1844,7 +1844,7 @@ class pdf_eratosthene extends ModelePDFCommandes ), 'border-left' => true, // add left line separator ); - + // Add extrafields cols if (!empty($object->lines)) { $line = reset($object->lines); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index bd7b055c28e..7e730fabbc5 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -394,7 +394,7 @@ class pdf_sponge extends ModelePDFFactures $this->atleastonediscount++; } } - + // Situation invoice handling if ($object->situation_cycle_ref) @@ -750,7 +750,7 @@ class pdf_sponge extends ModelePDFFactures $this->printStdColumnContent($pdf, $curY, 'totalincltax', $total_incl_tax); $nexY = max($pdf->GetY(), $nexY); } - + // Extrafields if (!empty($object->lines[$i]->array_options)) { foreach ($object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue) { @@ -2349,7 +2349,7 @@ class pdf_sponge extends ModelePDFFactures ), 'border-left' => true, // add left line separator ); - + // Add extrafields cols if (!empty($object->lines)) { $line = reset($object->lines); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 6696364b9dd..324f52c1ca0 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -123,8 +123,8 @@ class pdf_cyan extends ModelePDFPropales * @var array of document table collumns */ public $cols; - - + + /** * Constructor * @@ -170,12 +170,12 @@ class pdf_cyan extends ModelePDFPropales // Define position of columns $this->posxdesc = $this->marge_gauche + 1; // used for notes ans other stuff - + $this->tabTitleHeight = 5; // default height // Use new system for position of columns, view $this->defineColumnField() - + $this->tva = array(); $this->localtax1 = array(); $this->localtax2 = array(); @@ -359,7 +359,7 @@ class pdf_cyan extends ModelePDFPropales $this->atleastonediscount++; } } - + // New page $pdf->AddPage(); @@ -1178,7 +1178,7 @@ class pdf_cyan extends ModelePDFPropales $outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal")); $default_font_size--; } - + $tab2_top = $posy; $tab2_hl = 4; $pdf->SetFont('', '', $default_font_size - 1); @@ -1534,7 +1534,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetFont('', 'B', $default_font_size + 3); $w = 100; - + $posy = $this->marge_haute; $posx = $this->page_largeur - $this->marge_droite - $w; diff --git a/htdocs/fichinter/class/fichinterstats.class.php b/htdocs/fichinter/class/fichinterstats.class.php index 1355c7a97cf..608b7d75f25 100644 --- a/htdocs/fichinter/class/fichinterstats.class.php +++ b/htdocs/fichinter/class/fichinterstats.class.php @@ -64,7 +64,6 @@ class FichinterStats extends Stats $this->userid = $userid; $this->cachefilesuffix = $mode; - $this->where .= " c.entity = ".$conf->entity; if ($mode == 'customer') { $object = new Fichinter($this->db); @@ -75,6 +74,8 @@ class FichinterStats extends Stats //$this->where.= " AND c.fk_statut > 0"; // Not draft and not cancelled } if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; + $this->where .= ($this->where ? ' AND ' : '')."c.entity IN (".getEntity('fichinter').')'; + if ($this->socid) { $this->where .= " AND c.fk_soc = ".$this->socid; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2de5e76f369..56f2bef6c6a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2652,25 +2652,29 @@ if ($action == 'create') print ''; } - // Intracomm report - $langs->loadLangs(array("intracommreport")); - print ''; - print ''; - if ($action != 'editmode' && $user->rights->fournisseur->facture->creer) { - print ''; - } - print '
'; - print $langs->trans('IntracommReportTransportMode'); - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; - print ''; - if ($action == 'editmode') - { - $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?id='.$object->id, $object->transport_mode_id, 'transport_mode_id', 1, 1); - } - else { - $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?id='.$object->id, $object->transport_mode_id, 'none'); - } - print ''; + // Intracomm report + if (!empty($conf->intracommreport->enabled)) { + $langs->loadLangs(array("intracommreport")); + print ''; + print ''; + if ($action != 'editmode' && $user->rights->fournisseur->facture->creer) { + print ''; + } + print '
'; + print $langs->trans('IntracommReportTransportMode'); + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; + print ''; + + print ''; + if ($action == 'editmode') + { + $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?id='.$object->id, $object->transport_mode_id, 'transport_mode_id', 1, 1); + } + else { + $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?id='.$object->id, $object->transport_mode_id, 'none'); + } + print ''; + } // Other attributes $cols = 2; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9ecd00ca36f..689a3a0a4fc 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -12,6 +12,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2020 Demarest Maxime + * Copyright (C) 2020 Charlene Benke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1655,8 +1656,13 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead $helpbaseurl = ''; $helppage = ''; $mode = ''; + $helppresent = ''; - if (empty($helppagename)) $helppagename = 'EN:User_documentation|FR:Documentation_utilisateur|ES:Documentación_usuarios'; + if (empty($helppagename)) { + $helppagename = 'EN:User_documentation|FR:Documentation_utilisateur|ES:Documentación_usuarios'; + } else { + $helppresent = 'helppresent'; + } // Get helpbaseurl, helppage and mode from helppagename and langs $arrayres = getHelpParamFor($helppagename, $langs); @@ -1674,7 +1680,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead if ($mode == 'wiki') $text .= sprintf($helpbaseurl, urlencode(html_entity_decode($helppage))); else $text .= sprintf($helpbaseurl, $helppage); $text .= '">'; - $text .= ''; + $text .= ''; $text .= ''; $toprightmenu .= @Form::textwithtooltip('', $title, 2, 1, $text, 'login_block_elem', 2); } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 5c493cd505e..1ffcce59297 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2581,6 +2581,7 @@ font.vsmenudisabledmargin { margin: 1px 1px 1px 6px; } li a.vsmenudisabled, li.vsmenudisabled { color: #aaa !important; } a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { text-align: ; color: #aaa; text-decoration: none; } +.helppresent, .helppresent:hover { color: #f3e4ac !important; } .vmenu div.blockvmenufirst, .vmenu div.blockvmenulogo, .vmenu div.blockvmenusearchphone, .vmenu div.blockvmenubookmarks {