Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
@@ -1016,9 +1016,9 @@ class block extends control
|
||||
->orderBy($orderBy)
|
||||
->fetchAll('id');
|
||||
|
||||
$testedBuilds = $this->dao->select('build')->from(TABLE_TESTTASK)->where('product')->in(array_keys($products))->fetchPairs();
|
||||
$builds = $this->dao->select('id, product, name, bugs')->from(TABLE_BUILD)->where('id')->in($testedBuilds)->fetchGroup('product', 'id');
|
||||
$openedBugs = $this->dao->select('id, openedBuild')->from(TABLE_BUG)->where('openedBuild')->in($testedBuilds)->fetchGroup('openedBuild', 'id');
|
||||
$testedBuilds = $this->dao->select('build')->from(TABLE_TESTTASK)->where('product')->in(array_keys($products))->andWhere('project')->ne(0)->andWhere('deleted')->eq(0)->fetchPairs();
|
||||
$builds = $this->dao->select('id, product, name, bugs')->from(TABLE_BUILD)->where('id')->in($testedBuilds)->andWhere('deleted')->eq(0)->fetchGroup('product', 'id');
|
||||
$openedBugs = $this->dao->select('id, openedBuild')->from(TABLE_BUG)->where('openedBuild')->in($testedBuilds)->andWhere('deleted')->eq(0)->fetchGroup('openedBuild', 'id');
|
||||
|
||||
/* Get bugs. */
|
||||
$bugIDList = array();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<?php echo html::checkbox('fields', $customFields, $showFields);?>
|
||||
</div>
|
||||
<div>
|
||||
<?php echo html::submitButton($lang->save);?>
|
||||
<button type="submit" class="btn btn-primary" data-loading="<?php echo $lang->submitting;?>"><?php echo $lang->save;?></button>
|
||||
<?php echo html::commonButton($lang->cancel, '', "btn close-dropdown");?>
|
||||
<?php echo html::a($customLink, $lang->restore, 'hiddenwin', "class='btn'");?>
|
||||
</div>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<th class='w-60px<?php echo zget($visibleFields, 'estimate', ' hidden') . zget($requiredFields, 'estimate', '', ' required');?>'><?php echo $lang->task->estimateAB;?></th>
|
||||
<th class='w-100px<?php echo zget($visibleFields, 'estStarted', ' hidden') . zget($requiredFields, 'estStarted', '', ' required');?>'><?php echo $lang->task->estStarted;?></th>
|
||||
<th class='w-100px<?php echo zget($visibleFields, 'deadline', ' hidden') . zget($requiredFields, 'deadline', '', ' required');?>'><?php echo $lang->task->deadline;?></th>
|
||||
<th class='w-100px<?php echo zget($visibleFields, 'desc', ' hidden') . zget($requiredFields, 'desc', '', ' required');?>'><?php echo $lang->task->desc;?></th>
|
||||
<th class='w-200px<?php echo zget($visibleFields, 'desc', ' hidden') . zget($requiredFields, 'desc', '', ' required');?>'><?php echo $lang->task->desc;?></th>
|
||||
<th class='w-80px<?php echo zget($visibleFields, 'pri', ' hidden') . zget($requiredFields, 'pri', '', ' required');?>'><?php echo $lang->task->pri;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
+11
-2
@@ -1487,8 +1487,9 @@ class treeModel extends model
|
||||
|
||||
if($this->isMergeModule($rootID, $viewType) and $viewType != 'task') $viewType .= ',story';
|
||||
|
||||
$existsModules = $this->dao->select('id,branch,name')->from(TABLE_MODULE)->where('root')->eq($rootID)->andWhere('type')->in($viewType)->andWhere('parent')->eq($parentModuleID)->andWhere('branch')->in($branches)->andWhere('deleted')->eq(0)->fetchAll();
|
||||
$repeatName = '';
|
||||
$existsModules = $this->dao->select('id,branch,name')->from(TABLE_MODULE)->where('root')->eq($rootID)->andWhere('type')->in($viewType)->andWhere('parent')->eq($parentModuleID)->andWhere('branch')->in($branches)->andWhere('deleted')->eq(0)->fetchAll();
|
||||
$checkedModules = ',';
|
||||
$repeatName = '';
|
||||
foreach($modules as $id => $name)
|
||||
{
|
||||
$existed = false;
|
||||
@@ -1497,6 +1498,13 @@ class treeModel extends model
|
||||
$existed = true;
|
||||
$moduleID = substr($id, 2);
|
||||
}
|
||||
|
||||
if(strpos($checkedModules, ",$name,") !== false)
|
||||
{
|
||||
$repeatName = $name;
|
||||
break;
|
||||
}
|
||||
|
||||
foreach($existsModules as $existsModule)
|
||||
{
|
||||
if($name == $existsModule->name and (!$existed or $moduleID != $existsModule->id) and (!isset($branches[$id]) or $branches[$id] == $existsModule->branch))
|
||||
@@ -1505,6 +1513,7 @@ class treeModel extends model
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
$checkedModules .= "$name,";
|
||||
}
|
||||
if($repeatName) die(js::alert(sprintf($this->lang->tree->repeatName, $repeatName)));
|
||||
return true;
|
||||
|
||||
@@ -694,6 +694,7 @@ class user extends control
|
||||
if($this->post->password) $password = $this->post->password;
|
||||
if($this->get->password) $password = $this->get->password;
|
||||
|
||||
$account = trim($account);
|
||||
if($this->user->checkLocked($account))
|
||||
{
|
||||
$failReason = sprintf($this->lang->user->loginLocked, $this->config->user->lockMinutes);
|
||||
|
||||
@@ -10,7 +10,7 @@ $(document).ready(function()
|
||||
{
|
||||
$('#verifyPassword').closest('form').find('#submit').click(function()
|
||||
{
|
||||
var password = $('input#verifyPassword').val();
|
||||
var password = $('input#verifyPassword').val().trim();
|
||||
var rand = $('input#verifyRand').val();
|
||||
$('input#verifyPassword').val(md5(md5(password) + rand));
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ $(document).ready(function()
|
||||
|
||||
$('#loginPanel #submit').click(function()
|
||||
{
|
||||
var password = $('input:password').val();
|
||||
var password = $('input:password').val().trim();
|
||||
var rand = $('input#verifyRand').val();
|
||||
if(password.length != 32 && typeof(md5) == 'function') $('input:password').val(md5(md5(password) + rand));
|
||||
});
|
||||
|
||||
+18
-11
@@ -206,6 +206,7 @@ class userModel extends model
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$_POST['account'] = trim($_POST['account']);
|
||||
if(!$this->checkPassword()) return;
|
||||
if(strtolower($_POST['account']) == 'guest') return false;
|
||||
|
||||
@@ -236,17 +237,18 @@ class userModel extends model
|
||||
->check('account', 'account')
|
||||
->checkIF($this->post->email != '', 'email', 'email')
|
||||
->exec();
|
||||
if($this->post->group)
|
||||
{
|
||||
$data = new stdClass();
|
||||
$data->account = $this->post->account;
|
||||
$data->group = $this->post->group;
|
||||
$this->dao->insert(TABLE_USERGROUP)->data($data)->exec();
|
||||
}
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
$this->loadModel('action')->create('user', $user->id, 'create');
|
||||
$userID = $this->dao->lastInsertID();
|
||||
if($this->post->group)
|
||||
{
|
||||
$data = new stdClass();
|
||||
$data->account = $this->post->account;
|
||||
$data->group = $this->post->group;
|
||||
$this->dao->insert(TABLE_USERGROUP)->data($data)->exec();
|
||||
}
|
||||
|
||||
$this->loadModel('action')->create('user', $userID, 'Created');
|
||||
$this->loadModel('mail');
|
||||
if($this->config->mail->mta == 'sendcloud' and !empty($user->email)) $this->mail->syncSendCloud('sync', $user->email, $user->realname);
|
||||
}
|
||||
@@ -268,6 +270,7 @@ class userModel extends model
|
||||
$accounts = array();
|
||||
for($i = 0; $i < $this->config->user->batchCreate; $i++)
|
||||
{
|
||||
$users->account[$i] = trim($users->account[$i]);
|
||||
if($users->account[$i] != '')
|
||||
{
|
||||
if(strtolower($users->account[$i]) == 'guest') die(js::error(sprintf($this->lang->user->error->reserved, $i+1)));
|
||||
@@ -289,7 +292,7 @@ class userModel extends model
|
||||
$data[$i]->group = $users->group[$i] == 'ditto' ? (isset($prev['group']) ? $prev['group'] : '') : $users->group[$i];
|
||||
$data[$i]->email = $users->email[$i];
|
||||
$data[$i]->gender = $users->gender[$i];
|
||||
$data[$i]->password = md5($users->password[$i]);
|
||||
$data[$i]->password = md5(trim($users->password[$i]));
|
||||
$data[$i]->commiter = $users->commiter[$i];
|
||||
$data[$i]->join = empty($users->join[$i]) ? '0000-00-00' : ($users->join[$i]);
|
||||
$data[$i]->skype = $users->skype[$i];
|
||||
@@ -356,6 +359,7 @@ class userModel extends model
|
||||
*/
|
||||
public function update($userID)
|
||||
{
|
||||
$_POST['account'] = trim($_POST['account']);
|
||||
if(!$this->checkPassword(true)) return;
|
||||
|
||||
$oldUser = $this->getById($userID, 'id');
|
||||
@@ -457,7 +461,7 @@ class userModel extends model
|
||||
$accounts = array();
|
||||
foreach($data->account as $id => $account)
|
||||
{
|
||||
$users[$id]['account'] = $account;
|
||||
$users[$id]['account'] = trim($account);
|
||||
$users[$id]['realname'] = $data->realname[$id];
|
||||
$users[$id]['commiter'] = $data->commiter[$id];
|
||||
$users[$id]['email'] = $data->email[$id];
|
||||
@@ -570,6 +574,7 @@ class userModel extends model
|
||||
*/
|
||||
public function resetPassword()
|
||||
{
|
||||
$_POST['account'] = trim($_POST['account']);
|
||||
if(!$this->checkPassword()) return;
|
||||
|
||||
$user = $this->getById($this->post->account);
|
||||
@@ -594,6 +599,8 @@ class userModel extends model
|
||||
*/
|
||||
public function checkPassword($canNoPassword = false)
|
||||
{
|
||||
$_POST['password1'] = trim($_POST['password1']);
|
||||
$_POST['password2'] = trim($_POST['password2']);
|
||||
if(!$canNoPassword and empty($_POST['password1'])) dao::$errors['password'][] = sprintf($this->lang->error->notempty, $this->lang->user->password);
|
||||
if($this->post->password1 != false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user