From 4947ddfd991eb110dbe5280e0ea56396b132a647 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 9 May 2007 08:21:26 +0000 Subject: [PATCH] "php5.2 fixes and hiding Export button for php4 or importexport not available" --- timesheet/inc/class.botimesheet.inc.php | 2 +- timesheet/inc/class.uitimesheet.inc.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/timesheet/inc/class.botimesheet.inc.php b/timesheet/inc/class.botimesheet.inc.php index 85079cd9bd..388148dbeb 100644 --- a/timesheet/inc/class.botimesheet.inc.php +++ b/timesheet/inc/class.botimesheet.inc.php @@ -323,7 +323,7 @@ class botimesheet extends so_sql if ($only_summary) return $this->summary; - if ($this->show_sums && strstr($order_by,'ts_start') && // sums only make sense if ordered by ts_start + if ($this->show_sums && strpos($order_by,'ts_start') !== false && // sums only make sense if ordered by ts_start $this->db->capabilities['union'] && ($from_unixtime_ts_start = $this->db->from_unixtime('ts_start'))) { $sum_sql = array( diff --git a/timesheet/inc/class.uitimesheet.inc.php b/timesheet/inc/class.uitimesheet.inc.php index 7a436f1e57..b7308f73d5 100644 --- a/timesheet/inc/class.uitimesheet.inc.php +++ b/timesheet/inc/class.uitimesheet.inc.php @@ -86,7 +86,7 @@ class uitimesheet extends botimesheet ); } $referer = preg_match('/menuaction=([^&]+)/',$_SERVER['HTTP_REFERER'],$matches) ? $matches[1] : - (strstr($_SERVER['HTTP_REFERER'],'/infolog/index.php') ? 'infolog.uiinfolog.index' : TIMESHEET_APP.'.uitimesheet.index'); + (strpos($_SERVER['HTTP_REFERER'],'/infolog/index.php') !== false ? 'infolog.uiinfolog.index' : TIMESHEET_APP.'.uitimesheet.index'); } else { @@ -635,6 +635,9 @@ class uitimesheet extends botimesheet if (!is_array($projects)) $projects = array(); $sel_options['ts_project'] = $projects + array(lang('No project')); } + // dont show [Export] button if app is not availible to the user or we are on php4 + $readonlys['export'] = !$GLOBALS['egw_info']['user']['apps']['importexport'] || (int) phpversion() < 5; + return $etpl->exec(TIMESHEET_APP.'.uitimesheet.index',$content,$sel_options,$readonlys,$preserv); }