From 69b69896c80e6cf33f9e63b025fefa2cd044bbfa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Tue, 26 Jul 2005 17:20:59 +0000 Subject: [PATCH] - for 1.5.4 Changed files: eventum-cli-wr-separated.patch -> 1.1 --- eventum-cli-wr-separated.patch | 91 ++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 eventum-cli-wr-separated.patch diff --git a/eventum-cli-wr-separated.patch b/eventum-cli-wr-separated.patch new file mode 100644 index 0000000..4e581bc --- /dev/null +++ b/eventum-cli-wr-separated.patch @@ -0,0 +1,91 @@ +--- ./rpc/xmlrpc.php 2005-07-19 16:33:54.000000000 +0300 ++++ /tmp/xmlrpc.php 2005-07-19 17:41:28.000000000 +0300 +@@ -650,7 +650,7 @@ + } + } + +-$getWeeklyReport_sig = array(array($XML_RPC_String, $XML_RPC_String, $XML_RPC_String, $XML_RPC_Int, $XML_RPC_String, $XML_RPC_String)); ++$getWeeklyReport_sig = array(array($XML_RPC_String, $XML_RPC_String, $XML_RPC_String, $XML_RPC_Int, $XML_RPC_String, $XML_RPC_String, $XML_RPC_Int)); + function getWeeklyReport($p) + { + $email = XML_RPC_decode($p->getParam(0)); +@@ -662,6 +662,7 @@ + $week = abs(XML_RPC_decode($p->getParam(2))); + $start = XML_RPC_decode($p->getParam(3)); + $end = XML_RPC_decode($p->getParam(4)); ++ $separate_closed = XML_RPC_decode($p->getParam(5)); + + // we have to set a project so the template class works, even though the weekly report doesn't actually need it + $projects = Project::getAssocList(Auth::getUserID()); +@@ -677,9 +678,14 @@ + $start = date("Y-m-d", $start); + } + ++ if ($separate_closed) { ++ // emulate smarty value for reports/weekly_data.tpl.tmpl: ++ // {if $smarty.post.separate_closed == 1} ++ $_POST['separate_closed'] = true; ++ } + $tpl = new Template_API(); + $tpl->setTemplate("reports/weekly_data.tpl.html"); +- $tpl->assign("data", Report::getWeeklyReport(User::getUserIDByEmail($email), $start, $end)); ++ $tpl->assign("data", Report::getWeeklyReport(User::getUserIDByEmail($email), $start, $end, $separate_closed)); + + $ret = $tpl->getTemplateContents(). "\n"; + return new XML_RPC_Response(XML_RPC_Encode(base64_encode($ret))); +--- ./misc/cli/eventum 2005-07-19 16:33:54.000000000 +0300 ++++ /tmp/eventum 2005-07-19 17:43:37.000000000 +0300 +@@ -218,15 +218,19 @@ + } + Command_Line::lookupCustomer(&$client, $auth, $HTTP_SERVER_VARS['argv'][2], $HTTP_SERVER_VARS['argv'][3]); + } elseif (($HTTP_SERVER_VARS['argv'][1] == 'weekly-report') || ($HTTP_SERVER_VARS['argv'][1] == 'wr')) { +- if (count(@$HTTP_SERVER_VARS['argv']) == 4) { ++ if (count(@$HTTP_SERVER_VARS['argv']) >= 4 and $HTTP_SERVER_VARS['argv'][3] != '--separate-closed') { ++ $separate_closed = (@$HTTP_SERVER_VARS['argv'][4] == '--separate-closed'); + // date range +- Command_Line::getWeeklyReport(&$client, $auth, 0, $HTTP_SERVER_VARS['argv'][2], $HTTP_SERVER_VARS['argv'][3]); ++ Command_Line::getWeeklyReport(&$client, $auth, 0, $HTTP_SERVER_VARS['argv'][2], $HTTP_SERVER_VARS['argv'][3], $separate_closed); + } else { + // weekly + if (@$HTTP_SERVER_VARS['argv'][2] == '') { ++ $separate_closed = false; + @$HTTP_SERVER_VARS['argv'][2] = 0; ++ } else { ++ $separate_closed = (@$HTTP_SERVER_VARS['argv'][3] == '--separate-closed' or @$HTTP_SERVER_VARS['argv'][2] == '--separate-closed'); + } +- Command_Line::getWeeklyReport(&$client, $auth, $HTTP_SERVER_VARS['argv'][2]); ++ Command_Line::getWeeklyReport(&$client, $auth, $HTTP_SERVER_VARS['argv'][2], '', '', $separate_closed); + } + } elseif ($HTTP_SERVER_VARS['argv'][1] == 'clock') { + Command_Line::timeClock(&$client, $auth, @$HTTP_SERVER_VARS['argv'][2]); +--- ./misc/cli/include/class.command_line.php 2005-07-19 16:33:54.000000000 +0300 ++++ /tmp/class.command_line.php 2005-07-19 17:43:37.000000000 +0300 +@@ -1144,15 +1144,17 @@ + * @param integer $week The week for the report. If start and end date are set, this is ignored. + * @param string $start_date The start date of the report. (optional) + * @param string $end_date The end_date of the report. (optional) ++ * @param boolean If closed issues should be separated from other issues. + */ +- function getWeeklyReport($rpc_conn, $auth, $week, $start_date = '', $end_date = '') ++ function getWeeklyReport($rpc_conn, $auth, $week, $start_date = '', $end_date = '', $separate_closed = false) + { + $msg = new XML_RPC_Message("getWeeklyReport", array( + new XML_RPC_Value($auth[0], 'string'), + new XML_RPC_Value($auth[1], 'string'), + new XML_RPC_Value($week, "int"), + new XML_RPC_Value($start_date, "string"), +- new XML_RPC_Value($end_date, "string") ++ new XML_RPC_Value($end_date, "string"), ++ new XML_RPC_Value($separate_closed ? 1 : 0, 'int'), + )); + $result = $rpc_conn->send($msg); + if ($result->faultCode()) { +@@ -1686,7 +1688,7 @@ + "help" => "Looks up a customer's record information." + ); + $usage[] = array( +- "command" => array("weekly-report ([])|([] [])", "wr ([])|([] [])"), ++ "command" => array("weekly-report ([] [--separate-closed])|([] [] [--separate-closed])", "wr ([])|([] [] [--separate-closed])"), + "help" => "Fetches the weekly report. Week is specified as an integer with 0 representing + the current week, -1 the previous week and so on. If the week is omitted it defaults + to the current week. Alternately, a date range can be set. Dates should be in the format 'YYYY-MM-DD'." -- 2.44.0