From ab06ffda5847f4c97ae43a5c885553ed14e18dfb Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 3 Jun 2016 15:43:05 +0200 Subject: [PATCH 01/46] NEW : select default bank account on thirdparty card --- htdocs/comm/card.php | 32 ++++++++++++++++++- .../install/mysql/migration/4.0.0-4.1.0.sql | 24 ++++++++++++++ htdocs/install/mysql/tables/llx_societe.sql | 1 + htdocs/societe/class/societe.class.php | 5 +-- 4 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 htdocs/install/mysql/migration/4.0.0-4.1.0.sql diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 256a31fd947..8ead3188ae7 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -46,6 +46,8 @@ if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherent if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $langs->load("companies"); +$langs->load('banks'); + if (! empty($conf->contrat->enabled)) $langs->load("contracts"); if (! empty($conf->commande->enabled)) $langs->load("orders"); if (! empty($conf->expedition->enabled)) $langs->load("sendings"); @@ -124,7 +126,15 @@ if (empty($reshook)) if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } - // customer preferred shipping method + // Bank account + if ($action == 'setbankaccount' && $user->rights->societe->creer) + { + $object->fetch($id); + $result=$object->setBankAccount(GETPOST('fk_account','int')); + if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); + } + + // customer preferred shipping method if ($action == 'setshippingmethod' && $user->rights->societe->creer) { $object->fetch($id); @@ -337,6 +347,26 @@ if ($id > 0) print ""; print ''; + // Compte bancaire par défaut + print ''; + print ''; + print '
'; + print $langs->trans('BankAccount'); + print ''; + if (($action != 'editbankaccount') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; + print ''; + if ($action == 'editbankaccount') + { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'fk_account',1); + } + else + { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'none'); + } + print ""; + print ''; + + // Relative discounts (Discounts-Drawbacks-Rebates) print ''; print ' - '; - print ''; + print ''; + print ''; print ''; } From ec03ea8f70a6e2440379c3246cd808fa390e27d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Jul 2016 15:33:17 +0200 Subject: [PATCH 33/46] Dev branch is now 5.0 alpha --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 54053c26606..02b87940916 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','4.0.0-rc'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.0-alpha'); if (! defined('EURO')) define('EURO',chr(128)); From ec6640af632ec8bbe1b8d018322928e08ad2cc44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Jul 2016 15:54:46 +0200 Subject: [PATCH 34/46] Add field virtualhost for website module --- htdocs/install/check.php | 3 +- .../install/mysql/migration/4.0.0-5.0.0.sql | 29 +++++++++++++++++++ htdocs/install/mysql/tables/llx_website.sql | 1 + htdocs/websites/class/website.class.php | 22 ++++++++++++-- 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 htdocs/install/mysql/migration/4.0.0-5.0.0.sql diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 9e21b994780..66a9f7f77bb 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -392,7 +392,8 @@ else array('from'=>'3.6.0', 'to'=>'3.7.0'), array('from'=>'3.7.0', 'to'=>'3.8.0'), array('from'=>'3.8.0', 'to'=>'3.9.0'), - array('from'=>'3.9.0', 'to'=>'4.0.0') + array('from'=>'3.9.0', 'to'=>'4.0.0'), + array('from'=>'4.0.0', 'to'=>'5.0.0') ); $count=0; diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql new file mode 100644 index 00000000000..849a71c935f --- /dev/null +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -0,0 +1,29 @@ +-- +-- Be carefull to requests order. +-- This file must be loaded by calling /install/index.php page +-- when current version is 4.0.0 or higher. +-- +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; +-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); +-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; +-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); +-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; +-- To drop an index: -- VMYSQL4.0 DROP INDEX nomindex on llx_table +-- To drop an index: -- VPGSQL8.0 DROP INDEX nomindex +-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y +-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y +-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE +-- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; +-- To set a field as default NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; +-- Note: fields with type BLOB/TEXT can't have default value. +-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); +-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); + + +ALTER TABLE llx_website ADD COLUMN virtualhost varchar(255) after fk_default_home; + + + + diff --git a/htdocs/install/mysql/tables/llx_website.sql b/htdocs/install/mysql/tables/llx_website.sql index 8dd257ffa69..331e6b085bd 100644 --- a/htdocs/install/mysql/tables/llx_website.sql +++ b/htdocs/install/mysql/tables/llx_website.sql @@ -25,6 +25,7 @@ CREATE TABLE llx_website description varchar(255), status integer, fk_default_home integer, + virtualhost varchar(255), date_creation datetime, date_modification datetime, tms timestamp diff --git a/htdocs/websites/class/website.class.php b/htdocs/websites/class/website.class.php index e87e830bb77..a3760a792ce 100644 --- a/htdocs/websites/class/website.class.php +++ b/htdocs/websites/class/website.class.php @@ -85,6 +85,12 @@ class Website extends CommonObject * @var integer */ public $fk_default_home; + /** + * @var string + */ + public $virtualhost; + + public $records; /** @@ -143,7 +149,8 @@ class Website extends CommonObject $sql.= 'ref,'; $sql.= 'description,'; $sql.= 'status,'; - $sql.= 'fk_default_home,'; + $sql.= 'fk_default_home,'; + $sql.= 'virtualhost,'; $sql.= 'date_creation,'; $sql.= 'date_modification'; @@ -154,6 +161,7 @@ class Website extends CommonObject $sql .= ' '.(! isset($this->description)?'NULL':"'".$this->db->escape($this->description)."'").','; $sql .= ' '.(! isset($this->status)?'NULL':$this->status).','; $sql .= ' '.(! isset($this->fk_default_home)?'NULL':$this->fk_default_home).','; + $sql .= ' '.(! isset($this->virtualhost)?'NULL':$this->virtualhost).','; $sql .= ' '.(! isset($this->date_creation) || dol_strlen($this->date_creation)==0?'NULL':"'".$this->db->idate($this->date_creation)."'").','; $sql .= ' '.(! isset($this->date_modification) || dol_strlen($this->date_modification)==0?'NULL':"'".$this->db->idate($this->date_modification)."'"); @@ -214,6 +222,7 @@ class Website extends CommonObject $sql .= " t.description,"; $sql .= " t.status,"; $sql .= " t.fk_default_home,"; + $sql .= " t.virtualhost,"; $sql .= " t.date_creation,"; $sql .= " t.date_modification,"; $sql .= " t.tms"; @@ -237,6 +246,7 @@ class Website extends CommonObject $this->description = $obj->description; $this->status = $obj->status; $this->fk_default_home = $obj->fk_default_home; + $this->virtualhost = $obj->virtualhost; $this->date_creation = $this->db->jdate($obj->date_creation); $this->date_modification = $this->db->jdate($obj->date_modification); $this->tms = $this->db->jdate($obj->tms); @@ -281,7 +291,8 @@ class Website extends CommonObject $sql .= " t.ref,"; $sql .= " t.description,"; $sql .= " t.status,"; - $sql .= " t.fk_default_home,"; + $sql .= " t.fk_default_home,"; + $sql .= " t.virtualhost,"; $sql .= " t.date_creation,"; $sql .= " t.date_modification,"; $sql .= " t.tms"; @@ -321,6 +332,7 @@ class Website extends CommonObject $line->description = $obj->description; $line->status = $obj->status; $line->fk_default_home = $obj->fk_default_home; + $line->virtualhost = $obj->virtualhost; $line->date_creation = $this->db->jdate($obj->date_creation); $line->date_modification = $this->db->jdate($obj->date_modification); $line->tms = $this->db->jdate($obj->tms); @@ -380,6 +392,7 @@ class Website extends CommonObject $sql .= ' description = '.(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").','; $sql .= ' status = '.(isset($this->status)?$this->status:"null").','; $sql .= ' fk_default_home = '.(($this->fk_default_home > 0)?$this->fk_default_home:"null").','; + $sql .= ' virtualhost = '.(($this->virtualhost != '')?$this->virtualhost:"null").','; $sql .= ' date_creation = '.(! isset($this->date_creation) || dol_strlen($this->date_creation) != 0 ? "'".$this->db->idate($this->date_creation)."'" : 'null').','; $sql .= ' date_modification = '.(! isset($this->date_modification) || dol_strlen($this->date_modification) != 0 ? "'".$this->db->idate($this->date_modification)."'" : 'null').','; $sql .= ' tms = '.(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : "'".$this->db->idate(dol_now())."'"); @@ -627,6 +640,7 @@ class Website extends CommonObject $this->description = 'A specimen website'; $this->status = ''; $this->fk_default_home = null; + $this->virtualhost = 'http://myvirtualhost'; $this->date_creation = dol_now(); $this->date_modification = dol_now(); $this->tms = dol_now(); @@ -665,6 +679,10 @@ class WebsiteLine * @var int */ public $fk_default_home; + /** + * @var string + */ + public $virtualhost; /** * @var mixed */ From ddcf135a9627494abe4b3c7670d9add5c643eaae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Jul 2016 15:56:35 +0200 Subject: [PATCH 35/46] Prepare 5.0 --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8655b27d4ed..8e1aa2aa10b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -287,10 +287,13 @@ script: php upgrade.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400.log php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade390400-2.log php step5.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-3.log + php upgrade.php 4.0.0 5.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade400500.log + php upgrade2.php 4.0.0 5.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade400500-2.log + php step5.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-3.log cd - set +e echo - #cat $TRAVIS_BUILD_DIR/upgrade390400-2.log + #cat $TRAVIS_BUILD_DIR/upgrade400500-2.log #cat /tmp/dolibarr_install.log - | From a5123c06dbe2930c1ef235a0ccc15e2f33ffe00c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Jul 2016 19:42:04 +0200 Subject: [PATCH 36/46] Save the virtualhost so we can test without entering it each time. --- htdocs/core/ajax/saveinplace.php | 15 ++++++++++++++- htdocs/core/class/genericobject.class.php | 3 +-- htdocs/core/modules/modWebsites.class.php | 2 +- htdocs/websites/index.php | 16 ++++++++++++++-- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php index 4d0ab65a941..48797dd0432 100644 --- a/htdocs/core/ajax/saveinplace.php +++ b/htdocs/core/ajax/saveinplace.php @@ -35,6 +35,19 @@ $element = GETPOST('element','alpha',2); $table_element = GETPOST('table_element','alpha',2); $fk_element = GETPOST('fk_element','alpha',2); +/* Example: +field:editval_ref_customer (8 first chars will removed to know name of property) +element:contrat +table_element:contrat +fk_element:4 +type:string +value:aaa +loadmethod: +savemethod: +savemethodname: +*/ + + /* * View */ @@ -81,7 +94,7 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($ } else $newelement = $element; - if (! empty($user->rights->$newelement->creer) || ! empty($user->rights->$newelement->write) + if (! empty($user->rights->$newelement->creer) || ! empty($user->rights->$newelement->create) || ! empty($user->rights->$newelement->write) || (isset($subelement) && (! empty($user->rights->$newelement->$subelement->creer) || ! empty($user->rights->$newelement->$subelement->write))) || ($element == 'payment' && $user->rights->facture->paiement) || ($element == 'payment_supplier' && $user->rights->fournisseur->facture->creer)) diff --git a/htdocs/core/class/genericobject.class.php b/htdocs/core/class/genericobject.class.php index 32960664c17..c89b5c31fea 100644 --- a/htdocs/core/class/genericobject.class.php +++ b/htdocs/core/class/genericobject.class.php @@ -24,8 +24,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; /** - * \class GenericObject - * \brief Class of a generic business object + * Class of a generic business object */ class GenericObject extends CommonObject diff --git a/htdocs/core/modules/modWebsites.class.php b/htdocs/core/modules/modWebsites.class.php index 30795c6c0fa..a510e569b60 100644 --- a/htdocs/core/modules/modWebsites.class.php +++ b/htdocs/core/modules/modWebsites.class.php @@ -99,7 +99,7 @@ class modWebsites extends DolibarrModules $this->rights[$r][0] = 10002; $this->rights[$r][1] = 'Create/modify website content'; $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'create'; + $this->rights[$r][4] = 'write'; $r++; $this->rights[$r][0] = 10003; diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index d61bad409a2..475fe219826 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -486,6 +486,7 @@ if (count($object->records) > 0) { $realurl=$urlwithroot.'/public/websites/index.php?website='.$website; $dataroot=DOL_DATA_ROOT.'/websites/'.$website; + if (! empty($object->virtualhost)) $realurl=$object->virtualhost; // TODO If virtual url defined, we use it /*print ' - '.$langs->trans("RealURL").' '; @@ -507,10 +508,21 @@ if (count($object->records) > 0) print '
'; diff --git a/htdocs/install/mysql/migration/4.0.0-4.1.0.sql b/htdocs/install/mysql/migration/4.0.0-4.1.0.sql new file mode 100644 index 00000000000..10ca20953c3 --- /dev/null +++ b/htdocs/install/mysql/migration/4.0.0-4.1.0.sql @@ -0,0 +1,24 @@ +-- +-- Be carefull to requests order. +-- This file must be loaded by calling /install/index.php page +-- when current version is 4.0.0 or higher. +-- +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; +-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); +-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; +-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); +-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; +-- To drop an index: -- VMYSQL4.0 DROP INDEX nomindex on llx_table +-- To drop an index: -- VPGSQL8.0 DROP INDEX nomindex +-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y +-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y +-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE +-- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; +-- To set a field as default NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; +-- Note: fields with type BLOB/TEXT can't have default value. +-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); +-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); + +ALTER TABLE llx_societe ADD COLUMN fk_account integer; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index 9822272e7c2..20440b692d7 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -47,6 +47,7 @@ create table llx_societe town varchar(50), -- town fk_departement integer DEFAULT 0, -- fk_pays integer DEFAULT 0, -- + fk_account integer DEFAULT 0, -- phone varchar(20), -- phone number fax varchar(20), -- fax number url varchar(255), -- diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index cb1d783497c..7e06e5171d3 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1023,7 +1023,7 @@ class Societe extends CommonObject $sql .= ', s.fk_forme_juridique as forme_juridique_code'; $sql .= ', s.webservices_url, s.webservices_key'; $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; - $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.tva_assuj'; + $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.fk_account, s.tva_assuj'; $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo'; $sql .= ', s.fk_shipping_method'; $sql .= ', s.outstanding_limit, s.import_key, s.canvas, s.fk_incoterms, s.location_incoterms'; @@ -1153,7 +1153,8 @@ class Societe extends CommonObject $this->mode_reglement_supplier_id = $obj->mode_reglement_supplier; $this->cond_reglement_supplier_id = $obj->cond_reglement_supplier; $this->shipping_method_id = ($obj->fk_shipping_method>0)?$obj->fk_shipping_method:null; - + $this->fk_account = $obj->fk_account; + $this->client = $obj->client; $this->fournisseur = $obj->fournisseur; From 41856a920e17b6eb1bb39e393c712b8cea137532 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 3 Jun 2016 23:41:32 +0200 Subject: [PATCH 02/46] if \n or \r we addquote too --- htdocs/core/modules/export/export_csv.modules.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index e8977c11789..83de884e7c3 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -307,9 +307,12 @@ class ExportCsv extends ModeleExports //print $charset.' '.$newvalue."\n"; // Rule 1 CSV: No CR, LF in cells + $oldvalue=$newvalue; $newvalue=str_replace("\r",'',$newvalue); $newvalue=str_replace("\n",'\n',$newvalue); - + if($oldvalue != $newvalue) + $addquote=1; + // Rule 2 CSV: If value contains ", we must escape with ", and add " if (preg_match('/"/',$newvalue)) { From 2a8f17bc40744f9ea083098bf04aa9c98c39771c Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 3 Jun 2016 23:58:37 +0200 Subject: [PATCH 03/46] Update export_csv.modules.php --- htdocs/core/modules/export/export_csv.modules.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 83de884e7c3..04b090f8827 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -299,7 +299,9 @@ class ExportCsv extends ModeleExports */ function csv_clean($newvalue, $charset) { + global $conf; $addquote=0; + // Rule Dolibarr: No HTML //print $charset.' '.$newvalue."\n"; @@ -308,10 +310,14 @@ class ExportCsv extends ModeleExports // Rule 1 CSV: No CR, LF in cells $oldvalue=$newvalue; - $newvalue=str_replace("\r",'',$newvalue); + $newvalue=str_replace("\r",'\r',$newvalue); $newvalue=str_replace("\n",'\n',$newvalue); - if($oldvalue != $newvalue) + if ($conf->global->USE_STRICT_CSV_RULES && $oldvalue != $newvalue) + { + // If strict use of CSV rules, we just add quote + $newvalue=$oldvalue; $addquote=1; + } // Rule 2 CSV: If value contains ", we must escape with ", and add " if (preg_match('/"/',$newvalue)) From 2f36611cad728c377adff5a247508457221d3e60 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 4 Jun 2016 19:22:15 +0200 Subject: [PATCH 04/46] Update export_csv.modules.php --- htdocs/core/modules/export/export_csv.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 04b090f8827..d11c2cb275f 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -312,7 +312,7 @@ class ExportCsv extends ModeleExports $oldvalue=$newvalue; $newvalue=str_replace("\r",'\r',$newvalue); $newvalue=str_replace("\n",'\n',$newvalue); - if ($conf->global->USE_STRICT_CSV_RULES && $oldvalue != $newvalue) + if (! empty($conf->global->USE_STRICT_CSV_RULES && $oldvalue != $newvalue) { // If strict use of CSV rules, we just add quote $newvalue=$oldvalue; From 7cd8e270cc632fe319961e133cc3477234ab8625 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 4 Jun 2016 19:25:32 +0200 Subject: [PATCH 05/46] Update export_csv.modules.php --- htdocs/core/modules/export/export_csv.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index d11c2cb275f..58891ddd2c9 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -312,7 +312,7 @@ class ExportCsv extends ModeleExports $oldvalue=$newvalue; $newvalue=str_replace("\r",'\r',$newvalue); $newvalue=str_replace("\n",'\n',$newvalue); - if (! empty($conf->global->USE_STRICT_CSV_RULES && $oldvalue != $newvalue) + if (! empty($conf->global->USE_STRICT_CSV_RULES) && $oldvalue != $newvalue) { // If strict use of CSV rules, we just add quote $newvalue=$oldvalue; From 85740a618ebf64d40b65b9d20da9675f467ba706 Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 6 Jun 2016 16:21:05 +0200 Subject: [PATCH 06/46] NEW : add restrictions on standard exports (societe, propal, expedition) --- htdocs/core/modules/modExpedition.class.php | 4 +++- htdocs/core/modules/modPropale.class.php | 4 +++- htdocs/core/modules/modSociete.class.php | 7 +++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 4f7baff0c64..26dbfc5a803 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -43,7 +43,7 @@ class modExpedition extends DolibarrModules */ function __construct($db) { - global $conf; + global $conf, $user; $this->db = $db; $this->numero = 80; @@ -257,6 +257,7 @@ class modExpedition extends DolibarrModules $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'expedition as c'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'expedition_extrafields as extra ON c.rowid = extra.fk_object,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'expeditiondet as ed'; @@ -271,6 +272,7 @@ class modExpedition extends DolibarrModules } $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_expedition AND ed.fk_origin_line = cd.rowid'; $this->export_sql_end[$r] .=' AND c.entity IN ('.getEntity('shipment',1).')'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; } diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index 32ebb340e71..dd8f819c5eb 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -43,7 +43,7 @@ class modPropale extends DolibarrModules */ function __construct($db) { - global $conf; + global $conf, $user; $this->db = $db; $this->numero = 20; @@ -184,6 +184,7 @@ class modPropale extends DolibarrModules include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s '; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'propal as c'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON c.fk_projet = pj.rowid'; @@ -196,6 +197,7 @@ class modPropale extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra3 on p.rowid = extra3.fk_object'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_propal'; $this->export_sql_end[$r] .=' AND c.entity IN ('.getEntity('propal',1).')'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; } diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index baf680f0352..ec60d7aafeb 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -43,7 +43,7 @@ class modSociete extends DolibarrModules */ function __construct($db) { - global $conf; + global $conf, $user; $this->db = $db; $this->numero = 1; @@ -274,7 +274,8 @@ class modSociete extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_stcomm as st ON s.fk_stcomm = st.id'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON sc.fk_user = u.rowid'; $this->export_sql_end[$r] .=' WHERE s.entity IN ('.getEntity('societe', 1).')'; - + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; + // Export list of contacts and attributes $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; @@ -295,10 +296,12 @@ class modSociete extends DolibarrModules $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'socpeople as c'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON c.fk_soc = s.rowid'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON c.fk_pays = co.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = c.rowid'; $this->export_sql_end[$r] .=' WHERE c.entity IN ('.getEntity("societe", 1).')'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; // Imports From a2df6dc59f66c4b24e5c2570c6b23f637b119ebe Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 6 Jun 2016 17:51:39 +0200 Subject: [PATCH 07/46] NEW : add restrictions on standard exports (agenda, order, deplacement, facture, fournisseur) --- htdocs/core/modules/modAgenda.class.php | 6 +++++- htdocs/core/modules/modCommande.class.php | 4 +++- htdocs/core/modules/modDeplacement.class.php | 10 +++++++++- htdocs/core/modules/modFacture.class.php | 6 +++++- htdocs/core/modules/modFournisseur.class.php | 8 +++++++- 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 0d0720d7440..b4e12ab3c5a 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -44,7 +44,7 @@ class modAgenda extends DolibarrModules */ function __construct($db) { - global $conf; + global $conf, $user; $this->db = $db; $this->numero = 2400; @@ -392,10 +392,14 @@ class modAgenda extends DolibarrModules $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'actioncomm as ac'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_actioncomm as cac on ac.fk_action = cac.id'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_resources acr on ac.id = acr.fk_actioncomm'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp on ac.fk_contact = sp.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s on ac.fk_soc = s.rowid'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co on s.fk_pays = co.rowid'; $this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda',1).')'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' OR ac.fk_soc IS NULL)'; + if(!$user->rights->agenda->allactions->read) $this->export_sql_end[$r] .=' AND acr.fk_element = '.$user->id; $this->export_sql_end[$r] .=' ORDER BY ac.datep'; } diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index ec11708641c..be644dca471 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -45,7 +45,7 @@ class modCommande extends DolibarrModules */ function __construct($db) { - global $conf; + global $conf, $user; $this->db = $db; $this->numero = 25; @@ -191,6 +191,7 @@ class modCommande extends DolibarrModules include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande as c'; @@ -204,6 +205,7 @@ class modCommande extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra3 on p.rowid = extra3.fk_object'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_commande'; $this->export_sql_end[$r] .=' AND c.entity IN ('.getEntity('commande',1).')'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; } diff --git a/htdocs/core/modules/modDeplacement.class.php b/htdocs/core/modules/modDeplacement.class.php index 19ef73f37bc..d1fa2e4ad33 100644 --- a/htdocs/core/modules/modDeplacement.class.php +++ b/htdocs/core/modules/modDeplacement.class.php @@ -39,7 +39,7 @@ class modDeplacement extends DolibarrModules */ function __construct($db) { - global $conf; + global $conf, $user; $this->db = $db; $this->numero = 75 ; @@ -124,8 +124,16 @@ class modDeplacement extends DolibarrModules $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'user as u'; $this->export_sql_end[$r] .=', '.MAIN_DB_PREFIX.'deplacement as d'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON d.fk_soc = s.rowid'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' WHERE d.fk_user = u.rowid'; $this->export_sql_end[$r] .=' AND d.entity IN ('.getEntity('deplacement',1).')'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' OR d.fk_soc IS NULL)'; + + $childids = $user->getAllChildIds(); + $childids[]=$user->id; + + if (!$user->rights->deplacement->readall && !$user->rights->deplacement->lire_tous) $sql.=' AND d.fk_user IN ('.join(',',$childids).')'; + } diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index c4f9dc20243..b35af14ba6f 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -42,7 +42,7 @@ class modFacture extends DolibarrModules */ function __construct($db) { - global $conf; + global $conf, $user; $this->db = $db; $this->numero = 30; @@ -205,6 +205,7 @@ class modFacture extends DolibarrModules include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid'; @@ -217,6 +218,7 @@ class modFacture extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra3 on p.rowid = extra3.fk_object'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture'; $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('facture',1).')'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; @@ -232,6 +234,7 @@ class modFacture extends DolibarrModules include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid'; @@ -245,6 +248,7 @@ class modFacture extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON ba.rowid = b.fk_account'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('facture',1).')'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; $r++; } diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 3cf63b6cfb9..5bc4bddd8cf 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -42,7 +42,7 @@ class modFournisseur extends DolibarrModules */ function __construct($db) { - global $conf; + global $conf, $user; $this->db = $db; $this->numero = 40; @@ -366,6 +366,7 @@ class modFournisseur extends DolibarrModules // End add extra fields line $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; @@ -375,6 +376,7 @@ class modFournisseur extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn'; $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; @@ -428,6 +430,7 @@ class modFournisseur extends DolibarrModules // End add extra fields object $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; @@ -436,6 +439,7 @@ class modFournisseur extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; // Order $r++; @@ -532,6 +536,7 @@ class modFournisseur extends DolibarrModules // End add extra fields line $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande_fournisseur as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; @@ -543,6 +548,7 @@ class modFournisseur extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande'; $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_order',1).')'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; } From 2aa688e6f2e68e7d9670cb2bd3732a84c827815b Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 7 Jun 2016 09:39:48 +0200 Subject: [PATCH 08/46] NEW : tests for LEFT JOIN --- htdocs/core/modules/modAgenda.class.php | 4 ++-- htdocs/core/modules/modCommande.class.php | 2 +- htdocs/core/modules/modDeplacement.class.php | 2 +- htdocs/core/modules/modExpedition.class.php | 2 +- htdocs/core/modules/modFacture.class.php | 4 ++-- htdocs/core/modules/modFournisseur.class.php | 6 +++--- htdocs/core/modules/modPropale.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index b4e12ab3c5a..8224673f1a2 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -392,10 +392,10 @@ class modAgenda extends DolibarrModules $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'actioncomm as ac'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_actioncomm as cac on ac.fk_action = cac.id'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_resources acr on ac.id = acr.fk_actioncomm'; + if(!$user->rights->agenda->allactions->read) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_resources acr on ac.id = acr.fk_actioncomm'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp on ac.fk_contact = sp.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s on ac.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co on s.fk_pays = co.rowid'; $this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda',1).')'; if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' OR ac.fk_soc IS NULL)'; diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index be644dca471..7d38a427e1c 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -191,7 +191,7 @@ class modCommande extends DolibarrModules include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande as c'; diff --git a/htdocs/core/modules/modDeplacement.class.php b/htdocs/core/modules/modDeplacement.class.php index d1fa2e4ad33..c1e9c092ff6 100644 --- a/htdocs/core/modules/modDeplacement.class.php +++ b/htdocs/core/modules/modDeplacement.class.php @@ -124,7 +124,7 @@ class modDeplacement extends DolibarrModules $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'user as u'; $this->export_sql_end[$r] .=', '.MAIN_DB_PREFIX.'deplacement as d'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON d.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' WHERE d.fk_user = u.rowid'; $this->export_sql_end[$r] .=' AND d.entity IN ('.getEntity('deplacement',1).')'; if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' OR d.fk_soc IS NULL)'; diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 26dbfc5a803..189d31265a4 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -257,7 +257,7 @@ class modExpedition extends DolibarrModules $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'expedition as c'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'expedition_extrafields as extra ON c.rowid = extra.fk_object,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'expeditiondet as ed'; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index b35af14ba6f..794032c59f5 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -205,7 +205,7 @@ class modFacture extends DolibarrModules include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid'; @@ -234,7 +234,7 @@ class modFacture extends DolibarrModules include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid'; diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 5bc4bddd8cf..794b6cb50ff 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -366,7 +366,7 @@ class modFournisseur extends DolibarrModules // End add extra fields line $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; @@ -430,7 +430,7 @@ class modFournisseur extends DolibarrModules // End add extra fields object $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; @@ -536,7 +536,7 @@ class modFournisseur extends DolibarrModules // End add extra fields line $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande_fournisseur as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index dd8f819c5eb..e9fe448baf7 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -184,7 +184,7 @@ class modPropale extends DolibarrModules include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s '; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'propal as c'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON c.fk_projet = pj.rowid'; diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index ec60d7aafeb..c238470ce6f 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -296,7 +296,7 @@ class modSociete extends DolibarrModules $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'socpeople as c'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON c.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON c.fk_pays = co.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = c.rowid'; From dc224f3c880ed69748093c9175c93ee695a183e3 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Mon, 13 Jun 2016 16:25:27 +0200 Subject: [PATCH 09/46] NEW hook in element overview --- htdocs/projet/element.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index fe6fe738110..a69108905bf 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -95,6 +95,8 @@ if ($user->societe_id > 0) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $projectid, 'projet&project'); +$hookmanager->initHooks(array('projectOverview')); + /* * View */ @@ -347,6 +349,15 @@ $listofreferent=array( 'test'=>$conf->projet->enabled && $user->rights->projet->lire && $conf->salaries->enabled && empty($conf->global->PROJECT_HIDE_TASKS)), ); +$parameters=array('listofreferent'=>$listofreferent); +$resHook = $hookmanager->executeHooks('completeListOfReferent',$parameters,$object,$action); + +if(!empty($hookmanager->resArray)) { + + $listofreferent = array_merge($listofreferent, $hookmanager->resArray); + +} + if ($action=="addelement") { $tablename = GETPOST("tablename"); @@ -435,6 +446,7 @@ foreach ($listofreferent as $key => $value) $element = new $classname($db); $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); + if (count($elementarray)>0 && is_array($elementarray)) { $total_ht = 0; @@ -450,7 +462,7 @@ foreach ($listofreferent as $key => $value) $element->fetch($idofelement); if ($idofelementuser) $elementuser->fetch($idofelementuser); - if ($tablename != 'expensereport_det') $element->fetch_thirdparty(); + if ($tablename != 'expensereport_det' && method_exists($element, 'fetch_thirdparty')) $element->fetch_thirdparty(); if ($tablename == 'don') $total_ht_by_line=$element->amount; elseif ($tablename == 'projet_task') @@ -676,7 +688,7 @@ foreach ($listofreferent as $key => $value) if ($tablename != 'expensereport_det') { - $element->fetch_thirdparty(); + if(method_exists($element, 'fetch_thirdparty')) $element->fetch_thirdparty(); } else { From c365d14c2c95b4f289b78ab0bb23c81ec4892ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 16 Jun 2016 13:00:38 +0200 Subject: [PATCH 10/46] New: Autoset port and admin user from db type [Usability] Enhance install procedure by automatically suggesting the database port and administrative user on database type selection. --- htdocs/install/fileconf.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 8d040e06ed4..d0cf9a4a385 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -369,7 +369,7 @@ if (! empty($force_install_message))
trans("Port"); ?> value=""> @@ -484,9 +484,27 @@ if (! empty($force_install_message)) '."\n"; diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js index cf7163671a3..f47260ccec3 100644 --- a/htdocs/theme/eldy/ckeditor/config.js +++ b/htdocs/theme/eldy/ckeditor/config.js @@ -28,7 +28,9 @@ CKEDITOR.editorConfig = function( config ) config.toolbar_Full = [ - ['Source','-','Save','NewPage','Preview','-','Templates'], + ['Templates','NewPage'], + ['Save'], + ['Source','Maximize','Preview'], ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'], diff --git a/htdocs/theme/md/ckeditor/config.js b/htdocs/theme/md/ckeditor/config.js index cf7163671a3..f47260ccec3 100644 --- a/htdocs/theme/md/ckeditor/config.js +++ b/htdocs/theme/md/ckeditor/config.js @@ -28,7 +28,9 @@ CKEDITOR.editorConfig = function( config ) config.toolbar_Full = [ - ['Source','-','Save','NewPage','Preview','-','Templates'], + ['Templates','NewPage'], + ['Save'], + ['Source','Maximize','Preview'], ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'], From f256de323e8c07391657b306b422cf0eccf94307 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Jul 2016 12:52:00 +0200 Subject: [PATCH 30/46] Fix management of preview for website module --- htdocs/langs/en_US/website.lang | 2 ++ htdocs/theme/eldy/style.css.php | 6 +++++ htdocs/theme/md/style.css.php | 6 +++++ htdocs/websites/index.php | 47 ++++++++++++++++++++++++++++----- 4 files changed, 54 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 64e5041061a..a3626c3c5df 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -21,3 +21,5 @@ ViewSiteInNewTab=View site in new tab ViewPageInNewTab=View page in new tab SetAsHomePage=Set as Home page RealURL=Real URL +ViewWebsiteInProduction=View web site using home URLs +SetHereVirtualHost=If you can set, on your web server, a dedicated virtual host with a root directory on %s, define here the virtual hostname so the preview will be done using this direct access instead of Dolibarr URLs wrapper. diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 761ce42e0f5..7453a6b1b2f 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -603,6 +603,12 @@ div.myavailability { .minwidth300 { min-width: 300px; } .minwidth400 { min-width: 400px; } .minwidth500 { min-width: 500px; } +.minwidth50imp { min-width: 50px !important; } +.minwidth100imp { min-width: 100px !important; } +.minwidth200imp { min-width: 200px !important; } +.minwidth300imp { min-width: 300px !important; } +.minwidth400imp { min-width: 400px !important; } +.minwidth500imp { min-width: 500px !important; } .maxwidth100 { max-width: 100px; } .maxwidth150 { max-width: 150px; } .maxwidth200 { max-width: 200px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 92234aeddf3..9d12de74a6d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -601,6 +601,12 @@ div.myavailability { .minwidth300 { min-width: 300px; } .minwidth400 { min-width: 400px; } .minwidth500 { min-width: 500px; } +.minwidth50imp { min-width: 50px !important; } +.minwidth100imp { min-width: 100px !important; } +.minwidth200imp { min-width: 200px !important; } +.minwidth300imp { min-width: 300px !important; } +.minwidth400imp { min-width: 400px !important; } +.minwidth500imp { min-width: 500px !important; } .maxwidth100 { max-width: 100px; } .maxwidth150 { max-width: 150px; } .maxwidth200 { max-width: 200px; } diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index 19f72486c3f..d61bad409a2 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -454,6 +454,8 @@ print '
'; if (count($object->records) > 0) { + // ***** Part for web sites + print '
'; print $langs->trans("Website").': '; print '
'; @@ -478,15 +480,44 @@ if (count($object->records) > 0) } $out.=''; print $out; - print ''; + print ''; if ($website) { - print ' - '.$langs->trans("RealURL").' '; $realurl=$urlwithroot.'/public/websites/index.php?website='.$website; + $dataroot=DOL_DATA_ROOT.'/websites/'.$website; + // TODO If virtual url defined, we use it + + /*print ' - '.$langs->trans("RealURL").' '; print ' '; - print ''.$langs->trans("ViewSiteInNewTab").''; + print ''.$langs->trans("ViewSiteInNewTab").'';*/ + + print '   '; + + print $langs->trans("ViewWebsiteInProduction").': '; + print ''; + //print ''; + $htmltext=$langs->trans("SetHereVirtualHost", $dataroot); + print $form->textwithpicto('', $htmltext); + print ''.$langs->trans("ViewSiteInNewTab").''; + + // Example : Adding jquery code + if (! empty($conf->use_javascript_ajax)) + { + print ''; + } } + print '
'; // Button for websites @@ -513,7 +544,8 @@ if (count($object->records) > 0) print ''; - // Part for pages + // ***** Part for pages + if ($website) { print ''; @@ -555,7 +587,7 @@ if (count($object->records) > 0) else $out.=''; $out.=''; print $out; - print ''; + print ''; print ''; //print $form->selectarray('page', $array); @@ -563,8 +595,9 @@ if (count($object->records) > 0) { print ' - '.$langs->trans("RealURL").' '; $realurl=$urlwithroot.'/public/websites/index.php?website='.$website.'&page='.$pageid; - print ' '; - print ''.$langs->trans("ViewPageInNewTab").''; + print ' '; + print ''.$langs->trans("ViewPageInNewTab").''; + //print ''; } print ''; From 241fd8db980ee65d2147fdcde621a92c597ab2a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Jul 2016 15:22:04 +0200 Subject: [PATCH 31/46] Fix css --- htdocs/theme/md/img/info.png | Bin 254 -> 399 bytes htdocs/theme/md/img/title_accountancy.png | Bin 218 -> 679 bytes htdocs/theme/md/img/title_products.png | Bin 107 -> 410 bytes htdocs/theme/md/style.css.php | 5 +++-- 4 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/md/img/info.png b/htdocs/theme/md/img/info.png index bb6095bd00a792c96a465b2f14ddacb5bd269a72..a5af4a11e3cdb566747ffa327cf99fe522f894e1 100644 GIT binary patch delta 372 zcmV-)0gL|r0gnTaB!2>8OGiWi|A&vvzW@LL32;bRa{vGf6951U69E94oEQKA00(qQ zO+^Rb2M!GsE^^OP$N&HVAW1|)R4C7tlD|sBP!z_0h6r7S#P02yK#IOVyNG=O!P>6H zNkuy6#K~E7DSd>LO5NHAsOb|#j6-hXtz^(|`+x5F_|CcCIq(PUm_)g> zr~xY`5|@Znl_4E$O%p<{WStR9OMD_uxZ!{b6%M)Olt_7old2N&$+0Yq);=#lLq2k+ zA$z$*jnoK0-e}`8(Cw57B-JX>C(`JT+rmn0%}0vleYu?TBrE( z4}xDj%?4iqUTtaA9JBg}wj zzGz5X>`r;S;_yJo0`Tb4XU&nkZ!g$oK#$#G!DFuTOV~aYhbDDWmP}>C|L_fXfl>4Z SR59BC0000B6m>Me(+u0jC9!B!2>8OGiWi|A&vvzW@LL32;bRa{vGf6951U69E94oEQKA00(qQ zO+^Rb2M!Gp8ZHb|H~;_wI7vi7R7l6=*2_zjQ5XjBpQbr^EA3)qb^*&oDI$uZL=qR> zAcz(&gZ_Y^ZP6xzHZ9z?jJCCC7ez&_ipCOKR8R}8w6sx3^M8_`o;Dvt<><^1w5Vrw zzH<)GdEWOt=Y2o^OB5~fm1FbosBv1I?@HYD=ub2?8WjY=2fmt37Rks0N{vPHvP zt=Vy%%0b$YanpqnQ7q|@E+=h>HP=XrjQd(xZg#usok$SOn-&B!MqIIJk)xGl39M3w zE)BkV;)M~x3V(YXwAKk}*No?izofgMb88DWeY7w8BGvT8_Z>01Zuw1<=4HEkDHDorly5N~=*B$v zTDw}2enUoc`zR>au0@46p6bu!Y+R4e8kI^~m7gIK+MJP;(w!lKHF1)o%(Kby)}}o6 z5_=qVFn<&3R;O&koVSMaQ#2#xz7`FRs`5%&kg&~eb?DXOQ(=YeZCu!b*|@+>c;uXl zLfTQW_4e!3t~u76*5{!Idh>aAzml)A(^+3)Rks}0q%5CSnGN*@VxseZ*4I|3j7R0U ph)R}R9d#*g+4uh1PsBfr9}G3F4iK3kn*aa+00>D%PDHLkV1hr)Ft`8! delta 190 zcmV;v073t!1=<0SB!8hvL_t(|0qxLF3c@fDN8y)oEqF&2ui-JIw*J43;KBo`ROyrq zTBoF&LSDD!8(jJWK$V4W*CT`Zt(;#L!ZSjG>AIMkzP5 svy7oO9tO&YNocO)lUwNc@t4cJ0Cyjc+FLh!AOHXW07*qoM6N<$f;!7or~m)} diff --git a/htdocs/theme/md/img/title_products.png b/htdocs/theme/md/img/title_products.png index 142d71505c8c1a4855394adf3a392990224b3ecf..79c42a93647290818de98c961ff2b379efcd401a 100644 GIT binary patch delta 382 zcmV-^0fGK&ngfs|e*$7lM??VshmXv^00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-#q4h;?l_g4Yw0003iNkle}3%j&hElqyR8ZyT3~Nf zqA+D9B8)~ep}Y)ND^Q(+IEMmvCTNc7kV$AA0BjR9*J0w-ggjNkuoho@E^LTnIvgYf zol@K!rM6W&{|?H;Ic(meEZ_t14CuvZj*$#>#uMN&0{ZmRre<+Ni4rc>U-qcVBVBB4 zdOUEQ7IZ-mcz4yi<(~62AVo7&yG5FD=NmPBLfsg1Ig%g$lp4q6@Cg7#7R@(fImp4| z9iKcFFl7KZG;=<_P1xG+Ts^mqiJvF@gH*;{T;oEFdkR? cKYX_}1FeIpO9f4V!vFvP07*qoM6N<$f(-PZH2?qr delta 77 zcmbQmoIOFs-N@6$F{FYqnV~VzfJ;U~>O=#d#4`rg|C1S|GtvZ}#vNu^ywOZ58%A)s ZF)}POa(2)VkqTr00#8>zmvv4FO#r3L7is_i diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 92234aeddf3..e32b53b70d4 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -746,7 +746,7 @@ td.showDragHandle { margin-left: 0; } div.login_block { - border-right: none ! important; + /* border-right: none ! important; */ top: inherit !important; } .side-nav { @@ -771,6 +771,7 @@ div.login_block { #id-left { z-index: 201; background: #FFF; + border-right: 1px solid rgba(0,0,0,0.3); global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> top: 50px ! important; @@ -2664,7 +2665,7 @@ div.tabBar .noborder { } span.boxstatstext { - opacity: 0.9; + /* opacity: 0.9; Disabled. This make text on top of left menu in smartphone size */ line-height: 18px; } span.boxstatsindicator { From 258662e6163e03603442908924103ebd5319855a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Jul 2016 15:31:56 +0200 Subject: [PATCH 32/46] Fix: missing month of update in leave "view log" page. --- htdocs/holiday/define_holiday.php | 3 --- htdocs/holiday/view_log.php | 13 ++++++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 6af57716648..7a94e686173 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -169,9 +169,6 @@ if ($lastUpdate) print '
'.$langs->trans("MonthOfLastMonthlyUpdate").': '.$yearLastUpdate.'-'.$monthLastUpdate.''."\n"; } else print $langs->trans('None'); - - - print "
\n"; $result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index e4b5070f097..1b0e779488a 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -60,7 +60,14 @@ $log_holiday = $cp->fetchLog('ORDER BY cpl.rowid DESC', " AND date_action BETWEE print load_fiche_titre($langs->trans('LogCP'), '', 'title_hrm.png'); print '
'.$langs->trans('LastUpdateCP').': '."\n"; -if ($cp->getConfCP('lastUpdate')) print ''.dol_print_date($db->jdate($cp->getConfCP('lastUpdate')),'dayhour','tzuser').''; +$lastUpdate = $cp->getConfCP('lastUpdate'); +if ($lastUpdate) +{ + $monthLastUpdate = $lastUpdate[4].$lastUpdate[5]; + $yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3]; + print ''.dol_print_date($db->jdate($cp->getConfCP('lastUpdate')),'dayhour','tzuser').''; + print '
'.$langs->trans("MonthOfLastMonthlyUpdate").': '.$yearLastUpdate.'-'.$monthLastUpdate.''."\n"; +} else print $langs->trans('None'); print "

\n"; @@ -108,8 +115,8 @@ foreach($cp->logs as $logs_CP) if ($log_holiday == '2') { - print '
'.$langs->trans('None').'
'.$langs->trans('NoRecordFound').'