From 53e9da4748bcf9a8493ad0a30a3cf5a471a11686 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 23 Oct 2021 20:37:07 +0000 Subject: [PATCH] Fixing style errors. --- htdocs/delivery/card.php | 22 ++++++++++------------ htdocs/delivery/class/delivery.class.php | 18 +++++++++--------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 67a80084710..ee41019d218 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -609,20 +609,18 @@ if ($action == 'create') { // Create. Seems to no be used $object->lines[$i]->fetch_optionals(); - if ($action == 'create_delivery') { - $srcLine = new ExpeditionLigne($db); + if ($action == 'create_delivery') { + $srcLine = new ExpeditionLigne($db); + $extrafields->fetch_name_optionals_label($srcLine->table_element); + $srcLine->id = $expedition->lines[$i]->id; + $srcLine->fetch_optionals(); + + $object->lines[$i]->array_options = array_merge($object->lines[$i]->array_options, $srcLine->array_options); + } else { + $srcLine = new DeliveryLine($db); $extrafields->fetch_name_optionals_label($srcLine->table_element); - $srcLine->id = $expedition->lines[$i]->id; - $srcLine->fetch_optionals(); - - $object->lines[$i]->array_options = array_merge($object->lines[$i]->array_options, $srcLine->array_options); - } - else { - $srcLine = new DeliveryLine($db); - $extrafields->fetch_name_optionals_label($srcLine->table_element); - - } + } print $object->lines[$i]->showOptionals($extrafields, $mode, array('style' => 'class="oddeven"', 'colspan' => $colspan), ''); //} } diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 775cd96e2c3..dee6d021e17 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -282,14 +282,14 @@ class Delivery extends CommonObject if (!$this->db->query($sql)) { $error++; } - + $id = $this->db->last_insert_id(MAIN_DB_PREFIX."deliverydet"); - + if (is_array($array_options) && count($array_options) > 0) { - $line = new DeliveryLine($this->db); - $line->id = $id; - $line->array_options = $array_options; - $result = $line->insertExtraFields(); + $line = new DeliveryLine($this->db); + $line->id = $id; + $line->array_options = $array_options; + $result = $line->insertExtraFields(); } if ($error == 0) { @@ -541,7 +541,7 @@ class Delivery extends CommonObject $line->qty = $expedition->lines[$i]->qty_shipped; $line->fk_product = $expedition->lines[$i]->fk_product; if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($expedition->lines[$i]->array_options) && count($expedition->lines[$i]->array_options) > 0) { // For avoid conflicts if trigger used - $line->array_options = $expedition->lines[$i]->array_options; + $line->array_options = $expedition->lines[$i]->array_options; } $this->lines[$i] = $line; } @@ -608,13 +608,13 @@ class Delivery extends CommonObject { global $conf; - $num = count($this->lines); + $num = count($this->lines); $line = new DeliveryLine($this->db); $line->origin_id = $origin_id; $line->qty = $qty; if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) { // For avoid conflicts if trigger used - $line->array_options = $array_options; + $line->array_options = $array_options; } $this->lines[$num] = $line; }