From 4c08d34bb5332d42678a37d482007faa436569d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 2 Mar 2015 03:53:12 +0100 Subject: [PATCH] Standardized $rowid as property --- htdocs/commande/class/commande.class.php | 1 + htdocs/compta/facture/class/facture.class.php | 1 + htdocs/core/class/commonobject.class.php | 6 +++--- htdocs/core/class/commonobjectline.class.php | 7 +++++++ htdocs/core/tpl/objectline_edit.tpl.php | 4 ++-- htdocs/core/tpl/objectline_view.tpl.php | 12 ++++++------ htdocs/fichinter/class/fichinter.class.php | 1 - 7 files changed, 20 insertions(+), 12 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index c1c0fa9ec4e..01de7890f9b 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3141,6 +3141,7 @@ class Commande extends CommonOrder $this->lines[$i] = new OrderLine($this->db); $this->lines[$i]->id = $obj->rowid; + $this->lines[$i]->rowid = $obj->rowid; $this->lines[$i]->label = $obj->custom_label; $this->lines[$i]->description = $obj->description; $this->lines[$i]->fk_product = $obj->fk_product; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index d9254df2374..72801b121ff 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3388,6 +3388,7 @@ class Facture extends CommonInvoice $this->lines[$i] = new FactureLigne($this->db); $this->lines[$i]->id = $obj->rowid; + $this->lines[$i]->rowid = $obj->rowid; $this->lines[$i]->label = $obj->custom_label; // deprecated $this->lines[$i]->description = $obj->description; $this->lines[$i]->fk_product = $obj->fk_product; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c4b2902113a..c08a2b449d7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2671,7 +2671,7 @@ abstract class CommonObject * TODO Move this into an output class file (htmlline.class.php) * * @param string $action GET/POST action - * @param array $line Selected object line to output + * @param CommonObjectLine $line Selected object line to output * @param string $var Is it a an odd line (true) * @param int $num Number of line (0) * @param int $i I @@ -2699,7 +2699,7 @@ abstract class CommonObject if (! empty($line->date_end)) $type=1; // deprecated // Ligne en mode visu - if ($action != 'editline' || $selected != $line->id) + if ($action != 'editline' || $selected != $line->rowid) { // Product if ($line->fk_product > 0) @@ -2762,7 +2762,7 @@ abstract class CommonObject } // Ligne en mode update - if ($this->statut == 0 && $action == 'editline' && $selected == $line->id) + if ($this->statut == 0 && $action == 'editline' && $selected == $line->rowid) { $label = (! empty($line->label) ? $line->label : (($line->fk_product > 0) ? $line->product_label : '')); if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $placeholder=' placeholder="'.$langs->trans("Label").'"'; diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 7f81c85fa23..b88dfabe83d 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -28,6 +28,13 @@ */ abstract class CommonObjectLine extends CommonObject { + /** + * Id of the line + * @var int + * @deprecated Use $rowid + */ + public $id; + /** * Id of the line * @var int diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 98f1b842f1a..6148d50f6fc 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -53,9 +53,9 @@ $coldisplay=-1; // We remove first td ?> > global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>global->MAIN_VIEW_LINE_NUMBER))?2:1; ?> -
+
- + diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 0664d471dec..3ae8a8bcaa4 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -44,11 +44,11 @@ if (empty($usemargins)) $usemargins=0; ?> -> +> global->MAIN_VIEW_LINE_NUMBER)) { ?> -
+
info_bits & 2) == 2) { ?> info_bits & 2) == 2) { ?> - id.'#'.$line->id; ?>"> + rowid.'#'.$line->rowid; ?>"> @@ -186,7 +186,7 @@ if (empty($usemargins)) $usemargins=0; situation_counter == 1 || !$this->situation_cycle_ref) { - print 'id . '">'; + print 'rowid . '">'; print img_delete(); print ''; } @@ -196,12 +196,12 @@ if (empty($usemargins)) $usemargins=0; 1 && empty($conf->browser->phone) && ($this->situation_counter == 1 || !$this->situation_cycle_ref)) { ?> 0) { ?> - id; ?>"> + rowid; ?>"> - id; ?>"> + rowid; ?>"> diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 7be3b0bf3bd..e98852685ad 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1022,7 +1022,6 @@ class FichinterLigne extends CommonObjectLine var $error; // From llx_fichinterdet - var $rowid; var $fk_fichinter; var $desc; // Description ligne var $datei; // Date intervention