* finish task #6902 and merge xuanxuan.
This commit is contained in:
@@ -65,6 +65,7 @@ zentaoxx:
|
||||
cp -r xuan/xxb/module/im zentaoxx/module/
|
||||
cp -r xuan/xxb/module/client zentaoxx/module/
|
||||
cp -r xuan/xxb/module/license zentaoxx/module/
|
||||
cp -r xuan/xxb/module/owt zentaoxx/module/
|
||||
mkdir -p zentaoxx/module/common/view
|
||||
cp -r xuan/xxb/module/common/view/header.modal.html.php zentaoxx/module/common/view
|
||||
cp -r xuan/xxb/module/common/view/marked.html.php zentaoxx/module/common/view
|
||||
@@ -79,9 +80,6 @@ zentaoxx:
|
||||
cp -r xuan/xxb/module/action/ext zentaoxx/module/action
|
||||
cp -r xuan/xxb/config/ext/xxb.php zentaoxx/config/ext/
|
||||
cp -r xuan/xxb/config/ext/maps.php zentaoxx/config/ext/
|
||||
cp -r xuan/xxb/apischeme.json zentaoxx/
|
||||
cp $(XUANPATH)/xxb/config/ext/maps.php zentaoxx/config/ext/
|
||||
cp $(XUANPATH)/xxb/apischeme.json zentaoxx/
|
||||
cp -r xuanxuan/config/* zentaoxx/config/
|
||||
cp -r xuanxuan/module/* zentaoxx/module/
|
||||
cp -r xuanxuan/www/* zentaoxx/www/
|
||||
|
||||
@@ -122,14 +122,11 @@ $(function()
|
||||
})
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<?php $showedModal = false;?>
|
||||
<?php if(!empty($config->global->showAnnual) and empty($config->global->annualShowed)):?>
|
||||
<?php $this->app->loadLang('misc');?>
|
||||
var myModalTrigger = new $.zui.ModalTrigger({title:'<?php echo $lang->misc->showAnnual;?>', custom: function(){return <?php echo json_encode(sprintf($lang->misc->annualDesc, $this->createLink('report', 'annualData')));?>}});
|
||||
<?php $remind = $this->loadModel('misc')->getRemind();?>
|
||||
<?php if(!empty($remind)):?>
|
||||
var myModalTrigger = new $.zui.ModalTrigger({title:'<?php echo $lang->misc->remind;?>', custom: function(){return <?php echo json_encode($remind);?>}, width:'600px'});
|
||||
var result = myModalTrigger.show();
|
||||
$('#showAnnual').click(function(){myModalTrigger.close()});
|
||||
<?php $this->loadModel('setting')->setItem("{$this->app->user->account}.common.global.annualShowed", 1);?>
|
||||
<?php $showedModal = true;?>
|
||||
<?php endif;?>
|
||||
</script>
|
||||
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
|
||||
|
||||
@@ -72,6 +72,7 @@ $lang->misc->tableStatus = "状态";
|
||||
$lang->misc->novice = "您可能初次使用禅道,是否进入新手模式?";
|
||||
$lang->misc->showAnnual = '新增年度总结功能';
|
||||
$lang->misc->annualDesc = '12.0版本后,新增年度总结功能,可以到『统计->年度总结』页面查看。 是否现在<a href="%s" target="_blank" id="showAnnual" class="btn btn-mini btn-primary">查看</a>';
|
||||
$lang->misc->remind = '新功能提醒';
|
||||
|
||||
$lang->misc->noticeRepair = "<h5>普通用户请联系管理员进行修复</h5>
|
||||
<h5>管理员请登录禅道所在的服务器,创建<span>%s</span>文件。</h5>
|
||||
|
||||
@@ -42,4 +42,22 @@ class miscModel extends model
|
||||
}
|
||||
return $tables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get remind.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getRemind()
|
||||
{
|
||||
$remind = '';
|
||||
if(!empty($this->config->global->showAnnual) and empty($this->config->global->annualShowed))
|
||||
{
|
||||
$remind = '<h4>' . $this->lang->misc->showAnnual . '</h4>';
|
||||
$remind .= '<p>' . sprintf($this->lang->misc->annualDesc, helper::createLink('report', 'annualData')) . '</p>';
|
||||
$this->loadModel('setting')->setItem("{$this->app->user->account}.common.global.annualShowed", 1);
|
||||
}
|
||||
return $remind;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -986,6 +986,7 @@ class productModel extends model
|
||||
$totalEstimate = 0.0;
|
||||
$storyIdList = array();
|
||||
|
||||
$count = 0;
|
||||
foreach($stories as $key => $story)
|
||||
{
|
||||
$totalEstimate += $story->estimate;
|
||||
@@ -997,12 +998,28 @@ class productModel extends model
|
||||
{
|
||||
$storyIdList[] = $story->id;
|
||||
}
|
||||
|
||||
$count ++;
|
||||
if(!empty($story->children))
|
||||
{
|
||||
foreach($story->children as $child)
|
||||
{
|
||||
if(
|
||||
$child->status != 'closed' or
|
||||
($child->status == 'closed' and ($child->closedReason == 'done' or $child->closedReason == 'postponed'))
|
||||
)
|
||||
{
|
||||
$storyIdList[] = $child->id;
|
||||
}
|
||||
$count ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$cases = $this->dao->select('DISTINCT story')->from(TABLE_CASE)->where('story')->in($storyIdList)->andWhere('deleted')->eq(0)->fetchAll();
|
||||
$rate = count($stories) == 0 ? 0 : round(count($cases) / count($stories), 2);
|
||||
$rate = count($stories) == 0 ? 0 : round(count($cases) / $count, 2);
|
||||
|
||||
return sprintf($this->lang->product->storySummary, count($stories), $totalEstimate, $rate * 100 . "%");
|
||||
return sprintf($this->lang->product->storySummary, $count, $totalEstimate, $rate * 100 . "%");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -270,8 +270,11 @@ class productplan extends control
|
||||
foreach($order as $id)
|
||||
{
|
||||
if(empty($id)) continue;
|
||||
if(!isset($planStories[$id])) continue;
|
||||
$stories[$id] = $planStories[$id];
|
||||
unset($planStories[$id]);
|
||||
}
|
||||
if($planStories) $stories += $planStories;
|
||||
$planStories = $stories;
|
||||
unset($stories);
|
||||
}
|
||||
|
||||
@@ -2062,6 +2062,14 @@ class storyModel extends model
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get parent story pairs.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $append
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getParentStoryPairs($productID, $append = '')
|
||||
{
|
||||
$stories = $this->dao->select('id, title')->from(TABLE_STORY)
|
||||
|
||||
@@ -101,7 +101,6 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($stories as $storyID => $storyTitle):?>
|
||||
<?php if(empty($storyID) or isset($testStoryIdList[$storyID])) continue;?>
|
||||
<tr>
|
||||
@@ -123,30 +122,7 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i++;?>
|
||||
<?php if($i >= 5) break;?>
|
||||
<?php endforeach;?>
|
||||
<?php if($i == 0):?>
|
||||
<tr>
|
||||
<td><?php echo html::select("testStory[]", $stories, '', "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::select("testPri[]", $lang->task->priList, $task->pri, "class='form-control chosen'");?></td>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::input("testEstStarted[]", $task->estStarted, "class='form-control form-date' placeholder='{$lang->task->estStarted}'");?>
|
||||
<span class='input-group-addon fix-border'>~</span>
|
||||
<?php echo html::input("testDeadline[]", $task->deadline, "class='form-control form-date' placeholder='{$lang->task->deadline}'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td><?php echo html::select("testAssignedTo[]", $members, $task->assignedTo, "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::input("testEstimate[]", '', "class='form-control'");?></td>
|
||||
<td class='text-center'>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-sm" tabindex="-1" onclick='addItem(this)'><i class="icon icon-plus"></i></button>
|
||||
<button type="button" class="btn btn-sm" tabindex="-1" onclick='removeItem(this)'><i class="icon icon-close"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
@@ -568,6 +568,19 @@ class upgradeModel extends model
|
||||
$this->execSQL($this->getUpgradeFile('12.0.1'));
|
||||
$this->importRepoFromConfig();
|
||||
$this->appendExec('12_0_1');
|
||||
case '12_1':
|
||||
$this->saveLogs('Execute 12_1');
|
||||
|
||||
if(!isset($this->config->isINT) or !($this->config->isINT))
|
||||
{
|
||||
if(!$executeXuanxuan)
|
||||
{
|
||||
$xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan3.1.1.sql';
|
||||
$this->execSQL($xuanxuanSql);
|
||||
}
|
||||
}
|
||||
|
||||
$this->appendExec('12_1');
|
||||
}
|
||||
|
||||
$this->deletePatch();
|
||||
|
||||
@@ -4,3 +4,5 @@ $filter->default->get['display'] = 'code';
|
||||
$filter->entry = new stdclass();
|
||||
$filter->entry->visit = new stdclass();
|
||||
$filter->entry->visit->get['referer'] = 'reg::any';
|
||||
|
||||
$config->owt = new stdclass();
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<script>
|
||||
<?php
|
||||
$this->app->loadLang('im');
|
||||
$account = str_replace('.', '_', $this->app->user->account);
|
||||
$xxInstalled = $account . 'installed';
|
||||
?>
|
||||
<?php if(!$showedModal and isset($config->xxserver->installed) and $config->xuanxuan->turnon and !isset($config->xxclient->$xxInstalled) and $config->global->flow == 'full' ):?>
|
||||
var myModalTrigger = new $.zui.ModalTrigger({custom: '<?php echo $lang->im->xxClientConfirm;?>', title: '<?php echo $lang->im->zentaoClient;?>'});
|
||||
var result = myModalTrigger.show();
|
||||
<?php $this->loadModel('setting')->setItem("system.common.xxclient.{$account}installed", 1);?>
|
||||
<?php $showedModal = true;?>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if(!$showedModal and !isset($config->xxserver->noticed) and $this->app->user->admin and $config->global->flow == 'full' and $config->$module->block->initVersion >= '2'):?>
|
||||
var myModalTrigger = new $.zui.ModalTrigger({custom: '<?php echo $lang->im->xxServerConfirm;?>', title: '<?php echo $lang->im->zentaoClient;?>'});
|
||||
var result = myModalTrigger.show();
|
||||
<?php $this->loadModel('setting')->setItem("system.common.xxserver.noticed", 1);?>
|
||||
<?php endif;?>
|
||||
</script>
|
||||
|
||||
@@ -19,13 +19,13 @@ class xuanxuanMessage extends messageModel
|
||||
$server = $this->loadModel('im')->getServer('zentao');
|
||||
$onlybody = isset($_GET['onlybody']) ? $_GET['onlybody'] : '';
|
||||
unset($_GET['onlybody']);
|
||||
$url = $server . helper::createLink($objectType, 'view', "id=$objectID", 'html');
|
||||
$url = $server . helper::createLink($objectType, 'view', "id=$objectID", 'xhtml');
|
||||
|
||||
$target = '';
|
||||
if(!empty($object->assignedTo)) $target .= $object->assignedTo;
|
||||
if(!empty($object->mailto)) $target .= ",{$object->mailto}";
|
||||
$target = trim($target, ',');
|
||||
$target = $this->dao->select('id')->from(TABLE_USER)->where('account')->in($target)->fetchAll('id');
|
||||
$target = $this->dao->select('id')->from(TABLE_USER)->where('account')->in($target)->andWhere('account')->ne($this->app->user->account)->fetchAll('id');
|
||||
$target = array_keys($target);
|
||||
|
||||
if($target) $this->loadModel('im')->messageCreateNotify($target, $text, '', '', 'text', $url, array(), array('id' => 'zentao', 'realname' => $this->lang->message->sender, 'name' => $this->lang->message->sender));
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
public function getRemind()
|
||||
{
|
||||
$remind = parent::getRemind();
|
||||
|
||||
$this->app->loadLang('im');
|
||||
$account = str_replace('.', '_', $this->app->user->account);
|
||||
$xxInstalled = $account . 'installed';
|
||||
|
||||
if(isset($this->config->xxserver->installed) and $this->config->xuanxuan->turnon and !isset($this->config->xxclient->$xxInstalled) and $this->config->global->flow == 'full')
|
||||
{
|
||||
$remind .= '<h4>' . $this->lang->im->zentaoClient . '</h4>';
|
||||
$remind .= '<p>' . $this->lang->im->xxClientConfirm . '</p>';
|
||||
$this->loadModel('setting')->setItem("system.common.xxclient.{$account}installed", 1);
|
||||
}
|
||||
elseif(!isset($this->config->xxserver->noticed) and $this->app->user->admin and $this->config->global->flow == 'full' and $this->config->$module->block->initVersion >= '2')
|
||||
{
|
||||
$remind .= '<h4>' . $this->lang->im->zentaoClient . '</h4>';
|
||||
$remind .= '<p>' . $this->lang->im->xxServerConfirm . '</p>';
|
||||
$this->loadModel('setting')->setItem("system.common.xxserver.noticed", 1);
|
||||
}
|
||||
|
||||
return $remind;
|
||||
}
|
||||
Reference in New Issue
Block a user