diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index edcb68ca3a7..1cc02f0939a 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -58,6 +58,11 @@ class Form
*/
public $error='';
+ /**
+ * @var string[] Array of error strings
+ */
+ public $errors = array();
+
public $num;
// Cache arrays
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index c80358315c6..68da2dce777 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -4,6 +4,7 @@
* Copyright (C) 2010-2011 Juanjo Menent
* Copyright (C) 2015-2017 Marcos García
* Copyright (C) 2015-2017 Nicolas ZABOURI
+ * Copyright (C) 2018 Frédéric France
*
* 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
@@ -44,7 +45,28 @@ class FormMail extends Form
public $fromname;
public $frommail;
- public $replytoname;
+
+ /**
+ * @var string user, company, robot
+ */
+ public $fromtype;
+
+ /**
+ * @var int ID
+ */
+ public $fromid;
+
+ /**
+ * @var string thirdparty etc
+ */
+ public $totype;
+
+ /**
+ * @var int ID
+ */
+ public $toid;
+
+ public $replytoname;
public $replytomail;
public $toname;
public $tomail;
@@ -91,11 +113,6 @@ class FormMail extends Form
public $withtouser=array();
public $withtoccuser=array();
- /**
- * @var string Error code (or message)
- */
- public $error='';
-
public $lines_model;
diff --git a/htdocs/core/login/functions_openid.php b/htdocs/core/login/functions_openid.php
index 83543c43dd5..79cf1a09cb9 100644
--- a/htdocs/core/login/functions_openid.php
+++ b/htdocs/core/login/functions_openid.php
@@ -70,7 +70,7 @@ function check_user_password_openid($usertotest,$passwordtotest,$entitytotest)
$openid = new SimpleOpenID();
$openid->SetIdentity($_GET['openid_identity']);
$openid_validation_result = $openid->ValidateWithServer();
- if ($openid_validation_result == true)
+ if ($openid_validation_result === true)
{
// OK HERE KEY IS VALID
@@ -90,7 +90,7 @@ function check_user_password_openid($usertotest,$passwordtotest,$entitytotest)
}
}
}
- else if($openid->IsError() == true)
+ else if($openid->IsError() === true)
{
// ON THE WAY, WE GOT SOME ERROR
$error = $openid->GetError();
diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php
index 1530e068856..d61630eb88e 100644
--- a/htdocs/product/stock/class/productlot.class.php
+++ b/htdocs/product/stock/class/productlot.class.php
@@ -3,7 +3,7 @@
* Copyright (C) 2014 Juanjo Menent
* Copyright (C) 2015 Florian Henry
* Copyright (C) 2015 Raphaël Doursenaud
- * Copyright (C) ---Put here your own copyright and developer email---
+ * Copyright (C) 2018 Frédéric France
*
* 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
@@ -115,19 +115,19 @@ class Productlot extends CommonObject
// Clean parameters
if (isset($this->entity)) {
- $this->entity = trim($this->entity);
+ $this->entity = (int) $this->entity;
}
if (isset($this->fk_product)) {
- $this->fk_product = trim($this->fk_product);
+ $this->fk_product = (int) $this->fk_product;
}
if (isset($this->batch)) {
$this->batch = trim($this->batch);
}
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)) {
- $this->fk_user_modif = trim($this->fk_user_modif);
+ $this->fk_user_modif = (int) $this->fk_user_modif;
}
if (isset($this->import_key)) {
$this->import_key = trim($this->import_key);
@@ -296,19 +296,19 @@ class Productlot extends CommonObject
// Clean parameters
if (isset($this->entity)) {
- $this->entity = trim($this->entity);
+ $this->entity = (int) $this->entity;
}
if (isset($this->fk_product)) {
- $this->fk_product = trim($this->fk_product);
+ $this->fk_product = (int) $this->fk_product;
}
if (isset($this->batch)) {
$this->batch = trim($this->batch);
}
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)) {
- $this->fk_user_modif = trim($this->fk_user_modif);
+ $this->fk_user_modif = (int) $this->fk_user_modif;
}
if (isset($this->import_key)) {
$this->import_key = trim($this->import_key);
@@ -358,9 +358,6 @@ class Productlot extends CommonObject
}
if (!$error && !$notrigger) {
- // Uncomment this and change MYOBJECT to your own tag if you
- // want this action calls a trigger.
-
// Call triggers
$result=$this->call_trigger('PRODUCTLOT_MODIFY',$user);
if ($result < 0) { $error++; }
@@ -395,8 +392,8 @@ class Productlot extends CommonObject
$this->db->begin();
- if (!$error) {
- if (!$notrigger) {
+ //if (!$error) {
+ //if (!$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@@ -404,8 +401,8 @@ class Productlot extends CommonObject
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
- }
- }
+ //}
+ //}
if (!$error) {
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
@@ -587,15 +584,15 @@ class Productlot extends CommonObject
{
$this->id = 0;
- $this->entity = '';
- $this->fk_product = '';
+ $this->entity = null;
+ $this->fk_product = null;
$this->batch = '';
$this->eatby = '';
$this->sellby = '';
$this->datec = '';
$this->tms = '';
- $this->fk_user_creat = '';
- $this->fk_user_modif = '';
+ $this->fk_user_creat = null;
+ $this->fk_user_modif = null;
$this->import_key = '';
}
}
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index cdfe47a756f..c71f7f861a3 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -115,7 +115,7 @@ if ($action=="deleteline"){
$row = $db->fetch_array ($resql);
$deletelineid=$row[0];
$invoice->deleteline($deletelineid);
- $invoice->fetch($deletelineid);
+ $invoice->fetch($placeid);
}
}