1 --- ./rpc/xmlrpc.php 2005-07-19 16:33:54.000000000 +0300
2 +++ /tmp/xmlrpc.php 2005-07-19 17:41:28.000000000 +0300
7 -$getWeeklyReport_sig = array(array($XML_RPC_String, $XML_RPC_String, $XML_RPC_String, $XML_RPC_Int, $XML_RPC_String, $XML_RPC_String));
8 +$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));
9 function getWeeklyReport($p)
11 $email = XML_RPC_decode($p->getParam(0));
13 $week = abs(XML_RPC_decode($p->getParam(2)));
14 $start = XML_RPC_decode($p->getParam(3));
15 $end = XML_RPC_decode($p->getParam(4));
16 + $separate_closed = XML_RPC_decode($p->getParam(5));
18 // we have to set a project so the template class works, even though the weekly report doesn't actually need it
19 $projects = Project::getAssocList(Auth::getUserID());
20 --- ./misc/cli/eventum 2005-07-19 16:33:54.000000000 +0300
21 +++ /tmp/eventum 2005-07-19 17:43:37.000000000 +0300
24 Command_Line::lookupCustomer($client, $auth, $HTTP_SERVER_VARS['argv'][2], $HTTP_SERVER_VARS['argv'][3]);
25 } elseif (($HTTP_SERVER_VARS['argv'][1] == 'weekly-report') || ($HTTP_SERVER_VARS['argv'][1] == 'wr')) {
26 - if (count(@$HTTP_SERVER_VARS['argv']) == 4) {
27 + if (count(@$HTTP_SERVER_VARS['argv']) >= 4 and $HTTP_SERVER_VARS['argv'][3] != '--separate-closed') {
28 + $separate_closed = (@$HTTP_SERVER_VARS['argv'][4] == '--separate-closed');
30 - Command_Line::getWeeklyReport($client, $auth, 0, $HTTP_SERVER_VARS['argv'][2], $HTTP_SERVER_VARS['argv'][3]);
31 + Command_Line::getWeeklyReport($client, $auth, 0, $HTTP_SERVER_VARS['argv'][2], $HTTP_SERVER_VARS['argv'][3], $separate_closed);
34 if (@$HTTP_SERVER_VARS['argv'][2] == '') {
35 + $separate_closed = false;
36 @$HTTP_SERVER_VARS['argv'][2] = 0;
38 + $separate_closed = (@$HTTP_SERVER_VARS['argv'][3] == '--separate-closed' or @$HTTP_SERVER_VARS['argv'][2] == '--separate-closed');
40 - Command_Line::getWeeklyReport($client, $auth, $HTTP_SERVER_VARS['argv'][2]);
41 + Command_Line::getWeeklyReport($client, $auth, $HTTP_SERVER_VARS['argv'][2], '', '', $separate_closed);
43 } elseif ($HTTP_SERVER_VARS['argv'][1] == 'clock') {
44 Command_Line::timeClock(&$client, $auth, @$HTTP_SERVER_VARS['argv'][2]);
45 --- ./misc/cli/include/class.command_line.php 2005-07-19 16:33:54.000000000 +0300
46 +++ /tmp/class.command_line.php 2005-07-19 17:43:37.000000000 +0300
47 @@ -1144,15 +1144,17 @@
48 * @param integer $week The week for the report. If start and end date are set, this is ignored.
49 * @param string $start_date The start date of the report. (optional)
50 * @param string $end_date The end_date of the report. (optional)
51 + * @param boolean If closed issues should be separated from other issues.
53 - function getWeeklyReport(&$rpc_conn, $auth, $week, $start_date = '', $end_date = '')
54 + function getWeeklyReport(&$rpc_conn, $auth, $week, $start_date = '', $end_date = '', $separate_closed = false)
56 $msg = new XML_RPC_Message("getWeeklyReport", array(
57 new XML_RPC_Value($auth[0], 'string'),
58 new XML_RPC_Value($auth[1], 'string'),
59 new XML_RPC_Value($week, "int"),
60 new XML_RPC_Value($start_date, "string"),
61 - new XML_RPC_Value($end_date, "string")
62 + new XML_RPC_Value($end_date, "string"),
63 + new XML_RPC_Value($separate_closed ? 1 : 0, 'int'),
65 $result = $rpc_conn->send($msg);
66 if ($result->faultCode()) {
68 "help" => "Looks up a customer's record information."
71 - "command" => array("weekly-report ([<week>])|([<start>] [<end>])", "wr ([<week>])|([<start>] [<end>])"),
72 + "command" => array("weekly-report ([<week>] [--separate-closed])|([<start>] [<end>] [--separate-closed])", "wr ([<week>])|([<start>] [<end>] [--separate-closed])"),
73 "help" => "Fetches the weekly report. Week is specified as an integer with 0 representing
74 the current week, -1 the previous week and so on. If the week is omitted it defaults
75 to the current week. Alternately, a date range can be set. Dates should be in the format 'YYYY-MM-DD'."
76 --- ../rpc/xmlrpc.php~ 2005-07-26 20:19:37.000000000 +0300
77 +++ ../rpc/xmlrpc.php 2005-07-26 20:21:11.000000000 +0300
79 $start = date("Y-m-d", $start);
82 + if ($separate_closed) {
83 + // emulate smarty value for reports/weekly_data.tpl.tmpl:
84 + // {if $smarty.post.separate_closed == 1}
85 + $_POST['separate_closed'] = true;
87 $tpl = new Template_API();
88 $tpl->setTemplate("reports/weekly_data.tpl.html");
89 - $tpl->assign("data", Report::getWeeklyReport(User::getUserIDByEmail($email), $start, $end));
90 + $tpl->assign("data", Report::getWeeklyReport(User::getUserIDByEmail($email), $start, $end, $separate_closed));
92 $ret = $tpl->getTemplateContents(). "\n";
93 return new XML_RPC_Response(XML_RPC_Encode(base64_encode($ret)));