Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
@@ -1075,6 +1075,7 @@ EOT;
|
||||
$jsLang = new stdclass();
|
||||
$jsLang->submitting = isset($lang->loading) ? $lang->loading : '';
|
||||
$jsLang->save = $jsConfig->save;
|
||||
$jsLang->expand = isset($lang->expand) ? $lang->expand : '';
|
||||
$jsLang->timeout = isset($lang->timeout) ? $lang->timeout : '';
|
||||
|
||||
$js = self::start(false);
|
||||
|
||||
@@ -82,7 +82,7 @@ $lang->install->iconvFail = '修改PHP配置文件,加载ICONV扩展。';
|
||||
$lang->install->tmpRoot = '临时文件目录';
|
||||
$lang->install->dataRoot = '上传文件目录';
|
||||
$lang->install->session = 'Session存储目录';
|
||||
$lang->install->sessionFail = '修改PHP配置文件,设置session.save_path';
|
||||
$lang->install->sessionFail = '修改PHP配置文件,设置session.save_path。<br />如果使用宝塔面板,可以到宝塔Web面板中“软件商店”,打开PHP设置,到“Session配置”项,选择files,点击保存。老版本需要修改php配置文件。';
|
||||
$lang->install->mkdirWin = '<p>需要创建目录%s。命令为:<br /> mkdir %s</p>';
|
||||
$lang->install->chmodWin = '需要修改目录 "%s" 的权限。';
|
||||
$lang->install->mkdirLinux = '<p>需要创建目录%s。<br /> 命令为:<br /> mkdir -p %s</p>';
|
||||
|
||||
@@ -2002,6 +2002,13 @@ class projectModel extends model
|
||||
{
|
||||
foreach($taskTeam as $taskID => $team) $tasks[$taskID]->team = $team;
|
||||
}
|
||||
|
||||
$parents = array();
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if($task->parent > 0) $parents[$task->parent] = $task->parent;
|
||||
}
|
||||
$parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id');
|
||||
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
@@ -2012,6 +2019,11 @@ class projectModel extends model
|
||||
$tasks[$task->parent]->children[$task->id] = $task;
|
||||
unset($tasks[$task->id]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$parent = $parents[$task->parent];
|
||||
$task->parentName = $parent->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->loadModel('task')->processTasks($tasks);
|
||||
|
||||
+15
-53
@@ -1655,41 +1655,9 @@ class taskModel extends model
|
||||
$parents = array();
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if($task->parent == -1) $parents[] = $task->id;
|
||||
}
|
||||
if(!empty($parents))
|
||||
{
|
||||
/* Select children task. */
|
||||
$children = $this->dao->select('DISTINCT t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName')
|
||||
->from(TABLE_TASK)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
|
||||
->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account')
|
||||
->leftJoin(TABLE_MODULE)->alias('t4')->on('t1.module = t4.id')
|
||||
->where('t1.parent')->in($parents)
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->beginIF($productID)->andWhere("((t4.root=" . (int)$productID . " and t4.type='story') OR t2.product=" . (int)$productID . ")")->fi()
|
||||
->beginIF($type == 'undone')->andWhere("(t1.status = 'wait' or t1.status ='doing')")->fi()
|
||||
->beginIF($type == 'needconfirm')->andWhere('t2.version > t1.storyVersion')->andWhere("t2.status = 'active'")->fi()
|
||||
->beginIF($type == 'assignedtome')->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi()
|
||||
->beginIF($type == 'finishedbyme')
|
||||
->andWhere('t1.finishedby', 1)->eq($this->app->user->account)
|
||||
->orWhere('t1.finishedList')->like("%,{$this->app->user->account},%")
|
||||
->markRight(1)
|
||||
->fi()
|
||||
->beginIF($type == 'delayed')->andWhere('t1.deadline')->gt('1970-1-1')->andWhere('t1.deadline')->lt(date(DT_DATE1))->andWhere('t1.status')->in('wait,doing')->fi()
|
||||
->beginIF(is_array($type) or strpos(',all,undone,needconfirm,assignedtome,delayed,finishedbyme,myinvolved,', ",$type,") === false)->andWhere('t1.status')->in($type)->fi()
|
||||
->beginIF($modules)->andWhere('t1.module')->in($modules)->fi()
|
||||
->orderBy("t1.$orderBy")
|
||||
->fetchAll('id');
|
||||
|
||||
if(!empty($children))
|
||||
{
|
||||
foreach($children as $child)
|
||||
{
|
||||
$tasks[$child->parent]->children[$child->id] = $child;
|
||||
}
|
||||
}
|
||||
if($task->parent > 0) $parents[$task->parent] = $task->parent;
|
||||
}
|
||||
$parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id');
|
||||
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
@@ -1700,6 +1668,11 @@ class taskModel extends model
|
||||
$tasks[$task->parent]->children[$task->id] = $task;
|
||||
unset($tasks[$task->id]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$parent = $parents[$task->parent];
|
||||
$task->parentName = $parent->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1842,26 +1815,9 @@ class taskModel extends model
|
||||
$parents = array();
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if($task->parent == -1) $parents[] = $task->id;
|
||||
}
|
||||
if(!empty($parents))
|
||||
{
|
||||
/* Select children task. */
|
||||
$children = $this->dao->select('id, parent, name, assignedTo, pri, status, estimate, consumed, closedReason, `left`')
|
||||
->from(TABLE_TASK)
|
||||
->where('story')->eq((int)$storyID)
|
||||
->andwhere('parent')->in($parents)
|
||||
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
|
||||
->fetchAll('id');
|
||||
|
||||
if(!empty($children))
|
||||
{
|
||||
foreach($children as $child)
|
||||
{
|
||||
$tasks[$child->parent]->children[$child->id] = $child;
|
||||
}
|
||||
}
|
||||
if($task->parent > 0) $parents[$task->parent] = $task->parent;
|
||||
}
|
||||
$parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id');
|
||||
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
@@ -1872,6 +1828,11 @@ class taskModel extends model
|
||||
$tasks[$task->parent]->children[$task->id] = $task;
|
||||
unset($tasks[$task->id]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$parent = $parents[$task->parent];
|
||||
$task->parentName = $parent->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2671,6 +2632,7 @@ class taskModel extends model
|
||||
echo "</span>";
|
||||
break;
|
||||
case 'name':
|
||||
if($task->parent > 0 and isset($task->parentName)) $task->name = "{$task->parentName} / {$task->name}";
|
||||
if(!empty($task->product) && isset($branchGroups[$task->product][$task->branch])) echo "<span class='label label-info label-outline'>" . $branchGroups[$task->product][$task->branch] . '</span> ';
|
||||
if(empty($task->children) and $task->module and isset($modulePairs[$task->module])) echo "<span class='label label-gray label-badge'>" . $modulePairs[$task->module] . '</span> ';
|
||||
if($task->parent > 0) echo '<span class="label label-badge label-light" title="' . $this->lang->task->children . '">' . $this->lang->task->childrenAB . '</span> ';
|
||||
|
||||
+11
-8
@@ -372,14 +372,17 @@ class user extends control
|
||||
*/
|
||||
public function setReferer($referer = '')
|
||||
{
|
||||
if(!empty($referer))
|
||||
{
|
||||
$this->referer = helper::safe64Decode($referer);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->referer = $this->server->http_referer ? $this->server->http_referer: '';
|
||||
}
|
||||
$this->referer = $this->server->http_referer ? $this->server->http_referer: '';
|
||||
if(!empty($referer)) $this->referer = helper::safe64Decode($referer);
|
||||
|
||||
/* Build zentao link regular. */
|
||||
$webRoot = $this->config->webRoot;
|
||||
$linkReg = $webRoot . 'index.php?' . $this->config->moduleVar . '=\w+&' . $this->config->methodVar . '=\w+';
|
||||
if($this->config->requestType == 'PATH_INFO') $linkReg = $webRoot . '\w+' . $this->config->requestFix . '\w+';
|
||||
$linkReg = str_replace(array('/', '.', '?', '-'), array('\/', '\.', '\?', '\-'), $linkReg);
|
||||
|
||||
/* Check zentao link by regular. */
|
||||
$this->referer = preg_match('/^' . $linkReg . '/', $this->referer) ? $this->referer : $webRoot;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,10 @@ $(document).ready(function()
|
||||
{
|
||||
var password = $('input:password').val().trim();
|
||||
var passwordStrength = computePasswordStrength(password);
|
||||
$('#submit').after("<input type='hidden' name='passwordStrength' value='" + passwordStrength + "'>");
|
||||
|
||||
if($('#loginPanel #passwordStrength').length == 0) $(this).after("<input type='hidden' name='passwordStrength' id='passwordStrength' value='0' />");
|
||||
$('#loginPanel #passwordStrength').val(passwordStrength);
|
||||
|
||||
var rand = $('input#verifyRand').val();
|
||||
if(password.length != 32 && typeof(md5) == 'function') $('input:password').val(md5(md5(password) + rand));
|
||||
});
|
||||
|
||||
+27
-6
@@ -91,17 +91,38 @@ function setFormAction(actionLink, hiddenwin, obj)
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setImageSize(image, maxWidth)
|
||||
function setImageSize(image, maxWidth, maxHeight)
|
||||
{
|
||||
var $image = $(image);
|
||||
if($image.parent().prop('tagName').toLowerCase() == 'a') return;
|
||||
|
||||
/* If not set maxWidth, set it auto. */
|
||||
if(!maxWidth)
|
||||
{
|
||||
bodyWidth = $('body').width();
|
||||
maxWidth = bodyWidth - 470; // The side bar's width is 336, and add some margins.
|
||||
}
|
||||
if(!maxHeight) maxHeight = $(window).height();
|
||||
|
||||
if($(image).width() > maxWidth) $(image).attr('width', maxWidth);
|
||||
$(image).wrap('<a href="' + $(image).attr('src') + '" target="_blank"></a>');
|
||||
setTimeout(function()
|
||||
{
|
||||
if($image.width() > maxWidth) $image.attr('width', maxWidth);
|
||||
$image.wrap('<a href="' + $image.attr('src') + '" style="display:block;position:relative;overflow:hidden;max-height:' + maxHeight + 'px" target="_blank"></a>');
|
||||
if($image.height() > maxHeight) $image.closest('a').append("<a href='###' class='showMoreImage' onclick='showMoreImage(this)'>" + lang.expand + " <i class='icon-angle-down'></i></a>");
|
||||
}, 50);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show more image when image is too height.
|
||||
*
|
||||
* @param obj $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function showMoreImage(obj)
|
||||
{
|
||||
$(obj).parents('a').css('max-height', 'none');
|
||||
$(obj).remove();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -734,10 +755,10 @@ function convertURL()
|
||||
|
||||
$('.article-content, .article>.content').each(function()
|
||||
{
|
||||
var aTags = [];
|
||||
var aTags = [];
|
||||
var iframeTags = [];
|
||||
var imgTags = [];
|
||||
var content = $(this).html();
|
||||
var imgTags = [];
|
||||
var content = $(this).html();
|
||||
$(this).find('a').each(function(i)
|
||||
{
|
||||
aTags[i] = $(this).prop('outerHTML');
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
#dropMenu.show-right-col .col-right>.list-group{width:250px;max-width:260px;}
|
||||
#dropMenu .col-footer{width:230px;}
|
||||
|
||||
.main-actions .btn-toolbar .divider {margin-right:8px !important; margin-left: 8px !important;}
|
||||
.main-actions .btn-toolbar .btn + .btn {margin-left: 8px !important;}
|
||||
|
||||
/* Pager v-align. */
|
||||
.pager>li>.pager-label { padding: 2px; line-height: 21px; }
|
||||
|
||||
@@ -33,3 +36,17 @@
|
||||
|
||||
.modal-title{font-size: 14px;}
|
||||
.fixed-footer .text {color: #fff;}
|
||||
|
||||
a.showMoreImage {
|
||||
display: block;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background: #888;
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
opacity: 0.7;
|
||||
text-align: center;
|
||||
color:red;
|
||||
}
|
||||
a.showMoreImage:hover{opacity: 1;}
|
||||
|
||||
Reference in New Issue
Block a user