From 84c8de754d0e2a633efc18a777e4b48c21dad002 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 27 Jan 2009 15:51:04 +0000 Subject: [PATCH] fix for issue in tracker #1876 (Timesheet, in detail view, not shows link to the owner project); fix for not working 'no-project'-filter --- timesheet/inc/class.timesheet_ui.inc.php | 33 +++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php index 6d0c02d220..faf72162bd 100644 --- a/timesheet/inc/class.timesheet_ui.inc.php +++ b/timesheet/inc/class.timesheet_ui.inc.php @@ -409,7 +409,7 @@ class timesheet_ui extends timesheet_bo //echo "

show_sums=".print_r($this->show_sums,true)."

\n"; $GLOBALS['egw']->session->appsession('index',TIMESHEET_APP,$query_in); $query = $query_in; // keep the original query - + #_debug_array($query['col_filter']); // PM project filter for the PM integration if ((string)$query['col_filter']['pm_id'] != '') { @@ -417,11 +417,17 @@ class timesheet_ui extends timesheet_bo $query['col_filter']['ts_id'] = $this->get_ts_links($query['col_filter']['pm_id']); if (!$query['col_filter']['ts_id']) $query['col_filter']['ts_id'] = 0; } + if ((string)$query['col_filter']['pm_id'] != '' && (string)$query['col_filter']['pm_id'] == '0') { + $query['col_filter']['ts_project'] = 0; + unset($query['col_filter']['ts_id']); + } unset($query['col_filter']['pm_id']); // filter for no project - if ((string)$query['col_filter']['ts_project'] == '0') $query['col_filter']['ts_project'] = null; - + if ((string)$query['col_filter']['ts_project'] == '0') { + $query['col_filter']['ts_project'] = null; + } + #_debug_array($query['col_filter']); if ((int)$query['filter2'] != (int)$GLOBALS['egw_info']['user']['preferences'][TIMESHEET_APP]['show_details']) { $GLOBALS['egw']->preferences->add(TIMESHEET_APP,'show_details',(int)$query['filter2']); @@ -504,9 +510,24 @@ class timesheet_ui extends timesheet_bo $rows = $ids; return $this->total; // no need to set other fields or $readonlys } - #$links = egw_link::get_links_multiple(TIMESHEET_APP,$ids,true,'projectmanager'); // only check for pm links! - $links = egw_link::get_links_multiple(TIMESHEET_APP,$ids,true); - + $links3 = egw_link::get_links_multiple(TIMESHEET_APP,$ids,true,'projectmanager'); // only check for pm links! + #_debug_array($links); + //as the full array is expected, we must supply the missing but needed (since expected further down) information + if (is_array($links3)) { + foreach ($links3 as $likey => $liarray) { + #echo "$likey";_debug_array($liarray);echo"
"; + if (is_array($liarray)) { + foreach ($liarray as $li2key => $lival) { + $links[$likey][$li2key]['id'] = $lival; + $links[$likey][$li2key]['app'] = 'projectmanager'; + } + } + } + if (!is_array($links)) $links = array(); + } else { + $links = array(); + } + #_debug_array($links); unset($query['col_filter'][0]); // query cf's for the displayed rows