]> git.pld-linux.org Git - packages/eventum.git/blob - eventum-cli-wr-separated.patch
- for 1.5.4
[packages/eventum.git] / eventum-cli-wr-separated.patch
1 --- ./rpc/xmlrpc.php    2005-07-19 16:33:54.000000000 +0300
2 +++ /tmp/xmlrpc.php     2005-07-19 17:41:28.000000000 +0300
3 @@ -650,7 +650,7 @@
4      }
5  }
6  
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)
10  {
11      $email = XML_RPC_decode($p->getParam(0));
12 @@ -662,6 +662,7 @@
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));
17      
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 @@ -677,9 +678,14 @@
21          $start = date("Y-m-d", $start);
22      }
23      
24 +    if ($separate_closed) {
25 +        // emulate smarty value for reports/weekly_data.tpl.tmpl:
26 +        // {if $smarty.post.separate_closed == 1}
27 +        $_POST['separate_closed'] = true;
28 +    }
29      $tpl = new Template_API();
30      $tpl->setTemplate("reports/weekly_data.tpl.html");
31 -    $tpl->assign("data", Report::getWeeklyReport(User::getUserIDByEmail($email), $start, $end));
32 +    $tpl->assign("data", Report::getWeeklyReport(User::getUserIDByEmail($email), $start, $end, $separate_closed));
33  
34      $ret = $tpl->getTemplateContents(). "\n";
35      return new XML_RPC_Response(XML_RPC_Encode(base64_encode($ret)));
36 --- ./misc/cli/eventum  2005-07-19 16:33:54.000000000 +0300
37 +++ /tmp/eventum        2005-07-19 17:43:37.000000000 +0300
38 @@ -218,15 +218,19 @@
39          }
40          Command_Line::lookupCustomer(&$client, $auth, $HTTP_SERVER_VARS['argv'][2], $HTTP_SERVER_VARS['argv'][3]);
41      } elseif (($HTTP_SERVER_VARS['argv'][1] == 'weekly-report') || ($HTTP_SERVER_VARS['argv'][1] == 'wr')) {
42 -        if (count(@$HTTP_SERVER_VARS['argv']) == 4) {
43 +        if (count(@$HTTP_SERVER_VARS['argv']) >= 4 and $HTTP_SERVER_VARS['argv'][3] != '--separate-closed') {
44 +            $separate_closed = (@$HTTP_SERVER_VARS['argv'][4] == '--separate-closed');
45              // date range
46 -            Command_Line::getWeeklyReport(&$client, $auth, 0, $HTTP_SERVER_VARS['argv'][2], $HTTP_SERVER_VARS['argv'][3]);
47 +            Command_Line::getWeeklyReport(&$client, $auth, 0, $HTTP_SERVER_VARS['argv'][2], $HTTP_SERVER_VARS['argv'][3], $separate_closed);
48          } else {
49              // weekly
50              if (@$HTTP_SERVER_VARS['argv'][2] == '') {
51 +                $separate_closed = false;
52                  @$HTTP_SERVER_VARS['argv'][2] = 0;
53 +            } else {
54 +                $separate_closed = (@$HTTP_SERVER_VARS['argv'][3] == '--separate-closed' or @$HTTP_SERVER_VARS['argv'][2] == '--separate-closed');
55              }
56 -            Command_Line::getWeeklyReport(&$client, $auth, $HTTP_SERVER_VARS['argv'][2]);
57 +            Command_Line::getWeeklyReport(&$client, $auth, $HTTP_SERVER_VARS['argv'][2], '', '', $separate_closed);
58          }
59      } elseif ($HTTP_SERVER_VARS['argv'][1] == 'clock') {
60          Command_Line::timeClock(&$client, $auth, @$HTTP_SERVER_VARS['argv'][2]);
61 --- ./misc/cli/include/class.command_line.php   2005-07-19 16:33:54.000000000 +0300
62 +++ /tmp/class.command_line.php 2005-07-19 17:43:37.000000000 +0300
63 @@ -1144,15 +1144,17 @@
64       * @param   integer $week The week for the report. If start and end date are set, this is ignored.
65       * @param   string $start_date The start date of the report. (optional)
66       * @param   string $end_date The end_date of the report. (optional)
67 +     * @param   boolean If closed issues should be separated from other issues. 
68       */
69 -    function getWeeklyReport($rpc_conn, $auth, $week, $start_date = '', $end_date = '')
70 +    function getWeeklyReport($rpc_conn, $auth, $week, $start_date = '', $end_date = '', $separate_closed = false)
71      {
72          $msg = new XML_RPC_Message("getWeeklyReport", array(
73              new XML_RPC_Value($auth[0], 'string'), 
74              new XML_RPC_Value($auth[1], 'string'),
75              new XML_RPC_Value($week, "int"), 
76              new XML_RPC_Value($start_date, "string"), 
77 -            new XML_RPC_Value($end_date, "string")
78 +            new XML_RPC_Value($end_date, "string"),
79 +            new XML_RPC_Value($separate_closed ? 1 : 0, 'int'), 
80          ));
81          $result = $rpc_conn->send($msg);
82          if ($result->faultCode()) {
83 @@ -1686,7 +1688,7 @@
84              "help"      =>  "Looks up a customer's record information."
85          );
86          $usage[] = array(
87 -            "command"   =>  array("weekly-report ([<week>])|([<start>] [<end>])", "wr ([<week>])|([<start>] [<end>])"),
88 +            "command"   =>  array("weekly-report ([<week>] [--separate-closed])|([<start>] [<end>] [--separate-closed])", "wr ([<week>])|([<start>] [<end>] [--separate-closed])"),
89              "help"      =>  "Fetches the weekly report. Week is specified as an integer with 0 representing
90       the current week, -1 the previous week and so on. If the week is omitted it defaults 
91       to the current week. Alternately, a date range can be set. Dates should be in the format 'YYYY-MM-DD'."
This page took 0.033584 seconds and 3 git commands to generate.