From 2da87bcdc7c1c0d7530724f1251830025192bec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Nov 2019 17:52:58 +0100 Subject: [PATCH 1/6] Update UserTest.php --- test/phpunit/UserTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index e46d1ac084a..7451b7ba920 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -192,7 +192,7 @@ class UserTest extends PHPUnit\Framework\TestCase $newlocalobject=new User($this->savdb); $newlocalobject->initAsSpecimen(); $this->changeProperties($newlocalobject); - $this->assertEquals($this->objCompare($localobject, $newlocalobject, true, array('id','socid','societe_id','ref','pass','pass_indatabase','pass_indatabase_crypted','datec','datem','datelastlogin','datepreviouslogin')), array()); // Actual, Expected + $this->assertEquals($this->objCompare($localobject, $newlocalobject, true, array('id','ref','pass','pass_indatabase','pass_indatabase_crypted','datec','datem','datelastlogin','datepreviouslogin')), array()); // Actual, Expected return $localobject; } @@ -304,7 +304,7 @@ class UserTest extends PHPUnit\Framework\TestCase /** * Edit an object to test updates * - * @param mixed $localobject Object Facture + * @param mixed $localobject Object User * @return void */ public function changeProperties(&$localobject) From b8202f6ed4df3a7fbaebc182352d6531415f29a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Nov 2019 18:15:24 +0100 Subject: [PATCH 2/6] wip --- htdocs/core/lib/ticket.lib.php | 4 ++-- htdocs/product/class/product.class.php | 1 - htdocs/product/fournisseurs.php | 3 +-- test/phpunit/UserTest.php | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index e89e9a79194..a85d8bad2d7 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -834,7 +834,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $filePath = DOL_DATA_ROOT . '/'. $doc->filepath . '/'. $doc->filename; $mime = dol_mimetype($filePath); $file = $actionstatic->id.'/'.$doc->filename; - $thumb = $actionstatic->id.'/thumbs/'.substr($doc->filename, 0, strrpos($doc->filename,'.')).'_mini'.substr($doc->filename, strrpos($doc->filename,'.')); + $thumb = $actionstatic->id.'/thumbs/'.substr($doc->filename, 0, strrpos($doc->filename, '.')).'_mini'.substr($doc->filename, strrpos($doc->filename, '.')); $doclink = dol_buildpath('document.php', 1).'?modulepart=actions&attachment=0&file='.urlencode($file).'&entity='.$conf->entity; $viewlink = dol_buildpath('viewimage.php', 1).'?modulepart=actions&file='.urlencode($thumb).'&entity='.$conf->entity; @@ -881,7 +881,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no /** - * @var $object ActionComm + * @var ActionComm $object ActionComm * @return array */ function getTicketActionCommEcmList($object) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index de14a5621a2..4d8afaad9aa 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2093,7 +2093,6 @@ class Product extends CommonObject $resql = $this->db->query($sql); if ($resql) { - unset($this->oldcopy); if ($this->db->num_rows($resql) > 0) { diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index f0bedbcd7f5..e1940864dd0 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -269,7 +269,6 @@ if (empty($reshook)) $resql = $db->query("SELECT * FROM " . MAIN_DB_PREFIX . "product_fournisseur_price_extrafields WHERE fk_object = " . $object->product_fourn_price_id); // Insert a new extrafields row, if none exists if ($db->num_rows($resql) != 1) { - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_fournisseur_price_extrafields (fk_object, "; foreach ($extrafield_values as $key => $value) { $sql .= str_replace('options_', '', $key) . ', '; @@ -291,7 +290,7 @@ if (empty($reshook)) // Execute the sql command from above $db->query($sql); - + $newprice = price2num(GETPOST("price", "alpha")); if ($conf->multicurrency->enabled) diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index 7451b7ba920..94b2830ffdf 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -192,7 +192,7 @@ class UserTest extends PHPUnit\Framework\TestCase $newlocalobject=new User($this->savdb); $newlocalobject->initAsSpecimen(); $this->changeProperties($newlocalobject); - $this->assertEquals($this->objCompare($localobject, $newlocalobject, true, array('id','ref','pass','pass_indatabase','pass_indatabase_crypted','datec','datem','datelastlogin','datepreviouslogin')), array()); // Actual, Expected + $this->assertEquals($this->objCompare($localobject, $newlocalobject, true, array('id','socid','societe_id','ref','pass','pass_indatabase','pass_indatabase_crypted','datec','datem','datelastlogin','datepreviouslogin')), array()); // Actual, Expected return $localobject; } @@ -309,7 +309,7 @@ class UserTest extends PHPUnit\Framework\TestCase */ public function changeProperties(&$localobject) { - $localobject->note='New note after update'; + $localobject->note_private='New note after update'; } /** From f25196dcdcb4cc22f137c879021506e3394d12dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Nov 2019 18:27:36 +0100 Subject: [PATCH 3/6] wip --- htdocs/core/lib/ticket.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index a85d8bad2d7..1aa4de3192c 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -881,7 +881,8 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no /** - * @var ActionComm $object ActionComm + * get ticket Actioncomm Ecm List + * @param ActionComm $object ActionComm * @return array */ function getTicketActionCommEcmList($object) From 06021b23a3aefc733ab226a0d642b2d4e076c891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Nov 2019 19:04:18 +0100 Subject: [PATCH 4/6] wip --- htdocs/user/class/user.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 76d4d431561..6c9ede1a3b2 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1520,6 +1520,7 @@ class User extends CommonObject $this->signature = trim($this->signature); $this->note_public = trim($this->note_public); $this->note_private = trim($this->note_private); + $this->note = trim($this->note_private); $this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning $this->admin = $this->admin?$this->admin:0; $this->address = empty($this->address)?'':$this->address; From fecc9e86a5e9a09a45b018398e05ecc62f533e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Nov 2019 19:55:56 +0100 Subject: [PATCH 5/6] wip --- test/phpunit/UserTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index 94b2830ffdf..3c89bd52d06 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -192,7 +192,7 @@ class UserTest extends PHPUnit\Framework\TestCase $newlocalobject=new User($this->savdb); $newlocalobject->initAsSpecimen(); $this->changeProperties($newlocalobject); - $this->assertEquals($this->objCompare($localobject, $newlocalobject, true, array('id','socid','societe_id','ref','pass','pass_indatabase','pass_indatabase_crypted','datec','datem','datelastlogin','datepreviouslogin')), array()); // Actual, Expected + $this->assertEquals($this->objCompare($localobject, $newlocalobject, true, array('id','socid','societe_id','note','ref','pass','pass_indatabase','pass_indatabase_crypted','datec','datem','datelastlogin','datepreviouslogin')), array()); // Actual, Expected return $localobject; } From c580aab54307b0ac33d64a5c41d9e03388310659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Nov 2019 20:13:01 +0100 Subject: [PATCH 6/6] wip --- htdocs/user/class/user.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 6c9ede1a3b2..76d4d431561 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1520,7 +1520,6 @@ class User extends CommonObject $this->signature = trim($this->signature); $this->note_public = trim($this->note_public); $this->note_private = trim($this->note_private); - $this->note = trim($this->note_private); $this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning $this->admin = $this->admin?$this->admin:0; $this->address = empty($this->address)?'':$this->address;