예제 #1
0
 /**
  * Get summations
  *
  * @return  string
  */
 public function getReport()
 {
     if (!isset($this->report)) {
         $tests = array();
         foreach ($this->getTests() as $key => $audit) {
             if (!isset($tests[$key])) {
                 $tests[$key] = array('name' => $audit->name(), 'total' => 0, 'totals' => array('skipped' => 0, 'passed' => 0, 'failed' => 0));
             }
             $tests[$key]['totals']['skipped'] = Result::all()->whereEquals('scope', $this->scope)->whereEquals('test_id', $key)->whereEquals('status', 0)->total();
             $tests[$key]['totals']['passed'] = Result::all()->whereEquals('scope', $this->scope)->whereEquals('test_id', $key)->whereEquals('status', 1)->total();
             $tests[$key]['totals']['failed'] = Result::all()->whereEquals('scope', $this->scope)->whereEquals('test_id', $key)->whereEquals('status', -1)->total();
             $tests[$key]['total'] += $tests[$key]['totals']['skipped'];
             $tests[$key]['total'] += $tests[$key]['totals']['passed'];
             $tests[$key]['total'] += $tests[$key]['totals']['failed'];
         }
         $this->report = $tests;
     }
     return $this->report;
 }
예제 #2
0
							</tr>
						</thead>
						<tbody>
							<?php 
        switch ($this->status) {
            case 'failed':
                $status = -1;
                break;
            case 'skipped':
                $status = 0;
                break;
            case 'passed':
                $status = 1;
                break;
        }
        $results = \Hubzero\Content\Auditor\Result::all()->whereEquals('scope', 'resource')->whereEquals('test_id', $this->test)->whereEquals('status', $status)->ordered()->rows();
        foreach ($results as $result) {
            ?>
								<tr>
									<th><?php 
            echo $result->get('scope_id');
            ?>
</th>
									<td><a href="<?php 
            echo Route::url('index.php?option=com_resources&task=edit&id=' . $result->get('scope_id'));
            ?>
">
										<?php 
            if ($notes = $result->get('notes')) {
                $notes = json_decode($notes);
                if (isset($notes->field)) {