Merge branch 'master' of https://git.zcorp.cc/zentaopms
This commit is contained in:
@@ -197,6 +197,8 @@ $lang->action->label->changestatus = '修改状态';
|
||||
$lang->action->label->marked = '编辑了';
|
||||
$lang->action->label->linked2project = "关联{$lang->executionCommon}";
|
||||
$lang->action->label->unlinkedfromproject = "移除{$lang->executionCommon}";
|
||||
$lang->action->label->linked2prj = "关联项目";
|
||||
$lang->action->label->unlinkedfromprj = "移除项目";
|
||||
$lang->action->label->unlinkedfrombuild = "移除版本";
|
||||
$lang->action->label->linked2release = "关联发布";
|
||||
$lang->action->label->unlinkedfromrelease = "移除发布";
|
||||
@@ -492,6 +494,8 @@ $lang->action->search->label['changestatus'] = $lang->action->label->chan
|
||||
$lang->action->search->label['marked'] = $lang->action->label->marked;
|
||||
$lang->action->search->label['linked2project'] = $lang->action->label->linked2project;
|
||||
$lang->action->search->label['unlinkedfromproject'] = $lang->action->label->unlinkedfromproject;
|
||||
$lang->action->search->label['linked2prj'] = $lang->action->label->linked2prj;
|
||||
$lang->action->search->label['unlinkedfromprj'] = $lang->action->label->unlinkedfromprj;
|
||||
$lang->action->search->label['started'] = $lang->action->label->started;
|
||||
$lang->action->search->label['restarted'] = $lang->action->label->restarted;
|
||||
$lang->action->search->label['recordestimate'] = $lang->action->label->recordestimate;
|
||||
|
||||
@@ -243,6 +243,12 @@ class actionModel extends model
|
||||
$name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name');
|
||||
if($name) $action->extra = common::hasPriv('project', 'story') ? html::a(helper::createLink('project', 'story', "projectID=$action->extra"), $name) : $name;
|
||||
}
|
||||
elseif($actionName == 'linked2prj')
|
||||
{
|
||||
$name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name');
|
||||
$productID = trim($action->product, ',');
|
||||
if($name) $action->extra = common::hasPriv('project', 'story') ? html::a(helper::createLink('projectstory', 'story', "productID=$productID"), $name) : $name;
|
||||
}
|
||||
elseif($actionName == 'linked2plan')
|
||||
{
|
||||
$title = $this->dao->select('title')->from(TABLE_PRODUCTPLAN)->where('id')->eq($action->extra)->fetch('title');
|
||||
@@ -277,6 +283,12 @@ class actionModel extends model
|
||||
$name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name');
|
||||
if($name) $action->extra = common::hasPriv('project', 'story') ? html::a(helper::createLink('project', 'story', "projectID=$action->extra"), "#$action->extra " . $name) : "#$action->extra " . $name;
|
||||
}
|
||||
elseif($actionName == 'unlinkedfromprj')
|
||||
{
|
||||
$name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name');
|
||||
$productID = trim($action->product, ',');
|
||||
if($name) $action->extra = common::hasPriv('project', 'story') ? html::a(helper::createLink('projectstory', 'story', "productID=$productID"), "#$action->extra " . $name) : "#$action->extra " . $name;
|
||||
}
|
||||
elseif($actionName == 'unlinkedfrombuild')
|
||||
{
|
||||
$name = $this->dao->select('name')->from(TABLE_BUILD)->where('id')->eq($action->extra)->fetch('name');
|
||||
|
||||
@@ -276,7 +276,9 @@ class commonModel extends model
|
||||
$isGuest = $app->user->account == 'guest';
|
||||
|
||||
echo "<a class='dropdown-toggle' data-toggle='dropdown'>";
|
||||
echo "<div class='avatar avatar bg-secondary avatar-circle'>" . strtoupper($app->user->account[0]) . "</div>\n";
|
||||
echo "<div class='avatar avatar bg-secondary avatar-circle'>";
|
||||
echo $app->user->avatar ? html::image($app->user->avatar) : strtoupper($app->user->account[0]);
|
||||
echo "</div>\n";
|
||||
echo '</a>';
|
||||
echo "<ul class='dropdown-menu pull-right'>";
|
||||
if(!$isGuest)
|
||||
@@ -284,7 +286,9 @@ class commonModel extends model
|
||||
$noRole = (!empty($app->user->role) && isset($lang->user->roleList[$app->user->role])) ? '' : ' no-role';
|
||||
echo '<li class="user-profile-item">';
|
||||
echo "<a href='" . helper::createLink('my', 'profile', '', '', true) . "' data-width='600' class='iframe $noRole'" . '>';
|
||||
echo "<div class='avatar avatar bg-secondary avatar-circle'>" . strtoupper($app->user->account[0]) . "</div>\n";
|
||||
echo "<div class='avatar avatar bg-secondary avatar-circle'>";
|
||||
echo $app->user->avatar ? html::image($app->user->avatar) : strtoupper($app->user->account[0]);
|
||||
echo "</div>\n";
|
||||
echo '<div class="user-profile-name">' . (empty($app->user->realname) ? $app->user->account : $app->user->realname) . '</div>';
|
||||
if(isset($lang->user->roleList[$app->user->role])) echo '<div class="user-profile-role">' . $lang->user->roleList[$app->user->role] . '</div>';
|
||||
echo '</a></li><li class="divider"></li>';
|
||||
|
||||
@@ -14,7 +14,18 @@
|
||||
<div id='mainContent'>
|
||||
<div class='cell'>
|
||||
<div class='main-header text-center'>
|
||||
<span class="avatar avatar bg-secondary avatar-circle">A</span>
|
||||
<span class="avatar avatar bg-secondary avatar-circle">
|
||||
<?php
|
||||
if($user->avatar)
|
||||
{
|
||||
echo html::image($app->user->avatar);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo strtoupper($app->user->account[0]);
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<span class='user-name'><strong><?php echo $user->realname;?></strong></span>
|
||||
<span class='user-role'><?php echo zget($lang->user->roleList, $user->role);?></span>
|
||||
<?php if(!isset($fromModule)):?>
|
||||
|
||||
@@ -2756,6 +2756,7 @@ class project extends control
|
||||
}
|
||||
$planStories = array_keys($planStory);
|
||||
$this->project->linkStory($projectID, $planStories, $planProducts);
|
||||
if($projectID != $this->session->PRJ) $this->project->linkStory($this->session->PRJ, $planStories, $planProducts);
|
||||
}
|
||||
|
||||
$moduleName = 'project';
|
||||
|
||||
@@ -1775,6 +1775,29 @@ class projectModel extends model
|
||||
$existedProducts[$productID] = true;
|
||||
}
|
||||
|
||||
/* Link the stories of the plans to the project. */
|
||||
foreach($plans as $productID => $planID)
|
||||
{
|
||||
$planStories = $planProducts = array();
|
||||
$planStory = $this->loadModel('story')->getPlanStories($planID);
|
||||
$count = 0;
|
||||
if(!empty($planStory))
|
||||
{
|
||||
foreach($planStory as $id => $story)
|
||||
{
|
||||
if($story->status == 'draft')
|
||||
{
|
||||
$count++;
|
||||
unset($planStory[$id]);
|
||||
continue;
|
||||
}
|
||||
$planProducts[$story->id] = $story->product;
|
||||
}
|
||||
$planStories = array_keys($planStory);
|
||||
$this->linkStory($projectID, $planStories, $planProducts);
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete the execution linked products that is not linked with the project. */
|
||||
$executions = $this->dao->select('id')->from(TABLE_PROJECT)->where('project')->eq((int)$projectID)->fetchPairs('id');
|
||||
$this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->in($executions)->andWhere('product')->notin($products)->exec();
|
||||
@@ -2080,6 +2103,26 @@ class projectModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* project link plan.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param int $planID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
// public function linkPlan($projectID, $planID)
|
||||
// {
|
||||
// $plan = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('id')->eq($planID)->fetch();
|
||||
//
|
||||
// $data = new stdclass();
|
||||
// $data->project = $projectID;
|
||||
// $data->product = $plan->product;
|
||||
// $data->branch = $plan->branch;
|
||||
// $data->plan = $plan->id;
|
||||
// $this->dao->replace(TABLE_PROJECTPRODUCT)->data($data)->exec();
|
||||
// }
|
||||
|
||||
/**
|
||||
* Link story.
|
||||
*
|
||||
@@ -2115,7 +2158,8 @@ class projectModel extends model
|
||||
$data->order = ++$lastOrder;
|
||||
$this->dao->insert(TABLE_PROJECTSTORY)->data($data)->exec();
|
||||
$this->story->setStage($storyID);
|
||||
$this->action->create('story', $storyID, 'linked2project', '', $projectID);
|
||||
$action = $projectID == $this->session->PRJ ? 'linked2prj' : 'linked2project';
|
||||
$this->action->create('story', $storyID, $action, '', $projectID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -134,6 +134,12 @@ class story extends control
|
||||
}
|
||||
$actionID = $this->action->create('story', $storyID, $action, '', $extra);
|
||||
|
||||
if($projectID != 0)
|
||||
{
|
||||
if($projectID != $this->session->PRJ) $this->loadModel('action')->create('story', $storyID, 'linked2project', '', $projectID);
|
||||
$this->loadModel('action')->create('story', $storyID, 'linked2prj', '', $this->session->PRJ);
|
||||
}
|
||||
|
||||
if($todoID > 0)
|
||||
{
|
||||
$this->dao->update(TABLE_TODO)->set('status')->eq('done')->where('id')->eq($todoID)->exec();
|
||||
@@ -169,7 +175,7 @@ class story extends control
|
||||
setcookie('storyModuleParam', 0, 0, $this->config->webRoot, '', false, true);
|
||||
$project = $this->dao->findById((int)$projectID)->from(TABLE_PROJECT)->fetch();
|
||||
$moduleName = $project->type == 'project' ? 'projectstory' : 'project';
|
||||
$param = $project->type == 'project' ? "PRJ=$projectID" : "projectID=$projectID&orderBy=id_desc&browseType=unclosed";
|
||||
$param = $project->type == 'project' ? "productID=$productID" : "projectID=$projectID&orderBy=id_desc&browseType=unclosed";
|
||||
$response['locate'] = $this->createLink($moduleName, 'story', $param);
|
||||
}
|
||||
if($this->app->getViewType() == 'xhtml') $response['locate'] = $this->createLink('story', 'view', "storyID=$storyID");
|
||||
@@ -371,11 +377,7 @@ class story extends control
|
||||
|
||||
$stories = array();
|
||||
foreach($mails as $mail) $stories[] = $mail->storyID;
|
||||
if($project)
|
||||
{
|
||||
$this->loadModel('project')->linkStory($project, $stories);
|
||||
if($project != $this->session->PRJ) $this->loadModel('project')->linkStory($this->session->PRJ, $stories);
|
||||
}
|
||||
if($project) $this->loadModel('project')->linkStory($project, $stories);
|
||||
|
||||
/* If storyID not equal zero, subdivide this story to child stories and close it. */
|
||||
if($storyID and !empty($mails))
|
||||
|
||||
@@ -279,6 +279,8 @@ $lang->story->action->linked2plan = array('main' => '$date, 由 <strong>
|
||||
$lang->story->action->unlinkedfromplan = array('main' => '$date, 由 <strong>$actor</strong> 从计划 <strong>$extra</strong> 移除。');
|
||||
$lang->story->action->linked2project = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
|
||||
$lang->story->action->unlinkedfromproject = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
|
||||
$lang->story->action->linked2prj = array('main' => '$date, 由 <strong>$actor</strong> 关联到项目 <strong>$extra</strong>。');
|
||||
$lang->story->action->unlinkedfromprj = array('main' => '$date, 由 <strong>$actor</strong> 从项目 <strong>$extra</strong> 移除。');
|
||||
$lang->story->action->linked2build = array('main' => '$date, 由 <strong>$actor</strong> 关联到版本 <strong>$extra</strong>。');
|
||||
$lang->story->action->unlinkedfrombuild = array('main' => '$date, 由 <strong>$actor</strong> 从版本 <strong>$extra</strong> 移除。');
|
||||
$lang->story->action->linked2release = array('main' => '$date, 由 <strong>$actor</strong> 关联到发布 <strong>$extra</strong>。');
|
||||
|
||||
@@ -244,11 +244,7 @@ class storyModel extends model
|
||||
$this->dao->insert(TABLE_STORYSPEC)->data($data)->exec();
|
||||
|
||||
/* Project or execution linked story. */
|
||||
if($projectID != 0 and $story->status != 'draft')
|
||||
{
|
||||
$this->linkStory($projectID, $this->post->product, $storyID);
|
||||
if($projectID != $this->session->PRJ) $this->linkStory($this->session->PRJ, $this->post->product, $storyID);
|
||||
}
|
||||
if($projectID != 0 and $story->status != 'draft') $this->linkStory($projectID, $this->post->product, $storyID);
|
||||
|
||||
if(is_array($this->post->URS))
|
||||
{
|
||||
@@ -325,7 +321,7 @@ class storyModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a batch stories.
|
||||
* Batch create stories.
|
||||
*
|
||||
* @access public
|
||||
* @return int|bool the id of the created story or false when error.
|
||||
|
||||
@@ -11,31 +11,41 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="img-cutter fixed-ratio" id="imgCutter" style="max-width: 100%">
|
||||
<div class="canvas">
|
||||
<?php
|
||||
if(empty($user->avatar))
|
||||
{
|
||||
echo html::image($image->webPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::image($user->avatar);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<h5 id='avatarCropTip'><?php echo $lang->user->cropAvatarTip;?></h5>
|
||||
<div class="img-cutter-preview"></div>
|
||||
<button type="button" class="btn btn-primary img-cutter-submit"><?php echo $lang->save;?></button> <?php echo html::a(inlink('profile'), $lang->goback, "class='btn loadInModal'");?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script> /*! TangBin: image.ready.js http://www.planeart.cn/?p=1121 */ !function(n){"use strict";n.zui.imgReady=function(){var n=[],l=null,e=function(){for(var l=0;l<n.length;l++)n[l].end?n.splice(l--,1):n[l]();!n.length&&o()},o=function(){clearInterval(l),l=null};return function(o,r,t,u){var c,i,a,d,f,h=new Image;return h.src=o,h.complete?(r.call(h),void(t&&t.call(h))):(i=h.width,a=h.height,h.onerror=function(){u&&u.call(h),c.end=!0,h=h.onload=h.onerror=null},c=function(){d=h.width,f=h.height,(d!==i||f!==a||d*f>1024)&&(r.call(h),c.end=!0)},c(),h.onload=function(){!c.end&&c(),t&&t.call(h),h=h.onload=h.onerror=null},void(c.end||(n.push(c),null===l&&(l=setInterval(e,40)))))}}()}(jQuery); </script>
|
||||
<?php js::import($this->app->getWebRoot() . 'js/zui/imgcutter/min.js');?>
|
||||
<?php css::import($this->app->getWebRoot() . 'js/zui/imgcutter/min.css');?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->user->cropAvatar;?></h2>
|
||||
</div>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="img-cutter fixed-ratio" id="imgCutter" style="max-width: 100%">
|
||||
<div class="canvas">
|
||||
<?php
|
||||
if(empty($user->avatar))
|
||||
{
|
||||
echo html::image($image->webPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::image($user->avatar);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<h5 id='avatarCropTip'><?php echo $lang->user->cropAvatarTip;?></h5>
|
||||
<div class="img-cutter-preview"></div>
|
||||
<button type="button" class="btn btn-primary img-cutter-submit"><?php echo $lang->save;?></button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var $imgCutter = $("#imgCutter");
|
||||
$imgCutter.imgCutter(
|
||||
@@ -44,12 +54,12 @@ $imgCutter.imgCutter(
|
||||
minWidth: 48,
|
||||
minHeight: 48,
|
||||
post: '<?php echo inlink('cropavatar', "image={$image->id}")?>',
|
||||
ready: function() {$.zui.ajustModalPosition(); $imgCutter.css('width', $imgCutter.closest('.modal-dialog').width() - 50);},
|
||||
ready: function() {$.zui.ajustModalPosition(); $imgCutter.css('width', $imgCutter.closest('#mainContent').width());},
|
||||
done: function(response)
|
||||
{
|
||||
$('#start .avatar, #startMenu .avatar').html('<img src="<?php echo $user->avatar?>?v=' + $.zui.uuid() + '" />');
|
||||
if($('#start .avatar, #startMenu .avatar').hasClass('with-text')) $('#start .avatar, #startMenu .avatar').toggleClass('with-text').css('background', 'none');
|
||||
$('#ajaxModal').load(createLink('user', 'profile'), function(){$.zui.ajustModalPosition()});
|
||||
location.href = createLink('my', 'profile');
|
||||
},
|
||||
onSizeError: function(size)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user