* finish task #2532.

This commit is contained in:
wangyidong
2016-04-13 10:42:19 +08:00
parent ceeeb89435
commit f8ff737086
5 changed files with 47 additions and 33 deletions
+1 -3
View File
@@ -990,9 +990,7 @@ EOT;
static public function reload($window = 'self')
{
$js = self::start();
$js .= "var href = $window.location.href;\n";
$js .= "$window.location.href = href.indexOf('#') < 0 ? href : href.substring(0, href.indexOf('#'));";
$js .= "$window.location.reload();\n";
$js .= self::end();
return $js;
}
+2
View File
@@ -41,10 +41,12 @@ $config->story->list->exportFields = '
childStories, linkStories, duplicateStory, files';
$config->story->list->customCreateFields = 'source,verify,pri,estimate,mailto,keywords';
$config->story->list->batchCreateFields = 'module,plan,source,spec,verify,pri,estimate,review,keywords';
$config->story->list->batchEditFields = 'module,plan,estimate,pri,assignedTo,source,stage,closedBy,closedReason,keywords';
$config->story->custom = new stdclass();
$config->story->custom->create = $config->story->list->customCreateFields;
$config->story->custom->batchcreate = 'module,plan,spec,pri,estimate,review';
$config->story->custom->batchedit = 'module,plan,estimate,pri,source,stage,closedBy,closedReason';
$config->story->datatable = new stdclass();
$config->story->datatable->defaultField = array('id', 'pri', 'title', 'plan', 'source', 'openedBy', 'assignedTo', 'estimate', 'status', 'stage', 'actions');
+5
View File
@@ -430,6 +430,11 @@ class story extends control
$this->lang->story->stageList['ditto'] = $this->lang->story->ditto;
$this->lang->story->reasonList['ditto'] = $this->lang->story->ditto;
/* Set Custom*/
foreach(explode(',', $this->config->story->list->batchEditFields) as $field) $customFields[$field] = $this->lang->story->$field;
$this->view->customFields = $customFields;
$this->view->showFields = $this->config->story->custom->batchedit;
/* Judge whether the editedStories is too large and set session. */
$showSuhosinInfo = false;
$showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting(count($stories), $this->config->story->batchEdit->columns);
+3
View File
@@ -522,9 +522,12 @@ class storyModel extends model
$story->title = $data->titles[$storyID];
$story->estimate = $data->estimates[$storyID];
$story->pri = $data->pris[$storyID];
$story->assignedTo = $data->assignedTo[$storyID];
$story->assignedDate = $oldStory == $data->assignedTo[$storyID] ? $oldStory->assignedDate : $now;
$story->module = $data->modules[$storyID];
$story->plan = $data->plans[$storyID];
$story->source = $data->sources[$storyID];
$story->keywords = $data->keywords[$storyID];
$story->stage = isset($data->stages[$storyID]) ? $data->stages[$storyID] : $oldStory->stage;
$story->closedBy = isset($data->closedBys[$storyID]) ? $data->closedBys[$storyID] : $oldStory->closedBy;
$story->closedReason = isset($data->closedReasons[$storyID]) ? $data->closedReasons[$storyID] : $oldStory->closedReason;
+36 -30
View File
@@ -19,23 +19,35 @@
<?php if($productName):?>
<small class='text-muted'><?php echo html::icon($lang->icons['product']) . ' ' . $lang->story->product . $lang->colon . ' ' . $productName;?></small>
<?php endif;?>
<div class='actions'>
<button type="button" class="btn btn-default" data-toggle="customModal"><i class='icon icon-cog'></i> </button>
</div>
</div>
</div>
<?php
$hasFields = array();
foreach(explode(',', $showFields) as $field)
{
if($field)$hasFields[$field] = '';
}
?>
<form class='form-condensed' method='post' target='hiddenwin' action="<?php echo inLink('batchEdit', "from=storyBatchEdit")?>">
<table class='table table-form table-fixed'>
<thead>
<tr class='text-center'>
<th class='w-30px'> <?php echo $lang->idAB;?></th>
<th class='w-200px'><?php echo $lang->story->module;?></th>
<th class='w-200px'><?php echo $lang->story->planAB;?></th>
<th class='w-40px'> <?php echo $lang->idAB;?></th>
<th class='w-150px<?php echo zget($hasFields, 'module', ' hidden')?>'><?php echo $lang->story->module;?></th>
<th class='w-150px<?php echo zget($hasFields, 'plan', ' hidden')?>'><?php echo $lang->story->planAB;?></th>
<th> <?php echo $lang->story->title;?> <span class='required'></span></th>
<th class='w-50px'> <?php echo $lang->story->estimateAB;?></th>
<th class='w-70px'> <?php echo $lang->priAB;?></th>
<th class='w-100px'> <?php echo $lang->story->source;?></th>
<th class='w-50px<?php echo zget($hasFields, 'estimate', ' hidden')?>'> <?php echo $lang->story->estimateAB;?></th>
<th class='w-70px<?php echo zget($hasFields, 'pri', ' hidden')?>'> <?php echo $lang->priAB;?></th>
<th class='w-100px<?php echo zget($hasFields, 'assignedTo', ' hidden')?>'> <?php echo $lang->story->assignedTo;?></th>
<th class='w-100px<?php echo zget($hasFields, 'source', ' hidden')?>'> <?php echo $lang->story->source;?></th>
<th class='w-80px'> <?php echo $lang->story->status;?></th>
<th class='w-100px'> <?php echo $lang->story->stageAB;?></th>
<th class='w-130px'><?php echo $lang->story->closedBy;?></th>
<th><?php echo $lang->story->closedReason;?></th>
<th class='w-100px<?php echo zget($hasFields, 'stage', ' hidden')?>'> <?php echo $lang->story->stageAB;?></th>
<th class='w-130px<?php echo zget($hasFields, 'closedBy', ' hidden')?>'><?php echo $lang->story->closedBy;?></th>
<th<?php echo zget($hasFields, 'closedReason', "class='hidden'")?>><?php echo $lang->story->closedReason;?></th>
<th class='w-80px<?php echo zget($hasFields, 'keywords', ' hidden')?>'><?php echo $lang->story->keywords;?></th>
</tr>
</thead>
<tbody>
@@ -54,28 +66,19 @@
?>
<tr class='text-center'>
<td><?php echo $storyID . html::hidden("storyIDList[$storyID]", $storyID);?></td>
<td class='text-left' style='overflow:visible'> <?php echo html::select("modules[$storyID]", $modules, $stories[$storyID]->module, "class='form-control chosen'");?></td>
<td class='text-left' style='overflow:visible'> <?php echo html::select("plans[$storyID]", $productPlans, $stories[$storyID]->plan, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($hasFields, 'module', ' hidden')?>' style='overflow:visible'> <?php echo html::select("modules[$storyID]", $modules, $stories[$storyID]->module, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($hasFields, 'plan', ' hidden')?>' style='overflow:visible'> <?php echo html::select("plans[$storyID]", $productPlans, $stories[$storyID]->plan, "class='form-control chosen'");?></td>
<td title='<?php echo $stories[$storyID]->title?>'><?php echo html::input("titles[$storyID]", $stories[$storyID]->title, 'class=form-control'); ?></td>
<td><?php echo html::input("estimates[$storyID]", $stories[$storyID]->estimate, "class='form-control' autocomplete='off'"); ?></td>
<td><?php echo html::select("pris[$storyID]", $priList, $stories[$storyID]->pri, 'class=form-control');?></td>
<td><?php echo html::select("sources[$storyID]", $sourceList, $stories[$storyID]->source, 'class=form-control');?></td>
<td <?php echo zget($hasFields, 'estimate', "class='hidden'")?>><?php echo html::input("estimates[$storyID]", $stories[$storyID]->estimate, "class='form-control' autocomplete='off'"); ?></td>
<td <?php echo zget($hasFields, 'pri', "class='hidden'")?>><?php echo html::select("pris[$storyID]", $priList, $stories[$storyID]->pri, 'class=form-control');?></td>
<td class='text-left<?php echo zget($hasFields, 'assignedTo', ' hidden')?>' style='overflow:visible'><?php echo html::select("assignedTo[$storyID]", $users, $stories[$storyID]->assignedTo, "class='form-control chosen'");?></td>
<td <?php echo zget($hasFields, 'source', "class='hidden'")?>><?php echo html::select("sources[$storyID]", $sourceList, $stories[$storyID]->source, 'class=form-control');?></td>
<td class='story-<?php echo $stories[$storyID]->status;?>'><?php echo $lang->story->statusList[$stories[$storyID]->status];?></td>
<?php if($stories[$storyID]->status != 'draft'):?>
<td><?php echo html::select("stages[$storyID]", $stageList, $stories[$storyID]->stage, 'class=form-control');?></td>
<?php else:?>
<td><?php echo html::select("stages[$storyID]", $stageList, $stories[$storyID]->stage, 'class="form-control" disabled="disabled"');?></td>
<?php endif;?>
<td <?php echo zget($hasFields, 'stage', "class='hidden'")?>><?php echo html::select("stages[$storyID]", $stageList, $stories[$storyID]->stage, 'class="form-control"' . ($stories[$storyID]->status == 'draft' ? ' disabled="disabled"' : ''));?></td>
<td class='text-left<?php echo zget($hasFields, 'closedBy', ' hidden')?>' style='overflow:visible'><?php echo html::select("closedBys[$storyID]", $users, $stories[$storyID]->closedBy, "class='form-control" . ($stories[$storyID]->status == 'closed' ? " chosen'" : "' disabled='disabled'"));?></td>
<?php if($stories[$storyID]->status == 'closed'):?>
<td class='text-left' style='overflow:visible'><?php echo html::select("closedBys[$storyID]", $users, $stories[$storyID]->closedBy, "class='form-control chosen'");?></td>
<?php else:?>
<td class='text-left'><?php echo html::select("closedBys[$storyID]", $users, $stories[$storyID]->closedBy, 'class="form-control" disabled="disabled"');?></td>
<?php endif;?>
<?php if($stories[$storyID]->status == 'closed'):?>
<td>
<td <?php echo zget($hasFields, 'closedReason', "class='hidden'")?>>
<table class='w-p100'>
<tr>
<td class='pd-0'>
@@ -91,17 +94,20 @@
</table>
</td>
<?php else:?>
<td><?php echo html::select("closedReasons[$storyID]", $reasonList, $stories[$storyID]->closedReason, 'class="form-control" disabled="disabled"');?></td>
<td <?php echo zget($hasFields, 'closedReason', "class='hidden'")?>><?php echo html::select("closedReasons[$storyID]", $reasonList, $stories[$storyID]->closedReason, 'class="form-control" disabled="disabled"');?></td>
<?php endif;?>
<td <?php echo zget($hasFields, 'keywords', "class='hidden'")?>><?php echo html::input("keywords[$storyID]", $stories[$storyID]->keywords, 'class="form-control"');?></td>
</tr>
<?php endforeach;?>
<?php if(isset($suhosinInfo)):?>
<tr><td colspan='<?php echo $this->config->story->batchEdit->columns;?>'><div id='suhosinInfo' class='alert alert-info'><?php echo $suhosinInfo;?></div></td></tr>
<tr><td colspan='<?php echo count($hasFields) + 3;?>'><div id='suhosinInfo' class='alert alert-info'><?php echo $suhosinInfo;?></div></td></tr>
<?php endif;?>
</tbody>
<tfoot>
<tr><td colspan='<?php echo $this->config->story->batchEdit->columns;?>' class='text-center'><?php echo html::submitButton();?></td></tr>
<tr><td colspan='<?php echo count($hasFields) + 3;?>' class='text-center'><?php echo html::submitButton();?></td></tr>
</tfoot>
</table>
</form>
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustom', 'module=story&section=custom&key=batchedit')?>
<?php include '../../common/view/customfield.html.php';?>
<?php include '../../common/view/footer.html.php';?>