Ejemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     Yii::configure($this, ['dataProvider' => $this->getDataProvider(), 'layout' => "{items}\n{pager}", 'columns' => ['title', 'description', 'moduleId', ['label' => '', 'class' => 'humhub\\libs\\DropDownGridColumn', 'attribute' => 'state', 'readonly' => function ($data) {
         return $data['changeable'];
     }, 'submitAttributes' => ['permissionId', 'moduleId'], 'dropDownOptions' => 'states']]]);
     parent::init();
 }
use humhub\widgets\GridView;
?>
<div class="panel panel-default">
    <div class="panel-heading"><?php 
echo Yii::t('AdminModule.views_group_index', '<strong>Manage</strong> groups');
?>
</div>
    <div class="panel-body">
        <?php 
echo \humhub\modules\admin\widgets\GroupMenu::widget();
?>
        <p />
        <p>
            <?php 
echo Yii::t('AdminModule.views_groups_index', 'You can split users into different groups (for teams, departments etc.) and define standard spaces and admins for them.');
?>
        </p>

        <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'tableOptions' => ['class' => 'table table-hover'], 'columns' => ['name', 'description', ['header' => Yii::t('AdminModule.views_group_index', 'Actions'), 'class' => 'yii\\grid\\ActionColumn', 'options' => ['width' => '80px'], 'buttons' => ['view' => function () {
    return;
}, 'delete' => function () {
    return;
}, 'update' => function ($url, $model) {
    return Html::a('<i class="fa fa-pencil"></i>', Url::toRoute(['edit', 'id' => $model->id]), ['class' => 'btn btn-primary btn-xs tt']);
}]]]]);
?>
           
    </div>
</div>
Ejemplo n.º 3
0
</div>
<?php 
ActiveForm::end();
?>

<div class="table-responsive">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'options' => ['style' => 'width:40px;'], 'format' => 'raw', 'value' => function ($data) {
    return $data->id;
}], 'username', 'email', 'profile.firstname', 'profile.lastname', ['attribute' => 'is_manager', 'visible' => $isManagerApprovalSetting, 'label' => Yii::t('AdminModule.views_user_index', 'Group Manager'), 'format' => 'raw', 'value' => function ($data) use($group) {
    $isManager = $group->isManager($data);
    $yesSelected = $isManager ? 'selected' : '';
    $noSelected = $isManager ? '' : 'selected';
    $result = '<select class="managerDropDown editableCell form-control" data-userid="' . $data->id . '"  data-groupid="' . $group->id . '">';
    $result .= '<option value="0" ' . $noSelected . '>' . Yii::t('AdminModule.views_group_manageGroupUser', 'No') . '</option>';
    $result .= '<option value="1" ' . $yesSelected . '>' . Yii::t('AdminModule.views_group_manageGroupUser', 'Yes') . '</option>';
    return $result;
}], ['header' => Yii::t('AdminModule.views_user_index', 'Actions'), 'class' => 'yii\\grid\\ActionColumn', 'options' => ['style' => 'width:80px; min-width:80px;'], 'buttons' => ['view' => function ($url, $model) {
    return false;
}, 'update' => function ($url, $model) use($group) {
    return false;
}, 'delete' => function ($url, $model) use($group) {
    return Html::a('<i class="fa fa-times"></i>', Url::toRoute(['remove-group-user', 'id' => $group->id, 'userId' => $model->id]), ['data-method' => 'POST', 'title' => Yii::t('AdminModule.views_group_manageGroupUser', 'Remove from group'), 'class' => 'btn btn-danger btn-xs tt']);
}]]]]);
?>
        </div>
        <script type="text/javascript">
            $('.managerDropDown').on('change', function () {
                var $this = $(this);
                var userId = $this.data('userid');
                var groupId = $this.data('groupid');
<?php

use yii\helpers\Url;
use yii\helpers\Html;
use humhub\widgets\GridView;
use humhub\modules\space\modules\manage\widgets\MemberMenu;
echo MemberMenu::widget(['space' => $space]);
?>
<br />
<div class="panel panel-default">
    <div class="panel-heading">
        <?php 
echo Yii::t('SpaceModule.views_admin_members', '<strong>Pending</strong> approvals');
?>
    </div>
    <div class="panel-body">
        <div class="table-responsive">
        <?php 
$groups = $space->getUserGroups();
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['user.username', 'user.profile.firstname', 'user.profile.lastname', 'request_message', ['header' => Yii::t('SpaceModule.views_admin_members', 'Actions'), 'class' => 'yii\\grid\\ActionColumn', 'buttons' => ['view' => function () {
    return;
}, 'delete' => function ($url, $model) use($space) {
    return Html::a('Reject', $space->createUrl('reject-applicant', ['userGuid' => $model->user->guid]), ['class' => 'btn btn-danger btn-sm', 'data-method' => 'POST']);
}, 'update' => function ($url, $model) use($space) {
    return Html::a('Approve', $space->createUrl('approve-applicant', ['userGuid' => $model->user->guid]), ['class' => 'btn btn-primary btn-sm', 'data-method' => 'POST']);
}]]]]);
?>
        </div>
    </div>
</div>
use yii\helpers\Url;
use yii\helpers\Html;
use humhub\widgets\GridView;
use humhub\modules\space\modules\manage\widgets\MemberMenu;
echo MemberMenu::widget(['space' => $space]);
?>
<br />
<div class="panel panel-default">
    <div class="panel-heading">
        <?php 
echo Yii::t('SpaceModule.views_admin_members', '<strong>Pending</strong> invitations');
?>
    </div>
    <div class="panel-body">
        <div class="table-responsive">
            <?php 
$groups = $space->getUserGroups();
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['user.username', 'user.profile.firstname', 'user.profile.lastname', ['attribute' => 'last_visit', 'format' => 'raw', 'value' => function ($data) use(&$groups) {
    return humhub\widgets\TimeAgo::widget(['timestamp' => $data->last_visit]);
}], ['header' => Yii::t('SpaceModule.views_admin_members', 'Actions'), 'class' => 'yii\\grid\\ActionColumn', 'buttons' => ['view' => function () {
    return;
}, 'delete' => function ($url, $model) use($space) {
    return Html::a('Cancel', $space->createUrl('remove', ['userGuid' => $model->user->guid]), ['class' => 'btn btn-danger btn-sm', 'data-confirm' => 'Are you sure?', 'data-method' => 'POST']);
}, 'update' => function () {
    return;
}]]]]);
?>
        </div>
    </div>
</div>
Ejemplo n.º 6
0
        <?php 
$groups = $space->getUserGroups();
unset($groups[Space::USERGROUP_OWNER]);
unset($groups[Space::USERGROUP_GUEST]);
unset($groups[Space::USERGROUP_USER]);
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['user.username', 'user.profile.firstname', 'user.profile.lastname', ['label' => 'Group', 'class' => 'humhub\\libs\\DropDownGridColumn', 'attribute' => 'group_id', 'submitAttributes' => ['user_id'], 'readonly' => function ($data) use($space) {
    if ($space->isSpaceOwner($data->user->id)) {
        return true;
    }
    return false;
}, 'filter' => $groups, 'dropDownOptions' => $groups, 'value' => function ($data) use(&$groups, $space) {
    return $groups[$data->group_id];
}], ['attribute' => 'last_visit', 'format' => 'raw', 'value' => function ($data) use(&$groups) {
    if ($data->last_visit == '') {
        return Yii::t('SpaceModule.views_admin_members', 'never');
    }
    return humhub\widgets\TimeAgo::widget(['timestamp' => $data->last_visit]);
}], ['header' => 'Actions', 'class' => 'yii\\grid\\ActionColumn', 'buttons' => ['view' => function () {
    return;
}, 'delete' => function ($url, $model) use($space) {
    if ($space->isSpaceOwner($model->user->id) || Yii::$app->user->id == $model->user->id) {
        return;
    }
    return Html::a('Remove', $space->createUrl('reject-applicant', ['userGuid' => $model->user->guid]), ['class' => 'btn btn-danger btn-sm', 'data-method' => 'POST', 'data-confirm' => 'Are you sure?']);
}, 'update' => function () {
    return;
}]]]]);
?>
    </div>
</div>
Ejemplo n.º 7
0
<?php

use yii\helpers\Url;
use yii\helpers\Html;
use humhub\widgets\GridView;
?>

<div class="panel-body">
    <h4><?php 
echo Yii::t('AdminModule.views_approval_index', 'Pending user approvals');
?>
</h4>

    <div class="help-block">
        <?php 
echo Yii::t('AdminModule.views_approval_index', 'The following list contains all registered users awaiting an approval.');
?>
    </div>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['username', 'email', 'profile.firstname', 'profile.lastname', 'profile.lastname', ['header' => Yii::t('AdminModule.views_approval_index', 'Actions'), 'class' => 'yii\\grid\\ActionColumn', 'options' => ['width' => '150px'], 'buttons' => ['view' => function () {
    return;
}, 'delete' => function ($url, $model) {
    return Html::a('Decline', Url::toRoute(['decline', 'id' => $model->id]), ['class' => 'btn btn-danger btn-sm']);
}, 'update' => function ($url, $model) {
    return Html::a('Approve', Url::toRoute(['approve', 'id' => $model->id]), ['class' => 'btn btn-primary btn-sm']);
}]]]]);
?>
</div>
Ejemplo n.º 8
0
</h4>
    <div class="help-block">
        <?php 
echo Yii::t('AdminModule.views_user_index', 'This overview contains a list of each registered user with actions to view, edit and delete users.');
?>
    </div>
    <div class="table-responsive">
        <div class="pull-right">
            <?php 
echo Html::a('<i class="fa fa-plus" aria-hidden="true"></i>&nbsp;&nbsp;' . Yii::t('AdminModule.views_user_index', 'Add new user'), ['/admin/user/add'], ['class' => 'btn btn-success', 'data-ui-loader' => '']);
?>
            <?php 
echo Html::a('<i class="fa fa-paper-plane" aria-hidden="true"></i>&nbsp;&nbsp;' . Yii::t('AdminModule.views_user_index', 'Send invite'), ['/user/invite'], ['class' => 'btn btn-success', 'data-target' => '#globalModal']);
?>
        </div>

        <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'options' => ['style' => 'width:40px;'], 'format' => 'raw', 'value' => function ($data) {
    return $data->id;
}], 'username', 'email', 'profile.firstname', 'profile.lastname', ['attribute' => 'last_login', 'label' => Yii::t('AdminModule.views_user_index', 'Last login'), 'filter' => \yii\jui\DatePicker::widget(['model' => $searchModel, 'attribute' => 'last_login', 'options' => ['style' => 'width:86px;', 'class' => 'form-control']]), 'value' => function ($data) {
    return $data->last_login == NULL ? Yii::t('AdminModule.views_user_index', 'never') : Yii::$app->formatter->asDate($data->last_login);
}], ['header' => Yii::t('AdminModule.views_user_index', 'Actions'), 'class' => 'yii\\grid\\ActionColumn', 'options' => ['style' => 'width:80px; min-width:80px;'], 'buttons' => ['view' => function ($url, $model) {
    return Html::a('<i class="fa fa-eye"></i>', $model->getUrl(), ['class' => 'btn btn-primary btn-xs tt']);
}, 'update' => function ($url, $model) {
    return Html::a('<i class="fa fa-pencil"></i>', Url::toRoute(['edit', 'id' => $model->id]), ['class' => 'btn btn-primary btn-xs tt']);
}, 'delete' => function ($url, $model) {
    return Html::a('<i class="fa fa-times"></i>', Url::toRoute(['delete', 'id' => $model->id]), ['class' => 'btn btn-danger btn-xs tt']);
}]]]]);
?>
    </div>
</div>
Ejemplo n.º 9
0
    <div class="help-block">
        <?php 
echo Yii::t('AdminModule.views_groups_index', 'Users can be assigned to different groups (e.g. teams, departments etc.) with specific standard spaces, group managers and permissions.');
?>
    </div>
</div>

<?php 
echo \humhub\modules\admin\widgets\GroupMenu::widget();
?>

<div class="panel-body">
    <div class="pull-right">
        <?php 
echo Html::a('<i class="fa fa-plus" aria-hidden="true"></i>&nbsp;&nbsp;' . Yii::t('AdminModule.views_groups_index', "Create new group"), Url::to(['edit']), array('class' => 'btn btn-success'));
?>
    </div>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'tableOptions' => ['class' => 'table table-hover'], 'columns' => ['name', 'description', ['attribute' => 'members', 'label' => Yii::t('AdminModule.views_group_index', 'Members'), 'format' => 'raw', 'options' => ['style' => 'text-align:center;'], 'value' => function ($data) {
    return $data->getGroupUsers()->count();
}], ['header' => Yii::t('AdminModule.views_group_index', 'Actions'), 'class' => 'yii\\grid\\ActionColumn', 'options' => ['width' => '80px'], 'buttons' => ['view' => function () {
    return;
}, 'delete' => function () {
    return;
}, 'update' => function ($url, $model) {
    return Html::a('<i class="fa fa-pencil"></i>', Url::toRoute(['edit', 'id' => $model->id]), ['class' => 'btn btn-primary btn-xs tt']);
}]]]]);
?>
           
</div>
Ejemplo n.º 10
0
use yii\bootstrap\Html;
use humhub\widgets\GridView;
?>
<div class="panel-heading">
    <?php 
echo Yii::t('FriendshipModule.base', '<strong>Sent</strong> friend requests');
?>
</div>


<?php 
echo \humhub\modules\friendship\widgets\ManageMenu::widget(['user' => $user]);
?>

<div class="panel-body">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['username', 'profile.firstname', 'profile.lastname', ['header' => 'Actions', 'class' => 'yii\\grid\\ActionColumn', 'buttons' => ['update' => function () {
    return;
}, 'view' => function () {
    return;
}, 'delete' => function ($url, $model) {
    return Html::a('Cancel', ['/friendship/request/delete', 'userId' => $model->id], ['class' => 'btn btn-danger btn-sm', 'data-method' => 'POST']);
}]]]]);
?>

</div>



Ejemplo n.º 11
0
?>
</div>
    <div class="panel-body">

        <p>
            <?php 
echo Yii::t('AdminModule.views_approval_index', 'Here you see all users who have registered and still waiting for a approval.');
?>
        </p>

        <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'group.id', 'label' => 'Group', 'filter' => \yii\helpers\Html::activeDropDownList($searchModel, 'group.id', \yii\helpers\ArrayHelper::map($searchModel->getGroups(), 'id', 'name')), 'value' => function ($data) {
    return $data->group->name . " (" . $data->group->id . ")";
}], 'username', 'email', 'profile.firstname', 'profile.lastname', 'profile.lastname', ['header' => 'Actions', 'class' => 'yii\\grid\\ActionColumn', 'options' => ['width' => '150px'], 'buttons' => ['view' => function () {
    return;
}, 'delete' => function ($url, $model) {
    return Html::a('Decline', Url::toRoute(['decline', 'id' => $model->id]), ['class' => 'btn btn-danger btn-sm']);
}, 'update' => function ($url, $model) {
    return Html::a('Approve', Url::toRoute(['approve', 'id' => $model->id]), ['class' => 'btn btn-primary btn-sm']);
}]]]]);
?>

                <?php 
/*
 $this->widget('zii.widgets.grid.CGridView', array(
 'id' => 'approve-grid',
 'dataProvider' => $model->resetScope()->searchNeedApproval(),
 'filter' => $model,
 'itemsCssClass' => 'table table-hover',
 'columns' => array(
 array(