* custom for user batchcreate.
This commit is contained in:
@@ -6,10 +6,12 @@ $config->user->edit = new stdclass();
|
||||
$config->user->create->requiredFields = 'account,realname,password,password1,password2';
|
||||
$config->user->edit->requiredFields = 'account,realname';
|
||||
|
||||
$config->user->customBatchEditFields = 'dept,role,join,email,commiter,skype,qq,yahoo,gtalk,wangwang,mobile,phone,address,zipcode';
|
||||
$config->user->customBatchCreateFields = 'dept,email,gender,commiter,join,skype,qq,yahoo,gtalk,wangwang,mobile,phone,address,zipcode';
|
||||
$config->user->customBatchEditFields = 'dept,email,commiter,join,skype,qq,yahoo,gtalk,wangwang,mobile,phone,address,zipcode';
|
||||
|
||||
$config->user->custom = new stdclass();
|
||||
$config->user->custom->batchedit = 'dept,role,join,email,commiter';
|
||||
$config->user->custom->batchcreate = 'dept,email,gender';
|
||||
$config->user->custom->batchedit = 'dept,join,email,commiter';
|
||||
|
||||
$config->user->failTimes = 6;
|
||||
$config->user->lockMinutes = 10;
|
||||
|
||||
@@ -442,6 +442,11 @@ class user extends control
|
||||
die(js::locate($this->createLink('company', 'browse'), 'parent'));
|
||||
}
|
||||
|
||||
/* Set custom. */
|
||||
foreach(explode(',', $this->config->user->customBatchCreateFields) as $field) $customFields[$field] = $this->lang->user->$field;
|
||||
$this->view->customFields = $customFields;
|
||||
$this->view->showFields = $this->config->user->custom->batchcreate;
|
||||
|
||||
$title = $this->lang->company->common . $this->lang->colon . $this->lang->user->batchCreate;
|
||||
$position[] = $this->lang->user->batchCreate;
|
||||
$this->view->title = $title;
|
||||
|
||||
@@ -284,6 +284,17 @@ class userModel extends model
|
||||
$data[$i]->email = $users->email[$i];
|
||||
$data[$i]->gender = $users->gender[$i];
|
||||
$data[$i]->password = md5($users->password[$i]);
|
||||
$data[$i]->commiter = $users->commiter[$i];
|
||||
$data[$i]->join = $users->join[$i];
|
||||
$data[$i]->skype = $users->skype[$i];
|
||||
$data[$i]->qq = $users->qq[$i];
|
||||
$data[$i]->yahoo = $users->yahoo[$i];
|
||||
$data[$i]->gtalk = $users->gtalk[$i];
|
||||
$data[$i]->wangwang = $users->wangwang[$i];
|
||||
$data[$i]->mobile = $users->mobile[$i];
|
||||
$data[$i]->phone = $users->phone[$i];
|
||||
$data[$i]->address = $users->address[$i];
|
||||
$data[$i]->zipcode = $users->zipcode[$i];
|
||||
|
||||
$accounts[$i] = $data[$i]->account;
|
||||
$prev['dept'] = $data[$i]->dept;
|
||||
|
||||
@@ -11,27 +11,49 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/datepicker.html.php';?>
|
||||
<?php js::set('roleGroup', $roleGroup);?>
|
||||
<div id='titlebar'>
|
||||
<div class='heading'>
|
||||
<span class='prefix'><?php echo html::icon($lang->icons['user']);?></span>
|
||||
<strong><small class='text-muted'><?php echo html::icon($lang->icons['batchCreate']);?></small> <?php echo $lang->user->batchCreate;?></strong>
|
||||
<div class='actions'>
|
||||
<button type="button" class="btn btn-default" data-toggle="customModal"><i class='icon icon-cog'></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$hasFields = array();
|
||||
foreach(explode(',', $showFields) as $field)
|
||||
{
|
||||
if($field)$hasFields[$field] = '';
|
||||
}
|
||||
$minWidth = (count($hasFields) > 5) ? 'w-150px' : '';
|
||||
?>
|
||||
<form class='form-condensed' method='post' target='hiddenwin' id='dataform'>
|
||||
<table class='table table-form table-fixed'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='w-40px'><?php echo $lang->idAB;?></th>
|
||||
<th class='w-150px'><?php echo $lang->user->dept;?></th>
|
||||
<th class='w-130px red'><?php echo $lang->user->account;?></th>
|
||||
<th class='w-130px red'><?php echo $lang->user->realname;?></th>
|
||||
<th class='w-120px red'><?php echo $lang->user->role;?></th>
|
||||
<th class='w-150px<?php echo zget($hasFields, 'dept', ' hidden')?>'><?php echo $lang->user->dept;?></th>
|
||||
<th class='w-130px'><?php echo $lang->user->account;?> <span class='required'></span></th>
|
||||
<th class='w-130px'><?php echo $lang->user->realname;?> <span class='required'></span></th>
|
||||
<th class='w-120px'><?php echo $lang->user->role;?> <span class='required'></span></th>
|
||||
<th class='w-120px'><?php echo $lang->user->group;?></th>
|
||||
<th><?php echo $lang->user->email;?></th>
|
||||
<th class='w-90px'><?php echo $lang->user->gender;?></th>
|
||||
<th class="w-p20 red"><?php echo $lang->user->password;?></th>
|
||||
<th class='<?php echo zget($hasFields, 'email', "$minWidth hidden", $minWidth)?>'><?php echo $lang->user->email;?></th>
|
||||
<th class='w-90px<?php echo zget($hasFields, 'gender', ' hidden')?>'><?php echo $lang->user->gender;?></th>
|
||||
<th class="<?php echo $minWidth?>"><?php echo $lang->user->password;?> <span class='required'></span></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'commiter', ' hidden')?>'><?php echo $lang->user->commiter;?></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'join', ' hidden')?>'> <?php echo $lang->user->join;?></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'skype', ' hidden')?>'> <?php echo $lang->user->skype;?></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'qq', ' hidden')?>'> <?php echo $lang->user->qq;?></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'yahoo', ' hidden')?>'> <?php echo $lang->user->yahoo;?></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'gtalk', ' hidden')?>'> <?php echo $lang->user->gtalk;?></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'wangwang', ' hidden')?>'><?php echo $lang->user->wangwang;?></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'mobile', ' hidden')?>'> <?php echo $lang->user->mobile;?></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'phone', ' hidden')?>'> <?php echo $lang->user->phone;?></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'address', ' hidden')?>'> <?php echo $lang->user->address;?></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'zipcode', ' hidden')?>'> <?php echo $lang->user->zipcode;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php $depts = $depts + array('ditto' => $lang->user->ditto)?>
|
||||
@@ -40,13 +62,13 @@
|
||||
<?php for($i = 0; $i < $config->user->batchCreate; $i++):?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo $i+1;?></td>
|
||||
<td class='text-left' style='overflow:visible'><?php echo html::select("dept[$i]", $depts, $i > 0 ? 'ditto' : $deptID, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($hasFields, 'dept', ' hidden')?>' style='overflow:visible'><?php echo html::select("dept[$i]", $depts, $i > 0 ? 'ditto' : $deptID, "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::input("account[$i]", '', "class='form-control account_$i' autocomplete='off' onchange='changeEmail($i)'");?></td>
|
||||
<td><?php echo html::input("realname[$i]", '', "class='form-control'");?></td>
|
||||
<td><?php echo html::select("role[$i]", $lang->user->roleList, $i > 0 ? 'ditto' : '', "class='form-control' onchange='changeGroup(this.value, $i)'");?></td>
|
||||
<td class='text-left' style='overflow:visible'><?php echo html::select("group[$i]", $groupList, $i > 0 ? 'ditto' : '', "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::input("email[$i]", '', "class='form-control email_$i' onchange='setDefaultEmail($i)'");?></td>
|
||||
<td><?php echo html::radio("gender[$i]", (array)$lang->user->genderList, 'm');?></td>
|
||||
<td <?php echo zget($hasFields, 'email', "class='hidden'")?>><?php echo html::input("email[$i]", '', "class='form-control email_$i' onchange='setDefaultEmail($i)'");?></td>
|
||||
<td <?php echo zget($hasFields, 'gender', "class='hidden'")?>><?php echo html::radio("gender[$i]", (array)$lang->user->genderList, 'm');?></td>
|
||||
<td align='left'>
|
||||
<div class='input-group'>
|
||||
<?php
|
||||
@@ -54,18 +76,31 @@
|
||||
if($i != 0) echo "<span class='input-group-addon'><input type='checkbox' name='ditto[$i]' id='ditto$i' " . ($i> 0 ? "checked" : '') . " /> {$lang->user->ditto}</span>";
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</itd>
|
||||
<td class='<?php echo zget($hasFields, 'commiter', 'hidden')?>'><?php echo html::input("commiter[$i]", '', "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'join', 'hidden')?>'> <?php echo html::input("join[$i]", '', "class='form-control form-date'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'skype', 'hidden')?>'> <?php echo html::input("skype[$i]", '', "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'qq', 'hidden')?>'> <?php echo html::input("qq[$i]", '', "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'yahoo', 'hidden')?>'> <?php echo html::input("yahoo[$i]", '', "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'gtalk', 'hidden')?>'> <?php echo html::input("gtalk[$i]", '', "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'wangwang', 'hidden')?>'><?php echo html::input("wangwang[$i]", '', "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'mobile', 'hidden')?>'> <?php echo html::input("mobile[$i]", '', "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'phone', 'hidden')?>'> <?php echo html::input("phone[$i]", '', "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'address', 'hidden')?>'> <?php echo html::input("address[$i]", '', "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'zipcode', 'hidden')?>'> <?php echo html::input("zipcode[$i]", '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<?php endfor;?>
|
||||
<tr>
|
||||
<th colspan='2'><?php echo $lang->user->verifyPassword?></th>
|
||||
<td colspan='7'>
|
||||
<td colspan='<?php echo count($hasFields) + 4?>'>
|
||||
<div class="required required-wrapper"></div>
|
||||
<input type='password' style="display:none"> <!-- for disable autocomplete all browser -->
|
||||
<?php echo html::password('verifyPassword', '', "class='form-control disabled-ie-placeholder' autocomplete='off' placeholder='{$lang->user->placeholder->verify}'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan='9' class='text-center'><?php echo html::submitButton() . html::backButton();?></td></tr>
|
||||
<tr><td colspan='<?php echo count($hasFields) + 6?>' class='text-center'><?php echo html::submitButton() . html::backButton();?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustom', 'module=user§ion=custom&key=batchcreate')?>
|
||||
<?php include '../../common/view/customfield.html.php';?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -37,7 +37,7 @@ $minWidth = (count($hasFields) > 7) ? 'w-120px' : '';
|
||||
<th class='w-150px<?php echo zget($hasFields, 'dept', ' hidden')?>'> <?php echo $lang->user->dept;?></th>
|
||||
<th class='<?php echo $minWidth?>'><?php echo $lang->user->account;?></th>
|
||||
<th class='<?php echo $minWidth?>'><?php echo $lang->user->realname;?></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'role', ' hidden')?>'> <?php echo $lang->user->role;?></th>
|
||||
<th class='w-120px'><?php echo $lang->user->role;?></th>
|
||||
<th class='<?php echo $minWidth . zget($hasFields, 'commiter', ' hidden')?>'><?php echo $lang->user->commiter;?></th>
|
||||
<th class='<?php echo $minWidth . zget($hasFields, 'email', ' hidden')?>'> <?php echo $lang->user->email;?></th>
|
||||
<th class='w-120px<?php echo zget($hasFields, 'join', ' hidden')?>'> <?php echo $lang->user->join;?></th>
|
||||
@@ -66,7 +66,7 @@ $minWidth = (count($hasFields) > 7) ? 'w-120px' : '';
|
||||
<td class='text-left<?php echo zget($hasFields, 'dept', ' hidden')?>' style='overflow:visible'><?php echo html::select("dept[$user->id]", $depts, $dept, "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::input("account[$user->id]", $user->account, "class='form-control' autocomplete='off'");?></td>
|
||||
<td><?php echo html::input("realname[$user->id]", $user->realname, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'role', 'hidden')?>'> <?php echo html::select("role[$user->id]", $lang->user->roleList, $role, "class='form-control'");?></td>
|
||||
<td><?php echo html::select("role[$user->id]", $lang->user->roleList, $role, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'commiter', 'hidden')?>'><?php echo html::input("commiter[$user->id]", $user->commiter, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'email', 'hidden')?>'> <?php echo html::input("email[$user->id]", $user->email, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($hasFields, 'join', 'hidden')?>'> <?php echo html::input("join[$user->id]", $user->join, "class='form-control form-date'");?></td>
|
||||
@@ -83,13 +83,13 @@ $minWidth = (count($hasFields) > 7) ? 'w-120px' : '';
|
||||
<?php endforeach;?>
|
||||
<tr>
|
||||
<th colspan='2'><?php echo $lang->user->verifyPassword?></th>
|
||||
<td colspan='<?php echo count($hasFields) + 1?>'>
|
||||
<td colspan='<?php echo count($hasFields) + 2?>'>
|
||||
<div class="required required-wrapper"></div>
|
||||
<input type='password' style="display:none"> <!-- for disable autocomplete all browser -->
|
||||
<?php echo html::password('verifyPassword', '', "class='form-control disabled-ie-placeholder' autocomplete='off' placeholder='{$lang->user->placeholder->verify}'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan='8' class='text-center'><?php echo html::submitButton() . html::backButton();?></td></tr>
|
||||
<tr><td colspan='<?php echo count($hasFields) + 4?>' class='text-center'><?php echo html::submitButton() . html::backButton();?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustom', 'module=user§ion=custom&key=batchedit')?>
|
||||
|
||||
Reference in New Issue
Block a user