* Merge sql.
This commit is contained in:
@@ -396,12 +396,12 @@ class custom extends control
|
||||
}
|
||||
|
||||
/**
|
||||
* Set story concept.
|
||||
* Browse story concept.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setStoryConcept()
|
||||
public function browseStoryConcept()
|
||||
{
|
||||
/* Process menu.*/
|
||||
$this->app->loadLang('custom');
|
||||
@@ -411,13 +411,28 @@ class custom extends control
|
||||
$key = array_search('custom', $this->lang->noMenuModule);
|
||||
unset($this->lang->noMenuModule[$key]);
|
||||
|
||||
$this->view->title = $this->lang->custom->browseStoryConcept;
|
||||
$this->view->position[] = $this->lang->custom->browseStoryConcept;
|
||||
$this->view->URSRList = $this->custom->getURSRList();
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set story concept.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setStoryConcept()
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$result = $this->custom->setURAndSR();
|
||||
if(!$result) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->URSREmpty));
|
||||
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('custom', 'setstoryconcept')));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->custom->setStoryConcept;
|
||||
@@ -426,6 +441,24 @@ class custom extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete story concept.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteStoryConcept($key = 0)
|
||||
{
|
||||
$lang = $this->app->getClientLang();
|
||||
$this->dao->delete()->from(TABLE_LANG)
|
||||
->where('lang')->eq($lang)
|
||||
->andWhere('section')->eq('URSRList')
|
||||
->andWhere('`key`')->eq($key)
|
||||
->exec();
|
||||
|
||||
die(js::reload('parent.parent'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure scrum.
|
||||
*
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
$(function()
|
||||
{
|
||||
$('[name^="URSRCustom"]').change(function()
|
||||
{
|
||||
if($(this).attr('checked'))
|
||||
{
|
||||
$('#customURSR').removeClass('hidden');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#customURSR').addClass('hidden');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -39,7 +39,11 @@ $lang->custom->epic = "史诗";
|
||||
$lang->custom->scrumStory = "故事";
|
||||
$lang->custom->waterfallCommon = "瀑布";
|
||||
$lang->custom->setStoryConcept = "设置需求概念";
|
||||
$lang->custom->browseStoryConcept = "需求概念列表";
|
||||
$lang->custom->deleteStoryConcept = "删除需求概念";
|
||||
$lang->custom->configureScrum = "敏捷模型自定义";
|
||||
$lang->custom->URConcept = "用需概念";
|
||||
$lang->custom->SRConcept = "软需概念";
|
||||
|
||||
$lang->custom->object['program'] = '项目';
|
||||
$lang->custom->program->fields['unitList'] = '预算单位';
|
||||
@@ -218,9 +222,6 @@ $lang->custom->conceptOptions->hourPoint['0'] = '故事点';
|
||||
$lang->custom->conceptOptions->hourPoint['1'] = '功能点';
|
||||
$lang->custom->conceptOptions->hourPoint['2'] = '代码行';
|
||||
|
||||
$lang->custom->waterfall = new stdclass();
|
||||
$lang->custom->waterfall->URSRName = '默认需求概念组合';
|
||||
|
||||
$lang->custom->scrum = new stdclass();
|
||||
$lang->custom->scrum->setConcept = '设置项目概念';
|
||||
|
||||
|
||||
+59
-20
@@ -468,6 +468,47 @@ class customModel extends model
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get UR and SR pairs.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getURSRPairs()
|
||||
{
|
||||
$this->app->loadLang('custom');
|
||||
|
||||
$URSRPairs = array();
|
||||
foreach($this->lang->custom->URSRList as $key => $content)
|
||||
{
|
||||
$content = json_decode($content);
|
||||
$URSRPairs[$key] = $content->SRName . '/' . $content->URName;
|
||||
}
|
||||
|
||||
return $URSRPairs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get UR and SR list.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getURSRList()
|
||||
{
|
||||
$this->app->loadLang('custom');
|
||||
|
||||
$URSRList = array();
|
||||
foreach($this->lang->custom->URSRList as $key => $content)
|
||||
{
|
||||
$content = json_decode($content);
|
||||
$URSRList[$key]['SRName'] = $content->SRName;
|
||||
$URSRList[$key]['URName'] = $content->URName;
|
||||
}
|
||||
|
||||
return $URSRList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save required fields.
|
||||
*
|
||||
@@ -572,34 +613,32 @@ class customModel extends model
|
||||
*/
|
||||
public function setURAndSR()
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
$lang = $this->app->getClientLang();
|
||||
$data = fixer::input('post')->get();
|
||||
$lang = $this->app->getClientLang();
|
||||
$maxKey = $this->dao->select('max(`key`) as maxKey')->from(TABLE_LANG)
|
||||
->where('section')->eq('URSRList')
|
||||
->andWhere('module')->eq('custom')
|
||||
->andWhere('lang')->eq($lang)
|
||||
->fetch('maxKey');
|
||||
$maxKey = $maxKey ? $maxKey : 1;
|
||||
|
||||
|
||||
/* If has custom UR and SR name. */
|
||||
$newKey = '';
|
||||
if(isset($data->URSRCustom))
|
||||
foreach($data->URName as $key => $URName)
|
||||
{
|
||||
if(!$data->URName || !$data->SRName) return false;
|
||||
$SRName = zget($data->SRName, $key, '');
|
||||
if(!$URName || !$SRName) continue;
|
||||
|
||||
$newKey = max(array_keys($this->lang->custom->URSRList)) + 1;
|
||||
$URSRName = $data->URName . '/' . $data->SRName;
|
||||
$URSRList = new stdclass();
|
||||
$URSRList->SRName = $SRName;
|
||||
$URSRList->URName = $URName;
|
||||
|
||||
/* Delete old lang data, and add new. */
|
||||
$this->lang->custom->URSRList[$newKey] = $URSRName;
|
||||
$this->lang->custom->URList[$newKey] = $data->URName;
|
||||
$this->lang->custom->SRList[$newKey] = $data->SRName;
|
||||
$this->deleteItems("lang=$lang&module=custom§ion=URSRList");
|
||||
$this->deleteItems("lang=$lang&module=custom§ion=URList");
|
||||
$this->deleteItems("lang=$lang&module=custom§ion=SRList");
|
||||
$value = json_encode($URSRList);
|
||||
$maxKey += 1;
|
||||
|
||||
foreach($this->lang->custom->URSRList as $key => $value) $this->setItem("$lang.custom.URSRList.{$key}.1", $value);
|
||||
foreach($this->lang->custom->URList as $key => $value) $this->setItem("$lang.custom.URList.{$key}.1", $value);
|
||||
foreach($this->lang->custom->SRList as $key => $value) $this->setItem("$lang.custom.SRList.{$key}.1", $value);
|
||||
$this->setItem("$lang.custom.URSRList.{$maxKey}.1", $value);
|
||||
}
|
||||
|
||||
$URSRName = $newKey ? $newKey : $data->URSRCommon;
|
||||
$this->loadModel('setting')->setItem("system.custom.URSRName", $URSRName);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* The html template file of setstoryconcept method of user module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2020 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Guangming Sun<sunguangming@cnezsoft.com>
|
||||
* @package ZenTaoPMS
|
||||
* @version $Id: browsestoryconcept.html.php 4129 2020-09-01 01:58:14Z sgm $
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='pull-right'>
|
||||
<?php if(common::hasPriv('custom', 'setstoryconcept')) echo html::a($this->createLink('custom', 'setstoryconcept', '', '', true), $lang->custom->setStoryConcept, '', "class='btn btn-primary iframe' data-toggle='modal'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content main-table'>
|
||||
<table class='table table-form mw-800px'>
|
||||
<tr>
|
||||
<th class='text-left'><?php echo $lang->custom->URConcept;?> </th>
|
||||
<th class='text-left'><?php echo $lang->custom->SRConcept;?> </th>
|
||||
<th class='w-60px text-left'><?php echo $lang->actions;?> </th>
|
||||
</tr>
|
||||
<?php foreach($URSRList as $key => $URSR):?>
|
||||
<tr>
|
||||
<td><?php echo $URSR['URName'];?></td>
|
||||
<td><?php echo $URSR['SRName'];?></td>
|
||||
<td class='c-actions'>
|
||||
<?php if(common::hasPriv('custom', 'deleteStoryConcept')) echo html::a($this->createLink('custom', 'deleteStoryConcept', "id=$key"), "<i class='icon icon-trash'></i>", 'hiddenwin', 'class="btn"');?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -9,30 +9,53 @@
|
||||
* @version $Id: setstoryconcept.html.php 4129 2020-09-01 01:58:14Z sgm $
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
$itemRow = <<<EOT
|
||||
<tr>
|
||||
<td><input type='text' class="form-control" autocomplete="off" value="" name="URName[]"></td>
|
||||
<td><input type='text' class="form-control" autocomplete="off" value="" name="SRName[]"></td>
|
||||
<td class='c-actions'>
|
||||
<a href="javascript:void(0)" class='btn btn-link' onclick="addItem(this)"><i class='icon-plus'></i></a>
|
||||
<a href="javascript:void(0)" class='btn btn-link' onclick="delItem(this)"><i class='icon-close'></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
EOT;
|
||||
?>
|
||||
<?php js::set('itemRow', $itemRow);?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<form class="load-indicator main-form form-ajax" method='post'>
|
||||
<div class='modal-body'>
|
||||
<table class='table table-form'>
|
||||
<tr id='URSRName'>
|
||||
<th class='w-120px'><?php echo $lang->custom->waterfall->URSRName;?></th>
|
||||
<td><?php echo html::select('URSRCommon', $lang->custom->URSRList, zget($config->custom, 'URSRName', 1), "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::checkbox('URSRCustom', $lang->custom->common, "class='form-control'");?></td>
|
||||
<td></td><td></td><td></td>
|
||||
</tr>
|
||||
<tr class='hidden' id='customURSR'>
|
||||
<th></th>
|
||||
<td><?php echo html::input('URName', '', "class='form-control' placeholder={$lang->custom->URTips}");?></td>
|
||||
<td><?php echo html::input('SRName', '', "class='form-control' placeholder={$lang->custom->SRTips}");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td class='text-left'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<form class="load-indicator main-form form-ajax" method='post'>
|
||||
<div class='modal-body'>
|
||||
<table class='table table-form'>
|
||||
<tr class='text-center'>
|
||||
<td class='w-200px'><strong><?php echo $lang->custom->URConcept;?></strong></th>
|
||||
<td class='w-200px'><strong><?php echo $lang->custom->SRConcept;?></strong></th>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo html::input('URName[]', '', "class='form-control'");?></td>
|
||||
<td><?php echo html::input('SRName[]', '', "class='form-control'");?></td>
|
||||
<td class='c-actions'>
|
||||
<a href="javascript:void(0)" class='btn btn-link' onclick="addItem(this)"><i class='icon-plus'></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td class='text-center' colspan='2'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
function addItem(clickedButton)
|
||||
{
|
||||
$(clickedButton).parent().parent().after(itemRow);
|
||||
}
|
||||
|
||||
function delItem(clickedButton)
|
||||
{
|
||||
$(clickedButton).parent().parent().remove();
|
||||
}
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user