Merge branch 'master' of github.com:easysoft/zentaopms
This commit is contained in:
@@ -96,7 +96,8 @@ class helper extends baseHelper
|
||||
if($position !== false) $toEncoding = substr($toEncoding, 0, $position);
|
||||
|
||||
/* Check string encoding. */
|
||||
$encoding = strtolower(mb_detect_encoding($string, mb_list_encodings()));
|
||||
$encodings = array_merge(array('GB2312','GBK','BIG5'), mb_list_encodings());
|
||||
$encoding = strtolower(mb_detect_encoding($string, $encodings));
|
||||
if($encoding == $toEncoding) return $string;
|
||||
return mb_convert_encoding($string, $toEncoding, $encoding);
|
||||
}
|
||||
|
||||
@@ -713,8 +713,20 @@ class block extends control
|
||||
$pager = pager::init(0, $num , 1);
|
||||
|
||||
$productStats = $this->loadModel('product')->getStats('order_desc', $this->viewType != 'json' ? $pager : '', $type);
|
||||
$projects = $this->loadModel('project')->getPairs();
|
||||
$productIdList = array();
|
||||
foreach($productStats as $product) $productIdList[] = $product->id;
|
||||
$this->loadModel('action');
|
||||
foreach($productStats as $product)
|
||||
{
|
||||
$currentProjectID = $this->dao->select('objectID')->from(TABLE_ACTION)
|
||||
->where('objectType')->eq('project')
|
||||
->andWhere('action')->eq('managed')
|
||||
->andWhere("CONCAT(extra, ',,')")->like("%$product->id,,")
|
||||
->orderBy('id_desc')
|
||||
->fetch('objectID');
|
||||
$product->currentProject = zget($projects, $currentProjectID, '');
|
||||
$productIdList[] = $product->id;
|
||||
}
|
||||
|
||||
$this->view->projects = $this->dao->select('t1.product,t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
<tr class='text-center' data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
|
||||
<td class='c-name text-left' title='<?php echo $product->name?>'><?php echo $product->name?></td>
|
||||
<?php if($longBlock):?>
|
||||
<?php $projectName = zget($projects, $product->id, '');?>
|
||||
<td class='c-name c-project text-left' title='<?php echo $projectName;?>'><?php echo zget($projects, $product->id, '');?></td>
|
||||
<?php $projectName = $product->currentProject ? $product->currentProject : zget($projects, $product->id, '');?>
|
||||
<td class='c-name c-project text-left' title='<?php echo $projectName;?>'><?php echo $projectName;?></td>
|
||||
<?php endif;?>
|
||||
<td class="c-num"><?php echo $product->plans?></td>
|
||||
<td class="c-num"><?php echo $product->releases?></td>
|
||||
|
||||
@@ -41,4 +41,6 @@ html[lang='en'] #deadlineTd .input-group-addon{padding: 5px 18px}
|
||||
#mainContent .center-block{padding-bottom:40px;}
|
||||
|
||||
#typeBox {width:180px;}
|
||||
#typeBox .required:after {right: 1px;}
|
||||
#osBox .required:after {right: 1px;}
|
||||
#osBox {width:190px;}
|
||||
|
||||
@@ -1716,6 +1716,8 @@ EOD;
|
||||
$user->admin = strpos($this->app->company->admins, ",{$user->account},") !== false;
|
||||
$this->session->set('user', $user);
|
||||
$this->app->user = $user;
|
||||
$this->loadModel('action')->create('user', $user->id, 'login');
|
||||
$this->loadModel('score')->create('user', 'login');
|
||||
|
||||
if($isFreepasswd) die(js::locate($this->config->webRoot));
|
||||
|
||||
|
||||
@@ -64,9 +64,10 @@
|
||||
<?php if(!empty($action->comment)):?>
|
||||
<?php if($canEditComment):?>
|
||||
<?php echo html::commonButton('<i class="icon icon-pencil"></i>', "title='{$lang->action->editComment}'", 'btn btn-link btn-icon btn-sm btn-edit-comment');?>
|
||||
<style>.comment .comment-content{width: 98%}</style>
|
||||
<?php endif;?>
|
||||
<div class='article-content comment'>
|
||||
<?php echo strip_tags($action->comment) == $action->comment ? nl2br($action->comment) : $action->comment;?>
|
||||
<div class='comment-content'><?php echo strip_tags($action->comment) == $action->comment ? nl2br($action->comment) : $action->comment;?></div>
|
||||
</div>
|
||||
<?php if($canEditComment):?>
|
||||
<form method='post' class='comment-edit-form' action='<?php echo $this->createLink('action', 'editComment', "actionID=$action->id")?>'>
|
||||
|
||||
@@ -41,7 +41,7 @@ class devModel extends model
|
||||
{
|
||||
if(isset($this->config->dev->tableMap[$module])) $aliasModule = $this->config->dev->tableMap[$module];
|
||||
if(strpos($aliasModule, '-') !== false) list($aliasModule, $subLang) = explode('-', $aliasModule);
|
||||
$this->app->loadLang($aliasModule ? $aliasModule : $module);
|
||||
if(strpos($module, 'im_') === false) $this->app->loadLang($aliasModule ? $aliasModule : $module);
|
||||
}
|
||||
catch(PDOException $e)
|
||||
{
|
||||
|
||||
@@ -566,7 +566,7 @@ class docModel extends model
|
||||
$doc->content = isset($docContent->content) ? $docContent->content : '';
|
||||
$doc->contentType = isset($docContent->type) ? $docContent->type : '';
|
||||
|
||||
$doc = $this->loadModel('file')->replaceImgURL($doc, 'content');
|
||||
if($doc->type != 'url') $doc = $this->loadModel('file')->replaceImgURL($doc, 'content');
|
||||
if($setImgSize) $doc->content = $this->file->setImgSize($doc->content);
|
||||
$doc->files = $docFiles;
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -66,7 +66,8 @@
|
||||
<i class="icon icon-flag text-primary"></i>
|
||||
<?php endif;?>
|
||||
<div class="block">
|
||||
<span class="title"><?php echo isset($roadmap->build) ? $roadmap->name : $roadmap->title;?></span>
|
||||
<?php $roadmapTitle = isset($roadmap->build) ? $roadmap->name : $roadmap->title;?>
|
||||
<span class="title" title='<?php echo $roadmapTitle;?>'><?php echo $roadmapTitle;?></span>
|
||||
<span class="date"><?php echo isset($roadmap->build) ? $roadmap->date : ($roadmap->end == '2030-01-01' ? $lang->productplan->future : $roadmap->begin . '~' . $roadmap->end);?></span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -1566,6 +1566,8 @@ class projectModel extends model
|
||||
$lastOrder = reset($linkedStories);
|
||||
foreach($stories as $key => $storyID)
|
||||
{
|
||||
$status = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch('status');
|
||||
if($status == 'draft') continue;
|
||||
if(isset($linkedStories[$storyID])) continue;
|
||||
|
||||
$productID = (int)$products[$storyID];
|
||||
|
||||
@@ -207,6 +207,7 @@ $lang->task->error->skipClose = 'Task: %s is not "Finished” or “Cance
|
||||
$lang->task->error->consumed = 'Task: %s hour must be < 0. Ignore changes to this task.';
|
||||
$lang->task->error->assignedTo = 'Multi-user task in the current status cannot be assigned to a member who is not in the task team.';
|
||||
$lang->task->error->consumedEmpty = '"Current Cost" should not be empty.';
|
||||
$lang->task->error->deadlineSmall = '"Deadline" must be greater than "StartDate".';
|
||||
|
||||
/* Report. */
|
||||
$lang->task->report = new stdclass();
|
||||
|
||||
@@ -207,6 +207,7 @@ $lang->task->error->skipClose = '任务:%s 不是“已完成”或“
|
||||
$lang->task->error->consumed = '任务:%s工时不能小于0,忽略该任务工时的改动';
|
||||
$lang->task->error->assignedTo = '当前状态的多人任务不能指派给任务团队外的成员。';
|
||||
$lang->task->error->consumedEmpty = '"本次消耗"不能为空';
|
||||
$lang->task->error->deadlineSmall = '"截止日期"必须大于"预计开始"';
|
||||
|
||||
/* Report. */
|
||||
$lang->task->report = new stdclass();
|
||||
|
||||
@@ -272,6 +272,12 @@ class taskModel extends model
|
||||
/* check data. */
|
||||
foreach($data as $i => $task)
|
||||
{
|
||||
|
||||
if($task->deadline != '0000-00-00' and $task->deadline <= $task->estStarted)
|
||||
{
|
||||
dao::$errors['message'][] = $this->lang->task->error->deadlineSmall;
|
||||
return false;
|
||||
}
|
||||
if($task->estimate and !preg_match("/^[0-9]+(.[0-9]{1,3})?$/", $task->estimate))
|
||||
{
|
||||
dao::$errors['message'][] = $this->lang->task->error->estimateNumber;
|
||||
@@ -413,6 +419,7 @@ class taskModel extends model
|
||||
if($parentID <= 0) return true;
|
||||
|
||||
$oldParentTask = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($parentID)->fetch();
|
||||
if($oldParentTask->parent != '-1') $this->dao->update(TABLE_TASK)->set('parent')->eq('-1')->where('id')->eq($parentID)->exec();
|
||||
$this->computeWorkingHours($parentID);
|
||||
|
||||
$childrenStatus = $this->dao->select('id,status')->from(TABLE_TASK)->where('parent')->eq($parentID)->andWhere('deleted')->eq(0)->fetchPairs('status', 'status');
|
||||
@@ -2760,7 +2767,7 @@ class taskModel extends model
|
||||
case 'actions':
|
||||
if($storyChanged)
|
||||
{
|
||||
common::printIcon('task', 'confirmStoryChange', "taskid=$task->id", '', 'list', '', 'hiddenwin', 'btn-wide');
|
||||
common::printIcon('task', 'confirmStoryChange', "taskid=$task->id", '', 'list', '', 'hiddenwin');
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1681,8 +1681,9 @@ class testcase extends control
|
||||
*/
|
||||
public function ajaxGetStatus($methodName, $caseID = 0)
|
||||
{
|
||||
$status = $this->testcase->getStatus($methodName, $caseID);
|
||||
|
||||
$case = $this->testcase->getByID($caseID);
|
||||
$status = $this->testcase->getStatus($methodName, $case);
|
||||
if($methodName == 'update') $status = zget($status, 1, '');
|
||||
die($status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1592,7 +1592,7 @@ class testcaseModel extends model
|
||||
return false;
|
||||
}
|
||||
|
||||
$status = $this->post->status;
|
||||
$status = $this->post->status ? $this->post->status : $case->status;
|
||||
$stepChanged = false;
|
||||
$steps = array();
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<?php if($viewType != 'story'):?>
|
||||
<style>
|
||||
li.tree-item-story > .tree-actions .tree-action[data-type=sort]{display:none;}
|
||||
li.tree-item-story > .tree-actions .tree-action[data-type=edit]{display:none;}
|
||||
li.tree-item-story > .tree-actions .tree-action[data-type=delete]{display:none;}
|
||||
</style>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -277,7 +277,7 @@ class userModel extends model
|
||||
if(!validater::checkAccount($users->account[$i])) 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' and empty($users->password[$i])) ? $prev['password'] : $users->password[$i];
|
||||
$users->password[$i] = (isset($prev['password']) and $users->ditto[$i] == 'on' and !$this->post->password[$i]) ? $prev['password'] : $this->post->password[$i];
|
||||
if(!validater::checkReg($users->password[$i], '|(.){6,}|')) die(js::error(sprintf($this->lang->user->error->password, $i + 1)));
|
||||
$role = $users->role[$i] == 'ditto' ? (isset($prev['role']) ? $prev['role'] : '') : $users->role[$i];
|
||||
|
||||
@@ -328,7 +328,7 @@ class userModel extends model
|
||||
$prev['dept'] = $data[$i]->dept;
|
||||
$prev['role'] = $data[$i]->role;
|
||||
$prev['group'] = $data[$i]->group;
|
||||
$prev['password'] = $users->password[$i];
|
||||
$prev['password'] = $this->post->password[$i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user