* adjust style.
This commit is contained in:
@@ -443,7 +443,7 @@ EOT;
|
||||
*/
|
||||
public static function commonButton($label = '', $misc = '')
|
||||
{
|
||||
return " <input type='button' value='$label' class='button-c' $misc /> ";
|
||||
return " <input type='button' value='$label' $misc class='button-c' /> ";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -467,7 +467,7 @@ EOT;
|
||||
$link .= $onlybody;
|
||||
}
|
||||
|
||||
return " <input type='button' value='$label' class='button-c' $misc onclick='location.href=\"$link\"' /> ";
|
||||
return " <input type='button' value='$label' $misc onclick='location.href=\"$link\"' class='button-c' /> ";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,8 @@ $lang->action->action = 'Action';
|
||||
$lang->action->actionID = 'ActionID';
|
||||
$lang->action->date = 'Date';
|
||||
$lang->action->trashTips = "Tips:The deleting actions in zentao are all logic";
|
||||
$lang->action->toggleDiff = 'Toggle Diff';
|
||||
$lang->action->textDiff = 'Text mode';
|
||||
$lang->action->original = 'Original content';
|
||||
|
||||
$lang->action->dynamic = new stdclass();
|
||||
$lang->action->dynamic->today = 'Today';
|
||||
|
||||
@@ -24,7 +24,8 @@ $lang->action->action = '动作';
|
||||
$lang->action->actionID = '记录ID';
|
||||
$lang->action->date = '日期';
|
||||
$lang->action->trashTips = '提示:为了保证系统的完整性,禅道系统的删除都是标记删除。';
|
||||
$lang->action->toggleDiff = '切换DIFF';
|
||||
$lang->action->textDiff = '文本格式';
|
||||
$lang->action->original = '原始格式';
|
||||
|
||||
$lang->action->dynamic = new stdclass();
|
||||
$lang->action->dynamic->today = '今天';
|
||||
|
||||
@@ -50,8 +50,8 @@ $lang->actions = 'Actions';
|
||||
$lang->comment = 'Comment';
|
||||
$lang->history = 'History';
|
||||
$lang->attatch = 'Attatch';
|
||||
$lang->reverse = '[Reverse]';
|
||||
$lang->switchDisplay= '[Toggle Show]';
|
||||
$lang->reverse = 'Reverse';
|
||||
$lang->switchDisplay= 'Toggle Show';
|
||||
$lang->switchHelp = 'Toggle Help';
|
||||
$lang->addFiles = 'Add Files';
|
||||
$lang->files = 'Files ';
|
||||
|
||||
@@ -50,8 +50,8 @@ $lang->actions = '操作';
|
||||
$lang->comment = '备注';
|
||||
$lang->history = '历史记录';
|
||||
$lang->attatch = '附件';
|
||||
$lang->reverse = '[切换顺序]';
|
||||
$lang->switchDisplay= '[切换显示]';
|
||||
$lang->reverse = '切换顺序';
|
||||
$lang->switchDisplay= '切换显示';
|
||||
$lang->switchHelp = '切换帮助';
|
||||
$lang->addFiles = '上传了附件 ';
|
||||
$lang->files = '附件 ';
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
<script language='Javascript'>
|
||||
var fold = '<?php echo $lang->fold;?>';
|
||||
var unfold = '<?php echo $lang->unfold;?>';
|
||||
function switchChange(historyID,type)
|
||||
function switchChange(historyID)
|
||||
{
|
||||
if(type == unfold)
|
||||
changeClass = $('#switchButton' + historyID).attr('class');
|
||||
if(changeClass.indexOf('change-show') > 0)
|
||||
{
|
||||
$('#switchButton' + historyID).val(fold);
|
||||
$('#switchButton' + historyID).attr('class', changeClass.replace('change-show', 'change-hide'));
|
||||
$('#changeBox' + historyID).show();
|
||||
$('#changeBox' + historyID).prev('.changeDiff').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#switchButton' + historyID).val(unfold);
|
||||
$('#switchButton' + historyID).attr('class', changeClass.replace('change-hide', 'change-show'));
|
||||
$('#changeBox' + historyID).hide();
|
||||
$('#changeBox' + historyID).prev('.changeDiff').hide();
|
||||
}
|
||||
@@ -19,6 +20,17 @@ function switchChange(historyID,type)
|
||||
|
||||
function toggleStripTags(obj)
|
||||
{
|
||||
var diffClass = $(obj).attr('class');
|
||||
if(diffClass.indexOf('diff-all') > 0)
|
||||
{
|
||||
$(obj).attr('class', diffClass.replace('diff-all', 'diff-short'));
|
||||
$(obj).attr('title', '<?php echo $lang->action->textDiff?>');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(obj).attr('class', diffClass.replace('diff-short', 'diff-all'));
|
||||
$(obj).attr('title', '<?php echo $lang->action->original?>');
|
||||
}
|
||||
var boxObj = $(obj).next();
|
||||
var oldDiff = '';
|
||||
var newDiff = '';
|
||||
@@ -30,17 +42,40 @@ function toggleStripTags(obj)
|
||||
})
|
||||
}
|
||||
|
||||
function toggleShow()
|
||||
function toggleShow(obj)
|
||||
{
|
||||
var orderClass = $(obj).find('span').attr('class');
|
||||
if(orderClass == 'change-show')
|
||||
{
|
||||
$(obj).find('span').attr('class', 'change-hide');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(obj).find('span').attr('class', 'change-show');
|
||||
}
|
||||
$('.changes').each(function(){
|
||||
var box = $(this).parent();
|
||||
var switchButtonID = ($(box).find('span').find("input[type='button']").attr('id'));
|
||||
switchChange(switchButtonID.replace('switchButton', ''), $('#' + switchButtonID).val());
|
||||
switchChange(switchButtonID.replace('switchButton', ''));
|
||||
})
|
||||
}
|
||||
|
||||
function toggleOrder(obj)
|
||||
{
|
||||
var orderClass = $(obj).find('span').attr('class');
|
||||
if(orderClass == 'log-asc')
|
||||
{
|
||||
$(obj).find('span').attr('class', 'log-desc');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(obj).find('span').attr('class', 'log-asc');
|
||||
}
|
||||
$("#historyItem li").reverseOrder();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
var diffButton = "<input type='button' onclick='toggleStripTags(this)' class='hidden changeDiff' value='<?php echo $lang->action->toggleDiff?>' >";
|
||||
var diffButton = "<input type='button' onclick='toggleStripTags(this)' class='hidden changeDiff diff-all' title='<?php echo $lang->action->original?>' >";
|
||||
var newBoxID = ''
|
||||
var oldBoxID = ''
|
||||
$('blockquote').each(function(){
|
||||
@@ -61,14 +96,16 @@ $(function(){
|
||||
<div id='actionbox'>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<span onclick='$("#historyItem li").reverseOrder();' class='hand'> <?php echo $lang->history . "[<span title='$lang->reverse' class='log-reverse'> </span>]";?></span>
|
||||
<span onclick='toggleShow();' class='hand'><?php echo "[<span title='$lang->switchDisplay' class='switchDisplay'> </span>]";?></span>
|
||||
<?php echo $lang->history?>
|
||||
<span onclick='toggleOrder(this)' class='hand'> <?php echo "<span title='$lang->reverse' class='log-asc'> </span>";?></span>
|
||||
<span onclick='toggleShow(this);' class='hand'><?php echo "<span title='$lang->switchDisplay' class='change-show'> </span>";?></span>
|
||||
</legend>
|
||||
<?php else:?>
|
||||
<table class='table-1' id='actionbox'>
|
||||
<caption>
|
||||
<span onclick='$("#historyItem li").reverseOrder();' class='hand'> <?php echo $lang->history . "[<span title='$lang->reverse' class='log-reverse'> </span>]";?></span>
|
||||
<span onclick='toggleShow();' class='hand'><?php echo "[<span title='$lang->switchDisplay' class='switchDisplay'> </span>]";?></span>
|
||||
<?php echo $lang->history?>
|
||||
<span onclick='$("#historyItem li").reverseOrder();' class='hand'> <?php echo "<span title='$lang->reverse' class='log-asc'> </span>";?></span>
|
||||
<span onclick='toggleShow();' class='hand'><?php echo "<span title='$lang->switchDisplay' class='change-show'> </span>";?></span>
|
||||
</caption>
|
||||
<tr><td>
|
||||
<?php endif;?>
|
||||
@@ -84,7 +121,7 @@ $(function(){
|
||||
?>
|
||||
<span>
|
||||
<?php $this->action->printAction($action);?>
|
||||
<?php if(!empty($action->history)) echo html::commonButton($lang->unfold, "id=switchButton$i onclick=switchChange($i,this.value)");?>
|
||||
<?php if(!empty($action->history)) echo html::commonButton('', "id=switchButton$i class='hand change-show' onclick=switchChange($i)");?>
|
||||
</span>
|
||||
<?php if(!empty($action->comment) or !empty($action->history)):?>
|
||||
<?php if(!empty($action->comment)) echo "<div class='history'>";?>
|
||||
|
||||
@@ -23,3 +23,19 @@ function switchAccount(account, method)
|
||||
location.href=link;
|
||||
}
|
||||
|
||||
var mailsuffix = '';
|
||||
var account = new Array();
|
||||
function setDefaultEmail(num)
|
||||
{
|
||||
var mailValue = $('.email_' + num).val();
|
||||
if(mailValue.indexOf('@') <= 0) return;
|
||||
if(mailValue.indexOf('@') > 0) mailValue = mailValue.substr(mailValue.indexOf('@'));
|
||||
mailsuffix = mailValue;
|
||||
}
|
||||
|
||||
function changeEmail(num)
|
||||
{
|
||||
var mailValue = $('.email_' + num).val();
|
||||
if(mailsuffix != '' && (mailValue == '' || mailValue == account[num] + mailsuffix)) $('.email_' + num).val($('.account_' + num).val() + mailsuffix);
|
||||
account[num] = $('.account_' + num).val();
|
||||
}
|
||||
|
||||
@@ -113,3 +113,4 @@ $lang->user->error->accountDupl = "ID %s,this account has been exist";
|
||||
$lang->user->error->realname = "ID %s,please input realname";
|
||||
$lang->user->error->password = "ID %s,password must be six letters at least";
|
||||
$lang->user->error->mail = "ID %s,please input correct email address";
|
||||
$lang->user->error->role = "ID %s,please input role";
|
||||
|
||||
@@ -114,6 +114,7 @@ $lang->user->error->accountDupl = "ID %s,该用户名已经存在";
|
||||
$lang->user->error->realname = "ID %s,必须填写真实姓名";
|
||||
$lang->user->error->password = "ID %s,密码必须六位以上";
|
||||
$lang->user->error->mail = "ID %s,请填写正确的邮箱地址";
|
||||
$lang->user->error->role = "ID %s,角色不能为空";
|
||||
|
||||
$lang->user->contacts = new stdclass();
|
||||
$lang->user->contacts->common = '联系人';
|
||||
|
||||
+23
-13
@@ -222,39 +222,42 @@ class userModel extends model
|
||||
*/
|
||||
public function batchCreate()
|
||||
{
|
||||
$users = fixer::input('post')->get();
|
||||
$data = array();
|
||||
$users = fixer::input('post')->get();
|
||||
$data = array();
|
||||
$accounts = array();
|
||||
for($i = 0; $i < $this->config->user->batchCreate; $i++)
|
||||
{
|
||||
if($users->account[$i] != '')
|
||||
{
|
||||
$account = $this->dao->select('account')->from(TABLE_USER)->where('account')->eq($users->account[$i])->fetch();
|
||||
if($account) die(js::error(sprintf($this->lang->user->error->accountDupl, $i+1)));
|
||||
if(in_array($users->account[$i], $accounts)) die(js::error(sprintf($this->lang->user->error->accountDupl, $i+1)));
|
||||
if(!validater::checkReg($users->account[$i], '|(.){3,}|')) die(js::error(sprintf($this->lang->user->error->account, $i+1)));
|
||||
if($users->realname[$i] == '') die(js::error(sprintf($this->lang->user->error->realname, $i+1)));
|
||||
if($users->email[$i] and !validater::checkEmail($users->email[$i])) die(js::error(sprintf($this->lang->user->error->mail, $i+1)));
|
||||
$users->password[$i] = (isset($prev['password']) and $users->ditto[$i] == 'on') ? $prev['password'] : $users->password[$i];
|
||||
$users->password[$i] = (isset($prev['password']) and $users->ditto[$i] == 'on' and empty($users->password[$i])) ? $prev['password'] : $users->password[$i];
|
||||
a($users->password[$i]);
|
||||
if(!validater::checkReg($users->password[$i], '|(.){6,}|')) die(js::error(sprintf($this->lang->user->error->password, $i+1)));
|
||||
if(empty($users->role[$i])) die(js::error(sprintf($this->lang->user->error->role, $id)));
|
||||
|
||||
$data[$i]->dept = (isset($prev['dept']) and $users->dept[$i] == 'ditto') ? $prev['dept'] : $users->dept[$i];
|
||||
$data[$i]->dept = $users->dept[$i] == 'ditto' ? (isset($prev['dept']) ? $prev['dept'] : 0) : $users->dept[$i];
|
||||
$data[$i]->account = $users->account[$i];
|
||||
$data[$i]->realname = $users->realname[$i];
|
||||
$data[$i]->role = (isset($prev['role']) and $users->role[$i] == 'ditto') ? $prev['role'] : $users->role[$i];
|
||||
$data[$i]->role = $users->role[$i] == 'ditto' ? (isset($prev['role']) ? $prev['role'] : '') : $users->role[$i];
|
||||
$data[$i]->email = $users->email[$i];
|
||||
$data[$i]->gender = $users->gender[$i];
|
||||
$data[$i]->password = md5($users->password[$i]);
|
||||
|
||||
$prev['dept'] = $data[$i]->dept;
|
||||
$prev['role'] = $data[$i]->role;
|
||||
$accounts[$i] = $data[$i]->account;
|
||||
$prev['dept'] = $data[$i]->dept;
|
||||
$prev['role'] = $data[$i]->role;
|
||||
$prev['password'] = $users->password[$i];
|
||||
}
|
||||
}
|
||||
|
||||
foreach($data as $user)
|
||||
{
|
||||
$this->dao->insert(TABLE_USER)->data($user)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->user->create->requiredFields, 'notempty')
|
||||
->exec();
|
||||
$this->dao->insert(TABLE_USER)->data($user)->autoCheck()->exec();
|
||||
if(dao::isError())
|
||||
{
|
||||
echo js::error(dao::getError());
|
||||
@@ -317,20 +320,27 @@ class userModel extends model
|
||||
$oldUsers = $this->dao->select('id, account')->from(TABLE_USER)->where('id')->in(array_keys($this->post->account))->fetchPairs('id', 'account');
|
||||
$accountGroup = $this->dao->select('id, account')->from(TABLE_USER)->where('account')->in($this->post->account)->fetchGroup('account', 'id');
|
||||
|
||||
$accounts = array();
|
||||
foreach($this->post->account as $id => $account)
|
||||
{
|
||||
$users[$id]['account'] = $account;
|
||||
$users[$id]['dept'] = $this->post->dept[$id];
|
||||
$users[$id]['realname'] = $this->post->realname[$id];
|
||||
$users[$id]['role'] = $this->post->role[$id];
|
||||
$users[$id]['commiter'] = $this->post->commiter[$id];
|
||||
$users[$id]['email'] = $this->post->email[$id];
|
||||
$users[$id]['join'] = $this->post->join[$id];
|
||||
$users[$id]['dept'] = $this->post->dept[$id] == 'ditto' ? (isset($prev['dept']) ? $prev['dept'] : 0) : $this->post->dept[$id];
|
||||
$users[$id]['role'] = $this->post->role[$id] == 'ditto' ? (isset($prev['role']) ? $prev['role'] : 0) : $this->post->role[$id];
|
||||
|
||||
if(isset($accountGroup[$account]) and count($accountGroup[$account]) > 1) die(js::error(sprintf($this->lang->user->error->accountDupl, $id)));
|
||||
if(in_array($account, $accounts)) die(js::error(sprintf($this->lang->user->error->accountDupl, $id)));
|
||||
if(!validater::checkReg($users[$id]['account'], '|(.){3,}|')) die(js::error(sprintf($this->lang->user->error->account, $id)));
|
||||
if($users[$id]['realname'] == '') die(js::error(sprintf($this->lang->user->error->realname, $id)));
|
||||
if($users[$id]['email'] and !validater::checkEmail($users[$id]['email'])) die(js::error(sprintf($this->lang->user->error->mail, $id)));
|
||||
if(empty($users[$id]['role'])) die(js::error(sprintf($this->lang->user->error->role, $id)));
|
||||
|
||||
$accounts[$id] = $account;
|
||||
$prev['dept'] = $users[$id]['dept'];
|
||||
$prev['role'] = $users[$id]['role'];
|
||||
}
|
||||
|
||||
foreach($users as $id => $user)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<th class='w-150px'><?php echo $lang->user->realname;?></th>
|
||||
<th class='w-150px'><?php echo $lang->user->role;?></th>
|
||||
<th><?php echo $lang->user->email;?></th>
|
||||
<th class='w-80px'><?php echo $lang->user->gender;?></th>
|
||||
<th class='w-60px'><?php echo $lang->user->gender;?></th>
|
||||
<th><?php echo $lang->user->password;?></th>
|
||||
</tr>
|
||||
<?php $depts = $depts + array('ditto' => $lang->user->ditto)?>
|
||||
@@ -32,17 +32,17 @@
|
||||
<tr class='a-center'>
|
||||
<td><?php echo $i+1;?></td>
|
||||
<td><?php echo html::select("dept[$i]", $depts, $i > 0 ? 'ditto' : $deptID, "class='select-2'");?>
|
||||
<td><?php echo html::input("account[$i]", '', "class='text-2' autocomplete='off'");?></td>
|
||||
<td><?php echo html::input("account[$i]", '', "class='text-2 account_$i' autocomplete='off' onchange='changeEmail($i)'");?></td>
|
||||
<td><?php echo html::input("realname[$i]", '', "class='text-2'");?></td>
|
||||
<td><?php echo html::select("role[$i]", $lang->user->roleList, $i > 0 ? 'ditto' : '', "class='select-2'");?></td>
|
||||
<td><?php echo html::input("email[$i]", '', "class='text-3'");?></td>
|
||||
<td><?php echo html::input("email[$i]", '', "class='text-3 email_$i' onchange='setDefaultEmail($i)'");?></td>
|
||||
<td><?php echo html::radio("gender[$i]", (array)$lang->user->genderList, 'm');?></td>
|
||||
<td>
|
||||
<?php
|
||||
echo html::input("password[$i]", '', "class='text-3' autocomplete='off'");
|
||||
echo "<input type='checkbox' name='ditto[$i]' " . ($i> 0 ? "checked" : '') . " />"
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
echo html::input("password[$i]", '', "class='text-3' autocomplete='off'");
|
||||
echo "<input type='checkbox' name='ditto[$i]' " . ($i> 0 ? "checked" : '') . " /> {$lang->user->ditto}";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endfor;?>
|
||||
<tr><td colspan='8' class='a-center'><?php echo html::submitButton() . html::resetButton();?></td></tr>
|
||||
|
||||
@@ -26,13 +26,15 @@
|
||||
<th><?php echo $lang->user->email;?></th>
|
||||
<th class='w-150px'><?php echo $lang->user->join;?></th>
|
||||
</tr>
|
||||
<?php $depts = $depts + array('ditto' => $lang->user->ditto)?>
|
||||
<?php $lang->user->roleList = $lang->user->roleList + array('ditto' => $lang->user->ditto)?>
|
||||
<?php foreach($users as $user):?>
|
||||
<tr class='a-center'>
|
||||
<td><?php echo $user->id;?></td>
|
||||
<td><?php echo html::select("dept[$user->id]", $depts, $user->dept, "class='select-2'");?>
|
||||
<td><?php echo html::select("dept[$user->id]", $depts, empty($user->dept) ? 'ditto' : $user->dept, "class='select-2'");?>
|
||||
<td><?php echo html::input("account[$user->id]", $user->account, "class='text-2' autocomplete='off'");?></td>
|
||||
<td><?php echo html::input("realname[$user->id]", $user->realname, "class='text-2'");?></td>
|
||||
<td><?php echo html::select("role[$user->id]", $lang->user->roleList, $user->role, "class='select-2'");?>
|
||||
<td><?php echo html::select("role[$user->id]", $lang->user->roleList, empty($user->role) ? 'ditto' : $user->role, "class='select-2'");?>
|
||||
<td><?php echo html::input("commiter[$user->id]", $user->commiter, "class='text-3'");?></td>
|
||||
<td><?php echo html::input("email[$user->id]", $user->email, "class='text-3'");?></td>
|
||||
<td><?php echo html::input("join[$user->id]", $user->join, "class='text-2 date'");?></td>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 57 KiB |
@@ -371,7 +371,7 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table
|
||||
.plan {background:#ffcc00;}
|
||||
.plan a{color:green}
|
||||
.search {display:block; float:left; clear:none; width:16px; height:16px; padding:0; margin:0 0 0 2px; text-indent:-2000px; overflow:hidden; background: url(images/main/search.gif) no-repeat;}
|
||||
.button-search{width:40px; height:27px; padding:0; margin:0px; text-indent:-2000px; background: url(images/main/searchButton.jpg) no-repeat;}
|
||||
.button-search{width:33px; height:24px; padding:0; margin:0px; text-indent:-2000px; background: url(images/main/zt-icons.png) -120px 24px;border-width:1px;}
|
||||
.searchleft{display:block; float:left; clear:none;}
|
||||
.helplink {font-size:9px}
|
||||
#bysearchTab a{color:red}
|
||||
@@ -535,5 +535,9 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table
|
||||
#featurebar .f-right .icon-green-todo-create {padding:2px 8px; background:url(images/main/zt-icons.png) 0px -202px;}
|
||||
#featurebar .f-right .icon-green-todo-batchCreate {padding:2px 8px; background:url(images/main/zt-icons.png) -20px -202px;}
|
||||
|
||||
.log-reverse{padding:2px 10px; background:url(images/main/log-reverse.png) center no-repeat}
|
||||
.switchDisplay{padding:2px 10px; background:url(images/main/switchdisplay.png) center no-repeat}
|
||||
.log-asc {padding:2px 6px; background:url(images/main/zt-icons.png) -2px 25px;}
|
||||
.log-desc {padding:2px 6px; background:url(images/main/zt-icons.png) -22px 25px;}
|
||||
.change-hide {padding:2px 8px; background:url(images/main/zt-icons.png) -42px 25px; border:0px;}
|
||||
.change-show {padding:2px 8px; background:url(images/main/zt-icons.png) -62px 25px; border:0px;}
|
||||
.diff-all {padding:2px 9px; background:url(images/main/zt-icons.png) -80px 25px; border:0px}
|
||||
.diff-short {padding:2px 9px; background:url(images/main/zt-icons.png) -100px 25px; border:0px}
|
||||
|
||||
Reference in New Issue
Block a user