Пример #1
0
</label>
                    <div class="col-sm-9">
                        <?php 
echo CHtml::activeCheckboxList($user, 'store', Authitem::model()->getAuthItemStore(), array('separator' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 'checkAll' => Yii::t('app', 'Select All')));
?>
                    </div>
                </div>
                
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="RbacUser_reports"><?php 
echo Yii::t('app', 'Report');
?>
</label>
                    <div class="col-sm-9">
                        <?php 
echo CHtml::activeCheckboxList($user, 'reports', Authitem::model()->getAuthItemReport(), array('separator' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 'checkAll' => Yii::t('app', 'Select All')));
?>
                    </div>
                </div>
                
                <?php 
//echo $form->inlineCheckBoxListControlGroup($user, 'items',Authitem::model()->getAuthItemItem(),array('class'=>'ace-checkbox-2'));
?>

                <?php 
//echo $form->inlineCheckBoxListControlGroup($user, 'sales', Authitem::model()->getAuthItemSale(),array('class'=>'ace-checkbox-2'));
?>

                <?php 
//echo $form->inlineCheckBoxListControlGroup($user, 'receivings', Authitem::model()->getAuthItemReceiving());
?>
Пример #2
0
/**
 * ROLES
 */
$aChecked = Authassignment::model()->getUserRoles($model->id);
$admin_role = Yii::app()->getModule('rights')->superuserName;
if (in_array($admin_role, $aChecked)) {
    $info_allert = array(UserModule::t('For administrator can not save changes of roles'));
    $body = '';
} else {
    $info_allert = array();
    $aChecked = Authassignment::model()->getUserRoles($model->id);
    if (count($aChecked) == 1) {
        //kaut kads gljuks, nedrikst padot masivu ar vienu elementu
        $aChecked = $aChecked[0];
    }
    $all_roles = Authitem::model()->findAllByAttributes(['type' => Authitem::TYPE_ROLE]);
    $all_roles_dict = [];
    foreach ($all_roles as $role_record) {
        $all_roles_dict[$role_record['name']] = $role_record['description'];
    }
    $UserAdminRoles = Yii::app()->getModule('user')->UserAdminRoles;
    $list = [];
    foreach ($UserAdminRoles as $role_name) {
        //add only defined roles
        if (isset($all_roles_dict[$role_name])) {
            $list[$role_name] = $all_roles_dict[$role_name];
        }
    }
    $body = CHtml::checkBoxList('user_role_name', $aChecked, $list, array('labelOptions' => array('style' => 'display: inline'), 'template' => '{input}<span class="lbl"></span> {label}', 'class' => 'ace'));
}
$this->widget('AceBox', array('header_text' => UserModule::t('Roles'), 'info_allert' => $info_allert, 'body' => $body));
Пример #3
0
                    <div class="row">
            <?php 
echo $form->label($model, 'stfa_stsf_id');
?>
                            <?php 
echo $form->dropDownList($model, 'stfa_stsf_id', CHtml::listData(StsfStatesFlow::model()->findAll(), 'stsf_id', 'stsf_stfl_id'), array('prompt' => 'all'));
?>
                    </div>

                    <div class="row">
            <?php 
echo $form->label($model, 'stfa_authitem');
?>
                            <?php 
echo $form->dropDownList($model, 'stfa_authitem', CHtml::listData(Authitem::model()->findAll(), 'name', 'type'), array('prompt' => 'all'));
?>
                    </div>

                    <div class="row">
            <?php 
echo $form->label($model, 'stfa_notes');
?>
                            <?php 
echo $form->textArea($model, 'stfa_notes', array('rows' => 6, 'cols' => 50));
?>
                    </div>

        <div class="row buttons">
        <?php 
echo CHtml::submitButton(Yii::t('D1StatusModule.crud', 'Search'));
Пример #4
0
 public function getAuthItemInvoice($match = 'invoice')
 {
     $match = addcslashes($match, '%_');
     // escape LIKE's special characters
     $q = new CDbCriteria(array('condition' => "name LIKE :match and type=0", 'params' => array(':match' => "{$match}%"), 'order' => "sort_order"));
     $model = Authitem::model()->findAll($q);
     $list = CHtml::listData($model, 'name', 'AuthItemName');
     return $list;
 }
Пример #5
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Authitem the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Authitem::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
echo $form->inlineCheckBoxListControlGroup($user, 'sales', Authitem::model()->getAuthItemSale(), array('class' => 'ace-checkbox-2'));
?>

<?php 
echo $form->inlineCheckBoxListControlGroup($user, 'receivings', Authitem::model()->getAuthItemReceiving());
?>

<?php 
echo $form->inlineCheckBoxListControlGroup($user, 'reports', Authitem::model()->getAuthItemReport());
?>

<?php 
echo $form->inlineCheckBoxListControlGroup($user, 'employees', Authitem::model()->getAuthItemEmployee());
?>

<?php 
echo $form->inlineCheckBoxListControlGroup($user, 'customers', Authitem::model()->getAuthItemClient());
?>

<?php 
echo $form->inlineCheckBoxListControlGroup($user, 'suppliers', Authitem::model()->getAuthItemSupplier());
?>

<?php 
echo $form->inlineCheckBoxListControlGroup($user, 'store', Authitem::model()->getAuthItemStore(), array('class' => 'ace-checkbox-2'));
?>

 <?php 
//$this->endWidget();
?>
 
Пример #7
0
<?php

$this->breadcrumbs[] = Yii::t('D1StatusModule.crud', 'Stfa Flow Accesses');
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\$('.search-form').toggle();\nreturn false;\n});\n\$('.search-form form').submit(function(){\n\$.fn.yiiGridView.update('stfa-flow-access-grid', {\ndata: \$(this).serialize()\n});\nreturn false;\n});\n");
?>

<?php 
$this->widget("TbBreadcrumbs", array("links" => $this->breadcrumbs));
?>
<h1>
    <?php 
echo Yii::t('D1StatusModule.crud', 'Stfa Flow Accesses');
?>
 <small><?php 
echo Yii::t('D1StatusModule.crud', 'Manage');
?>
</small>
</h1>

<?php 
$this->renderPartial("_toolbar", array("model" => $model));
$this->widget('TbGridView', array('id' => 'stfa-flow-access-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'pager' => array('class' => 'TbPager', 'displayFirstAndLast' => true), 'columns' => array(array('name' => 'stfa_stsf_id', 'value' => 'CHtml::value($data,\'stfaStsf.stsf_stfl_id\')', 'filter' => CHtml::listData(StsfStatesFlow::model()->findAll(), 'stsf_id', 'stsf_stfl_id')), array('name' => 'stfa_authitem', 'value' => 'CHtml::value($data,\'stfaAuthitem.type\')', 'filter' => CHtml::listData(Authitem::model()->findAll(), 'name', 'type')), array('class' => 'TbButtonColumn', 'viewButtonUrl' => "Yii::app()->controller->createUrl('view', array('stfa_id' => \$data->stfa_id))", 'updateButtonUrl' => "Yii::app()->controller->createUrl('update', array('stfa_id' => \$data->stfa_id))", 'deleteButtonUrl' => "Yii::app()->controller->createUrl('delete', array('stfa_id' => \$data->stfa_id))"))));