From 1957af52b1049e18a8df72d2e8f4aff43cebd085 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 7 Jul 2016 09:23:43 +0200 Subject: [PATCH 1/4] fix syntax --- htdocs/comm/action/pertype.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 6138e79cafd..ae11f06cedd 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -86,12 +86,12 @@ $status=GETPOST("status"); $type=GETPOST("type"); $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) -if (GETPOST('actioncode','array')) +if (GETPOST('actioncode','array')) { $actioncode=GETPOST('actioncode','array',3); if (! count($actioncode)) $actioncode='0'; } -else +else { $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } @@ -186,7 +186,7 @@ $week = $prev['week']; $day = (int) $day; $next = dol_get_next_day($day, $month, $year); -$next_year = year + 1; +$next_year = $year + 1; $next_month = $month; $next_day = $day; From 240dcc78fb07db44b7df65ea18f6d85ad56153c5 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 7 Jul 2016 09:47:12 +0200 Subject: [PATCH 2/4] fix php warning introduce by 97eedb866bedf92be38af7e84974920776767f13 urlencode cannot deal with array --- htdocs/main.inc.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 3f790907fc1..2eb2dc675db 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1038,7 +1038,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs $ext='version='.urlencode(DOL_VERSION); if (GETPOST('version')) $ext='version='.GETPOST('version','int'); // usefull to force no cache on css/js if (GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) $ext='testmenuhider='.GETPOST('testmenuhider','int'); - + if (! defined('DISABLE_JQUERY') && ! $disablejs && $conf->use_javascript_ajax) { print ''."\n"; @@ -1376,7 +1376,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $searchform=''; $bookmarks=''; - + // Instantiate hooks of thirdparty module $hookmanager->initHooks(array('toprightmenu')); @@ -1480,11 +1480,13 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && empty($conf->browser->phone)) { $qs=$_SERVER["QUERY_STRING"]; - + foreach($_POST as $key=>$value) { - if($key!=='action')$qs.='&'.$key.'='.urlencode($value); - } - + if (!is_array($value)) { + if($key!=='action')$qs.='&'.$key.'='.urlencode($value); + } + } + $qs.=(($qs && $morequerystring)?'&':'').$morequerystring; $text =''; $text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"'); From 96172a59109268744688c22bc7c9727951cab81f Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 7 Jul 2016 09:49:27 +0200 Subject: [PATCH 3/4] better syntax --- htdocs/main.inc.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2eb2dc675db..40aa25798c4 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1482,9 +1482,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $qs=$_SERVER["QUERY_STRING"]; foreach($_POST as $key=>$value) { - if (!is_array($value)) { - if($key!=='action')$qs.='&'.$key.'='.urlencode($value); - } + if($key!=='action' && !is_array($value))$qs.='&'.$key.'='.urlencode($value); } $qs.=(($qs && $morequerystring)?'&':'').$morequerystring; From 9b5bcc6dcd3cee5e4244cec28fde73dc84bcc741 Mon Sep 17 00:00:00 2001 From: Sof Date: Thu, 7 Jul 2016 10:25:17 +0200 Subject: [PATCH 4/4] FIX: Missing semicolon --- htdocs/install/mysql/migration/repair.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 74c1b4680c0..8e445c1e1a6 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -263,7 +263,7 @@ delete from llx_menu where menu_handler = 'smartphone'; -- Detect bad consistency between duraction_effective of a task and sum of time of tasks -- select pt.rowid, pt.duration_effective, SUM(ptt.task_duration) as y from llx_projet_task as pt, llx_projet_task_time as ptt where ptt.fk_task = pt.rowid group by pt.rowid, pt.duration_effective having pt.duration_effective <> y; -update llx_projet_task as pt set pt.duration_effective = (select SUM(ptt.task_duration) as y from llx_projet_task_time as ptt where ptt.fk_task = pt.rowid) where pt.duration_effective <> (select SUM(ptt.task_duration) as y from llx_projet_task_time as ptt where ptt.fk_task = pt.rowid) +update llx_projet_task as pt set pt.duration_effective = (select SUM(ptt.task_duration) as y from llx_projet_task_time as ptt where ptt.fk_task = pt.rowid) where pt.duration_effective <> (select SUM(ptt.task_duration) as y from llx_projet_task_time as ptt where ptt.fk_task = pt.rowid); -- Remove duplicate of shipment mode (keep the one with tracking defined)