* Fix bug #12840.
This commit is contained in:
@@ -434,7 +434,6 @@ class story extends control
|
||||
$products = $this->product->getPairs();
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch);
|
||||
|
||||
|
||||
/* Init vars. */
|
||||
$planID = $plan;
|
||||
$pri = 0;
|
||||
@@ -494,6 +493,7 @@ class story extends control
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->moduleOptionMenu = $moduleOptionMenu;
|
||||
$this->view->plans = $plans;
|
||||
$this->view->users = $this->user->getPairs('pdfirst|noclosed|nodeleted');
|
||||
$this->view->priList = $priList;
|
||||
$this->view->sourceList = $sourceList;
|
||||
$this->view->planID = $planID;
|
||||
|
||||
+23
-1
@@ -353,6 +353,16 @@ class storyModel extends model
|
||||
*/
|
||||
public function batchCreate($productID = 0, $branch = 0, $type = 'story')
|
||||
{
|
||||
foreach($_POST['needReview'] as $index => $value)
|
||||
{
|
||||
if(isset($_POST['reviewer'][$index])) $_POST['reviewer'][$index] = array_filter($_POST['reviewer'][$index]);
|
||||
if($value and !isset($_POST['reviewer'][$index]))
|
||||
{
|
||||
dao::$errors[] = $this->lang->story->errorEmptyReviewedBy;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->loadModel('action');
|
||||
$branch = (int)$branch;
|
||||
$productID = (int)$productID;
|
||||
@@ -489,6 +499,19 @@ class storyModel extends model
|
||||
|
||||
$this->dao->insert(TABLE_STORYSPEC)->data($specData)->exec();
|
||||
|
||||
/* Save the story reviewer to storyreview table. */
|
||||
if(isset($_POST['reviewer'][$i]))
|
||||
{
|
||||
foreach($_POST['reviewer'][$i] as $reviewer)
|
||||
{
|
||||
$reviewData = new stdclass();
|
||||
$reviewData->story = $storyID;
|
||||
$reviewData->version = 1;
|
||||
$reviewData->reviewer = $reviewer;
|
||||
$this->dao->insert(TABLE_STORYREVIEW)->data($reviewData)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
$this->executeHooks($storyID);
|
||||
|
||||
$actionID = $this->action->create('story', $storyID, 'Opened', '');
|
||||
@@ -498,7 +521,6 @@ class storyModel extends model
|
||||
$mails[$i]->actionID = $actionID;
|
||||
}
|
||||
|
||||
|
||||
/* Remove upload image file and session. */
|
||||
if(!empty($stories->uploadImage) and $this->session->storyImagesFile)
|
||||
{
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
<th class='col-pri<?php echo zget($visibleFields, 'pri', ' hidden') . zget($requiredFields, 'pri', '', ' required');?>'><?php echo $lang->story->pri;?></th>
|
||||
<th class='col-estimate<?php echo zget($visibleFields, 'estimate', ' hidden') . zget($requiredFields, 'estimate', '', ' required');?>'><?php echo $lang->story->estimate;?></th>
|
||||
<th class='col-review<?php echo zget($visibleFields, 'review', ' hidden') . zget($requiredFields, 'review', '', ' required');?>'><?php echo $lang->story->needReview;?></th>
|
||||
<th class='<?php echo zget($visibleFields, 'review', ' hidden');?>' style="width: 200px !important"><?php echo $lang->story->reviewedBy;?></th>
|
||||
<th class='w-100px<?php echo zget($visibleFields, 'keywords', ' hidden') . zget($requiredFields, 'keywords', '', ' required');?>'><?php echo $lang->story->keywords;?></th>
|
||||
<?php
|
||||
$extendFields = $this->story->getFlowExtendFields();
|
||||
@@ -95,6 +96,7 @@
|
||||
<td class='text-left<?php echo zget($visibleFields, 'pri', ' hidden')?>' style='overflow:visible'><?php echo html::select('pri[$id]', $priList, $pri, "class='form-control chosen'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'estimate', 'hidden')?>'><?php echo html::input('estimate[$id]', $estimate, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'review', 'hidden')?>'><?php echo html::select('needReview[$id]', $lang->story->reviewList, $needReview, "class='form-control'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'review', 'hidden')?>'><?php echo html::select('reviewer[$id][]', $users, '', "class='form-control chosen' multiple disabled");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'keywords', 'hidden')?>'><?php echo html::input('keywords[$id]', '', "class='form-control'");?></td>
|
||||
<?php foreach($extendFields as $extendField) echo "<td" . (($extendField->control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->loadModel('flow')->getFieldControl($extendField, '', $extendField->field . '[$id]') . "</td>";?>
|
||||
</tr>
|
||||
@@ -141,6 +143,14 @@ $(function()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('change', "#mainContent select[name^=needReview]", function()
|
||||
{
|
||||
select = $(this).parent('td').next('td').children("select[name^=reviewer]");
|
||||
$(select).removeAttr('disabled');
|
||||
if($(this).val() == 0) $(select).attr('disabled', 'disabled');
|
||||
$(select).trigger("chosen:updated");
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<?php if(isset($execution)) js::set('execution', $execution);?>
|
||||
|
||||
Reference in New Issue
Block a user