From e9ac41fb2412fb1391323a9dd2cb2170ac4d4b18 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 2 Mar 2016 11:23:57 +0100 Subject: [PATCH 01/18] Fix: issue during upgrade of MAIN_VERSION_LAST_UPGRADE (rc -> rc2) --- htdocs/core/lib/admin.lib.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 7823b3534ad..f4a1c9846c8 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2016 Regis Houssin * Copyright (C) 2012 J. Fernando Lagrange * Copyright (C) 2015 Raphaël Doursenaud * @@ -62,18 +62,22 @@ function versioncompare($versionarray1,$versionarray2) { $operande1=isset($versionarray1[$level])?$versionarray1[$level]:0; $operande2=isset($versionarray2[$level])?$versionarray2[$level]:0; - if (preg_match('/alpha|dev/i',$operande1)) $operande1=-3; - if (preg_match('/alpha|dev/i',$operande2)) $operande2=-3; - if (preg_match('/beta/i',$operande1)) $operande1=-2; - if (preg_match('/beta/i',$operande2)) $operande2=-2; - if (preg_match('/rc/i',$operande1)) $operande1=-1; - if (preg_match('/rc/i',$operande2)) $operande2=-1; + if (preg_match('/alpha|dev/i',$operande1)) $operande1=-5; + if (preg_match('/alpha|dev/i',$operande2)) $operande2=-5; + if (preg_match('/beta$/i',$operande1)) $operande1=-4; + if (preg_match('/beta$/i',$operande2)) $operande2=-4; + if (preg_match('/beta([0-9])*/i',$operande1)) $operande1=-3; + if (preg_match('/beta([0-9])*/i',$operande2)) $operande2=-3; + if (preg_match('/rc$/i',$operande1)) $operande1=-2; + if (preg_match('/rc$/i',$operande2)) $operande2=-2; + if (preg_match('/rc([0-9])*/i',$operande1)) $operande1=-1; + if (preg_match('/rc([0-9])*/i',$operande2)) $operande2=-1; $level++; - //print 'level '.$level.' '.$operande1.'-'.$operande2.'
'; + print 'level '.$level.' '.$operande1.'-'.$operande2.'
'; if ($operande1 < $operande2) { $ret = -$level; break; } if ($operande1 > $operande2) { $ret = $level; break; } } - //print join('.',$versionarray1).'('.count($versionarray1).') / '.join('.',$versionarray2).'('.count($versionarray2).') => '.$ret.'
'."\n"; + print join('.',$versionarray1).'('.count($versionarray1).') / '.join('.',$versionarray2).'('.count($versionarray2).') => '.$ret.'
'."\n"; return $ret; } @@ -591,7 +595,7 @@ function listOfSessions() $sessValues = file_get_contents($fullpath); // get raw session data // Example of possible value //$sessValues = 'newtoken|s:32:"1239f7a0c4b899200fe9ca5ea394f307";dol_loginmesg|s:0:"";newtoken|s:32:"1236457104f7ae0f328c2928973f3cb5";dol_loginmesg|s:0:"";token|s:32:"123615ad8d650c5cc4199b9a1a76783f";dol_login|s:5:"admin";dol_authmode|s:8:"dolibarr";dol_tz|s:1:"1";dol_tz_string|s:13:"Europe/Berlin";dol_dst|i:0;dol_dst_observed|s:1:"1";dol_dst_first|s:0:"";dol_dst_second|s:0:"";dol_screenwidth|s:4:"1920";dol_screenheight|s:3:"971";dol_company|s:12:"MyBigCompany";dol_entity|i:1;mainmenu|s:4:"home";leftmenuopened|s:10:"admintools";idmenu|s:0:"";leftmenu|s:10:"admintools";'; - + if (preg_match('/dol_login/i',$sessValues) && // limit to dolibarr session (preg_match('/dol_entity\|i:'.$conf->entity.';/i',$sessValues) || preg_match('/dol_entity\|s:([0-9]+):"'.$conf->entity.'"/i',$sessValues)) && // limit to current entity preg_match('/dol_company\|s:([0-9]+):"('.$conf->global->MAIN_INFO_SOCIETE_NOM.')"/i',$sessValues)) // limit to company name From 057188e1de4cca5d8929271ef2b9d666efd828e7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 2 Mar 2016 11:26:43 +0100 Subject: [PATCH 02/18] Fix: comment debug lines --- htdocs/core/lib/admin.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index f4a1c9846c8..aa8a81558fe 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -73,11 +73,11 @@ function versioncompare($versionarray1,$versionarray2) if (preg_match('/rc([0-9])*/i',$operande1)) $operande1=-1; if (preg_match('/rc([0-9])*/i',$operande2)) $operande2=-1; $level++; - print 'level '.$level.' '.$operande1.'-'.$operande2.'
'; + //print 'level '.$level.' '.$operande1.'-'.$operande2.'
'; if ($operande1 < $operande2) { $ret = -$level; break; } if ($operande1 > $operande2) { $ret = $level; break; } } - print join('.',$versionarray1).'('.count($versionarray1).') / '.join('.',$versionarray2).'('.count($versionarray2).') => '.$ret.'
'."\n"; + //print join('.',$versionarray1).'('.count($versionarray1).') / '.join('.',$versionarray2).'('.count($versionarray2).') => '.$ret.'
'."\n"; return $ret; } 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 03/18] 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 04/18] 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 25686e82c9f5043dbadd9ba496707e0a13dceced Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 3 Mar 2016 08:41:39 +0100 Subject: [PATCH 05/18] Fix: best compatibility with multicompany and others security issue --- htdocs/holiday/card.php | 158 ++++++++---------- htdocs/holiday/class/holiday.class.php | 60 +++++-- htdocs/holiday/define_holiday.php | 29 ++-- htdocs/holiday/list.php | 14 +- .../install/mysql/migration/3.8.0-3.9.0.sql | 1 + .../install/mysql/tables/llx_holiday.key.sql | 4 +- 6 files changed, 142 insertions(+), 124 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 59c920c26ca..8cae9592033 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1,9 +1,9 @@ - * Copyright (C) 2012-2015 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2014 Ferran Marcet +/* Copyright (C) 2011 Dimitri Mouillard + * Copyright (C) 2012-2015 Laurent Destailleur + * Copyright (C) 2012-2016 Regis Houssin + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2014 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,23 +91,23 @@ if ($action == 'create') $error++; $action='create'; } - + // If no start date if (empty($date_debut)) { - header('Location: card.php?action=request&error=nodatedebut'); + header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=nodatedebut'); exit; } // If no end date if (empty($date_fin)) { - header('Location: card.php?action=request&error=nodatefin'); + header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=nodatefin'); exit; } // If start date after end date if ($date_debut > $date_fin) { - header('Location: card.php?action=request&error=datefin'); + header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=datefin'); exit; } @@ -115,15 +115,15 @@ if ($action == 'create') $verifCP = $cp->verifDateHolidayCP($userID, $date_debut, $date_fin, $halfday); if (! $verifCP) { - header('Location: card.php?action=request&error=alreadyCP'); + header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=alreadyCP'); exit; } - // If there is no Business Days within request + // If there is no Business Days within request $nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday); if($nbopenedday < 0.5) { - header('Location: card.php?action=request&error=DureeHoliday'); + header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=DureeHoliday'); exit; } @@ -137,7 +137,7 @@ if ($action == 'create') $result = 0; $result = 0; - + if (! $error) { $cp->fk_user = $userid; @@ -147,16 +147,16 @@ if ($action == 'create') $cp->fk_validator = $valideur; $cp->halfday = $halfday; $cp->fk_type = $type; - + $result = $cp->create($user); } - + // If no SQL error we redirect to the request card if (! $error && $result > 0) { $db->commit(); - header('Location: card.php?id='.$result); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id); exit; } else @@ -179,15 +179,15 @@ if ($action == 'update') else if ($starthalfday == 'afternoon') $halfday=-1; else if ($endhalfday == 'morning') $halfday=1; - // If no right to modify a request + // If no right to modify a request if (! $user->rights->holiday->write) { - header('Location: card.php?action=request&error=CantUpdate'); + header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=CantUpdate'); exit; } $cp = new Holiday($db); - $cp->fetch($_POST['holiday_id']); + $cp->fetch($id); $canedit=(($user->id == $cp->fk_user && $user->rights->holiday->write) || ($user->id != $cp->fk_user && $user->rights->holiday->write_all)); @@ -202,25 +202,25 @@ if ($action == 'update') // If no start date if (empty($_POST['date_debut_'])) { - header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatedebut'); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&action=edit&error=nodatedebut'); exit; } // If no end date if (empty($_POST['date_fin_'])) { - header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatefin'); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&action=edit&error=nodatefin'); exit; } // If start date after end date if ($date_debut > $date_fin) { - header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=datefin'); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&action=edit&error=datefin'); exit; } // If no validator designated if ($valideur < 1) { - header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=Valideur'); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&action=edit&error=Valideur'); exit; } @@ -228,7 +228,7 @@ if ($action == 'update') $nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday); if ($nbopenedday < 0.5) { - header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=DureeHoliday'); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&action=edit&error=DureeHoliday'); exit; } @@ -242,18 +242,18 @@ if ($action == 'update') $verif = $cp->update($user->id); if ($verif > 0) { - header('Location: card.php?id='.$_POST['holiday_id']); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id); exit; } else { // Otherwise we display the request form with the SQL error message - header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=SQL_Create&msg='.$cp->error); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&action=edit&error=SQL_Create&msg='.$cp->error); exit; } } } else { - header('Location: card.php?id='.$_POST['holiday_id']); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id); exit; } } @@ -276,7 +276,7 @@ if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' && $user->rights- // Si l'utilisateur à le droit de lire cette demande, il peut la supprimer if ($canedit) { - $result=$cp->delete($id); + $result=$cp->delete($cp->id); } else { @@ -303,7 +303,7 @@ if ($action == 'confirm_send') $cp->fetch($id); $canedit=(($user->id == $cp->fk_user && $user->rights->holiday->write) || ($user->id != $cp->fk_user && $user->rights->holiday->write_all)); - + // Si brouillon et créateur if($cp->statut == 1 && $canedit) { @@ -321,7 +321,7 @@ if ($action == 'confirm_send') if (!$emailTo) { - header('Location: card.php?id='.$_GET['id']); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id); exit; } @@ -370,7 +370,7 @@ if ($action == 'confirm_send') $message.= "\n"; $message.= "- ".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n"; $message.= "- ".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($cp->date_debut,'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($cp->date_fin,'day')."\n"; - $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$cp->rowid."\n\n"; + $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$cp->id."\n\n"; $message.= "\n"; $mail = new CMailFile($subject,$emailTo,$emailFrom,$message); @@ -380,16 +380,16 @@ if ($action == 'confirm_send') if (!$result) { - header('Location: card.php?id='.$_GET['id'].'&error=mail&error_content='.$mail->error); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&error=mail&error_content='.$mail->error); exit; } - header('Location: card.php?id='.$_GET['id']); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id); exit; } else { // Sinon on affiche le formulaire de demande avec le message d'erreur SQL - header('Location: card.php?id='.$_GET['id'].'&error=SQL_Create&msg='.$cp->error); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&error=SQL_Create&msg='.$cp->error); exit; } } @@ -433,7 +433,7 @@ if ($action == 'confirm_valid') if (!$emailTo) { - header('Location: card.php?id='.$_GET['id']); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id); exit; } @@ -455,7 +455,7 @@ if ($action == 'confirm_valid') $message.= "- ".$langs->transnoentitiesnoconv("ValidatedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n"; - $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$cp->rowid."\n\n"; + $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$cp->id."\n\n"; $message.= "\n"; $mail = new CMailFile($subject,$emailTo,$emailFrom,$message); @@ -464,15 +464,15 @@ if ($action == 'confirm_valid') $result=$mail->sendfile(); if(!$result) { - header('Location: card.php?id='.$_GET['id'].'&error=mail&error_content='.$mail->error); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&error=mail&error_content='.$mail->error); exit; } - header('Location: card.php?id='.$_GET['id']); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id); exit; } else { // Sinon on affiche le formulaire de demande avec le message d'erreur SQL - header('Location: card.php?id='.$_GET['id'].'&error=SQL_Create&msg='.$cp->error); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&error=SQL_Create&msg='.$cp->error); exit; } @@ -485,7 +485,7 @@ if ($action == 'confirm_refuse') if (! empty($_POST['detail_refuse'])) { $cp = new Holiday($db); - $cp->fetch($_GET['id']); + $cp->fetch($id); // Si statut en attente de validation et valideur = utilisateur if ($cp->statut == 2 && $user->id == $cp->fk_validator) @@ -507,7 +507,7 @@ if ($action == 'confirm_refuse') if (!$emailTo) { - header('Location: card.php?id='.$_GET['id']); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id); exit; } @@ -530,7 +530,7 @@ if ($action == 'confirm_refuse') $message.= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n"; - $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$cp->rowid."\n\n"; + $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$cp->id."\n\n"; $message.= "\n"; $mail = new CMailFile($subject,$emailTo,$emailFrom,$message); @@ -539,22 +539,22 @@ if ($action == 'confirm_refuse') $result=$mail->sendfile(); if(!$result) { - header('Location: card.php?id='.$_GET['id'].'&error=mail&error_content='.$mail->error); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&error=mail&error_content='.$mail->error); exit; } - header('Location: card.php?id='.$_GET['id']); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id); exit; } else { // Sinon on affiche le formulaire de demande avec le message d'erreur SQL - header('Location: card.php?id='.$_GET['id'].'&error=SQL_Create&msg='.$cp->error); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&error=SQL_Create&msg='.$cp->error); exit; } } } else { - header('Location: card.php?id='.$_GET['id'].'&error=NoMotifRefuse'); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&error=NoMotifRefuse'); exit; } } @@ -563,7 +563,7 @@ if ($action == 'confirm_refuse') if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes') { $cp = new Holiday($db); - $cp->fetch($_GET['id']); + $cp->fetch($id); // Si statut en attente de validation et valideur = utilisateur if (($cp->statut == 2 || $cp->statut == 3) && ($user->id == $cp->fk_validator || $user->id == $cp->fk_user)) @@ -616,7 +616,7 @@ if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes') if (!$emailTo) { - header('Location: card.php?id='.$_GET['id']); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id); exit; } @@ -638,7 +638,7 @@ if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes') $message.= $langs->transnoentities("HolidaysCanceledBody", dol_print_date($cp->date_debut,'day'), dol_print_date($cp->date_fin,'day'))."\n"; $message.= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n"; - $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$cp->rowid."\n\n"; + $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$cp->id."\n\n"; $message.= "\n"; $mail = new CMailFile($subject,$emailTo,$emailFrom,$message); @@ -648,17 +648,17 @@ if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes') if(!$result) { - header('Location: card.php?id='.$_GET['id'].'&error=mail&error_content='.$mail->error); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&error=mail&error_content='.$mail->error); exit; } - header('Location: card.php?id='.$_GET['id']); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id); exit; } else { // Sinon on affiche le formulaire de demande avec le message d'erreur SQL - header('Location: card.php?id='.$_GET['id'].'&error=SQL_Create&msg='.$cp->error); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$cp->id.'&error=SQL_Create&msg='.$cp->error); exit; } @@ -852,13 +852,8 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create // Approved by print ''; print ''.$langs->trans("ReviewedByCP").''; - $validator = new UserGroup($db); - $excludefilter=$user->admin?'':'u.rowid <> '.$user->id; - $valideurobjects = $validator->listUsersForGroup($excludefilter); - $valideurarray = array(); - foreach($valideurobjects as $val) $valideurarray[$val->id]=$val->id; print ''; - print $form->select_dolusers((GETPOST('valideur')>0?GETPOST('valideur'):$user->fk_user), "valideur", 1, "", 0, $valideurarray, 0, 0, 0, 0, '', 0, '', '', 1); // By default, hierarchical parent + print $form->select_dolusers((GETPOST('valideur')>0?GETPOST('valideur'):$user->fk_user), "valideur", 1, ($user->admin ? '' : array($user->id)), 0, '', 0, 0, 0, 0, '', 0, '', '', 1); // By default, hierarchical parent print ''; print ''; @@ -952,35 +947,35 @@ else { if ($action == 'delete') { - if($user->rights->holiday->delete) + if ($user->rights->holiday->delete) { - print $form->formconfirm("card.php?id=".$id,$langs->trans("TitleDeleteCP"),$langs->trans("ConfirmDeleteCP"),"confirm_delete", '', 0, 1); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id,$langs->trans("TitleDeleteCP"),$langs->trans("ConfirmDeleteCP"),"confirm_delete", '', 0, 1); } } // Si envoi en validation if ($action == 'sendToValidate' && $cp->statut == 1) { - print $form->formconfirm("card.php?id=".$id,$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 1, 1); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id,$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 1, 1); } // Si validation de la demande if ($action == 'valid') { - print $form->formconfirm("card.php?id=".$id,$langs->trans("TitleValidCP"),$langs->trans("ConfirmValidCP"),"confirm_valid", '', 1, 1); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id,$langs->trans("TitleValidCP"),$langs->trans("ConfirmValidCP"),"confirm_valid", '', 1, 1); } // Si refus de la demande if ($action == 'refuse') { $array_input = array(array('type'=>"text",'label'=> $langs->trans('DetailRefusCP'),'name'=>"detail_refuse",'size'=>"50",'value'=>"")); - print $form->formconfirm("card.php?id=".$id."&action=confirm_refuse", $langs->trans("TitleRefuseCP"), $langs->trans('ConfirmRefuseCP'), "confirm_refuse", $array_input, 1, 0); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id."&action=confirm_refuse", $langs->trans("TitleRefuseCP"), $langs->trans('ConfirmRefuseCP'), "confirm_refuse", $array_input, 1, 0); } // Si annulation de la demande if ($action == 'cancel') { - print $form->formconfirm("card.php?id=".$id,$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 1, 1); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id,$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 1, 1); } $head=holiday_prepare_head($cp); @@ -989,13 +984,13 @@ else if ($action == 'edit' && $cp->statut == 1) { $edit = true; - print '
'."\n"; + print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; } dol_fiche_head($head,'card',$langs->trans("CPTitreMenu"),0,'holiday'); - + print ''; print ''; @@ -1132,15 +1127,8 @@ else } else { print ''; print ''; - - $validator = new UserGroup($db); - $excludefilter=$user->admin?'':'u.rowid <> '.$user->id; - $valideurobjects = $validator->listUsersForGroup($excludefilter); - $valideurarray = array(); - foreach($valideurobjects as $val) $valideurarray[$val->id]=$val->id; - print ''; print ''; } @@ -1149,19 +1137,19 @@ else print ''; print ''; print ''; - if($cp->statut == 3) { + if ($cp->statut == 3) { print ''; print ''; print ''; print ''; } - if($cp->statut == 4) { + if ($cp->statut == 4) { print ''; print ''; print ''; print ''; } - if($cp->statut == 5) { + if ($cp->statut == 5) { print ''; print ''; print ''; @@ -1171,7 +1159,7 @@ else print '
'.$langs->trans('ReviewedByCP').''; - print $form->select_dolusers($user->fk_user, "valideur", 1, "", 0, $valideurarray); // By default, hierarchical parent + print $form->select_dolusers($cp->fk_user, "valideur", 1, ($user->admin ? '' : array($user->id))); // By default, hierarchical parent print '
'.$langs->trans('DateCreateCP').''.dol_print_date($cp->date_create,'dayhour').'
'.$langs->trans('DateValidCP').''.dol_print_date($cp->date_valid,'dayhour').'
'.$langs->trans('DateCancelCP').''.dol_print_date($cp->date_cancel,'dayhour').'
'.$langs->trans('DateRefusCP').''.dol_print_date($cp->date_refuse,'dayhour').'
'; dol_fiche_end(); - + if ($action == 'edit' && $cp->statut == 1) { print '
'; @@ -1192,26 +1180,26 @@ else // Boutons d'actions if ($canedit && $cp->statut == 1) { - print ''.$langs->trans("EditCP").''; + print ''.$langs->trans("EditCP").''; } if ($canedit && $cp->statut == 1) { - print ''.$langs->trans("Validate").''; + print ''.$langs->trans("Validate").''; } if ($user->rights->holiday->delete && $cp->statut == 1) // If draft { - print ''.$langs->trans("DeleteCP").''; + print ''.$langs->trans("DeleteCP").''; } if ($user->id == $cp->fk_validator && $cp->statut == 2) { - print ''.$langs->trans("Approve").''; - print ''.$langs->trans("ActionRefuseCP").''; + print ''.$langs->trans("Approve").''; + print ''.$langs->trans("ActionRefuseCP").''; } if (($user->id == $cp->fk_validator || $user->id == $cp->fk_user) && ($cp->statut == 2 || $cp->statut == 3)) // Status validated or approved { - if (($cp->date_debut > dol_now()) || $user->admin) print ''.$langs->trans("ActionCancelCP").''; + if (($cp->date_debut > dol_now()) || $user->admin) print ''.$langs->trans("ActionCancelCP").''; else print ''.$langs->trans("ActionCancelCP").''; } diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 1d1c624aa4c..4e5706f94c6 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1,8 +1,8 @@ - * Copyright (C) 2012-2014 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013 Florian Henry +/* Copyright (C) 2011 Dimitri Mouillard + * Copyright (C) 2012-2014 Laurent Destailleur + * Copyright (C) 2012-2016 Regis Houssin + * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ class Holiday extends CommonObject public $table_element='holiday'; protected $isnolinkedbythird = 1; // No field fk_soc protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - + /** * @deprecated * @see id @@ -161,7 +161,7 @@ class Holiday extends CommonObject if (! $error) { - $this->rowid = $this->db->last_insert_id(MAIN_DB_PREFIX."holiday"); + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."holiday"); } // Commit or rollback @@ -178,7 +178,7 @@ class Holiday extends CommonObject else { $this->db->commit(); - return $this->rowid; + return $this->id; } } @@ -301,7 +301,8 @@ class Holiday extends CommonObject $sql.= " ua.firstname as validator_firstname"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp, ".MAIN_DB_PREFIX."user as uu, ".MAIN_DB_PREFIX."user as ua"; - $sql.= " WHERE cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau + $sql.= " WHERE cp.entity IN (".getEntity('holiday', 1).")"; + $sql.= " AND cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau $sql.= " AND cp.fk_user = '".$user_id."'"; // Filtre de séléction @@ -413,7 +414,8 @@ class Holiday extends CommonObject $sql.= " ua.firstname as validator_firstname"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp, ".MAIN_DB_PREFIX."user as uu, ".MAIN_DB_PREFIX."user as ua"; - $sql.= " WHERE cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau + $sql.= " WHERE cp.entity IN (".getEntity('holiday', 1).")"; + $sql.= " AND cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau // Filtrage de séléction if(!empty($filter)) { @@ -560,7 +562,7 @@ class Holiday extends CommonObject $sql.= " detail_refuse = NULL"; } - $sql.= " WHERE rowid= '".$this->rowid."'"; + $sql.= " WHERE rowid= '".$this->id."'"; $this->db->begin(); @@ -607,7 +609,7 @@ class Holiday extends CommonObject $error=0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."holiday"; - $sql.= " WHERE rowid=".$this->rowid; + $sql.= " WHERE rowid=".$this->id; $this->db->begin(); @@ -1112,16 +1114,29 @@ class Holiday extends CommonObject */ function fetchUsers($stringlist=true,$type=true) { + global $conf; + // Si vrai donc pour user Dolibarr if ($stringlist) { - if($type) + if ($type) { // Si utilisateur de Dolibarr $sql = "SELECT u.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql.= " WHERE statut > 0"; + + 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.")"; + + $sql.= " AND u.statut > 0"; dol_syslog(get_class($this)."::fetchUsers", LOG_DEBUG); $resql=$this->db->query($sql); @@ -1138,7 +1153,7 @@ class Holiday extends CommonObject { $obj = $this->db->fetch_object($resql); - if($i == 0) { + if ($i == 0) { $stringlist.= $obj->rowid; } else { $stringlist.= ', '.$obj->rowid; @@ -1158,7 +1173,7 @@ class Holiday extends CommonObject } else - { + { // We want only list of user id $sql = "SELECT DISTINCT cpu.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as cpu"; @@ -1199,14 +1214,25 @@ class Holiday extends CommonObject } else - { // Si faux donc user Congés Payés + { // Si faux donc user Congés Payés // List for Dolibarr users if ($type) { $sql = "SELECT u.rowid, u.lastname, u.firstname"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql.= " WHERE statut > 0"; + + 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.")"; + + $sql.= " AND u.statut > 0"; dol_syslog(get_class($this)."::fetchUsers", LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 71d286348e8..c181036a0da 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -1,7 +1,8 @@ - * Copyright (C) 2011 Dimitri Mouillard - * Copyright (C) 2013 Marcos García +/* Copyright (C) 2007-2015 Laurent Destailleur + * Copyright (C) 2011 Dimitri Mouillard + * Copyright (C) 2013 Marcos García + * Copyright (C) 2016 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -132,7 +133,7 @@ elseif($action == 'add_event') $new_holiday = $nb_holiday + $add_holiday; // add event to existing types of vacation - foreach ($typeleaves as $key => $leave) + foreach ($typeleaves as $key => $leave) { $vacationTypeID = $leave['rowid']; @@ -160,7 +161,7 @@ print load_fiche_titre($langs->trans('MenuConfCP'), '', 'title_hrm.png'); print '
'.$langs->trans('LastUpdateCP').': '."\n"; $lastUpdate = $holiday->getConfCP('lastUpdate'); -if ($lastUpdate) +if ($lastUpdate) { $monthLastUpdate = $lastUpdate[4].$lastUpdate[5]; $yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3]; @@ -215,7 +216,7 @@ else { print ''."\n"; print ''; - + print ''; print ""; print ''; @@ -233,12 +234,12 @@ else print ''; print ''; print ''; - - + + foreach($listUsers as $users) { $var=!$var; - + print ''; print ''; - + if (count($typeleaves)) { foreach($typeleaves as $key => $val) @@ -261,17 +262,17 @@ else } else { - print ''; + print ''; } print ''; print ''."\n"; print ''; - + $i++; } - + print '
'.$langs->trans('Employee').''.$langs->trans('Note').'
'; $userstatic->id=$users['rowid']; @@ -246,7 +247,7 @@ else $userstatic->firstname=$users['firstname']; print $userstatic->getNomUrl(1); print '
'; - + print ''; } diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index a92945ce502..c2cdab79d8d 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2015 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012-2016 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -232,16 +232,16 @@ if ($id > 0) $title = $langs->trans("User"); $linkback = ''.$langs->trans("BackToList").''; $head = user_prepare_head($fuser); - + dol_fiche_head($head, 'paidholidays', $title, 0, 'user'); dol_banner_tab($fuser,'id',$linkback,$user->rights->user->user->lire || $user->admin); - - + + print '
'; - + print '
'; - + } else { @@ -283,7 +283,7 @@ if ($sall) foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + print ''; print ""; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cp.rowid","",'','',$sortfield,$sortorder); diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index b6be65f725c..16cbb13a57d 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -593,6 +593,7 @@ ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN doc_ref varchar(300) NOT NU ALTER TABLE llx_holiday ADD COLUMN tms timestamp; ALTER TABLE llx_holiday ADD COLUMN entity integer DEFAULT 1 NOT NULL; +ALTER TABLE llx_holiday ADD INDEX idx_holiday_entity (entity); -- Fix Argentina provences INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2326', 2305, '', 0, 'MISIONES', 'Misiones', 1); diff --git a/htdocs/install/mysql/tables/llx_holiday.key.sql b/htdocs/install/mysql/tables/llx_holiday.key.sql index 8c66d2d80d4..9a1a6ae49e3 100644 --- a/htdocs/install/mysql/tables/llx_holiday.key.sql +++ b/htdocs/install/mysql/tables/llx_holiday.key.sql @@ -1,5 +1,6 @@ -- =================================================================== --- Copyright (C) 2012 Laurent Destailleur +-- Copyright (C) 2012 Laurent Destailleur +-- Copyright (C) 2016 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -16,6 +17,7 @@ -- -- =================================================================== +ALTER TABLE llx_holiday ADD INDEX idx_holiday_entity (entity); ALTER TABLE llx_holiday ADD INDEX idx_holiday_fk_user (fk_user); ALTER TABLE llx_holiday ADD INDEX idx_holiday_fk_user_create (fk_user_create); ALTER TABLE llx_holiday ADD INDEX idx_holiday_date_create (date_create); From 6fd533481225ce81d6ccfc862d2d70961a66e94e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 3 Mar 2016 10:10:55 +0100 Subject: [PATCH 06/18] 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 ''; - print ''; + print ''; print ''."\n"; $i++; From 9f798bc3fc1868c5c94e6d3fc9b1300a0d08a4d0 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Thu, 3 Mar 2016 11:54:12 +0100 Subject: [PATCH 07/18] 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 e873655bcdc..4c0fa930327 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -787,6 +787,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 9e80a3794736a219fa8c197481896364e80d01a2 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Thu, 3 Mar 2016 15:45:42 +0100 Subject: [PATCH 08/18] 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 09/18] 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 10/18] 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 11/18] 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 12/18] 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 ''; From e92318bc134efa8803fecfa4a264a5349d3c6112 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Mar 2016 15:21:26 +0100 Subject: [PATCH 13/18] Better fix to manage several level of beta and rc --- htdocs/core/lib/admin.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 812c5de4ead..5c6b9613c17 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -66,12 +66,12 @@ function versioncompare($versionarray1,$versionarray2) if (preg_match('/alpha|dev/i',$operande2)) $operande2=-5; if (preg_match('/beta$/i',$operande1)) $operande1=-4; if (preg_match('/beta$/i',$operande2)) $operande2=-4; - if (preg_match('/beta([0-9])*/i',$operande1)) $operande1=-3; - if (preg_match('/beta([0-9])*/i',$operande2)) $operande2=-3; + if (preg_match('/beta([0-9])+/i',$operande1)) $operande1=-3; + if (preg_match('/beta([0-9])+/i',$operande2)) $operande2=-3; if (preg_match('/rc$/i',$operande1)) $operande1=-2; if (preg_match('/rc$/i',$operande2)) $operande2=-2; - if (preg_match('/rc([0-9])*/i',$operande1)) $operande1=-1; - if (preg_match('/rc([0-9])*/i',$operande2)) $operande2=-1; + if (preg_match('/rc([0-9])+/i',$operande1)) $operande1=-1; + if (preg_match('/rc([0-9])+/i',$operande2)) $operande2=-1; $level++; //print 'level '.$level.' '.$operande1.'-'.$operande2.'
'; if ($operande1 < $operande2) { $ret = -$level; break; } From ae472b932cc54806bf85943e287be95b31217b89 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 4 Mar 2016 20:45:47 +0100 Subject: [PATCH 14/18] Fix: 3.9rc2 Show accountancy account ventilated instead of the rowid of the account --- htdocs/accountancy/customer/list.php | 62 ++++++++++++++-------------- htdocs/accountancy/supplier/list.php | 26 ++++++------ 2 files changed, 45 insertions(+), 43 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index a2a1619cb63..eb73ba16260 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -20,9 +20,9 @@ */ /** - * \file htdocs/accountancy/customer/list.php - * \ingroup Accountancy - * \brief Ventilation page from customers invoices + * \file htdocs/accountancy/customer/list.php + * \ingroup Advanced accountancy + * \brief Ventilation page from customers invoices */ require '../../main.inc.php'; @@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; // Langs $langs->load("compta"); @@ -105,7 +106,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) { /* * View */ - llxHeader('', $langs->trans("Ventilation")); print '
'.$obj->login.''.$langs->trans("Add").''.$langs->trans("Add").'