コード例 #1
0
ファイル: index.php プロジェクト: xuzhitong89/web1.0
                <?php 
echo CHtml::dropDownList('products', Yii::app()->user->currentProduct, Yii::app()->user->getProductOpts(), array('id' => 'products', 'options' => Yii::app()->user->getProductionOptsClass()));
?>
            </div>
        </div>
        <div id="project-tree">
        </div>
        </div>
    <div class="layout-right">
        <div class="sub-nav sub-nav-right">
            <?php 
$this->widget('zii.widgets.CMenu', array('id' => 'sub-menu', 'items' => array(array('label' => Yii::t('TOAST', 'All Task'), 'url' => array('/task'), 'active' => false), array('label' => Yii::t('TOAST', 'Created By Me'), 'url' => array('/task/index/q/@task created_by_username:(=={' . Yii::app()->user->username . '})'), 'active' => false), array('label' => Yii::t('TOAST', 'Responsible By Me'), 'url' => array('/task/index/q/@task responsible_username:(=={' . Yii::app()->user->username . '})'), 'active' => false), array('label' => Yii::t('TOAST', 'Recent Run'), 'url' => array('/run'), 'active' => true))));
?>
            <div class="search">
            <?php 
$this->Widget('application.extensions.querybuilder.QueryBuilderWidget', array('name' => 'search', 'options' => array('action' => Yii::app()->getBaseUrl(true) . '/#table#/index', 'cTable' => 'run', 'queryListUrl' => Yii::app()->getBaseUrl(true) . '/query/getlist', 'createQueryUrl' => Yii::app()->getBaseUrl(true) . '/query/create', 'updateQueryUrl' => Yii::app()->getBaseUrl(true) . '/query/update', 'deleteQueryUrl' => Yii::app()->getBaseUrl(true) . '/query/delete', 'tables' => array('run' => array('label' => '运行结果', 'items' => array('id' => array('label' => 'ID', 'type' => 'text', 'operators' => array('==' => '等于', '-=' => '不等于', '>=' => '大于等于', '>' => '大于', '<' => '小于', '<=' => '小于等于', '=' => '包含', '!=' => '不包含')), 'name' => array('label' => '运行名称', 'type' => 'text', 'operators' => array('' => '含有', '-' => '不含有')), 'product_id' => array('label' => '所属产品', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Product::getAllProductsList()), 'project_path' => array('label' => '所属项目', 'type' => 'text', 'operators' => array('in' => '在某路径下', '==' => '等于', '-=' => '不等于')), 'created_by_username' => array('label' => '运行者', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Yii::app()->user->getUsernameOpts()), 'created_by_username' => array('label' => '触发原因', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => array('ABS' => 'ABS触发', 'TOAST' => '定时运行触发')), 'create_time' => array('label' => '创建时间', 'type' => 'text', 'operators' => array('' => '等于', '-' => '不等于', '>=' => '大于等于', '>' => '大于', '<' => '小于', '<=' => '小于等于')), 'result' => array('label' => Yii::t('Run', 'Result'), 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => CommandRun::model()->getResultOptions()), 'status' => array('label' => Yii::t('Run', 'Status'), 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => CommandRun::model()->getStatusOptions())))))));
?>
            </div>
        </div>
        <div class="main-list">
            <?php 
$this->widget('GridView', array('id' => 'vtaskruns', 'dataProvider' => $vTaskRunProvider, 'htmlOptions' => array('class' => 'widget-view'), 'rowCssClassExpression' => '$data->getStatusStyle()', 'enablePageSize' => true, 'selectionChanged' => 'js:function(id){
                        var selectedID = $.fn.yiiGridView.getSelection(id);
                        if(selectedID.toString().match(/\\d+/))
                            location.href = getRootPath() + "/run/view/id/" + selectedID;
                    }', 'afterAjaxUpdate' => 'js:function(){setListHeight();triggerPageSizeChange()}', 'columns' => array(array('name' => 'id', 'headerHtmlOptions' => array('class' => 'id'), 'htmlOptions' => array('class' => 'id')), array('name' => 'name', 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode(Yii::t("Run", "Run Result") . " " . $data->task_name), array("view", "id" => $data->id))', 'headerHtmlOptions' => array('class' => 'name'), 'htmlOptions' => array('class' => 'name')), array('header' => Yii::t('Run', 'Run By'), 'name' => 'created_by_realname'), array('name' => 'create_time'), array('name' => 'project_name'), array('name' => 'result', 'value' => '$data->getResultText()', 'cssClassExpression' => '$data->getResultStyle()'), array('name' => 'status', 'value' => '$data->getStatusText()'))));
?>
        </div>
    </div>
</div>
<script type="text/javascript">
コード例 #2
0
ファイル: _index.php プロジェクト: xuzhitong89/web1.0
?>
    </div>
    <div class="main-detail" style="padding-right: 1px">
        <div class="report-control">
            <?php 
echo '<div class="action-group">';
echo CHtml::button(Yii::t('Report', 'Send Report'), array('class' => 'btn send-current-report'));
echo '</div>';
echo CHtml::dropDownList('products', Yii::app()->user->currentProduct, Yii::app()->user->getProductOpts(), array('id' => 'products', 'options' => Yii::app()->user->getProductionOptsClass()));
echo CHtml::dropDownList('task_type', $report->task_type, $report->getTypeOptions());
$this->widget('zii.widgets.jui.CJuiDatePicker', array('id' => 'report-date-picker', 'model' => $report, 'attribute' => 'date', 'options' => array('showAnim' => 'fold', 'dateFormat' => 'yy-mm-dd'), 'language' => Yii::app()->language, 'htmlOptions' => array('class' => 'focus')));
?>
        </div>
        <div class="report-search">
            <?php 
$this->Widget('application.extensions.querybuilder.QueryBuilderWidget', array('name' => 'search', 'options' => array('action' => Yii::app()->getBaseUrl(true) . '/#table#/index/task_type/' . $report->task_type . '/date/' . $report->date . '/product_id/' . $report->product_id . '/r/1', 'cTable' => 'report', 'queryListUrl' => Yii::app()->getBaseUrl(true) . '/query/getlist', 'createQueryUrl' => Yii::app()->getBaseUrl(true) . '/query/create', 'updateQueryUrl' => Yii::app()->getBaseUrl(true) . '/query/update', 'deleteQueryUrl' => Yii::app()->getBaseUrl(true) . '/query/delete', 'tables' => array('report' => array('label' => '报表', 'items' => array('task_name' => array('label' => '任务名称', 'type' => 'text', 'operators' => array('' => '包含', '-' => '不包含', '==' => '等于', '-=' => '不等于')), 'project_path' => array('label' => '所属项目', 'type' => 'text', 'operators' => array('in' => '在某路径下', '==' => '等于', '-=' => '不等于')), 'status' => array('label' => '运行状态', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => CommandRun::model()->getStatusOptions()), 'responsible_username' => array('label' => '负责人', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Yii::app()->user->getUsernameOpts())))))));
?>
        </div>
        <div style="clear:both"></div>
        <?php 
$data = $report->getDetailObj()->getCount($condition);
$case_passed = $data['case']['case_passed'][count($data['case']['case_passed']) - 1];
$case_failed = $data['case']['case_failed'][count($data['case']['case_failed']) - 1];
$task_success = $data['task']['success'];
$task_failure = $data['task']['failure'];
$task_other = $data['task']['other'];
$pieData = array(array('type' => 'pie', 'name' => Yii::t('VReport', 'Line Coverage Rate'), 'data' => array(array('name' => Yii::t('Report', 'Case Passed'), 'y' => $case_passed, 'color' => '#89A54E'), array('name' => Yii::t('Report', 'Case Failed'), 'y' => $case_failed, 'color' => '#AA4643'), array('name' => 'fill', 'visible' => false, 'y' => $case_passed + $case_failed == 0 ? 1 : 0)), 'center' => array('30%', '50%')), array('type' => 'pie', 'name' => Yii::t('VReport', 'Task Name'), 'data' => array(array('name' => Yii::t('Task', 'Success Task'), 'y' => $task_success, 'color' => '#89A54E'), array('name' => Yii::t('Task', 'Failed Task'), 'y' => $task_failure, 'color' => '#AA4643'), array('name' => Yii::t('Task', 'Other Task'), 'y' => $task_other, 'color' => '#E99D12'), array('name' => 'fill', 'y' => $task_success + $task_failure + $task_other == 0 ? 1 : 0, 'visible' => false)), 'center' => array('70%', '50%')));
$lineData = array(array('name' => Yii::t('Report', 'Case Passed'), 'pointStart' => (strtotime($report->date . ' UTC') - 86400 * 364) * 1000, 'pointInterval' => 86400 * 1000, 'data' => $data['case']['case_passed']), array('name' => Yii::t('Report', 'Case Failed'), 'pointStart' => (strtotime($report->date . ' UTC') - 86400 * 364) * 1000, 'pointInterval' => 86400 * 1000, 'data' => $data['case']['case_failed']), array('name' => Yii::t('Report', 'Case Total'), 'pointStart' => (strtotime($report->date . ' UTC') - 86400 * 364) * 1000, 'pointInterval' => 86400 * 1000, 'data' => $data['case']['case_total']));
?>
        <div>
            <?php