Example #1
0
         if ($table) {
             $report_objects[] = $table;
             $report_types[] = 'table';
         }
         if ($svg) {
             $report_objects[] = $svg;
             $report_types[] = 'svg';
         }
     }
     // report_objects and report_types are collected
     // Now if there is any chart, put it right of table
     for ($i = 0; $i < count($report_types); $i++) {
         if (count($report_objects[$i]->arrInfo) > 0) {
             $f->push(new Div());
             if ($report_types[$i] == 'table' && $report_types[$i + 1] == 'svg') {
                 $multicol = new multicol();
                 $f->add($multicol->add($report_objects[$i], '60%', '0 2% 0 0')->add($report_objects[$i + 1], '40%'));
                 $i++;
             } else {
                 $f->add($report_objects[$i]);
             }
             if ($report_types[$i] != 'title') {
                 $f->add(new SpanElement('<br /><hr style="border-top: 1px solid #DDDDDD"/><br />'));
             }
             $f->pop();
         } else {
             $f->add($report_objects[$i]);
         }
     }
 }
 $f->push(new Div());
Example #2
0
    $n->setItemCount($count);
    $n->setNavBar(new AjaxNavBar($count, $filter));
    $n->start = 0;
    $n->end = $maxperpage;
    $n->disableFirstColumnActionLink();
    if (isset($sum_running)) {
        $pieChart = new raphaelPie('deploy-pie');
        $total = $sum_running + $sum_done + $sum_failed + $sum_stopped + $sum_overtimed;
        $labels = array(_T('Running', 'msc') . sprintf(' %d%%  (%d)', 100 * $sum_running / $total, $sum_running), _T('Done', 'msc') . sprintf(' %d%% (%d)', 100 * $sum_done / $total, $sum_done), _T('Failed', 'msc') . sprintf(' %d%%  (%d)', 100 * $sum_failed / $total, $sum_failed), _T('Stopped', 'msc') . sprintf(' %d%%  (%d)', 100 * $sum_stopped / $total, $sum_stopped), _T('Overtime', 'msc') . sprintf(' %d%%  (%d)', 100 * $sum_overtimed / $total, $sum_overtimed));
        $pieChart->addData($sum_running, $labels[0], '000-#7991F2-#3D61F2');
        $pieChart->addData($sum_done, $labels[1], '000-#1C9139-#105722');
        $pieChart->addData($sum_failed, $labels[2], '000-#D93D11-#752008');
        $pieChart->addData($sum_stopped, $labels[3], '000-#F2B87E-#ED7D0C');
        $pieChart->addData($sum_overtimed, $labels[4], '000-#919191-#292829');
        $pieChart->legendpos = 'south';
        $pieChart->title = _T('Deploy status', 'msc');
        $mc = new multicol();
        $mc->add($n)->add($pieChart, array('width' => '200px', 'padding' => '30px 0 0 0', 'valign' => 'top'))->display();
        $DISPLAY_TABLE = FALSE;
    }
}
if ($n != null && $DISPLAY_TABLE) {
    $n->setParamInfo($params);
    $n->setTableHeaderPadding(1);
    $n->setItemCount($count);
    $n->setNavBar(new AjaxNavBar($count, $filter));
    $n->start = 0;
    $n->end = $maxperpage;
    $n->disableFirstColumnActionLink();
    $n->display();
}