Example #1
0
 public function actionSearch($type = 'all')
 {
     if (!param('useShowUserInfo')) {
         throw new CHttpException(403, tt('Displays information about the users is disabled by the administrator', 'users'));
     }
     $usersListPage = Menu::model()->findByPk(Menu::USERS_LIST_ID);
     if ($usersListPage) {
         if ($usersListPage->active == 0) {
             throw404();
         }
     }
     $this->showSearchForm = false;
     $existTypes = User::getTypeList('withAll');
     $criteria = new CDbCriteria();
     $type = in_array($type, array_keys($existTypes)) ? $type : 'all';
     //$criteria->compare('active', 1);
     if ($type != 'all') {
         $criteria->compare('type', $type);
     }
     //$criteria->compare('isAdmin', 0);
     $criteria->with = array('countAdRel');
     $sort = new CSort();
     $sort->sortVar = 'sort';
     $sort->defaultOrder = 'date_created DESC';
     $sort->multiSort = true;
     $sort->attributes = array('username' => array('label' => tc('by username'), 'default' => 'desc'), 'date_created' => array('label' => tc('by date of registration'), 'default' => 'desc'));
     $dataProvider = new CActiveDataProvider(User::model()->active(), array('criteria' => $criteria, 'sort' => $sort, 'pagination' => array('pageSize' => 12)));
     $this->render('search', array('dataProvider' => $dataProvider, 'type' => $type));
 }
Example #2
0
        <?php 
echo $model->renderAva();
$this->widget('ext.EAjaxUpload.EAjaxUpload', array('id' => 'uploadFile', 'label' => tc('Upload file'), 'config' => array('action' => Yii::app()->createUrl('/users/main/uploadAva', array('id' => $model->id)), 'allowedExtensions' => array("jpg", "jpeg", "gif", "png"), 'sizeLimit' => 1 * 1024 * 1024, 'minSizeLimit' => 1024, 'onComplete' => "js:function(id, fileName, responseJSON){ profile.showAva(responseJSON); }", 'multiple' => false, 'showMessage' => "js:function(message){ error(message); }")));
echo CHtml::link(tc('Delete'), 'javascript:;', array('id' => 'delete_ava', 'style' => 'display: show;'));
?>
    </div>

    <div class="clear"></div>
    <br>

    <div class="rowold">
        <?php 
echo $form->labelEx($model, 'type');
?>
        <?php 
echo $form->dropDownList($model, 'type', User::getTypeList(), array('class' => 'span2'));
?>
        <?php 
echo $form->error($model, 'type');
?>
    </div>

	<?php 
if (issetModule('rbac') && Yii::app()->user->role == User::ROLE_MODERATOR && $model->role != User::ROLE_ADMIN && $model->role != User::ROLE_MODERATOR) {
    ?>
		<div class="rowold">
			<?php 
    echo $form->labelEx($model, 'role');
    ?>
			<?php 
    echo $form->dropDownList($model, 'role', array_merge(array('' => tt('Select role')), User::$createUserWithoutRolesModeration), array('class' => 'span4'));
Example #3
0
			updateGrid();
		});

		$("#regionListing").on('change', function() {
			updateGrid();
		});

		$("#cityListing").on('change', function() {
			updateGrid();
		});
	});
</script>

<?php 
echo CHtml::label($model->getAttributeLabel('userType'), 'userType');
echo $form->dropDownList($model, 'type', CArray::merge(array(0 => tc('Please select')), User::getTypeList()), array('id' => 'userType'));
?>

<?php 
echo CHtml::label($model->getAttributeLabel('withListings'), 'withListings');
echo $form->dropDownList($model, 'withListings', CArray::merge(array('' => tc('Please select')), array(0 => tc('No'), 1 => tc('Ok'))), array('id' => 'withListings'));
?>

<?php 
if (issetModule('location')) {
    echo CHtml::label($model->getAttributeLabel('countryListing'), 'countryListing');
    echo CHtml::dropDownList('Mailing[countryListing]', isset($this->selectedCountry) ? $this->selectedCountry : '', Country::getCountriesArray(2), array('class' => 'width285 searchField', 'id' => 'countryListing', 'ajax' => array('type' => 'GET', 'url' => $this->createUrl('/location/main/getRegions'), 'data' => 'js:"country="+$("#countryListing").val()+"&type=2"', 'success' => 'function(result){
					$("#regionListing").html(result);
					$("#regionListing").change();
				}')));
    echo CHtml::label($model->getAttributeLabel('regionListing'), 'regionListing');
Example #4
0
<?php

$userTypes = User::getTypeList('withAll');
$typeName = isset($userTypes[$type]) ? $userTypes[$type] : '?';
$this->pageTitle .= ' - ' . tc('Users') . ': ' . $typeName;
$this->breadcrumbs = array(tc('Users'));
?>

<h1><?php 
echo tc('Users');
?>
</h1>

<?php 
$links = array();
$links[] = array('label' => tc('All'), 'url' => Yii::app()->createUrl('/users/main/search', array('type' => 'all')), 'active' => $type == 'all');
//$links[] = array('label' => tc('Private persons'), 'url' => Yii::app()->createUrl('/users/main/search', array('type' => User::TYPE_PRIVATE_PERSON)), 'active' => $type == User::TYPE_PRIVATE_PERSON);
//$links[] = array('label' => tc('Agents'), 'url' => Yii::app()->createUrl('/users/main/search', array('type' => User::TYPE_AGENT)), 'active' => $type == User::TYPE_AGENT);
//$links[] = array('label' => tc('Agency'), 'url' => Yii::app()->createUrl('/users/main/search', array('type' => User::TYPE_AGENCY)), 'active' => $type == User::TYPE_AGENCY);
?>

<div id="userfilter">
<?php 
/*$this->widget('zii.widgets.CMenu',array(
    'items'=>$links
));*/
?>
</div>

<?php 
$this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_search_user_item', 'ajaxUpdate' => false, 'emptyText' => tc('No user'), 'summaryText' => "{start}&mdash;{end} " . tc('of') . " {count}", 'template' => '{summary} {sorter} {items} {pager}', 'sortableAttributes' => array('username', 'date_created'), 'pager' => array('class' => 'CLinkPager', 'header' => false, 'htmlOptions' => array('class' => 'pager'))));
Example #5
0
<?php

$this->breadcrumbs = array(tt('Manage apartments') => array('/apartments/backend/main/admin'));
$this->menu = array(array('label' => tt('Manage apartments'), 'url' => array('/apartments/backend/main/admin')));
$this->adminTitle = tt('Set the owner of the listing', 'apartments') . ' ' . $modelApartment->getStrByLang('title');
$form = $this->beginWidget('CustomForm', array('id' => $this->modelName . '-form', 'enableAjaxValidation' => false, 'htmlOptions' => array('class' => '')));
?>

<p class="note"><?php 
echo Yii::t('common', 'Fields with <span class="required">*</span> are required.');
?>
</p>

<?php 
echo $form->errorSummary($model);
echo $form->labelEx($model, 'futureOwner');
$columns = array(array('class' => 'CCheckBoxColumn', 'id' => 'itemsSelected', 'selectableRows' => '1', 'htmlOptions' => array('class' => 'center')), array('name' => 'type', 'value' => '$data->getTypeName()', 'filter' => User::getTypeList()), array('name' => 'role', 'value' => '$data->getRoleName()', 'filter' => User::$roles), array('name' => 'username', 'header' => tt('User name', 'users')), 'email');
$this->widget('CustomGridView', array('id' => 'user-grid', 'dataProvider' => $modelUser->search(), 'filter' => $modelUser, 'columns' => $columns));
?>

<div class="clear">&nbsp;</div>
<div id="submit" class="rowold buttons">
	<?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'icon' => 'ok white', 'label' => tc('Change')));
?>
</div>

<?php 
$this->endWidget();
<?php

Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/js/chosen/chosen.css');
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/js/chosen/chosen.jquery.js', CClientScript::POS_END);
?>

<div class="row">
    <?php 
echo $form->labelEx($user, 'type');
?>
    <?php 
echo $form->dropDownList($user, 'type', User::getTypeList(), array('class' => 'width200'));
?>
    <?php 
echo $form->error($user, 'type');
?>
</div>

<div class="row" id="row_agency_name">
    <?php 
echo $form->labelEx($user, 'agency_name');
?>
    <?php 
echo $form->textField($user, 'agency_name', array('size' => 20, 'maxlength' => 128, 'class' => 'width200'));
?>
    <?php 
echo $form->error($user, 'agency_name');
?>
</div>

<?php 
Example #7
0
<?php

$this->breadcrumbs = array(Yii::t('common', 'User managment'));
$this->menu = array(array('label' => tt('Add user'), 'url' => array('/users/backend/main/create')));
$this->adminTitle = Yii::t('common', 'User managment');
$columns = array(array('class' => 'CCheckBoxColumn', 'id' => 'itemsSelected', 'selectableRows' => '2', 'htmlOptions' => array('class' => 'center'), 'disabled' => '$data->id == 1'), array('name' => 'active', 'header' => tt('Status'), 'type' => 'raw', 'value' => 'Yii::app()->controller->returnStatusHtml($data, "user-grid", 1, 1)', 'headerHtmlOptions' => array('class' => 'infopages_status_column'), 'filter' => array(0 => tt('Inactive'), 1 => tt('Active'))), array('name' => 'type', 'value' => '$data->getTypeName()', 'filter' => User::getTypeList()), array('name' => 'role', 'value' => '$data->getRoleName()', 'filter' => User::$roles), array('name' => 'username', 'header' => tt('User name')), 'phone', 'email', array('header' => '', 'value' => 'HUser::getLinkForRecover($data)', 'type' => 'raw'), array('name' => 'date_created', 'type' => 'raw', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'date_created', 'language' => Yii::app()->controller->datePickerLang, 'options' => array('showAnim' => 'fold', 'dateFormat' => 'yy-mm-dd', 'changeMonth' => 'true', 'changeYear' => 'true', 'showButtonPanel' => 'true')), true), 'htmlOptions' => array('style' => 'width:130px;')));
if (issetModule('paidservices')) {
    //$columns[] = 'balance';
}
if (issetModule('tariffPlans') && issetModule('paidservices') && Yii::app()->user->checkAccess('tariff_plans_admin')) {
    // for modal apply
    $cs = Yii::app()->clientScript;
    $cs->registerCoreScript('jquery.ui');
    $cs->registerScriptFile($cs->getCoreScriptUrl() . '/jui/js/jquery-ui-i18n.min.js');
    $cs->registerCssFile($cs->getCoreScriptUrl() . '/jui/css/base/jquery-ui.css');
    $columns[] = array('header' => tc('Tariff Plans'), 'value' => 'TariffPlans::getTariffPlansHtml(true, true, $data)', 'type' => 'raw', 'htmlOptions' => array('style' => 'width: 200px;'));
}
$columns[] = array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{view}{update}{delete}{send}', 'deleteConfirmation' => tc('Are you sure you want to delete this item?'), 'buttons' => array('view' => array('visible' => '$data->role != "admin"'), 'delete' => array('visible' => '$data->role != "admin"'), 'send' => array('label' => '', 'url' => 'Yii::app()->createUrl("/messages/backend/main/read", array("id" => $data->id))', 'options' => array('class' => 'icon-envelope', 'title' => tt('Message', 'messages')), 'visible' => '(issetModule("messages") && Yii::app()->user->checkAccess("messages_admin") && $data->id != Yii::app()->user->id && $data->role == "registered" && $data->active == 1) ? true : false')));
$this->widget('CustomGridView', array('id' => 'user-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'afterAjaxUpdate' => 'function(){$("a[rel=\'tooltip\']").tooltip(); $("div.tooltip-arrow").remove(); $("div.tooltip-inner").remove(); jQuery("#News_date_created").datepicker(jQuery.extend(jQuery.datepicker.regional["' . Yii::app()->controller->datePickerLang . '"],{"showAnim":"fold","dateFormat":"yy-mm-dd","changeMonth":"true","showButtonPanel":"true","changeYear":"true"}));}', 'columns' => $columns));
$this->renderPartial('//site/admin-select-items', array('url' => '/users/backend/main/itemsSelected', 'id' => 'user-grid', 'model' => $model, 'options' => array('activate' => Yii::t('common', 'Activate'), 'deactivate' => Yii::t('common', 'Deactivate'), 'delete' => Yii::t('common', 'Delete'))));
Example #8
0
<?php

$this->breadcrumbs = array(Yii::t('common', 'User managment'));
$this->menu = array(array('label' => tt('Add user'), 'url' => array('/users/backend/main/create')));
$this->adminTitle = Yii::t('common', 'User managment');
$columns = array(array('class' => 'CCheckBoxColumn', 'id' => 'itemsSelected', 'selectableRows' => '2', 'htmlOptions' => array('class' => 'center'), 'disabled' => '$data->id == 1'), array('name' => 'active', 'header' => tt('Status'), 'type' => 'raw', 'value' => 'Yii::app()->controller->returnStatusHtml($data, "user-grid", 1, 1)', 'headerHtmlOptions' => array('class' => 'infopages_status_column'), 'filter' => array(0 => tt('Inactive'), 1 => tt('Active'))), array('name' => 'type', 'value' => '$data->getTypeName()', 'filter' => User::getTypeList()), array('name' => 'username', 'header' => tt('User name')), 'phone', 'email');
if (issetModule('paidservices')) {
    $columns[] = 'balance';
}
$columns[] = array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{update}{delete}', 'deleteConfirmation' => tc('Are you sure you want to delete this item?'), 'buttons' => array('delete' => array('visible' => '$data->id != 1')));
$this->widget('CustomGridView', array('id' => 'user-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'afterAjaxUpdate' => 'function(){$("a[rel=\'tooltip\']").tooltip(); $("div.tooltip-arrow").remove(); $("div.tooltip-inner").remove();}', 'columns' => $columns));
$this->renderPartial('//site/admin-select-items', array('url' => '/users/backend/main/itemsSelected', 'id' => 'user-grid', 'model' => $model, 'options' => array('activate' => Yii::t('common', 'Activate'), 'deactivate' => Yii::t('common', 'Deactivate'), 'delete' => Yii::t('common', 'Delete'))));
Example #9
0
		<?php 
$this->widget('CMultiFileUpload', array('name' => 'files', 'accept' => "{$messageModel->supportExtForUploader}", 'duplicate' => '' . tt("The selected file has already been added!", "messages") . '', 'denied' => '' . tt("Unsupported file type!", "messages") . ''));
?>
		<?php 
echo $form->error($messageModel, 'file');
?>
	</div>
	<div class="clear">&nbsp;</div>

	<div class="rowold buttons">
		<?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'icon' => 'ok white', 'label' => tt('Send', 'messages')));
?>
	</div>
	<div class="clear">&nbsp;</div>

	<div class='flash-notice'><?php 
echo Yii::t('module_messages', 'max_newsletter_limit', array('{n}' => Mailing::MAILING_USERS_LIMIT));
?>
</div>

	<?php 
$columns = array(array('class' => 'CCheckBoxColumn', 'id' => 'itemsSelected', 'value' => '$data->id', 'checked' => 'true', 'selectableRows' => '2', 'htmlOptions' => array('class' => 'center')), array('name' => 'username'), array('name' => 'type', 'value' => '$data->getTypeName()', 'filter' => User::getTypeList()), 'phone', 'email');
$this->widget('CustomGridView', array('id' => 'message-mailing-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'afterAjaxUpdate' => 'function(){$("a[rel=\'tooltip\']").tooltip(); $("div.tooltip-arrow").remove(); $("div.tooltip-inner").remove();}', 'columns' => $columns));
?>
	<?php 
$this->endWidget();
?>
</div>
Example #10
0
<div class="form">
	<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'import-form', 'method' => 'post', 'action' => $this->createAbsoluteUrl('/iecsv/backend/main/importProcess'), 'enableClientValidation' => false));
echo $form->hiddenField($model, 'itemsSelectedImport');
echo CHtml::hiddenField('is_submit', 0, array('id' => 'is_submit'));
echo $form->hiddenField($model, 'selectedImportUser');
?>

	<div class="clear">&nbsp;</div>
	<div class="rowold">
		<?php 
echo $form->labelEx($model, 'selectedImportUser');
if (!isset($areasSelected) || !$areasSelected) {
    $areasSelected = array();
}
$columns = array(array('class' => 'CCheckBoxColumn'), array('name' => 'type', 'value' => '$data->getTypeName()', 'filter' => User::getTypeList()), array('name' => 'role', 'value' => '$data->getRoleName()', 'filter' => User::$roles), array('name' => 'username', 'header' => tt('User name')), 'phone', 'email');
$this->widget('CustomHistoryGridView', array('id' => 'users-grid', 'dataProvider' => $modelUsers->search(), 'filter' => $modelUsers, 'columns' => $columns, 'selectableRows' => 1, 'selectionChanged' => 'js:selUsersSelected'));
echo $form->error($model, 'selectedImportUser');
?>
	</div>

	<div class="rowold buttons">
		<?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'button', 'type' => 'primary', 'icon' => 'ok white', 'label' => tt('Import'), 'htmlOptions' => array('onclick' => '$("#is_submit").val("1"); $("#import-form").submit();')));
?>
	</div>
	<?php 
$this->endWidget();
?>
</div><!-- form -->