|
@@ -2103,7 +2103,7 @@ if ($action == 'create') {
|
|
|
|
|
|
// Loop on each product to send/sent
|
|
|
for ($i = 0; $i < $num_prod; $i++) {
|
|
|
- $parameters = array('i' => $i, 'line' => $lines[$i], 'line_id' => $line_id, 'num' => $num_prod, 'alreadysent' => $alreadysent, 'editColspan' => $editColspan, 'outputlangs' => $outputlangs);
|
|
|
+ $parameters = array('i' => $i, 'line' => $lines[$i], 'line_id' => $line_id, 'num' => $num_prod, 'alreadysent' => $alreadysent, 'editColspan' => !empty($editColspan) ? $editColspan : 0, 'outputlangs' => !empty($outputlangs) ? $outputlangs: '');
|
|
|
$reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $object, $action);
|
|
|
if ($reshook < 0) {
|
|
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
|
@@ -2143,10 +2143,10 @@ if ($action == 'create') {
|
|
|
$product_static->weight_units = $lines[$i]->weight_units;
|
|
|
$product_static->length = $lines[$i]->length;
|
|
|
$product_static->length_units = $lines[$i]->length_units;
|
|
|
- $product_static->width = $lines[$i]->width;
|
|
|
- $product_static->width_units = $lines[$i]->width_units;
|
|
|
- $product_static->height = $lines[$i]->height;
|
|
|
- $product_static->height_units = $lines[$i]->height_units;
|
|
|
+ $product_static->width = !empty($lines[$i]->width) ? $lines[$i]->width : 0;
|
|
|
+ $product_static->width_units = !empty($lines[$i]->width_units) ? $lines[$i]->width_units : 0;
|
|
|
+ $product_static->height = !empty($lines[$i]->height) ? $lines[$i]->height : 0;
|
|
|
+ $product_static->height_units = !empty($lines[$i]->height_units) ? $lines[$i]->height_units : 0;
|
|
|
$product_static->surface = $lines[$i]->surface;
|
|
|
$product_static->surface_units = $lines[$i]->surface_units;
|
|
|
$product_static->volume = $lines[$i]->volume;
|
|
@@ -2156,7 +2156,7 @@ if ($action == 'create') {
|
|
|
$text .= ' - '.$label;
|
|
|
$description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($lines[$i]->description));
|
|
|
print $form->textwithtooltip($text, $description, 3, '', '', $i);
|
|
|
- print_date_range($lines[$i]->date_start, $lines[$i]->date_end);
|
|
|
+ print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : '', !empty($lines[$i]->date_end) ? $lines[$i]->date_end : '');
|
|
|
if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) {
|
|
|
print (!empty($lines[$i]->description) && $lines[$i]->description != $lines[$i]->product) ? '<br>'.dol_htmlentitiesbr($lines[$i]->description) : '';
|
|
|
}
|
|
@@ -2181,7 +2181,7 @@ if ($action == 'create') {
|
|
|
}
|
|
|
|
|
|
$unit_order = '';
|
|
|
- if ($conf->global->PRODUCT_USE_UNITS) {
|
|
|
+ if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
|
|
$unit_order = measuringUnitString($lines[$i]->fk_unit);
|
|
|
}
|
|
|
|
|
@@ -2412,9 +2412,9 @@ if ($action == 'create') {
|
|
|
|
|
|
// TODO Show all in same line by setting $display_type = 'line'
|
|
|
if ($action == 'editline' && $line->id == $line_id) {
|
|
|
- print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked, '', 0, 'card');
|
|
|
+ print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), !empty($indiceAsked) ? $indiceAsked : '', '', 0, 'card');
|
|
|
} else {
|
|
|
- print $lines[$i]->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked, '', 0, 'card');
|
|
|
+ print $lines[$i]->showOptionals($extrafields, 'view', array('colspan'=>$colspan), !empty($indiceAsked) ? $indiceAsked : '', '', 0, 'card');
|
|
|
}
|
|
|
}
|
|
|
}
|