From 86e237f61fa728db3a6e53e3ad1c9d45ed7ff266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 9 Sep 2018 14:18:26 +0200 Subject: [PATCH 1/2] Completely comment unused code --- .../accountancy/class/bookkeeping.class.php | 69 +++++++++---------- 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index cacf9b0a641..86835eb2c26 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -335,18 +335,15 @@ class BookKeeping extends CommonObject dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); } - if (! $error) { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action to call a trigger. + //if (! $error && ! $notrigger) { - if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action to call a trigger. - - // // Call triggers - // $result=$this->call_trigger('MYOBJECT_CREATE',$user); - // if ($result < 0) $error++; - // // End call triggers - } - } + // // Call triggers + // $result=$this->call_trigger('MYOBJECT_CREATE',$user); + // if ($result < 0) $error++; + // // End call triggers + //} // Commit or rollback if ($error) { @@ -566,15 +563,15 @@ class BookKeeping extends CommonObject if (! $error) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element . $mode); - if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action to call a trigger. + // Uncomment this and change MYOBJECT to your own tag if you + // want this action to call a trigger. + //if (! $notrigger) { - // // Call triggers - // $result=$this->call_trigger('MYOBJECT_CREATE',$user); - // if ($result < 0) $error++; - // // End call triggers - } + // // Call triggers + // $result=$this->call_trigger('MYOBJECT_CREATE',$user); + // if ($result < 0) $error++; + // // End call triggers + //} } // Commit or rollback @@ -1131,15 +1128,15 @@ class BookKeeping extends CommonObject dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); } - if (! $error && ! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + //if (! $error && ! $notrigger) { - // // Call triggers - // $result=$this->call_trigger('MYOBJECT_MODIFY',$user); - // if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - // // End call triggers - } + // // Call triggers + // $result=$this->call_trigger('MYOBJECT_MODIFY',$user); + // if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} + // // End call triggers + //} // Commit or rollback if ($error) { @@ -1205,17 +1202,15 @@ class BookKeeping extends CommonObject $this->db->begin(); - if (! $error) { - if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + //if (! $error && ! $notrigger) { - // // Call triggers - // $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 - } - } + // // Call triggers + // $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.$mode; From bd07c3439108f62b09c2dc7a1bfba3695c845e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 9 Sep 2018 14:50:59 +0200 Subject: [PATCH 2/2] fix phpcs --- htdocs/core/lib/website.lib.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 38a35d98088..211cb7339b8 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -621,7 +621,7 @@ function dolSavePageContent($filetpl, $object, $objectpage) * @param string $pathofwebsite Path of website root * @param string $fileindex Full path of file index.php * @param string $filetpl File tpl to index.php page redirect to - * @param string $fileindex Full path of file wrapper.php + * @param string $filewrapper Full path of file wrapper.php * @return boolean True if OK */ function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper) @@ -801,5 +801,3 @@ function dolSaveHtaccessFile($filehtaccess, $htaccess) return true; } - -