From 35182066a8dcfd1686a24c1d75615d8575e89156 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 19 Nov 2017 16:25:35 +0100 Subject: [PATCH 1/7] update createfromorder lack of 2 fields date_start and date_end not imported from order --- htdocs/compta/facture/class/facture.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index e704a5a229a..840bb93a49f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -939,7 +939,8 @@ class Facture extends CommonInvoice { $this->db->commit(); return $this->id; - } + + } else { $this->db->rollback(); @@ -989,6 +990,8 @@ class Facture extends CommonInvoice $line->special_code = $object->lines[$i]->special_code; $line->fk_parent_line = $object->lines[$i]->fk_parent_line; $line->fk_unit = $object->lines[$i]->fk_unit; + $line->date_start = $object->lines[$i]->date_start; + $line->date_end = $object->lines[$i]->date_end; $line->fk_fournprice = $object->lines[$i]->fk_fournprice; $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); From 3f360601affe69cd4b963cc41faa921c11d01e20 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 19 Nov 2017 21:52:18 +0100 Subject: [PATCH 2/7] Fix entity Fix entity in list.php --- htdocs/don/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 9602b69a615..c93dcad0224 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -89,7 +89,7 @@ $sql = "SELECT d.rowid, d.datedon, d.firstname, d.lastname, d.societe,"; $sql.= " d.amount, d.fk_statut as statut, "; $sql.= " p.rowid as pid, p.ref, p.title, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p"; -$sql.= " ON p.rowid = d.fk_projet WHERE 1 = 1"; +$sql.= " ON p.rowid = d.fk_projet WHERE d.entity = ".$conf->entity.""; if ($statut != '' && $statut != '-1') { $sql .= " AND d.fk_statut IN (".$db->escape($statut).")"; From 5d6555b9dd7a9bc19c1e2b098b81c599b105a578 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 19 Nov 2017 21:54:14 +0100 Subject: [PATCH 3/7] Update list.php --- htdocs/don/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/list.php b/htdocs/don/list.php index c93dcad0224..cb5ab766ae9 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -89,7 +89,7 @@ $sql = "SELECT d.rowid, d.datedon, d.firstname, d.lastname, d.societe,"; $sql.= " d.amount, d.fk_statut as statut, "; $sql.= " p.rowid as pid, p.ref, p.title, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p"; -$sql.= " ON p.rowid = d.fk_projet WHERE d.entity = ".$conf->entity.""; +$sql.= " ON p.rowid = d.fk_projet WHERE d.entity IN (".getEntity('donation').")"; if ($statut != '' && $statut != '-1') { $sql .= " AND d.fk_statut IN (".$db->escape($statut).")"; From a9bfe0f48f2502ad3ee0c22a998c8b87292eec31 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Sep 2017 17:48:04 +0200 Subject: [PATCH 4/7] Fix: some problems with medias in multicompany (backport 6.0 commit 762b4eb8768a0b09d69c06529566954f7efbc1c0) --- htdocs/core/class/conf.class.php | 5 +++++ htdocs/core/lib/files.lib.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 203d41571a9..da55a9f5668 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -88,6 +88,7 @@ class Conf $this->user = new stdClass(); $this->syslog = new stdClass(); $this->browser = new stdClass(); + $this->medias = new stdClass(); $this->multicompany = new stdClass(); //! Charset for HTML output and for storing data in memory @@ -328,6 +329,10 @@ class Conf $this->propal->dir_output=$rootfordata."/propale"; $this->propal->dir_temp=$rootfordata."/propale/temp"; + // For medias storage + $this->medias->multidir_output = array($this->entity => $rootfordata."/medias"); + $this->medias->multidir_temp = array($this->entity => $rootfordata."/medias/temp"); + // Exception: Some dir are not the name of module. So we keep exception here // for backward compatibility. diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 5d3c209bdc7..b573a9588ae 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1857,7 +1857,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu elseif ($modulepart == 'medias' && !empty($dolibarr_main_data_root)) { $accessallowed=1; - $original_file=$dolibarr_main_data_root.'/medias/'.$original_file; + $original_file=$conf->medias->multidir_output[$entity].'/'.$original_file; } // Wrapping for backups From e1344eb97cd12b745b29a2216b784633b022dd70 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Nov 2017 17:25:31 +0100 Subject: [PATCH 5/7] Fix edit of time spent --- htdocs/projet/tasks/time.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 9a513a4bce6..33642d4d3b6 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -975,19 +975,19 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print '
'; print ''; } - else if ($user->rights->projet->lire) // Read project and enter time consumed on assigned tasks + else if ($user->rights->projet->lire || $user->rights->projet->all->creer) // Read project and enter time consumed on assigned tasks { - if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids)) - { - print ' '; - print 'rowid.($withproject?'&withproject=1':'').'">'; - print img_edit(); - print ''; + if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer) + { + print ' '; + print 'rowid.($withproject?'&withproject=1':'').'">'; + print img_edit(); + print ''; - print ' '; - print 'rowid.($withproject?'&withproject=1':'').'">'; - print img_delete(); - print ''; + print ' '; + print 'rowid.($withproject?'&withproject=1':'').'">'; + print img_delete(); + print ''; } } print ''; From 314c30f4897c6ee30e18425af64b4ddfbd0b90bf Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Thu, 23 Nov 2017 14:26:26 +0100 Subject: [PATCH 6/7] FIX too much users on holiday list --- htdocs/holiday/class/holiday.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 4815bee4b00..3bcd86774ba 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1309,7 +1309,7 @@ class Holiday extends CommonObject // List for Dolibarr users if ($type) { - $sql = "SELECT u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut"; + $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) From c2f84309db4d9db474612b9521bd5ab8e0db1dab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Nov 2017 16:38:52 +0100 Subject: [PATCH 7/7] Update holiday.class.php --- htdocs/holiday/class/holiday.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 3bcd86774ba..6572d1836fa 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1315,9 +1315,9 @@ class Holiday extends CommonObject if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql.= " WHERE (ug.fk_user = u.rowid"; + $sql.= " WHERE ((ug.fk_user = u.rowid"; $sql.= " AND ug.entity = ".$conf->entity.")"; - $sql.= " OR u.admin = 1"; + $sql.= " OR u.admin = 1)"; } else $sql.= " WHERE u.entity IN (0,".$conf->entity.")";