* adjust code for task #569 and #555.

This commit is contained in:
shiyangyangwork@yahoo.cn
2011-10-23 01:31:26 +00:00
parent 3568359288
commit 682dbbb6a0
6 changed files with 12 additions and 14 deletions

View File

@@ -2,7 +2,7 @@
$config->mail->turnon = false; // trun on email feature or not.
$config->mail->fromAddress = ''; // The from address.
$config->mail->fromName = ''; // The from name.
$config->mail->mta = 'gmail'; // phpmail|sendmail|smtp|gmail
$config->mail->mta = 'smtp'; // phpmail|sendmail|smtp|gmail
/* SMTP settings. */
if($config->mail->mta == 'smtp')

View File

@@ -12,6 +12,7 @@
include '../../common/view/header.html.php';
include '../../common/view/tablesorter.html.php';?>
<?php
$mta = 'smtp';
$gmailUsername = '';
$gmailPassword = '';
$smtpUsername = '';
@@ -20,6 +21,7 @@ $smtpHost = '';
$smtpSecure = '';
$smtpAuth = '';
$smtpPort = '';
if(!empty($mailConfig->mta)) $mta = $mailConfig->mta;
if(!empty($mailConfig->gmail->username)) $gmailUsername = $mailConfig->gmail->username;
if(!empty($mailConfig->gmail->password)) $gmailPassword = $mailConfig->gmail->password;
if(!empty($mailConfig->smtp->username)) $smtpUsername = $mailConfig->smtp->username;
@@ -38,7 +40,7 @@ if(!empty($mailConfig->smtp->port)) $smtpPort = $mailConfig->smtp->por
</tr>
<tr>
<th class='rowhead'><?php echo $lang->mail->mta; ?></th>
<td><?php echo html::select('mta', $lang->mail->mtaList, $mailConfig->mta, 'class=select-3 onchange=setMtaType(this.value)'); ?></td>
<td><?php echo html::select('mta', $lang->mail->mtaList, $mta, 'class=select-3 onchange=setMtaType(this.value)'); ?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->mail->fromAddress; ?></th>

View File

@@ -70,7 +70,6 @@ $lang->story->reviewResult = 'Reviewed result';
$lang->story->preVersion = 'Pre version';
$lang->story->keywords = 'Keyword';
$lang->story->use = 'Use or not';
$lang->story->same = 'The same up';
$lang->story->useList[0] = 'No use';
@@ -151,7 +150,7 @@ $lang->story->affectedBugs = 'Affected bugs';
$lang->story->affectedCases = 'Affected cases';
$lang->story->specTemplate = "Recommend template:As <<i class='red'>a type of user</i>>,I want <<i class='red'>some goals</i>>,so that <<i class='red'>some reason</i>>.";
$lang->story->needReview = 'Need review';
$lang->story->notes = "(notes:if the title is empty, it is no use)";
$lang->story->needNotReview = "needn't review";
$lang->story->confirmDelete = "Are you sure to delete this story?";
$lang->story->errorFormat = 'Error format';

View File

@@ -70,7 +70,6 @@ $lang->story->reviewResult = '评审结果';
$lang->story->preVersion = '之前版本';
$lang->story->keywords = '关键词';
$lang->story->use = '是否使用';
$lang->story->same = '同上';
$lang->story->useList[0] = '不使用';
@@ -151,7 +150,7 @@ $lang->story->affectedBugs = '影响的Bug';
$lang->story->affectedCases = '影响的用例';
$lang->story->specTemplate = "建议参考的模板:作为一名<<i class='red'>某种类型的用户</i>>,我希望<<i class='red'>达成某些目的</i>>,这样可以<<i class='red'>开发的价值</i>>。";
$lang->story->needReview = '是否需要评审';
$lang->story->notes = '(注:如果“需求标题”为空,则表示不使用此行)';
$lang->story->needNotReview = '不需要评审';
$lang->story->confirmDelete = "您确认删除该需求吗?";
$lang->story->errorFormat = '需求数据有误';

View File

@@ -143,11 +143,11 @@ class storyModel extends model
$stories = fixer::input('post')->get();
for($i = 0; $i < $this->config->story->batchCreate; $i++)
{
if($stories->use[$i] == 1)
if($stories->title[$i] != '')
{
$data[$i]->module = $stories->module[$i] != 'same' ? $stories->module[$i] : ($i == 0 ? 0 : $data[$i-1]->module);
$data[$i]->plan = $stories->plan[$i] == 'same' ? ($i != 0 ? $data[$i-1]->plan : 0) : ($stories->plan[$i] != '' ? $stories->plan[$i] : 0);
$data[$i]->title = $stories->title[$i] != '' ? $stories->title[$i] : '';
$data[$i]->title = $stories->title[$i];
$data[$i]->pri = $stories->pri[$i] != '' ? $stories->pri[$i] : 0;
$data[$i]->estimate = $stories->estimate[$i] != '' ? $stories->estimate[$i] : 0;
$data[$i]->status = $stories->needReview[$i] == 0 ? 'active' : 'draft';

View File

@@ -13,9 +13,8 @@
<?php include './header.html.php';?>
<form method='post' enctype='multipart/form-data'>
<table align='center' class='table-1'>
<caption><?php echo $lang->story->product; echo $lang->story->batchCreate;?></caption>
<caption><?php echo $lang->story->product . $lang->colon . $lang->story->batchCreate; echo "<span class='star'><small>{$lang->story->notes}</small></span>";?></caption>
<tr>
<th class='w-40px'><?php echo $lang->story->use;?>
<th><?php echo $lang->story->module;?></th>
<th><?php echo $lang->story->plan;?></th>
<th><?php echo $lang->story->title;?></th>
@@ -28,14 +27,13 @@
<?php $moduleID = $i == 0 ? 0 : 'same';?>
<?php $planID = $i == 0 ? '' : 'same';?>
<tr class='a-center'>
<td><?php echo html::select("use[$i]", $lang->story->useList, 0);?>
<td><span id='moduleIdBox'><?php echo html::select("module[$i]", $moduleOptionMenu, $moduleID);?></span></td>
<td><span id='planIdBox'><?php echo html::select("plan[$i]", $plans, $planID, 'class=select-2');?></span></td>
<td><?php echo html::select("module[$i]", $moduleOptionMenu, $moduleID, 'class=select-2');?></td>
<td><?php echo html::select("plan[$i]", $plans, $planID, 'class=select-2');?></td>
<td><?php echo html::input("title[$i]", $title, "class='text-1'"); echo "<span class='star'>*</span>";?></td>
<td><?php echo html::textarea("spec[$i]", $spec, "rows='1' class='text-1'");?></td>
<td><?php echo html::select("pri[$i]", (array)$lang->story->priList, $pri, 'class=w-50px');?></td>
<td><?php echo html::input("estimate[$i]", $estimate, "class='w-50px'");?></td>
<td><?php echo html::select("needReview[$i]", $lang->story->reviewList, 0, "id='needNotReview'");?></td>
<td><?php echo html::select("needReview[$i]", $lang->story->reviewList, 0, '');?></td>
</tr>
<?php endfor;?>
<tr><td colspan='8' class='a-center'><?php echo html::submitButton() . html::resetButton();?></td></tr>