summaryrefslogtreecommitdiff
path: root/protected/views/user/admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'protected/views/user/admin.php')
-rw-r--r--protected/views/user/admin.php80
1 files changed, 52 insertions, 28 deletions
diff --git a/protected/views/user/admin.php b/protected/views/user/admin.php
index 90691ce..ed6b636 100644
--- a/protected/views/user/admin.php
+++ b/protected/views/user/admin.php
@@ -1,41 +1,22 @@
<?php
$this->breadcrumbs=array(
- 'Users'=>array('index'),
- 'Manage',
+ 'Benutzer'=>array('index'),
+ 'Benutzerverwaltung',
);
$this->menu=array(
- array('label'=>'List User', 'url'=>array('index')),
- array('label'=>'Create User', 'url'=>array('create')),
+ array('label'=>'Benutzer', 'url'=>array('index')),
+ array('label'=>'Neuen Benutzer erstellen', 'url'=>array('create')),
);
-
-Yii::app()->clientScript->registerScript('search', "
-$('.search-button').click(function(){
- $('.search-form').toggle();
- return false;
-});
-$('.search-form form').submit(function(){
- $.fn.yiiGridView.update('user-grid', {
- data: $(this).serialize()
- });
- return false;
-});
-");
?>
-<h1>Manage Users</h1>
+<h1>Benutzerverwaltung</h1>
-<p>
-You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
-or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
-</p>
+<?php $this->renderPartial('/common/_comparison_text'); ?>
-<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
-<div class="search-form" style="display:none">
-<?php $this->renderPartial('_search',array(
+<?php $this->renderPartial('/common/_advanced_search',array(
'model'=>$model,
)); ?>
-</div><!-- search-form -->
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'user-grid',
@@ -46,10 +27,53 @@ or <b>=</b>) at the beginning of each of your search values to specify how the c
'username',
'created_at',
'last_login',
- 'is_active',
- 'is_super_admin',
+ array('header'=>'Aktiviert?',
+ 'name'=>'is_active',
+ 'value'=>'CHtml::image($data->is_active ? "images/ok.png" : "images/nok.png", $data->is_active ? "ok.png" : "nok.png")', 'type'=>'raw'),
+ array('header'=>'Admin',
+ 'name'=>'is_super_admin',
+ 'value'=>'CHtml::image($data->is_super_admin ? "images/ok.png" : "images/nok.png", $data->is_super_admin ? "ok.png" : "nok.png")', 'type'=>'raw'),
+ //'admin_pw_reset',
+ //'user_pw_reset',
+ array('header'=>'eMail',
+ 'value'=>'($data->verein) ? $data->verein->email : ""'),
array(
'class'=>'CButtonColumn',
+ 'template'=>'{email}{view}{update}{delete}',
+ 'buttons'=>array(
+ 'email'=>array(
+ 'label'=>'Generate new password and email it',
+ 'imageUrl'=>Html::imageUrl('email.png'),
+ 'click'=>'function(){generatePassword($(this).parent().parent().children(":first-child").text());}'
+ )
+ )
),
),
)); ?>
+
+<script type="text/javascript">
+function generatePassword(id) {
+ console.log(id);
+ <?php echo CHtml::ajax(array(
+ 'url'=>array('user/newPassword'),
+ 'data'=> "js:{'id':id}",
+ 'type'=>'post',
+ 'dataType'=>'json',
+ 'success'=>"function(data)
+ {
+ if (data.status == 'failure')
+ {
+ alert(data.message);
+ }
+ else
+ {
+ alert(data.message);
+ }
+
+ } ",
+ ))?>;
+ return false;
+
+}
+
+</script>