From 83ebea3f86e132bd2e51278983a33cd6fa6c9a8d Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Mar 2019 09:21:04 +0100 Subject: [PATCH 1/4] retrieve from dolibarr repo --- htdocs/custom/.gitignore | 4 ---- htdocs/custom/README.md | 22 ---------------------- htdocs/custom/index.html | 0 3 files changed, 26 deletions(-) delete mode 100644 htdocs/custom/.gitignore delete mode 100644 htdocs/custom/README.md delete mode 100644 htdocs/custom/index.html diff --git a/htdocs/custom/.gitignore b/htdocs/custom/.gitignore deleted file mode 100644 index 89ebd12182c..00000000000 --- a/htdocs/custom/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/* -!.gitignore -!README.md -!index.html \ No newline at end of file diff --git a/htdocs/custom/README.md b/htdocs/custom/README.md deleted file mode 100644 index 3a486e5a4a8..00000000000 --- a/htdocs/custom/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# DOLIBARR ERP & CRM custom directory for external modules. - -This directory is dedicated to store external modules. -To use it, just copy here the directory of the module into this directory. - -Note: On linux or MAC systems, it is better to unzip/store the external module directory into -a different place than this directory and just adding a symbolic link here to the htdocs directory -of the module. - -For example on Linux OS: Get the module from the command -mkdir ~/git; cd ~/git -git clone https://git.framasoft.org/p/newmodule/newmodule.git -Then create the symbolic link -ln -fs ~/git/newmodule/htdocs /path_to_dolibarr/htdocs/custom/newmodule - -WARNING !!! -Check also that the /custom directory is active by adding into dolibarr conf/conf.php file the following -two lines, so dolibarr will also scan /custom directory to find external external modules: - -$dolibarr_main_url_root_alt='/custom'; -$dolibarr_main_document_root_alt='/path_to_dolibarr/htdocs/custom/'; - diff --git a/htdocs/custom/index.html b/htdocs/custom/index.html deleted file mode 100644 index e69de29bb2d..00000000000 From 7afc8cdd7c1efd3285ee5928bf0c7a83ac269da7 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Mar 2019 10:32:01 +0100 Subject: [PATCH 2/4] custom content was deleted --- htdocs/custom/README.md | 22 ++++++++++++++++++++++ htdocs/custom/index.html | 0 2 files changed, 22 insertions(+) create mode 100644 htdocs/custom/README.md create mode 100644 htdocs/custom/index.html diff --git a/htdocs/custom/README.md b/htdocs/custom/README.md new file mode 100644 index 00000000000..3a486e5a4a8 --- /dev/null +++ b/htdocs/custom/README.md @@ -0,0 +1,22 @@ +# DOLIBARR ERP & CRM custom directory for external modules. + +This directory is dedicated to store external modules. +To use it, just copy here the directory of the module into this directory. + +Note: On linux or MAC systems, it is better to unzip/store the external module directory into +a different place than this directory and just adding a symbolic link here to the htdocs directory +of the module. + +For example on Linux OS: Get the module from the command +mkdir ~/git; cd ~/git +git clone https://git.framasoft.org/p/newmodule/newmodule.git +Then create the symbolic link +ln -fs ~/git/newmodule/htdocs /path_to_dolibarr/htdocs/custom/newmodule + +WARNING !!! +Check also that the /custom directory is active by adding into dolibarr conf/conf.php file the following +two lines, so dolibarr will also scan /custom directory to find external external modules: + +$dolibarr_main_url_root_alt='/custom'; +$dolibarr_main_document_root_alt='/path_to_dolibarr/htdocs/custom/'; + diff --git a/htdocs/custom/index.html b/htdocs/custom/index.html new file mode 100644 index 00000000000..e69de29bb2d From ab71be5d5bdb83850250cedef891d4ddd7c7845d Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Mar 2019 10:32:55 +0100 Subject: [PATCH 3/4] custom content was deleted --- htdocs/custom/.gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 htdocs/custom/.gitignore diff --git a/htdocs/custom/.gitignore b/htdocs/custom/.gitignore new file mode 100644 index 00000000000..9420e8c61eb --- /dev/null +++ b/htdocs/custom/.gitignore @@ -0,0 +1,4 @@ +/* +!.gitignore +!README.md +!index.html From ae50a8b8969f22a8b6df4827db5071425cf500e2 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 12 Mar 2019 10:48:08 +0100 Subject: [PATCH 4/4] change add_commercial signature --- htdocs/societe/class/societe.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 466cda8e05f..60790698b24 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1939,11 +1939,11 @@ class Societe extends CommonObject * * @param User $user Object user * @param int $commid Id of user - * @return void + * @return int <0 if KO, >0 if OK */ public function add_commercial(User $user, $commid) { - // phpcs:enable + // phpcs:enable $error=0; @@ -1961,14 +1961,18 @@ class Societe extends CommonObject if (! $this->db->query($sql) ) { dol_syslog(get_class($this)."::add_commercial Erreur"); + return -2; } else { $this->context=array('commercial_modified'=>$commid); $result=$this->call_trigger('COMPANY_LINK_SALE_REPRESENTATIVE', $user); - if ($result < 0) $error++; + if ($result < 0) return $result; + + return 1; } } + return -1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps