Fixing style errors.
This commit is contained in:
parent
7f1a17bcc9
commit
9ef883e7b0
@ -71,7 +71,7 @@ if ($action == 'getDurationUnitByProduct') {
|
|||||||
$res = $product->fetch($idproduct);
|
$res = $product->fetch($idproduct);
|
||||||
|
|
||||||
$cUnit = new CUnits($db);
|
$cUnit = new CUnits($db);
|
||||||
$fk_unit = $cUnit->getUnitFromCode($product->duration_unit, 'short_label','time');
|
$fk_unit = $cUnit->getUnitFromCode($product->duration_unit, 'short_label', 'time');
|
||||||
|
|
||||||
echo json_encode($fk_unit);
|
echo json_encode($fk_unit);
|
||||||
exit();
|
exit();
|
||||||
|
|||||||
@ -162,7 +162,7 @@ if ($filtertype != 1) {
|
|||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php';
|
||||||
$cUnit = new CUnits($this->db);
|
$cUnit = new CUnits($this->db);
|
||||||
$fk_unit_default = $cUnit->getUnitFromCode('h', 'short_label','time');
|
$fk_unit_default = $cUnit->getUnitFromCode('h', 'short_label', 'time');
|
||||||
print '<td class="bordertop nobottom nowrap linecolunit right">';
|
print '<td class="bordertop nobottom nowrap linecolunit right">';
|
||||||
print $formproduct->selectMeasuringUnits("fk_unit", "time", $fk_unit_default, 0, 0);
|
print $formproduct->selectMeasuringUnits("fk_unit", "time", $fk_unit_default, 0, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -423,13 +423,13 @@ class CUnits // extends CommonObject
|
|||||||
* @param string $unit_type weight,size,surface,volume,qty,time...
|
* @param string $unit_type weight,size,surface,volume,qty,time...
|
||||||
* @return int <0 if KO, Id of code if OK
|
* @return int <0 if KO, Id of code if OK
|
||||||
*/
|
*/
|
||||||
public function getUnitFromCode($code, $mode = 'code', $unit_type='')
|
public function getUnitFromCode($code, $mode = 'code', $unit_type = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($mode == 'short_label') {
|
if ($mode == 'short_label') {
|
||||||
return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid',0, ' AND unit_type = "'.$unit_type.'"');
|
return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid', 0, ' AND unit_type = "'.$unit_type.'"');
|
||||||
} elseif ($mode == 'code') {
|
} elseif ($mode == 'code') {
|
||||||
return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid',0, ' AND unit_type = "'. $unit_type .'"');
|
return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid', 0, ' AND unit_type = "'. $unit_type .'"');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $code;
|
return $code;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user