* Rewrite create page of story.

This commit is contained in:
daitingting
2018-04-16 10:20:32 +08:00
parent f191c19548
commit dafec6b33d
9 changed files with 259 additions and 405 deletions
+37
View File
@@ -39,6 +39,43 @@ class html extends baseHTML
return parent::a($href, $title, $misc, $newline);
}
/**
* 生成多选按钮。
* Create tags like "<input type='checkbox' />"
*
* @param string $name the name of the checkbox tag.
* @param array $options the array to create checkbox tag from.
* @param string $checked the value to checked by default, can be item1,item2
* @param string $attrib other attribs.
* @param string $type inline or block
* @static
* @access public
* @return string
*/
static public function checkbox($name, $options, $checked = "", $attrib = "", $type = 'block')
{
$options = (array)($options);
if(!is_array($options) or empty($options)) return false;
if(is_array($checked)) $checked = implode(',', $checked);
$string = '';
$checked = ",$checked,";
$isBlock = $type == 'block';
foreach($options as $key => $value)
{
$key = str_replace('item', '', $key);
if($isBlock) $string .= "<div class='checkbox-primary'>";
else $string .= "<div class='checkbox-inline'>";
$string .= "<input type='checkbox' name='{$name}[]' value='$key' ";
$string .= (strpos($checked, ",$key,") !== false) ? " checked ='checked'" : "";
$string .= $attrib;
$string .= " id='$name$key' /> ";
$string .= "<label for='$name$key'>" . $value . '</label></div>';
}
return $string;
}
/**
* 创建提交按钮。
* Create submit button.
+23 -26
View File
@@ -10,34 +10,31 @@
* @link http://www.zentao.net
*/
?>
<style>
#customModal .checkbox-inline{width:120px}
#customModal .checkbox-inline+.checkbox-inline{margin-left:0px;}
</style>
<div class="modal fade" id="customModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog w-800px">
<div class="modal-content">
<form class='form-condensed' method='post' target='hiddenwin' action='<?php echo $customLink?>'>
<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?>
<div class='pull-right' style='margin-right:15px;'><?php echo html::submitButton()?></div>
</h4>
</div>
<div class="modal-body">
<p><?php echo html::checkbox('fields', $customFields, $showFields);?></p>
</div>
</form>
</div>
<div class="dropdown">
<button type="button" title="<?php echo $lang->customField;?>" class="btn btn-link" data-toggle="dropdown"><i class="icon icon-cog"></i> <?php echo $lang->story->setting;?></button>
<div class="dropdown-menu pull-right" id="formSetting">
<form class='with-padding load-indicator' id='formSettingForm' method='post' target='hiddenwin' action='<?php echo $customLink?>'>
<div><?php echo $lang->customField;?></div>
<div class="clearfix checkboxes">
<?php echo html::checkbox('fields', $customFields, $showFields);?>
</div>
<div>
<?php echo html::submitButton($lang->save);?>
<?php echo html::commonButton($lang->cancel, '', "btn btn-gray close-dropdown");?>
</div>
</form>
</div>
</div>
<style>
#formSetting {min-width: 300px;}
#formSettingForm .checkboxes {padding: 10px 3px;}
#formSettingForm .checkbox-primary {width: 50%; float: left; margin: 3px 0;}
</style>
<script>
$("button[data-toggle='customModal']").click(function(){$('#customModal').modal('show')});
$(function()
var $formSetting = $('#formSetting');
$formSetting.on('click', '.close-dropdown', function()
{
$table = $('.outer form table:first');
$form = $table.closest('form');
if($table.width() > $form.width())$form.css('overflow-x', 'auto')
})
$formSetting.parent().removeClass('open');
}).on('click', function(e){e.stopPropagation()});
</script>
+12 -12
View File
@@ -18,7 +18,7 @@ $lang->file->edit = '重命名';
$lang->file->inputFileName = '请输入附件名称';
$lang->file->delete = '删除附件';
$lang->file->label = '标题:';
$lang->file->maxUploadSize = "<span class='red'>%s</span>";
$lang->file->maxUploadSize = "(不超过%s)";
$lang->file->applyTemplate = "应用模板";
$lang->file->tplTitle = "模板名称";
$lang->file->setPublic = "设置公共模板";
@@ -39,15 +39,15 @@ $lang->file->addedDate = '添加时间';
$lang->file->downloads = '下载次数';
$lang->file->extra = '备注';
$lang->file->dragFile = '请拖拽文件到此处';
$lang->file->errorNotExists = "<span class='red'>文件夹 '%s' 不存在</span>";
$lang->file->errorCanNotWrite = "<span class='red'>文件夹 '%s' 不可写,请改变文件夹的权限。在linux中输入指令:sudo chmod -R 777 %s</span>";
$lang->file->confirmDelete = " 您确定删除该附件吗?";
$lang->file->errorFileSize = " 文件大小已经超过限制,可能不能成功上传!";
$lang->file->errorFileUpload = " 文件上传失败,文件大小可能超出限制";
$lang->file->errorFileFormate = " 文件上传失败,文件格式不在规定范围内";
$lang->file->errorFileMove = " 文件上传失败,移动文件时出错";
$lang->file->dangerFile = " 您选择的文件存在安全风险,系统将不予上传。";
$lang->file->errorSuffix = '压缩包格式错误,只能上传zip压缩包!';
$lang->file->errorExtract = '解压缩失败!可能文件已经损坏,或压缩包里含有非法上传文件。';
$lang->file->dragFile = '请拖拽文件到此处';
$lang->file->errorNotExists = "<span class='red'>文件夹 '%s' 不存在</span>";
$lang->file->errorCanNotWrite = "<span class='red'>文件夹 '%s' 不可写,请改变文件夹的权限。在linux中输入指令:sudo chmod -R 777 %s</span>";
$lang->file->confirmDelete = " 您确定删除该附件吗?";
$lang->file->errorFileSize = " 文件大小已经超过%s,可能不能成功上传!";
$lang->file->errorFileUpload = " 文件上传失败,文件大小可能超出限制";
$lang->file->errorFileFormate = " 文件上传失败,文件格式不在规定范围内";
$lang->file->errorFileMove = " 文件上传失败,移动文件时出错";
$lang->file->dangerFile = " 您选择的文件存在安全风险,系统将不予上传。";
$lang->file->errorSuffix = '压缩包格式错误,只能上传zip压缩包!';
$lang->file->errorExtract = '解压缩失败!可能文件已经损坏,或压缩包里含有非法上传文件。';
$lang->file->uploadImagesExplain = '注:请上传"jpg, jpeg, gif, png"格式的图片,程序会以文件名作为标题,以图片作为内容。';
+26 -145
View File
@@ -1,146 +1,27 @@
<style>
.fileBox {margin-bottom: 10px; width: 100%}
table.fileBox td {padding: 0!important}
.fileBox .input-control > input[type='file'] {width: 100%; height: 100%; height: 26px; line-height: 26px; border: none; position: relative;}
.fileBox td .btn {border-radius: 0; border-left: none}
.file-wrapper.form-control {border-right: 0}
.file-wrapper.form-control .fileControl {width:100%;}
@-moz-document url-prefix(){.file-wrapper.form-control .fileControl {margin-top:-3px;}}
</style>
<div id='fileform'>
<?php
js::set('dangerFiles', $this->config->file->dangers);
/* Define the html code of a file row. */
$fileRow = <<<EOT
<table class='fileBox' id='fileBox\$i'>
<tr>
<td class='w-p45'><div class='form-control file-wrapper'><input type='file' name='{$filesName}[]' class='fileControl' tabindex='-1' onchange='checkSizeAndType(this)'/></div></td>
<td class=''><input type='text' name='{$labelsName}[]' class='form-control' placeholder='{$lang->file->label}' tabindex='-1' /></td>
<td class='w-30px'><a href='javascript:void(0);' onclick='addFile(this)' class='btn btn-block'><i class='icon-plus'></i></a></td>
<td class='w-30px'><a href='javascript:void(0);' onclick='delFile(this)' class='btn btn-block'><i class='icon-remove'></i></a></td>
</tr>
</table>
EOT;
for($i = 1; $i <= $fileCount; $i ++) echo str_replace('$i', $i, $fileRow);
?>
<?php $maxUploadSize = strtoupper(ini_get('upload_max_filesize'));?>
<div class="file-input-list" data-provide="fileInputList" data-each-file-max-size="<?php echo $maxUploadSize;?>" data-file-size-error="<?php echo sprintf($lang->file->errorFileSize, $maxUploadSize);?>">
<div class="file-input">
<div class="file-input-empty"><button type="button" class="btn btn-link file-input-btn"><i class="icon icon-plus"></i> <?php echo $lang->file->addFile;?></button> <small class="muted"><?php echo sprintf($lang->file->maxUploadSize, $maxUploadSize);?></small></div>
<div class="file-input-edit input-group">
<div class="input-group-cell"><i class="icon icon-paper-clip text-muted"></i></div>
<input type="text" name="labels[]" class="form-control file-editbox" placeholder="<?php echo $lang->file->title;?>">
<div class="input-group-btn">
<button type="button" class="btn btn-success file-name-confirm"><i class="icon icon-check"></i></button>
<button type="button" class="btn btn-gray file-name-cancel"><i class="icon icon-close"></i></button>
</div>
</div>
<div class="file-input-normal input-group">
<div class="input-group-cell"><i class="icon icon-paper-clip text-muted"></i></div>
<div class="input-group-cell">
<span class="file-title"></span>
<small class="file-size muted"></small>
</div>
<div class="input-group-btn">
<button type="button" class="btn btn-link file-input-rename"><?php echo $lang->file->edit;?></button>
<button type="button" class="btn btn-link file-input-delete"><?php echo $lang->delete;?></button>
</div>
</div>
<input type="file" name="files[]">
</div>
</div>
<script language='javascript'>
$(function()
{
var maxUploadInfo = maxFilesize();
parentTag = $('#fileform').parent();
if(parentTag.get(0).tagName == 'TD')
{
parentTag.parent().find('th').append(maxUploadInfo);
}
if(parentTag.get(0).tagName == 'FIELDSET')
{
parentTag.find('legend').append(maxUploadInfo);
}
});
/**
* Check file size and type.
*
* @param obj $obj
* @access public
* @return void
*/
function checkSizeAndType(obj)
{
if(typeof($(obj)[0].files) != 'undefined')
{
var maxUploadInfo = '<?php echo strtoupper(ini_get('upload_max_filesize'));?>';
var sizeType = {'K': 1024, 'M': 1024 * 1024, 'G': 1024 * 1024 * 1024};
var unit = maxUploadInfo.replace(/\d+/, '');
var maxUploadSize = maxUploadInfo.replace(unit,'') * sizeType[unit];
var fileSize = 0;
$(obj).closest('#fileform').find(':file').each(function()
{
/* Check file type. */
fileName = $(this)[0].files[0].name;
dotPos = fileName.lastIndexOf('.');
fileType = fileName.substring(dotPos + 1);
if((',' + dangerFiles + ',').indexOf((',' + fileType + ',')) != -1) alert('<?php echo $lang->file->dangerFile?>');
if($(this).val()) fileSize += $(this)[0].files[0].size;
})
if(fileSize > maxUploadSize) alert('<?php echo $lang->file->errorFileSize?>');//Check file size.
}
}
/**
* Show the upload max filesize of config.
*/
function maxFilesize(){return "(<?php printf($lang->file->maxUploadSize, ini_get('upload_max_filesize'));?>)";}
/**
* Set the width of the file form.
*
* @param float $percent
* @access public
* @return void
*/
function setFileFormWidth(percent)
{
totalWidth = Math.round($('#fileform').parent().width() * percent);
titleWidth = totalWidth - $('.fileControl').width() - $('.fileLabel').width() - $('.icon').width();
if($.browser.mozilla) titleWidth -= 8;
if(!$.browser.mozilla) titleWidth -= 12;
$('#fileform .text-3').css('width', titleWidth + 'px');
};
/**
* Add a file input control.
*
* @param object $clickedButton
* @access public
* @return void
*/
function addFile(clickedButton)
{
fileRow = <?php echo json_encode($fileRow);?>;
fileRow = fileRow.replace('$i', $('.fileID').size() + 1);
/* Get files and labels name.*/
filesName = $(clickedButton).closest('tr').find('input[type="file"]').attr('name');
labelsName = $(clickedButton).closest('tr').find('input[type="text"]').attr('name');
/* Add file input control and set files and labels name in it.*/
$fileBox = $(clickedButton).closest('.fileBox').after(fileRow).next('.fileBox');
$fileBox.find('input[type="file"]').attr('name', filesName);
$fileBox.find('input[type="text"]').attr('name', labelsName);
setFileFormWidth(<?php echo $percent;?>);
updateID();
}
/**
* Delete a file input control.
*
* @param object $clickedButton
* @access public
* @return void
*/
function delFile(clickedButton)
{
if($('.fileBox').size() == 1) return;
$(clickedButton).closest('.fileBox').remove();
updateID();
}
/**
* Update the file id labels.
*
* @access public
* @return void
*/
function updateID()
{
i = 1;
$('.fileID').each(function(){$(this).html(i ++)});
}
$(function(){setFileFormWidth(<?php echo $percent;?>)});
</script>
+2 -2
View File
@@ -18,8 +18,8 @@ if($contactLists)
else
{
echo '<span class="input-group-btn">';
echo '<a data-toggle="tooltip" title="' . $lang->user->contacts->manage . '" href="' . $this->createLink('my', 'managecontacts', "listID=0&mode=new", '', true) . "\" target='_blank' data-icon='cog' data-title='{$lang->user->contacts->manage}' class='btn iframe'><i class='icon icon-cog'></i></a>";
echo '<a data-toggle="tooltip" title="' . $lang->refresh . '" href="###" class="btn" onclick="ajaxGetContacts(this)"><i class="icon icon-refresh"></i></a>';
echo '<a title="' . $lang->user->contacts->manage . '" href="' . $this->createLink('my', 'managecontacts', "listID=0&mode=new", '', true) . "\" target='_blank' data-icon='cog' data-title='{$lang->user->contacts->manage}' class='btn btn-icon iframe'><i class='icon icon-cog'></i></a>";
echo '<button type="button" title="' . $lang->refresh . '" class="btn btn-icon" onclick="ajaxGetContacts(this)"><i class="icon icon-refresh"></i></button>';
echo '</span>';
}
?>
-23
View File
@@ -1,23 +0,0 @@
#mailto {width:90.3%}
select {border:1px solid #ccc}
#module_chosen.chosen-container .chosen-drop {min-width: 400px; border-top: 1px solid #ddd!important}
.row .col-sm-8{width:76%}
.row .col-sm-2{padding-left:0px; padding-right:0px; width:12%}
#dataform .input-group-btn > .btn + .btn {margin-left: -1px;}
#dataform .input-group-addon > .checkbox-inline {padding-right: 10px;}
#dataform .input-group .chosen-container-single .chosen-single {border-top-right-radius: 0; border-bottom-right-radius: 0}
#title.form-control {border-top-right-radius: 0; border-bottom-right-radius: 0}
.dropdown-pris > .btn {background-color: #fff;}
.minw-80px {min-width: 80px;}
.minw-60px {min-width: 60px;}
.w-230px{width:230px;}
.colorpicker.input-group-btn > .btn {border-right: none}
#branch_chosen.chosen-container .chosen-drop {min-width: 280px; border-top: 1px solid #ddd!important}
#branch {border-left-width: 0px}
#mailtoGroup .chosen-container-single a {border-left-width: 0px}
+2 -31
View File
@@ -1,35 +1,6 @@
$(function()
{
if($('#needNotReview').prop('checked'))
{
$('#assignedTo').attr('disabled', 'disabled');
}
else
{
$('#assignedTo').removeAttr('disabled');
}
$('#assignedTo').trigger("chosen:updated");
$('#needNotReview').change(function()
{
if($('#needNotReview').prop('checked'))
{
$('#assignedTo').attr('disabled', 'disabled');
}
else
{
$('#assignedTo').removeAttr('disabled');
}
$('#assignedTo').trigger("chosen:updated");
$('#needNotReview').on('change', function() {
$('#assignedTo').attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated');
});
$('[data-toggle=tooltip]').tooltip();
// ajust style for file box
var ajustFilebox = function()
{
applyCssStyle('.fileBox > tbody > tr > td:first-child {transition: none; width: ' + ($('#mailtoGroup').width() - 2) + 'px}', 'filebox')
};
ajustFilebox();
$(window).resize(ajustFilebox);
});
+1
View File
@@ -23,6 +23,7 @@ $lang->story->batchClose = '批量关闭';
$lang->story->activate = '激活';
$lang->story->delete = "删除";
$lang->story->view = "需求详情";
$lang->story->setting = "设置";
$lang->story->tasks = "相关任务";
$lang->story->bugs = "相关Bug";
$lang->story->cases = "相关用例";
+156 -166
View File
@@ -13,185 +13,175 @@
<?php include './header.html.php';?>
<?php include '../../common/view/form.html.php';?>
<?php js::set('holders', $lang->story->placeholder); ?>
<div class='container mw-1400px'>
<div id='titlebar'>
<div class='heading'>
<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 id="mainContent" class="main-content">
<div class="center-block">
<div class="main-header">
<h2><?php echo $lang->story->create;?></h2>
<div class="pull-right btn-toolbar">
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=story&section=custom&key=createFields')?>
<?php include '../../common/view/customfield.html.php';?>
</div>
</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'>
<tr>
<th class='w-80px'><?php echo $lang->story->product;?></th>
<td class='w-p45-f'>
<div class='input-group'>
<form class="load-indicator main-form form-ajax" method='post' enctype='multipart/form-data' id='dataform' data-type='ajax'>
<table class="table table-form">
<tbody>
<tr>
<th><?php echo $lang->story->product;?></th>
<td colspan="2">
<?php if($product->type != 'normal'):?>
<div class='input-group'>
<?php endif;?>
<?php echo html::select('product', $products, $productID, "onchange='loadProduct(this.value);' class='form-control chosen'");?>
<?php if($product->type != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control chosen' style='width:120px'");?>
</div>
</td>
<td>
<div class='input-group' id='moduleIdBox'>
<span class='input-group-addon w-80px'><?php echo $lang->story->module;?></span>
<?php
echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");
if(count($moduleOptionMenu) == 1)
{
echo "<span class='input-group-addon'>";
echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=story&currentModuleID=0&branch=$branch"), $lang->tree->manage, '_blank');
echo '&nbsp; ';
echo html::a("javascript:loadProductModules($productID)", $lang->refresh);
echo '</span>';
}
?>
</div>
</td><td></td>
</tr>
<tr>
<th><?php echo $lang->story->plan;?></th>
<td>
<div class='input-group' id='planIdBox'>
<?php
echo html::select('plan', $plans, $planID, "class='form-control chosen'");
if(count($plans) == 1)
{
echo "<span class='input-group-btn'>";
echo html::a($this->createLink('productplan', 'create', "productID=$productID&branch=$branch"), "<i class='icon icon-plus'></i>", '_blank', "class='btn' data-toggle='tooltip' title='{$lang->productplan->create}'");
echo '&nbsp; ';
echo html::a("javascript:loadProductPlans($productID)", "<i class='icon icon-refresh'></i>", '', "class='btn' data-toggle='tooltip' title='{$lang->refresh}'");
echo '</span>';
}
?>
</div>
</td>
<?php if(strpos(",$showFields,", ',source,') !== false):?>
<td>
<div class='input-group'>
<span class='input-group-addon w-60px'><?php echo $lang->story->source?></span>
<?php echo html::select('source', $lang->story->sourceList, $source, "class='form-control chosen'");?>
<span class='input-group-addon fix-border'><?php echo $lang->story->sourceNote?></span>
<?php echo html::input('sourceNote', $sourceNote, "class='form-control' autocomplete='off' style='width:200px;'");?>
</div>
</td>
<?php endif;?>
</tr>
<tr>
<th><?php echo $lang->story->reviewedBy;?></th>
<td>
<div class='input-group'>
<?php echo html::select('assignedTo', $users, empty($needReview) ? $product->PO : '', "class='form-control chosen'");?>
<?php if(!$this->story->checkForceReview()):?>
<span class='input-group-addon'><?php echo html::checkbox('needNotReview', $lang->story->needNotReview, '', "id='needNotReview' {$needReview}");?></span>
<?php endif;?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->story->title;?></th>
<td colspan='2'>
<div class='row-table'>
<div class='col-table'>
<div class="input-group w-p100">
<input type='hidden' id='color' name='color' data-provide='colorpicker' data-wrapper='input-group-btn' data-pull-menu-right='false' data-btn-tip='<?php echo $lang->story->colorTag ?>' data-update-text='#title' value='<?php echo $color;?>'>
<?php echo html::input('title', $storyTitle, "class='form-control' autocomplete='off'");?>
</div>
<?php if($product->type != 'normal'):?>
<?php echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control chosen'");?>
</div>
<?php
$hiddenPri = strpos(",$showFields,", ',pri,') === false;
$hiddenEst = strpos(",$showFields,", ',estimate,') === false;
?>
<?php if(!$hiddenPri or !$hiddenEst):?>
<?php $widthClass = ($hiddenPri or $hiddenEst) ? 'w-100px' : 'w-230px';?>
<div class='col-table <?php echo $widthClass?>'>
<?php endif;?>
</td>
<td colspan="2">
<div class='input-group' id='moduleIdBox'>
<div class="input-group-addon"><?php echo $lang->story->module;?></div>
<?php
echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");
if(count($moduleOptionMenu) == 1)
{
echo "<div class='input-group-addon'>";
echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=story&currentModuleID=0&branch=$branch"), $lang->tree->manage, '_blank');
echo '&nbsp; ';
echo html::a("javascript:loadProductModules($productID)", $lang->refresh);
echo '</div>';
}
?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->story->plan;?></th>
<td colspan="2">
<div class='input-group' id='planIdBox'>
<?php
echo html::select('plan', $plans, $planID, "class='form-control chosen'");
if(count($plans) != 1)
{
echo "<div class='input-group-btn'>";
echo html::a($this->createLink('productplan', 'create', "productID=$productID&branch=$branch"), "<i class='icon icon-plus'></i>", '_blank', "class='btn' data-toggle='tooltip' title='{$lang->productplan->create}'");
echo '&nbsp; ';
echo html::a("javascript:loadProductPlans($productID)", "<i class='icon icon-refresh'></i>", '', "class='btn' data-toggle='tooltip' title='{$lang->refresh}'");
echo '</div>';
}
?>
</div>
</td>
<?php if(strpos(",$showFields,", ',source,') !== false):?>
<td colspan="2">
<div class="input-group">
<div class="input-group">
<?php if(!$hiddenPri):?>
<span class='input-group-addon fix-border br-0'><?php echo $lang->story->pri;?></span>
<?php
$hasCustomPri = false;
foreach($lang->story->priList as $priKey => $priValue)
{
if($priKey != $priValue or strlen($priKey) != strlen($priValue))
{
$hasCustomPri = true;
break;
}
}
?>
<?php if($hasCustomPri):?>
<?php echo html::select('pri', (array)$lang->story->priList, $pri, "class='form-control minw-80px chosen'");?>
<?php else: ?>
<div class='input-group-btn dropdown-pris' data-set='0,1,2,3,4'>
<button type='button' class='btn dropdown-toggle br-0' data-toggle='dropdown'>
<span class='pri-text'></span> &nbsp;<span class='caret'></span>
</button>
<ul class='dropdown-menu pull-right'></ul>
<?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' autocomplete='off'");?>
<?php endif;?>
<div class="input-group-addon"><?php echo $lang->story->source;?></div>
<?php echo html::select('source', $lang->story->sourceList, $source, "class='form-control chosen'");?>
<span class='input-group-addon'><?php echo $lang->story->sourceNote;?></span>
<?php echo html::input('sourceNote', $sourceNote, "class='form-control' autocomplete='off' style='width:140px;'");?>
</div>
</div>
<?php endif;?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->story->spec;?></th>
<td colspan='2'><?php echo html::textarea('spec', $spec, "rows='9' class='form-control disabled-ie-placeholder' placeholder='" . htmlspecialchars($lang->story->specTemplate) . "'");?></td>
</tr>
<?php if(strpos(",$showFields,", ',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>
<?php endif;?>
<?php
$hiddenMailto = strpos(",$showFields,", ',mailto,') === false;
$hiddenKeywords = strpos(",$showFields,", ',keywords,') === false;
?>
<?php if(!$hiddenMailto or !$hiddenKeywords):?>
<?php $colspan = ($hiddenMailto or $hiddenKeywords) ? "colspan='2'" : '';?>
<tr>
<th><?php echo $hiddenMailto ? $lang->story->keywords : $lang->story->mailto;?></th>
<?php if(!$hiddenMailto):?>
<td>
<div class='input-group' id='mailtoGroup'>
<?php
echo html::select('mailto[]', $users, str_replace(' ' , '', $mailto), "multiple");
echo $this->fetch('my', 'buildContactLists');
</td>
<?php endif;?>
</tr>
<tr>
<th><?php echo $lang->story->title;?></th>
<td colspan="4">
<div class="input-control has-icon-right">
<?php echo html::input('title', $storyTitle, "class='form-control input-story-title' autocomplete='off' required");?>
<div class="colorpicker">
<button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown"><span class="cp-title"></span><span class="color-bar"></span><i class="ic"></i></button>
<ul class="dropdown-menu clearfix">
<li class="heading"><?php echo $lang->story->colorTag;?><i class="icon icon-close"></i></li>
</ul>
<input type="hidden" class="colorpicker" id="color" name="color" value="" data-icon="color" data-wrapper="input-control-icon-right" data-update-color="#title" data-provide="colorpicker">
</div>
</div>
</td>
</tr>
<?php if(strpos(",$showFields,", ',pri,') !== false):?>
<tr>
<th><?php echo $lang->story->pri;?></th>
<td colspan="4">
<?php
$hasCustomPri = false;
foreach($lang->story->priList as $priKey => $priValue)
{
if($priKey and $priValue and ($priKey != $priValue or strlen($priKey) != strlen($priValue)))
{
$hasCustomPri = true;
break;
}
}
?>
</div>
</td>
<?php if($hasCustomPri):?>
<?php echo html::select('pri', (array)$lang->story->priList, $pri, "class='form-control chosen'");?>
<?php else: ?>
<?php echo html::select('pri', (array)$lang->story->priList, $pri, "class='form-control' data-provide='labelSelector'");?>
<?php endif; ?>
</td>
</tr>
<?php endif;?>
<?php if(strpos(",$showFields,", ',estimate,') !== false):?>
<tr>
<th><?php echo $lang->story->estimateAB;?></th>
<td><input type="number" min="0" step="0.5" name="estimate" id="estimate" value="<?php echo $estimate;?>" class="form-control" autocomplete="off"></td>
<td class="muted"><?php echo $lang->story->hour;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->story->reviewedBy;?></th>
<td><?php echo html::select('assignedTo', $users, empty($needReview) ? $product->PO : '', "class='form-control chosen'");?></td>
<?php if(!$this->story->checkForceReview()):?>
<td><?php echo html::checkbox('needNotReview', $lang->story->needNotReview, '', "id='needNotReview' class='no-margin' {$needReview}");?></td>
<?php endif;?>
</tr>
<tr>
<th><?php echo $lang->story->spec;?></th>
<td colspan="4"><?php echo html::textarea('spec', $spec, "rows='9' class='form-control kindeditor disabled-ie-placeholder' hidefocus='true' placeholder='" . htmlspecialchars($lang->story->specTemplate) . "'");?></td>
</tr>
<?php if(strpos(",$showFields,", ',verify,') !== false):?>
<tr>
<th><?php echo $lang->story->verify;?></th>
<td colspan="4"><?php echo html::textarea('verify', $verify, "rows='6' class='form-control kindeditor' hidefocus='true'");?></td>
</tr>
<?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;?>
<tr>
<th><?php echo $lang->story->legendAttatch;?></th>
<td colspan='4'><?php echo $this->fetch('file', 'buildform');?></td>
</td>
</tr>
<?php if(strpos(",$showFields,", ',mailto,') !== false):?>
<tr>
<th><?php echo $lang->story->mailto;?></th>
<td colspan="4">
<div class="input-group">
<?php echo html::select('mailto[]', $users, str_replace(' ' , '', $mailto), "class='form-control chosen' data-placeholder='{$lang->chooseUsersToMail}' multiple");?>
<?php echo $this->fetch('my', 'buildContactLists');?>
</div>
</td>
</tr>
<?php endif;?>
<?php if(strpos(",$showFields,", ',keywords,') !== false):?>
<tr>
<th><?php echo $lang->story->keywords;?></th>
<td colspan="4">
<?php echo html::input('keywords', $keywords, 'class="form-control" autocomplete="off"');?>
</div>
</td>
</td>
</tr>
<?php endif;?>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->story->legendAttatch;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
<tr><td></td><td colspan='2' class='text-center'><?php echo html::submitButton() . html::backButton();?></td></tr>
</tbody>
<tfoot>
<tr>
<td colspan="5" class="text-center">
<?php echo html::submitButton('', '', 'btn btn-wide btn-primary');?>
<?php echo html::backButton('', '', 'btn btn-wide btn-gray');?>
</td>
</tr>
</tfoot>
</table>
<span id='responser'></span>
</form>
</div>
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=story&section=custom&key=createFields')?>
<?php include '../../common/view/customfield.html.php';?>
<?php js::set('storyModule', $lang->story->module);?>
<?php include '../../common/view/footer.html.php';?>