From 7d336bd5d4ada8f0d89b0f6bcdd5f4b878c92914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 2 Mar 2016 11:43:55 +0100 Subject: [PATCH 1/8] FIX #4414 Supplier invoices use FAC_FORCE_DATE_VALIDATION client invoices property Close #4414 --- htdocs/fourn/facture/card.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 1919faadee4..c2b2c587736 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1577,12 +1577,6 @@ else if ($objectref == 'PROV') { $savdate=$object->date; - if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) - { - $object->date=dol_now(); - //TODO: Possibly will have to control payment information into suppliers - //$object->date_lim_reglement=$object->calculate_date_lim_reglement(); - } $numref = $object->getNextNumRef($societe); } else From 59c4559a781238ac5f6c78507812ef42a9483d8c Mon Sep 17 00:00:00 2001 From: philippe grand Date: Wed, 2 Mar 2016 21:13:12 +0100 Subject: [PATCH 2/8] fix : missing translation --- htdocs/langs/en_US/admin.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index cfb5e9644be..8b1643f84a6 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -783,6 +783,7 @@ Permission2403=Delete actions (events or tasks) linked to his account Permission2411=Read actions (events or tasks) of others Permission2412=Create/modify actions (events or tasks) of others Permission2413=Delete actions (events or tasks) of others +Permission2414=Export actions/tasks of others Permission2501=Read/Download documents Permission2502=Download documents Permission2503=Submit or delete documents From 6fd533481225ce81d6ccfc862d2d70961a66e94e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 3 Mar 2016 10:10:55 +0100 Subject: [PATCH 3/8] Fix: compatibility with multicompany transversal mode and more security issue --- htdocs/societe/commerciaux.php | 40 ++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index 498257ea496..245626752e4 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -33,7 +33,7 @@ $langs->load("suppliers"); $langs->load("banks"); // Security check -$socid = isset($_GET["socid"])?$_GET["socid"]:''; +$socid = GETPOST('socid', 'int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'societe','',''); @@ -43,7 +43,7 @@ $hookmanager->initHooks(array('salesrepresentativescard','globalcard')); * Actions */ -if($_GET["socid"] && $_GET["commid"]) +if (! empty($socid) && $_GET["commid"]) { $action = 'add'; @@ -51,8 +51,8 @@ if($_GET["socid"] && $_GET["commid"]) { $soc = new Societe($db); - $soc->id = $_GET["socid"]; - $soc->fetch($_GET["socid"]); + $soc->id = $socid; + $soc->fetch($socid); $parameters=array('id'=>$_GET["commid"]); @@ -61,17 +61,17 @@ if($_GET["socid"] && $_GET["commid"]) if (empty($reshook)) $soc->add_commercial($user, $_GET["commid"]); - header("Location: commerciaux.php?socid=".$soc->id); + header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$soc->id); exit; } else { - header("Location: commerciaux.php?socid=".$_GET["socid"]); + header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid); exit; } } -if($_GET["socid"] && $_GET["delcommid"]) +if (! empty($socid) && $_GET["delcommid"]) { $action = 'delete'; @@ -87,12 +87,12 @@ if($_GET["socid"] && $_GET["delcommid"]) if (empty($reshook)) $soc->del_commercial($user, $_GET["delcommid"]); - header("Location: commerciaux.php?socid=".$soc->id); + header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$soc->id); exit; } else { - header("Location: commerciaux.php?socid=".$_GET["socid"]); + header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid); exit; } } @@ -107,11 +107,11 @@ llxHeader('',$langs->trans("ThirdParty"),$help_url); $form = new Form($db); -if ($_GET["socid"]) +if (! empty($socid)) { $soc = new Societe($db); - $soc->id = $_GET["socid"]; - $result=$soc->fetch($_GET["socid"]); + $soc->id = $socid; + $result=$soc->fetch($socid); $action='view'; @@ -190,7 +190,7 @@ if ($_GET["socid"]) print ' '; if ($user->rights->societe->creer) { - print ''; + print ''; print img_delete(); print ''; } @@ -222,9 +222,17 @@ if ($_GET["socid"]) $langs->load("users"); $title=$langs->trans("ListOfUsers"); - $sql = "SELECT u.rowid, u.lastname, u.firstname, u.login"; + $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.login"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; + if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) + { + $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; + $sql.= " WHERE (ug.fk_user = u.rowid"; + $sql.= " AND ug.entity = ".$conf->entity.")"; + $sql.= " OR u.admin = 1"; + } + else + $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut<>0 "; $sql.= " ORDER BY u.lastname ASC "; @@ -256,7 +264,7 @@ if ($_GET["socid"]) print dolGetFirstLastname($obj->firstname, $obj->lastname)."\n"; print ''; print ''.$obj->login.''; - print ''.$langs->trans("Add").''; + print ''.$langs->trans("Add").''; print ''."\n"; $i++; From 9e80a3794736a219fa8c197481896364e80d01a2 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Thu, 3 Mar 2016 15:45:42 +0100 Subject: [PATCH 4/8] fix : missing translation --- htdocs/langs/fr_FR/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index d566f1d3677..48bcac3abdc 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1660,7 +1660,7 @@ NotSupportedByAllThemes=Fonctionne avec le thème eldy mais n'est pas pris en ch BackgroundColor=Couleur de fond TopMenuBackgroundColor=Couleur de fond pour le menu Gauche LeftMenuBackgroundColor=Couleur de fond pour le menu Gauche -BackgroundTableTitleColor=Background color for Table title line +BackgroundTableTitleColor=Couleur de fond pour les titres des lignes des tables BackgroundTableLineOddColor=Couleur de fond pour les lignes impaires des tables BackgroundTableLineEvenColor=Couleur de fond pour les lignes paires des tales MinimumNoticePeriod=Période de préavis minimum (Votre demande de congé doit être faite avant ce délai) From 74601a0b1d0911445b0bb3593f1b8afff0232a96 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Thu, 3 Mar 2016 16:01:50 +0100 Subject: [PATCH 5/8] fix : missing translation --- htdocs/langs/en_US/admin.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8b1643f84a6..55e43d390f1 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -635,6 +635,7 @@ Permission162=Create/modify contracts/subscriptions Permission163=Activate a service/subscription of a contract Permission164=Disable a service/subscription of a contract Permission165=Delete contracts/subscriptions +Permission167=Export contracts Permission171=Read trips and expenses (yours and your subordinates) Permission172=Create/modify trips and expenses Permission173=Delete trips and expenses From 4a3509d35022bed3a9fb6dc53a2c4935e78f19b1 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Thu, 3 Mar 2016 16:09:19 +0100 Subject: [PATCH 6/8] fix : missing translation --- htdocs/langs/fr_FR/admin.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 48bcac3abdc..0837c240c9e 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -772,8 +772,8 @@ Permission20001=Lire les demandes de congé (les vôtres et celle de vos subordo Permission20002=Créer/modifier vos demandes de congé Permission20003=Supprimer les demandes de congé Permission20004=Lire toutes les demandes de congé (même celle des utilisateurs non subordonnés) -Permission20005=Create/modify leave requests for everybody -Permission20006=Admin leave requests (setup and update balance) +Permission20005=Créer/modifier les congés pour tout le monde +Permission20006=Administration des demandes de congés (configuration et mise à jour du solde) Permission23001=Voir les travaux planifiés Permission23002=Créer/Modifier des travaux planifiées Permission23003=Effacer travail planifié From 6851c3fdb059f4558f3d580ed10759b5ab596650 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Thu, 3 Mar 2016 16:18:07 +0100 Subject: [PATCH 7/8] fix : missing translation --- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 55e43d390f1..2a8b4b717b1 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -582,6 +582,7 @@ Permission38=Export products Permission41=Read projects and tasks (shared project and projects i'm contact for). Can also enter time consumed on assigned tasks (timesheet) Permission42=Create/modify projects (shared project and projects i'm contact for) Permission44=Delete projects (shared project and projects i'm contact for) +Permission45=Export projects Permission61=Read interventions Permission62=Create/modify interventions Permission64=Delete interventions diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 0837c240c9e..c58c9e3b0ec 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -583,6 +583,7 @@ Permission38=Exporter les produits Permission41=Lire les projets et les tâches (projets publiques et projets dont je suis contact). Peut également entrer le temps consommé sur les tâches assignées (feuille de temps) Permission42=Créer/modifier les projets et tâches (partagés ou dont je suis contact) Permission44=Supprimer les projets et tâches (partagés ou dont je suis contact) +Permission45=Exporter les projets Permission61=Consulter les interventions Permission62=Créer/modifier les interventions Permission64=Supprimer les interventions From 09a9546c14fa8bf2933ad1fb9bfb9a52934b1391 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Mar 2016 20:41:56 +0100 Subject: [PATCH 8/8] FIX Can not disabled an opened service line in a contract --- htdocs/contrat/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 9e0ed827ba8..3fe0530ec77 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1643,7 +1643,7 @@ else { $tmpaction='activateline'; if ($objp->statut == 4) $tmpaction='unactivateline'; - if (($tmpaction=='activateline' && $user->rights->contrat->activer) || ($tmpaction=='unactivateline' && $user->rights->contrat->unactiver)) { + if (($tmpaction=='activateline' && $user->rights->contrat->activer) || ($tmpaction=='unactivateline' && $user->rights->contrat->desactiver)) { print ''; print img_edit(); print '';