Example #1
0
            <?php 
$actives = array(false, false, false);
if (preg_match('#^\\S*\\@task\\%20created\\_by\\_username\\:\\(\\=\\=\\%7B' . Yii::app()->user->username . '\\%7D\\)$#', Yii::app()->request->requestUri)) {
    $actives[1] = true;
} else {
    if (preg_match('#^\\S*\\@task\\%20responsible_username\\:\\(\\=\\=\\%7B' . Yii::app()->user->username . '\\%7D\\)$#', Yii::app()->request->requestUri)) {
        $actives[2] = true;
    } else {
        $actives[0] = true;
    }
}
$this->widget('zii.widgets.CMenu', array('id' => 'sub-menu', 'items' => array(array('label' => Yii::t('TOAST', 'All Task'), 'url' => array('/task'), 'active' => $actives[0]), array('label' => Yii::t('TOAST', 'Created By Me'), 'url' => array('/task/index/q/@task created_by_username:(=={' . Yii::app()->user->username . '})'), 'active' => $actives[1]), array('label' => Yii::t('TOAST', 'Responsible By Me'), 'url' => array('/task/index/q/@task responsible_username:(=={' . Yii::app()->user->username . '})'), 'active' => $actives[2]), array('label' => Yii::t('TOAST', 'Recent Run'), 'url' => array('/run'), 'active' => false))));
?>
            <div class="search">
            <?php 
$this->Widget('application.extensions.querybuilder.QueryBuilderWidget', array('name' => 'search', 'options' => array('action' => Yii::app()->getBaseUrl(true) . '/#table#/index', 'cTable' => 'task', '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('task' => array('label' => '任务', 'items' => array('id' => array('label' => 'ID', 'type' => 'text', 'operators' => array('==' => '等于', '-=' => '不等于', '>=' => '大于等于', '>' => '大于', '<' => '小于', '<=' => '小于等于', '=' => '包含', '!=' => '不包含')), 'name' => array('label' => '任务名称', 'type' => 'text', 'operators' => array('' => '含有', '-' => '不含有')), 'type' => array('label' => '任务类型', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Task::model()->getTypeOptions()), 'product_id' => array('label' => '所属产品', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Product::getAllProductsList()), 'project_path' => array('label' => '模块路径', 'type' => 'text', 'operators' => array('in' => '在某路径下', '==' => '等于', '-=' => '不等于')), 'responsible_username' => array('label' => '负责人', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Yii::app()->user->getUsernameOpts()), 'svn_url' => array('label' => 'SVN监控', 'type' => 'text', 'operators' => array('' => '含有', '-' => '不含有')), 'created_by_username' => array('label' => '创建者', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Yii::app()->user->getUsernameOpts()), 'create_time' => array('label' => '创建时间', 'type' => 'text', 'operators' => array('' => '等于', '-' => '不等于', '>=' => '大于等于', '>' => '大于', '<' => '小于', '<=' => '小于等于')), 'updated_by_username' => array('label' => '修改者', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Yii::app()->user->getUsernameOpts()), 'update_time' => array('label' => '修改时间', 'type' => 'text', 'operators' => array('' => '等于', '-' => '不等于', '>=' => '大于等于', '>' => '大于', '<' => '小于', '<=' => '小于等于'))))))));
?>
            </div>
        </div>
        <div class="main-list">
            <div class="link-bar">
                <span class="task-new icon-link"><?php 
echo CHtml::link(Yii::t("TOAST", "Create"), array('/task/create'));
?>
</span>
            </div>
            <?php 
$this->widget('GridView', array('id' => 'vtasks', 'dataProvider' => $vTaskProvider, 'htmlOptions' => array('class' => 'widget-view'), 'enablePageSize' => true, 'selectionChanged' => 'js:function(id){
                                    var selectedID = $.fn.yiiGridView.getSelection(id);
                                    if(selectedID.toString().match(/\\d+/))
                                        location.href = getRootPath() + "/task/view/id/" + selectedID;
Example #2
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">
Example #3
0
        <?php 
$actives = array(false, false, false);
if (preg_match('#^\\S*\\@machine\\%20product\\_id\\:\\(\\)$#', Yii::app()->request->requestUri)) {
    $actives[1] = true;
} else {
    if (preg_match('#^\\S*\\@machine\\%20responsible_username\\:\\(\\=\\=\\%7B' . Yii::app()->user->username . '\\%7D\\)$#', Yii::app()->request->requestUri)) {
        $actives[2] = true;
    } else {
        $actives[0] = true;
    }
}
$this->widget('zii.widgets.CMenu', array('id' => 'sub-menu', 'items' => array(array('label' => Yii::t('Machine', 'Assigned'), 'url' => array('/machine'), 'active' => $actives[0]), array('label' => Yii::t('Machine', 'Unassigned'), 'url' => array('/machine/index/q/@machine product_id:()'), 'active' => $actives[1]), array('label' => Yii::t('TOAST', 'Responsible By Me'), 'url' => array('/machine/index/q/@machine responsible_username:(=={' . Yii::app()->user->username . '})'), 'active' => $actives[2]))));
?>
        <div class="search">
            <?php 
$this->Widget('application.extensions.querybuilder.QueryBuilderWidget', array('name' => 'search', 'options' => array('action' => Yii::app()->getBaseUrl(true) . '/#table#/index', 'cTable' => 'machine', '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('machine' => array('label' => '测试机', 'items' => array('id' => array('label' => 'ID', 'type' => 'text', 'operators' => array('==' => '等于', '-=' => '不等于', '>=' => '大于等于', '>' => '大于', '<' => '小于', '<=' => '小于等于', '=' => '包含', '!=' => '不包含')), 'name' => array('label' => '主机域名', 'type' => 'text', 'operators' => array('' => '含有', '-' => '不含有')), 'type' => array('label' => '类型', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Machine::model()->getTypeOptions()), 'product_id' => array('label' => '所属产品', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Product::getAllProductsList()), 'project_name' => array('label' => '所属项目', 'type' => 'text', 'operators' => array('' => '含有', '-' => '不含有')), 'agent_version' => array('label' => 'Agent版本', 'type' => 'text', 'operators' => array('' => '含有', '-' => '不含有')), 'responsible_username' => array('label' => '负责人', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Yii::app()->user->getUsernameOpts()), 'status' => array('label' => '状态', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Machine::model()->getStatusOptions()), 'update_time' => array('label' => '最后更新时间', 'type' => 'text', 'operators' => array('' => '等于', '-' => '不等于', '>=' => '大于等于', '>' => '大于', '<' => '小于', '<=' => '小于等于'))))))));
?>
        </div>
    </div>    
    <div class="main-list">
        <div class="link-bar">
            <span class="machine-new icon-link"><?php 
echo CHtml::link(Yii::t("TOAST", "Add"), 'javascript:void(0);', array('id' => 'add-machine'));
?>
</span>
        </div>
        <?php 
$this->widget('GridView', array('id' => 'vMachines', 'dataProvider' => $vMachineProvider, 'htmlOptions' => array('class' => 'widget-view'), 'enablePageSize' => true, 'selectionChanged' => 'js:function(id){
                        var selectedID = $.fn.yiiGridView.getSelection(id);
                        if(selectedID.toString().match(/\\d+/))
                            location.href = getRootPath() + "/machine/view/id/" + selectedID;