* finish task #2545.

This commit is contained in:
wangyidong
2016-03-30 10:55:00 +08:00
parent ddf15aa13b
commit b053ec972f
7 changed files with 98 additions and 5 deletions
+2
View File
@@ -45,6 +45,7 @@ $lang->goback = 'Back';
$lang->goPC = 'PC';
$lang->more = 'More';
$lang->day = 'Day';
$lang->customConfig = 'Custom';
$lang->actions = 'Actions';
$lang->comment = 'Comment';
@@ -62,6 +63,7 @@ $lang->duplicate = '%s has the same title';
$lang->ipLimited = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /></head><body>Sorry, current IP is limited by Administrator. Please contact the Administrator to lift the restrictions.</body></html>";
$lang->unfold = '+';
$lang->fold = '-';
$lang->checked2Hide = 'Hide checked field.';
$lang->preShortcutKey = '[Shortcut key:←]';
$lang->nextShortcutKey = '[Shortcut key:→]';
+2
View File
@@ -45,6 +45,7 @@ $lang->goback = '返回';
$lang->goPC = 'PC版';
$lang->more = '更多';
$lang->day = '天';
$lang->customConfig = '自定义';
$lang->actions = '操作';
$lang->comment = '备注';
@@ -62,6 +63,7 @@ $lang->duplicate = '已有相同标题的%s';
$lang->ipLimited = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /></head><body>抱歉,管理员限制当前IP登录,请联系管理员解除限制。</body></html>";
$lang->unfold = '+';
$lang->fold = '-';
$lang->checked2Hide = '选中字段在页面不显示';
$lang->preShortcutKey = '[快捷键:←]';
$lang->nextShortcutKey = '[快捷键:→]';
+31
View File
@@ -0,0 +1,31 @@
<?php
/**
* The custom field view file of common module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package common
* @version $Id$
* @link http://www.zentao.net
*/
?>
<div class="modal fade" id="customModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog w-800px">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"><i class="icon-cog"></i> <?php echo $lang->customConfig?></h4>
</div>
<div class="modal-body">
<form method='post' target='hiddenwin' action='<?php echo $this->createLink('custom', 'ajaxSaveCustom', 'module=story&section=custom&key=create')?>'>
<p><?php echo html::checkbox('fields', $customFields, $hiddenFields);?></p>
<p><?php echo html::submitButton() . ' ' . $lang->checked2Hide?></p>
</form>
</div>
</div>
</div>
</div>
<script>
$("button[data-toggle='customModal']").click(function(){$('#customModal').modal('show')});
</script>
+19
View File
@@ -142,4 +142,23 @@ class custom extends control
$this->view->position[] = $this->lang->custom->flow;
$this->display();
}
/**
* Ajax save custom.
*
* @param string $module
* @param string $section
* @param string $key
* @access public
* @return void
*/
public function ajaxSaveCustom($module, $section, $key)
{
if($_POST)
{
$account = $this->app->user->account;
$this->loadModel('setting')->setItem("$account.$module.$section.$key", join(',', $this->post->fields));
die(js::reload('parent'));
}
}
}
+1
View File
@@ -39,6 +39,7 @@ $config->story->list->exportFields = '
closedBy, closedDate, closedReason,
lastEditedBy, lastEditedDate,
childStories, linkStories, duplicateStory, files';
$config->story->list->customCreateFields = 'source,verify,pri,estimate,mailto,keywords';
$config->story->datatable = new stdclass();
$config->story->datatable->defaultField = array('id', 'pri', 'title', 'plan', 'source', 'openedBy', 'assignedTo', 'estimate', 'status', 'stage', 'actions');
+5
View File
@@ -161,6 +161,11 @@ class story extends control
}
}
/* Set Custom*/
foreach(explode(',', $this->config->story->list->customCreateFields) as $field) $customFields[$field] = $this->lang->story->$field;
$this->view->customFields = $customFields;
$this->view->hiddenFields = isset($this->config->story->custom->create) ? $this->config->story->custom->create : '';
$this->view->title = $product->name . $this->lang->colon . $this->lang->story->create;
$this->view->position[] = html::a($this->createLink('product', 'browse', "product=$productID&branch=$branch"), $product->name);
$this->view->position[] = $this->lang->story->common;
+38 -5
View File
@@ -19,6 +19,9 @@
<span class='prefix'><?php echo html::icon($lang->icons['story']);?></span>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['create']);?></small> <?php echo $lang->story->create;?></strong>
</div>
<div class='actions'>
<button type="button" class="btn btn-default" data-toggle="customModal"><i class='icon icon-cog'></i> </button>
</div>
</div>
<form class='form-condensed' method='post' enctype='multipart/form-data' id='dataform' data-type='ajax'>
<table class='table table-form'>
@@ -64,12 +67,14 @@
?>
</div>
</td>
<?php if(strpos($hiddenFields, 'source') === false):?>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->story->source?></span>
<?php echo html::select('source', $lang->story->sourceList, $source, "class='form-control'");?>
</div>
</td>
<?php endif;?>
</tr>
<tr>
<th><?php echo $lang->story->reviewedBy;?></th>
@@ -87,8 +92,15 @@
<div class='col-table'>
<?php echo html::input('title', $storyTitle, "class='form-control'");?>
</div>
<div class='col-table w-230px'>
<?php
$hiddenPri = strpos($hiddenFields, 'pri') !== false;
$hiddenEst = strpos($hiddenFields, 'estimate') !== false;
?>
<?php if(!$hiddenPri or !$hiddenEst):?>
<?php $widthClass = ($hiddenPri or $hiddenEst) ? 'w-100px' : 'w-230px';?>
<div class='col-table <?php echo $widthClass?>'>
<div class="input-group">
<?php if(!$hiddenPri):?>
<span class='input-group-addon fix-border br-0'><?php echo $lang->story->pri;?></span>
<?php $isAllNumberPri = is_numeric(join('', $lang->story->priList)); ?>
<?php if(!$isAllNumberPri):?>
@@ -102,10 +114,14 @@
<?php echo html::select('pri', (array)$lang->story->priList, $pri, "class='hide'");?>
</div>
<?php endif; ?>
<?php endif;?>
<?php if(!$hiddenEst):?>
<span class='input-group-addon fix-border br-0'><?php echo $lang->story->estimateAB;?></span>
<?php echo html::input('estimate', $estimate, "class='form-control minw-60px'");?>
<?php endif;?>
</div>
</div>
<?php endif;?>
</div>
</td>
</tr>
@@ -113,12 +129,21 @@
<th><?php echo $lang->story->spec;?></th>
<td colspan='2'><?php echo html::textarea('spec', $spec, "rows='9' class='form-control'");?><div class='help-block'><?php echo $lang->story->specTemplate;?></div></td>
</tr>
<tr>
<?php if(strpos($hiddenFields, 'verify') === false):?>
<tr>
<th><?php echo $lang->story->verify;?></th>
<td colspan='2'><?php echo html::textarea('verify', $verify, "rows='6' class='form-control'");?></td>
</tr>
</tr>
<?php endif;?>
<?php
$hiddenMailto = strpos($hiddenFields, 'mailto') !== false;
$hiddenKeywords = strpos($hiddenFields, 'keywords') !== false;
?>
<?php if(!$hiddenMailto or !$hiddenKeywords):?>
<?php $colspan = ($hiddenMailto or $hiddenKeywords) ? "colspan='2'" : '';?>
<tr>
<th><?php echo $lang->story->mailto;?></th>
<th><?php echo $hiddenMailto ? $lang->story->keywords : $lang->story->mailto;?></th>
<?php if(!$hiddenMailto):?>
<td>
<div class='input-group' id='mailtoGroup'>
<?php
@@ -134,13 +159,19 @@
?>
</div>
</td>
<td>
<?php endif;?>
<?php if(!$hiddenKeywords):?>
<td <?php echo $colspan?>>
<div class='input-group'>
<?php if(!$hiddenMailto):?>
<span class='input-group-addon'><?php echo $lang->story->keywords;?></span>
<?php endif;?>
<?php echo html::input('keywords', $keywords, 'class="form-control"');?>
</div>
</td>
<?php endif;?>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->story->legendAttatch;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
@@ -150,5 +181,7 @@
<span id='responser'></span>
</form>
</div>
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustom', 'module=story&section=custom&key=create')?>
<?php include '../../common/view/customfield.html.php';?>
<?php js::set('storyModule', $lang->story->module);?>
<?php include '../../common/view/footer.html.php';?>