do not trim int

This commit is contained in:
Frédéric FRANCE 2018-10-17 20:24:43 +02:00 committed by GitHub
parent a66256a799
commit ebc5cb5a96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) ---Put here your own copyright and developer email--- * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -115,19 +115,19 @@ class Productlot extends CommonObject
// Clean parameters // Clean parameters
if (isset($this->entity)) { if (isset($this->entity)) {
$this->entity = trim($this->entity); $this->entity = (int) $this->entity;
} }
if (isset($this->fk_product)) { if (isset($this->fk_product)) {
$this->fk_product = trim($this->fk_product); $this->fk_product = (int) $this->fk_product;
} }
if (isset($this->batch)) { if (isset($this->batch)) {
$this->batch = trim($this->batch); $this->batch = trim($this->batch);
} }
if (isset($this->fk_user_creat)) { if (isset($this->fk_user_creat)) {
$this->fk_user_creat = trim($this->fk_user_creat); $this->fk_user_creat = (int) $this->fk_user_creat;
} }
if (isset($this->fk_user_modif)) { if (isset($this->fk_user_modif)) {
$this->fk_user_modif = trim($this->fk_user_modif); $this->fk_user_modif = (int) $this->fk_user_modif;
} }
if (isset($this->import_key)) { if (isset($this->import_key)) {
$this->import_key = trim($this->import_key); $this->import_key = trim($this->import_key);
@ -296,19 +296,19 @@ class Productlot extends CommonObject
// Clean parameters // Clean parameters
if (isset($this->entity)) { if (isset($this->entity)) {
$this->entity = trim($this->entity); $this->entity = (int) $this->entity;
} }
if (isset($this->fk_product)) { if (isset($this->fk_product)) {
$this->fk_product = trim($this->fk_product); $this->fk_product = (int) $this->fk_product;
} }
if (isset($this->batch)) { if (isset($this->batch)) {
$this->batch = trim($this->batch); $this->batch = trim($this->batch);
} }
if (isset($this->fk_user_creat)) { if (isset($this->fk_user_creat)) {
$this->fk_user_creat = trim($this->fk_user_creat); $this->fk_user_creat = (int) $this->fk_user_creat;
} }
if (isset($this->fk_user_modif)) { if (isset($this->fk_user_modif)) {
$this->fk_user_modif = trim($this->fk_user_modif); $this->fk_user_modif = (int) $this->fk_user_modif;
} }
if (isset($this->import_key)) { if (isset($this->import_key)) {
$this->import_key = trim($this->import_key); $this->import_key = trim($this->import_key);
@ -358,9 +358,6 @@ class Productlot extends CommonObject
} }
if (!$error && !$notrigger) { if (!$error && !$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
// Call triggers // Call triggers
$result=$this->call_trigger('PRODUCTLOT_MODIFY',$user); $result=$this->call_trigger('PRODUCTLOT_MODIFY',$user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
@ -395,8 +392,8 @@ class Productlot extends CommonObject
$this->db->begin(); $this->db->begin();
if (!$error) { //if (!$error) {
if (!$notrigger) { //if (!$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you // Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger. // want this action calls a trigger.
@ -404,8 +401,8 @@ class Productlot extends CommonObject
//$result=$this->call_trigger('MYOBJECT_DELETE',$user); //$result=$this->call_trigger('MYOBJECT_DELETE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers //// End call triggers
} //}
} //}
if (!$error) { if (!$error) {
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element; $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
@ -587,15 +584,15 @@ class Productlot extends CommonObject
{ {
$this->id = 0; $this->id = 0;
$this->entity = ''; $this->entity = null;
$this->fk_product = ''; $this->fk_product = null;
$this->batch = ''; $this->batch = '';
$this->eatby = ''; $this->eatby = '';
$this->sellby = ''; $this->sellby = '';
$this->datec = ''; $this->datec = '';
$this->tms = ''; $this->tms = '';
$this->fk_user_creat = ''; $this->fk_user_creat = null;
$this->fk_user_modif = ''; $this->fk_user_modif = null;
$this->import_key = ''; $this->import_key = '';
} }
} }