~ubuntu-branches/ubuntu/wily/phabricator/wily

« back to all changes in this revision

Viewing changes to arcanist/src/workflow/ArcanistPhrequentWorkflow.php

  • Committer: Package Import Robot
  • Author(s): Richard Sellam
  • Date: 2015-02-11 14:13:38 UTC
  • mfrom: (0.18.1) (0.17.1) (0.13.2) (2.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20150211141338-7t6wkyisc5b04ww5
Tags: 0~git20150211-1
* New snapshot release
* updated german translation
* fixed daemons not starting with unprivileged user

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
 
3
3
/**
4
 
 * Base workflow for Phrequent workflows
 
4
 * Base workflow for Phrequent workflows.
5
5
 */
6
6
abstract class ArcanistPhrequentWorkflow extends ArcanistWorkflow {
7
7
 
10
10
 
11
11
    $results = $conduit->callMethodSynchronous(
12
12
      'phrequent.tracking',
13
 
      array(
14
 
      ));
 
13
      array());
15
14
    $results = $results['data'];
16
15
 
17
16
    if (count($results) === 0) {
18
17
      echo phutil_console_format(
19
 
        "Not currently tracking time against any object\n");
20
 
 
 
18
        "%s\n",
 
19
        pht('Not currently tracking time against any object.'));
21
20
      return 0;
22
21
    }
23
22
 
37
36
      if (array_key_exists($lookup, $phid_query)) {
38
37
        $phid_map[$lookup] = $phid_query[$lookup]['fullName'];
39
38
      } else {
40
 
        $phid_map[$lookup] = 'Unknown Object';
 
39
        $phid_map[$lookup] = pht('Unknown Object');
41
40
      }
42
41
    }
43
42
 
44
43
    $table = id(new PhutilConsoleTable())
45
 
      ->addColumn('type', array('title' => 'Status'))
46
 
      ->addColumn('time', array('title' => 'Tracked', 'align' => 'right'))
47
 
      ->addColumn('name', array('title' => 'Name'))
 
44
      ->addColumn('type', array('title' => pht('Status')))
 
45
      ->addColumn('time', array('title' => pht('Tracked'), 'align' => 'right'))
 
46
      ->addColumn('name', array('title' => pht('Name')))
48
47
      ->setBorders(false);
49
48
 
50
49
    $i = 0;
51
50
    foreach ($results as $result) {
52
51
      if ($i === 0) {
53
 
        $column_type = 'In Progress';
 
52
        $column_type = pht('In Progress');
54
53
      } else {
55
 
        $column_type = 'Suspended';
 
54
        $column_type = pht('Suspended');
56
55
      }
57
56
 
58
57
      $table->addRow(array(
65
64
    }
66
65
 
67
66
    $table->draw();
68
 
 
69
67
    return 0;
70
68
  }
71
69