2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2020-12-11 14:49:02 +01:00
4 changed files with 26 additions and 8 deletions

View File

@@ -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;

View File

@@ -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.')';

View File

@@ -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.')';

View File

@@ -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 = '<select class="flat" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
foreach ($TDurationTypes as $key=>$typeduration) {
foreach ($TDurationTypes as $key => $typeduration) {
$retstring .= '<option value="'.$key.'"';
if ($key == $selected) {
$retstring .= " selected";