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/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 24b3a5c2bbf..e1e1fc45228 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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 = '