From 03eadcebf1c636cb8a9d4c5945d33d5929c8f082 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Mon, 19 Jun 2017 12:25:00 +0200 Subject: [PATCH 1/6] FIX: User id correction on holiday request --- htdocs/holiday/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 8cae9592033..d9e651953c5 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2012-2015 Laurent Destailleur * Copyright (C) 2012-2016 Regis Houssin * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2014-2017 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 @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; $myparam = GETPOST("myparam"); $action=GETPOST('action', 'alpha'); $id=GETPOST('id', 'int'); -$userid = GETPOST('userid')?GETPOST('userid'):$user->id; +$userID = GETPOST('userID')?GETPOST('userID'):$user->id; // Protection if external user if ($user->societe_id > 0) accessforbidden(); @@ -57,6 +57,7 @@ if ($action == 'create') $cp = new Holiday($db); // If no right to create a request + $userid = GETPOST('userid'); if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all))) { $error++; @@ -82,7 +83,6 @@ if ($action == 'create') $valideur = GETPOST('valideur'); $description = trim(GETPOST('description')); - $userID = GETPOST('userID'); // If no type if ($type <= 0) @@ -112,7 +112,7 @@ if ($action == 'create') } // Check if there is already holiday for this period - $verifCP = $cp->verifDateHolidayCP($userID, $date_debut, $date_fin, $halfday); + $verifCP = $cp->verifDateHolidayCP($userid, $date_debut, $date_fin, $halfday); if (! $verifCP) { header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=alreadyCP'); @@ -762,7 +762,7 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create // Formulaire de demande print '
'."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; dol_fiche_head(); From c4546b6da6b7ca71b5f640184b22b3d0394b8139 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Mon, 19 Jun 2017 16:23:44 +0200 Subject: [PATCH 2/6] FIX: User id correction on holiday request --- htdocs/holiday/card.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index d9e651953c5..5789cf27180 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -39,7 +39,6 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; $myparam = GETPOST("myparam"); $action=GETPOST('action', 'alpha'); $id=GETPOST('id', 'int'); -$userID = GETPOST('userID')?GETPOST('userID'):$user->id; // Protection if external user if ($user->societe_id > 0) accessforbidden(); @@ -57,8 +56,8 @@ if ($action == 'create') $cp = new Holiday($db); // If no right to create a request - $userid = GETPOST('userid'); - if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all))) + $fuserid = GETPOST('fuserid'); + if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all))) { $error++; setEventMessages($langs->trans('CantCreateCP'), null, 'errors'); @@ -112,7 +111,7 @@ if ($action == 'create') } // Check if there is already holiday for this period - $verifCP = $cp->verifDateHolidayCP($userid, $date_debut, $date_fin, $halfday); + $verifCP = $cp->verifDateHolidayCP($fuserid, $date_debut, $date_fin, $halfday); if (! $verifCP) { header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=alreadyCP'); @@ -140,7 +139,7 @@ if ($action == 'create') if (! $error) { - $cp->fk_user = $userid; + $cp->fk_user = $fuserid; $cp->description = $description; $cp->date_debut = $date_debut; $cp->date_fin = $date_fin; @@ -682,7 +681,7 @@ llxHeader(array(),$langs->trans('CPTitreMenu')); if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create') { // Si l'utilisateur n'a pas le droit de faire une demande - if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all))) + if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all))) { $errors[]=$langs->trans('CantCreateCP'); } @@ -762,7 +761,6 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create // Formulaire de demande print ''."\n"; print ''."\n"; - print ''."\n"; dol_fiche_head(); @@ -793,10 +791,10 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create print ''; if (empty($user->rights->holiday->write_all)) { - print $form->select_dolusers($userid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - print ''; + print $form->select_dolusers($fuserid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + print ''; } - else print $form->select_dolusers(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0); + else print $form->select_dolusers(GETPOST('fuserid')?GETPOST('fuserid'):$user->id,'fuserid',0,'',0); print ''; print ''; From f694939fc74e81d823be4c56b51d66f64d793abb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Jun 2017 19:39:37 +0200 Subject: [PATCH 3/6] Fix migration with pgsql --- htdocs/install/mysql/migration/3.5.0-3.6.0.sql | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql index bd04766eebf..3d83d2a7af9 100644 --- a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql +++ b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql @@ -63,7 +63,7 @@ ALTER TABLE llx_bookmark ADD COLUMN entity integer DEFAULT 1 NOT NULL; ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL; -ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-01 00:00:00'; +-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-01 00:00:00'; -- Clean corrupted values for tms -- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES'; @@ -74,7 +74,7 @@ ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01- -- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL; -- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL; -ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP; +-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP; ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL; @@ -204,9 +204,14 @@ CREATE TABLE llx_payment_salary ( fk_user_modif integer )ENGINE=innodb; + +DELETE FROM llx_product_batch where fk_product_stock NOT IN (SELECT rowid from llx_product_stock); + ALTER TABLE llx_product_batch ADD INDEX idx_fk_product_stock (fk_product_stock); ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid); +DELETE FROM llx_expeditiondet_batch where fk_expeditiondet NOT IN (SELECT rowid from llx_expeditiondet); + ALTER TABLE llx_expeditiondet_batch ADD INDEX idx_fk_expeditiondet (fk_expeditiondet); ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet(rowid); From 99c78675222640e1890c678ba0fbc13fc64ee4ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Jun 2017 12:06:01 +0200 Subject: [PATCH 4/6] Fix travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bb6b774d9ab..60343805fcf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ php: - '5.3' - '5.4' - '5.5' -- '5.6' +- '5.6.29' - '7.0' - nightly From 65b9b70ff8ad62147bf5186ac07a9e3ac3a67ee2 Mon Sep 17 00:00:00 2001 From: arnaud Date: Tue, 27 Jun 2017 15:23:51 +0200 Subject: [PATCH 5/6] FIX invoice page list --- htdocs/compta/facture/list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 14a5c484e8c..e37f5b316fc 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -551,7 +551,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $nbtotalofrecords = $db->num_rows($result); } -$sql.= $db->plimit($limit,$offset); +$sql.= $db->plimit($limit + 1,$offset); //print $sql; $resql = $db->query($sql); @@ -591,7 +591,6 @@ if ($resql) $i = 0; print ''."\n"; - print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$massactionbutton,$num,$nbtotalofrecords,'title_accountancy.png'); if ($massaction == 'presend') From 4283b1ee30b294b975c34236897a0944a6901371 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Wed, 28 Jun 2017 18:31:37 +0200 Subject: [PATCH 6/6] FIX: User id correction on holiday request --- htdocs/holiday/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 5789cf27180..44ec0496f7b 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -792,7 +792,7 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create if (empty($user->rights->holiday->write_all)) { print $form->select_dolusers($fuserid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - print ''; + print ''; } else print $form->select_dolusers(GETPOST('fuserid')?GETPOST('fuserid'):$user->id,'fuserid',0,'',0); print '';