Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
6a24da54a1
@ -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);
|
$filearray = dol_dir_list($upload_dir, $type, $recursive, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
||||||
if (empty($filearray)) {
|
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.');
|
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;
|
return $filearray;
|
||||||
|
|||||||
@ -911,6 +911,7 @@ if (empty($reshook))
|
|||||||
if (count($prodcustprice->lines) > 0) {
|
if (count($prodcustprice->lines) > 0) {
|
||||||
$pu_ht = price($prodcustprice->lines[0]->price);
|
$pu_ht = price($prodcustprice->lines[0]->price);
|
||||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
$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;
|
$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);
|
$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.')';
|
if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||||
|
|||||||
@ -749,6 +749,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$pu_ht = price($prodcustprice->lines[0]->price);
|
$pu_ht = price($prodcustprice->lines[0]->price);
|
||||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
$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;
|
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||||
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
$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.')';
|
if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||||
|
|||||||
@ -5930,24 +5930,29 @@ class Form
|
|||||||
*
|
*
|
||||||
* @param string $prefix Prefix
|
* @param string $prefix Prefix
|
||||||
* @param string $selected Selected duration type
|
* @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
|
* @return string HTML select string
|
||||||
*/
|
*/
|
||||||
public function selectTypeDuration($prefix, $selected = 'i', $excludtypes = null)
|
public function selectTypeDuration($prefix, $selected = 'i', $excludetypes = array())
|
||||||
{
|
{
|
||||||
global $langs;
|
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
|
// Removed undesired duration types
|
||||||
if (is_array($excludtypes)) {
|
foreach ($excludetypes as $value) {
|
||||||
foreach($excludtypes as $value) {
|
unset($TDurationTypes[$value]);
|
||||||
unset($TDurationTypes[$value]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$retstring = '<select class="flat" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
|
$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.'"';
|
$retstring .= '<option value="'.$key.'"';
|
||||||
if ($key == $selected) {
|
if ($key == $selected) {
|
||||||
$retstring .= " selected";
|
$retstring .= " selected";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user