* Add notes.

This commit is contained in:
tianshujie98
2020-10-10 16:56:20 +08:00
parent 2ae42d3d16
commit 294b3e0ccf
+14 -6
View File
@@ -129,7 +129,7 @@ class bugModel extends model
*
* @param string $from object that is transfered to bug.
* @access public
* @return int|bool
* @return array|bool
*/
public function create($from = '')
{
@@ -177,17 +177,19 @@ class bugModel extends model
* Batch create
*
* @param int $productID
* @param int $branch
* @access public
* @return void
*/
public function batchCreate($productID, $branch = 0)
{
/* Load module and init vars. */
$this->loadModel('action');
$branch = (int)$branch;
$productID = (int)$productID;
$now = helper::now();
$actions = array();
$data = fixer::input('post')->get();
$branch = (int)$branch;
$productID = (int)$productID;
$now = helper::now();
$actions = array();
$data = fixer::input('post')->get();
$result = $this->loadModel('common')->removeDuplicate('bug', $data, "product={$productID}");
$data = $result['data'];
@@ -220,8 +222,10 @@ class bugModel extends model
$data->browsers[$i] = $browser;
}
/* If there are images to upload, load the file module. */
if(isset($data->uploadImage)) $this->loadModel('file');
$extendFields = $this->getFlowExtendFields();
$bugs = array();
foreach($data->title as $i => $title)
{
@@ -246,6 +250,7 @@ class bugModel extends model
$bug->browser = $data->browsers[$i];
$bug->keywords = $data->keywords[$i];
/* Assign the bug to the person in charge of the module. */
if(!empty($moduleOwners[$bug->module]))
{
$bug->assignedTo = $moduleOwners[$bug->module];
@@ -259,6 +264,7 @@ class bugModel extends model
if($message) die(js::alert($message));
}
/* Required field check. */
foreach(explode(',', $this->config->bug->create->requiredFields) as $field)
{
$field = trim($field);
@@ -268,6 +274,7 @@ class bugModel extends model
$bugs[$i] = $bug;
}
/* When the bug is created by uploading an image, add the image to the step of the bug. */
foreach($bugs as $i => $bug)
{
if(!empty($data->uploadImage[$i]))
@@ -305,6 +312,7 @@ class bugModel extends model
$this->executeHooks($bugID);
/* When the bug is created by uploading the image, add the image to the file of the bug. */
$this->loadModel('score')->create('bug', 'create', $bugID);
if(!empty($data->uploadImage[$i]) and !empty($file))
{