diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 8df357df07e..86faa655687 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -146,8 +146,7 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} elseif ($action == 'unsetdoc') -{ +} elseif ($action == 'unsetdoc') { dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity); } diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 590ff276831..6e0b0508a07 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -33,8 +33,8 @@ $langs->load("admin"); $action = GETPOST('action', 'aZ09'); $what = GETPOST('what', 'alpha'); $export_type = GETPOST('export_type', 'alpha'); -$file = GETPOST('zipfilename_template', 'alpha'); -$compression = GETPOST('compression'); +$file = trim(GETPOST('zipfilename_template', 'alpha')); +$compression = GETPOST('compression', 'aZ09'); $file = dol_sanitizeFileName($file); $file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2)$/i', '', $file); diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 92404b81a35..da9545aa248 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -497,6 +497,17 @@ class Documents extends DolibarrApi $filearray = dol_dir_list($upload_dir, $type, $recursive, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); if (empty($filearray)) { throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->ref) ? ' or Ref '.$object->ref : '').' does not return any document.'); + } else { + if (($object->id) > 0 && !empty($modulepart)) { + require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; + $ecmfile = new EcmFiles($this->db); + $result = $ecmfile->fetchAll('', '', 0, 0, array('t.src_object_type' => $modulepart, 't.src_object_id' => $object->id)); + if ($result < 0) { + throw new RestException(503, 'Error when retrieve ecm list : ' . $this->db->lasterror()); + } elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) { + $filearray['ecmfiles_infos'] = $ecmfile->lines; + } + } } return $filearray; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index db64dd65fe9..12146179db0 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -911,6 +911,7 @@ if (empty($reshook)) if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines[0]->price); $pu_ttc = price($prodcustprice->lines[0]->price_ttc); + $price_min = price($prodcustprice->lines[0]->price_min); $price_base_type = $prodcustprice->lines[0]->price_base_type; $tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx); if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')'; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 80ff2180801..e72ddbf8818 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -749,6 +749,7 @@ if (empty($reshook)) { $pu_ht = price($prodcustprice->lines[0]->price); $pu_ttc = price($prodcustprice->lines[0]->price_ttc); + $price_min = price($prodcustprice->lines[0]->price_min); $price_base_type = $prodcustprice->lines[0]->price_base_type; $tva_tx = $prodcustprice->lines[0]->tva_tx; if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')'; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 191efdc30dc..db539e060d2 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2020 Frédéric France * * 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 @@ -30,8 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; -if (!empty($conf->projet->enabled)) -{ +if (!empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -122,8 +121,8 @@ if (empty($reshook)) $object->accountancy_code = GETPOST("accountancy_code") > 0 ? GETPOST("accountancy_code", "alpha") : ""; $object->subledger_account = $subledger_account; - $object->sens = GETPOST('sens', 'int'); - $object->fk_project = GETPOST('fk_project', 'int'); + $object->sens = GETPOSTINT('sens'); + $object->fk_project = GETPOSTINT('fk_project'); if (empty($datep) || empty($datev)) { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index a92ac8a1e73..2e692dc25c4 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2010-2017 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2014-2018 Ferran Marcet + * Copyright (C) 2014-2020 Ferran Marcet * Copyright (C) 2014-2016 Marcos García * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018-2020 Frédéric France @@ -2035,7 +2035,7 @@ if ($action == 'create') // Send if (empty($user->socid)) { if ($object->statut == 1) { - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send)) { + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->contrat->creer)) { print ''; } else print ''; } diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 80f16cb037d..5a93a6ded0b 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -315,11 +315,15 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } - $model = $object->model_pdf; $ret = $object->fetch($id); // Reload to get new records - $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + $model = $object->model_pdf; + + $retgen = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($retgen < 0) { + setEventMessages($object->error, $object->errors, 'warnings'); + } } } } else { diff --git a/htdocs/core/boxes/box_funnel_of_prospection.php b/htdocs/core/boxes/box_funnel_of_prospection.php index c0218be92e2..a50426e1b29 100644 --- a/htdocs/core/boxes/box_funnel_of_prospection.php +++ b/htdocs/core/boxes/box_funnel_of_prospection.php @@ -97,6 +97,8 @@ class box_funnel_of_prospection extends ModeleBoxes $sql = "SELECT cls.rowid, cls.code, cls.percent, cls.label"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_lead_status as cls"; $sql .= " WHERE active=1"; + $sql .= " AND cls.code <> 'LOST'"; + $sql .= $this->db->order('cls.rowid', 'ASC'); $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); @@ -124,7 +126,6 @@ class box_funnel_of_prospection extends ModeleBoxes $colorseriesstat[$objp->rowid] = $badgeStatus6; break; default: - $colorseriesstat[$objp->rowid] = $badgeStatus2; break; } $i++; @@ -134,12 +135,11 @@ class box_funnel_of_prospection extends ModeleBoxes } global $conf, $user, $langs; - $this->max = $max; $this->info_box_head = array( - 'text' => $langs->trans("Statistics") . ' - ' . $langs->trans("OpportunitiesStatusForOpenedProjects"), - $max + 'text' => $langs->trans("Statistics") . ' - ' . $langs->trans("BoxTitleFunnelOfProspection"), + 'graph' => '1' ); if ($user->rights->projet->lire || !empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { @@ -187,6 +187,8 @@ class box_funnel_of_prospection extends ModeleBoxes $stringtoprint = ''; $stringtoprint .= '
'; $listofstatus = array_keys($listofoppstatus); + $liststatus = array(); + $data = array(''); foreach ($listofstatus as $status) { $labelStatus = ''; if ($status != 7) { @@ -198,7 +200,8 @@ class box_funnel_of_prospection extends ModeleBoxes $labelStatus = $listofopplabel[$status]; } - $dataseries[] = array($labelStatus,(isset($valsamount[$status]) ? (float) $valsamount[$status] : 0)); + $data[] = (isset($valsamount[$status]) ? (float) $valsamount[$status] : 0); + $liststatus[] = $labelStatus; if (!$conf->use_javascript_ajax) { $stringtoprint .= ''; $stringtoprint .= '' . $labelStatus . ''; @@ -207,17 +210,22 @@ class box_funnel_of_prospection extends ModeleBoxes } } } + $dataseries[] = $data; if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); + $dolgraph->SetMinValue(0); $dolgraph->SetData($dataseries); + $dolgraph->SetLegend($liststatus); $dolgraph->SetDataColor(array_values($colorseriesstat)); - //$dolgraph->SetLegend(array('PROSP',$dataseries['PROSP'])); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); - $dolgraph->SetType(array('pie')); + $dolgraph->setTitle(''); + $dolgraph->SetType(array('horizontalbars')); $dolgraph->SetHeight('200'); - $dolgraph->draw('idgraphstatus'); + $dolgraph->SetWidth('600'); + $dolgraph->mode = 'depth'; + $dolgraph->draw('idgraphleadfunnel'); $stringtoprint .= $dolgraph->show($totaloppnb ? 0 : 1); } $stringtoprint .= '
'; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ef1bd4eb7b7..dec15e4db83 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4557,6 +4557,11 @@ abstract class CommonObject { dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null')); + if (empty($modele)) { + $this->error = 'BadValueForParameterModele'; + return -1; + } + // Increase limit for PDF build $err = error_reporting(); error_reporting(0); diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 80314bcf9ed..bd350e40991 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -103,9 +103,8 @@ class DolGraph $this->datacolor = array(array(120, 130, 150), array(160, 160, 180), array(190, 190, 220)); $this->bgcolor = array(235, 235, 224); - $color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; - if (is_readable($color_file)) - { + $color_file = DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php'; + if (is_readable($color_file)) { include_once $color_file; if (isset($theme_bordercolor)) $this->bordercolor = $theme_bordercolor; if (isset($theme_datacolor)) $this->datacolor = $theme_datacolor; @@ -261,7 +260,7 @@ class DolGraph * Set type * * @param array $type Array with type for each serie. Example: array('type1', 'type2', ...) where type can be: - * 'pie', 'piesemicircle', 'polar', 'lines', 'linesnopoint', 'bars', 'horirontalbars'... + * 'pie', 'piesemicircle', 'polar', 'lines', 'linesnopoint', 'bars', 'horizontalbars'... * @return void */ public function SetType($type) @@ -466,10 +465,8 @@ class DolGraph // phpcs:enable global $theme_bgcolor, $theme_bgcoloronglet; - if (!is_array($bg_color)) - { - if ($bg_color == 'onglet') - { + if (!is_array($bg_color)) { + if ($bg_color == 'onglet') { //print 'ee'.join(',',$theme_bgcoloronglet); $this->bgcolor = $theme_bgcoloronglet; } else { @@ -492,10 +489,8 @@ class DolGraph // phpcs:enable global $theme_bgcolor, $theme_bgcoloronglet; - if (!is_array($bg_colorgrid)) - { - if ($bg_colorgrid == 'onglet') - { + if (!is_array($bg_colorgrid)) { + if ($bg_colorgrid == 'onglet') { //print 'ee'.join(',',$theme_bgcoloronglet); $this->bgcolorgrid = $theme_bgcoloronglet; } else { @@ -535,10 +530,8 @@ class DolGraph $nblines = count($this->data); $nbvalues = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1); - for ($j = 0; $j < $nblines; $j++) - { - for ($i = 0; $i < $nbvalues; $i++) - { + for ($j = 0; $j < $nblines; $j++) { + for ($i = 0; $i < $nbvalues; $i++) { $vals[$k] = $this->data[$j][$i + 1]; $k++; } @@ -564,10 +557,8 @@ class DolGraph $nblines = count($this->data); $nbvalues = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1); - for ($j = 0; $j < $nblines; $j++) - { - for ($i = 0; $i < $nbvalues; $i++) - { + for ($j = 0; $j < $nblines; $j++) { + for ($i = 0; $i < $nbvalues; $i++) { $vals[$k] = $this->data[$j][$i + 1]; $k++; } @@ -589,8 +580,7 @@ class DolGraph if ($max != 0) $max++; $size = dol_strlen(abs(ceil($max))); $factor = 1; - for ($i = 0; $i < ($size - 1); $i++) - { + for ($i = 0; $i < ($size - 1); $i++) { $factor *= 10; } @@ -615,8 +605,7 @@ class DolGraph if ($min != 0) $min--; $size = dol_strlen(abs(floor($min))); $factor = 1; - for ($i = 0; $i < ($size - 1); $i++) - { + for ($i = 0; $i < ($size - 1); $i++) { $factor *= 10; } @@ -635,24 +624,21 @@ class DolGraph */ public function draw($file, $fileurl = '') { - if (empty($file)) - { + if (empty($file)) { $this->error = "Call to draw method was made with empty value for parameter file."; - dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR); + dol_syslog(get_class($this) . "::draw " . $this->error, LOG_ERR); return -2; } - if (!is_array($this->data)) - { + if (!is_array($this->data)) { $this->error = "Call to draw method was made but SetData was not called or called with an empty dataset for parameters"; - dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR); + dol_syslog(get_class($this) . "::draw " . $this->error, LOG_ERR); return -1; } - if (count($this->data) < 1) - { + if (count($this->data) < 1) { $this->error = "Call to draw method was made but SetData was is an empty dataset"; - dol_syslog(get_class($this)."::draw ".$this->error, LOG_WARNING); + dol_syslog(get_class($this) . "::draw " . $this->error, LOG_WARNING); } - $call = "draw_".$this->_library; + $call = "draw_" . $this->_library; call_user_func_array(array($this, $call), array($file, $fileurl)); } @@ -678,10 +664,9 @@ class DolGraph // phpcs:enable global $conf, $langs; - dol_syslog(get_class($this)."::draw_jflot this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue); + dol_syslog(get_class($this) . "::draw_jflot this->type=" . join(',', $this->type) . " this->MaxValue=" . $this->MaxValue); - if (empty($this->width) && empty($this->height)) - { + if (empty($this->width) && empty($this->height)) { print 'Error width or height not set'; return; } @@ -701,7 +686,7 @@ class DolGraph while ($i < $nblot) // Loop on each serie { $values = array(); // Array with horizontal y values (specific values of a serie) for each abscisse x - $serie[$i] = "var d".$i." = [];\n"; + $serie[$i] = "var d" . $i . " = [];\n"; // Fill array $values $x = 0; @@ -712,14 +697,13 @@ class DolGraph $x++; } - if (isset($this->type[$firstlot]) && in_array($this->type[$firstlot], array('pie', 'piesemicircle', 'polar'))) - { + if (isset($this->type[$firstlot]) && in_array($this->type[$firstlot], array('pie', 'piesemicircle', 'polar'))) { foreach ($values as $x => $y) { - if (isset($y)) $serie[$i] .= 'd'.$i.'.push({"label":"'.dol_escape_js($legends[$x]).'", "data":'.$y.'});'."\n"; + if (isset($y)) $serie[$i] .= 'd' . $i . '.push({"label":"' . dol_escape_js($legends[$x]) . '", "data":' . $y . '});' . "\n"; } } else { foreach ($values as $x => $y) { - if (isset($y)) $serie[$i] .= 'd'.$i.'.push(['.$x.', '.$y.']);'."\n"; + if (isset($y)) $serie[$i] .= 'd' . $i . '.push([' . $x . ', ' . $y . ']);' . "\n"; } } @@ -728,43 +712,39 @@ class DolGraph } $tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.')))); - $this->stringtoshow = ''."\n"; - if (!empty($this->title)) $this->stringtoshow .= '
'.$this->title.'
'; - if (!empty($this->shownographyet)) - { - $this->stringtoshow .= '
'; - $this->stringtoshow .= '
'.$langs->trans("NotEnoughDataYet").'...
'; + $this->stringtoshow = '' . "\n"; + if (!empty($this->title)) $this->stringtoshow .= '
' . $this->title . '
'; + if (!empty($this->shownographyet)) { + $this->stringtoshow .= '
'; + $this->stringtoshow .= '
' . $langs->trans("NotEnoughDataYet") . '...
'; return; } // Start the div that will contains all the graph $dolxaxisvertical = ''; if (count($this->data) > 20) $dolxaxisvertical = 'dol-xaxis-vertical'; - $this->stringtoshow .= '
'."\n"; + $this->stringtoshow .= '
' . "\n"; - $this->stringtoshow .= ''."\n"; + $this->stringtoshow .= 'plotWithOptions_' . $tag . '();' . "\n"; + $this->stringtoshow .= '});' . "\n"; + $this->stringtoshow .= '' . "\n"; } @@ -947,10 +924,9 @@ class DolGraph // phpcs:enable global $conf, $langs; - dol_syslog(get_class($this)."::draw_chart this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue); + dol_syslog(get_class($this) . "::draw_chart this->type=" . join(',', $this->type) . " this->MaxValue=" . $this->MaxValue); - if (empty($this->width) && empty($this->height)) - { + if (empty($this->width) && empty($this->height)) { print 'Error width or height not set'; return; } @@ -971,7 +947,8 @@ class DolGraph // Works with line but not with bars //if ($nblot > 2) $firstlot = ($nblot - 2); // We limit nblot to 2 because jflot can't manage more than 2 bars on same x - $serie = array(); $arrayofgroupslegend = array(); + $serie = array(); + $arrayofgroupslegend = array(); //var_dump($this->data); $i = $firstlot; @@ -989,15 +966,15 @@ class DolGraph $alabelexists = 1; $tmpykey = explode('_', ($array_of_ykeys[$i + ($alabelexists ? 1 : 0)]), 3); if (!empty($tmpykey[2]) || $tmpykey[2] == '0') { // This is a 'Group by' array - $tmpvalue = (array_key_exists('y_'.$tmpykey[1].'_'.$tmpykey[2], $valarray) ? $valarray['y_'.$tmpykey[1].'_'.$tmpykey[2]] : $valarray[$i + 1]); + $tmpvalue = (array_key_exists('y_' . $tmpykey[1] . '_' . $tmpykey[2], $valarray) ? $valarray['y_' . $tmpykey[1] . '_' . $tmpykey[2]] : $valarray[$i + 1]); $values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null); $arrayofgroupslegend[$i] = array( - 'stacknum'=> $tmpykey[1], + 'stacknum' => $tmpykey[1], 'legend' => $this->Legend[$tmpykey[1]], - 'legendwithgroup' => $this->Legend[$tmpykey[1]].' - '.$tmpykey[2] + 'legendwithgroup' => $this->Legend[$tmpykey[1]] . ' - ' . $tmpykey[2] ); } else { - $tmpvalue = (array_key_exists('y_'.$i, $valarray) ? $valarray['y_'.$i] : $valarray[$i + 1]); + $tmpvalue = (array_key_exists('y_' . $i, $valarray) ? $valarray['y_' . $i] : $valarray[$i + 1]); //var_dump($i.'_'.$x.'_'.$tmpvalue); $values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null); } @@ -1007,9 +984,9 @@ class DolGraph $j = 0; foreach ($values as $x => $y) { if (isset($y)) { - $serie[$i] .= ($j > 0 ? ", " : "").$y; + $serie[$i] .= ($j > 0 ? ", " : "") . $y; } else { - $serie[$i] .= ($j > 0 ? ", " : "").'null'; + $serie[$i] .= ($j > 0 ? ", " : "") . 'null'; } $j++; } @@ -1022,12 +999,11 @@ class DolGraph $tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.')))); - $this->stringtoshow = ''."\n"; - if (!empty($this->title)) $this->stringtoshow .= '
'.$this->title.'
'; - if (!empty($this->shownographyet)) - { - $this->stringtoshow .= '
'; - $this->stringtoshow .= '
'.$langs->trans("NotEnoughDataYet").'...
'; + $this->stringtoshow = '' . "\n"; + if (!empty($this->title)) $this->stringtoshow .= '
' . $this->title . '
'; + if (!empty($this->shownographyet)) { + $this->stringtoshow .= '
'; + $this->stringtoshow .= '
' . $langs->trans("NotEnoughDataYet") . '...
'; return; } @@ -1036,17 +1012,15 @@ class DolGraph if (count($this->data) > 20) $dolxaxisvertical = 'dol-xaxis-vertical'; // No height for the pie grah $cssfordiv = 'dolgraphchart'; - if (isset($this->type[$firstlot])) $cssfordiv .= ' dolgraphchar'.$this->type[$firstlot]; - $this->stringtoshow .= '
'."\n"; + if (isset($this->type[$firstlot])) $cssfordiv .= ' dolgraphchar' . $this->type[$firstlot]; + $this->stringtoshow .= '
' . "\n"; - $this->stringtoshow .= ''."\n"; + $this->stringtoshow .= '' . "\n"; } @@ -1301,14 +1332,13 @@ class DolGraph { global $langs; - if ($shownographyet) - { - $s = '
'; + if ($shownographyet) { + $s = '
'; $s .= '
'; if (is_numeric($shownographyet)) { - $s .= $langs->trans("NotEnoughDataYet").'...'; + $s .= $langs->trans("NotEnoughDataYet") . '...'; } else { - $s .= $shownographyet.'...'; + $s .= $shownographyet . '...'; } $s .= '
'; return $s; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 24b3a5c2bbf..fdcdc89e53e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1995,7 +1995,7 @@ class Form if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { $urloption .= '&socid='.$socid; } - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); if (!empty($conf->variants->enabled)) { $out .= ' @@ -5930,24 +5930,29 @@ class Form * * @param string $prefix Prefix * @param string $selected Selected duration type - * @param array|null $ecludetypes Array of duration types to exclude. Example array('y', 'm') + * @param array $excludetypes Array of duration types to exclude. Example array('y', 'm') * @return string HTML select string */ - public function selectTypeDuration($prefix, $selected = 'i', $excludtypes = null) + public function selectTypeDuration($prefix, $selected = 'i', $excludetypes = array()) { global $langs; - $TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes')); + $TDurationTypes = array( + 'y'=>$langs->trans('Years'), + 'm'=>$langs->trans('Month'), + 'w'=>$langs->trans('Weeks'), + 'd'=>$langs->trans('Days'), + 'h'=>$langs->trans('Hours'), + 'i'=>$langs->trans('Minutes') + ); // Removed undesired duration types - if (is_array($excludtypes)) { - foreach($excludtypes as $value) { - unset($TDurationTypes[$value]); - } + foreach ($excludetypes as $value) { + unset($TDurationTypes[$value]); } $retstring = '