* Code for bug config.
This commit is contained in:
+35
-30
@@ -40,39 +40,39 @@ $config->bug->exportFields = 'id, product, branch, module, project, execution, s
|
||||
|
||||
$config->bug->fieldList['id']['title'] = 'id';
|
||||
|
||||
$config->bug->fieldList['product']['title'] = 'product';
|
||||
$config->bug->fieldList['product']['foreignKey'] = true;
|
||||
$config->bug->fieldList['product']['foreignKeySource'] = array('module' => 'product', 'method' => 'getPairs');
|
||||
$config->bug->fieldList['product']['title'] = 'product';
|
||||
$config->bug->fieldList['product']['control'] = 'hidden';
|
||||
$config->bug->fieldList['product']['dataSource'] = array('module' => 'product', 'method' => 'getPairs');
|
||||
|
||||
$config->bug->fieldList['branch']['title'] = 'branch';
|
||||
$config->bug->fieldList['branch']['foreignKey'] = true;
|
||||
$config->bug->fieldList['branch']['foreignKeySource'] = array('module' => 'bug', 'method' => 'getRelatedObjects', 'params' => 'branch&id,name');
|
||||
$config->bug->fieldList['branch']['title'] = 'branch';
|
||||
$config->bug->fieldList['branch']['control'] = 'select';
|
||||
$config->bug->fieldList['branch']['dataSource'] = array('module' => 'bug', 'method' => 'getRelatedObjects', 'params' => 'branch&id,name');
|
||||
|
||||
$config->bug->fieldList['module']['title'] = 'module';
|
||||
$config->bug->fieldList['module']['foreignKey'] = true;
|
||||
$config->bug->fieldList['module']['foreignKeySource'] = array('module' => 'tree', 'method' => 'getAllModulePairs', 'params' => 'bug');
|
||||
$config->bug->fieldList['module']['control'] = 'select';
|
||||
$config->bug->fieldList['module']['title'] = 'module';
|
||||
$config->bug->fieldList['module']['dataSource'] = array('module' => 'tree', 'method' => 'getAllModulePairs', 'params' => 'bug');
|
||||
|
||||
$config->bug->fieldList['project']['title'] = 'project';
|
||||
$config->bug->fieldList['project']['foreignKey'] = true;
|
||||
$config->bug->fieldList['project']['foreignKeySource'] = array('module' => 'product', 'method' => 'getProjectPairsByProduct', 'params' => '$productID');
|
||||
$config->bug->fieldList['project']['title'] = 'project';
|
||||
$config->bug->fieldList['project']['control'] = 'hidden';
|
||||
$config->bug->fieldList['project']['dataSource'] = array('module' => 'product', 'method' => 'getProjectPairsByProduct', 'params' => '$productID');
|
||||
|
||||
$config->bug->fieldList['execution']['title'] = 'execution';
|
||||
$config->bug->fieldList['execution']['foreignKey'] = true;
|
||||
$config->bug->fieldList['execution']['foreignKeySource'] = array('module' => 'execution', 'method' =>'getPairs');
|
||||
$config->bug->fieldList['execution']['title'] = 'execution';
|
||||
$config->bug->fieldList['execution']['dataSource'] = array('module' => 'execution', 'method' =>'getPairs');
|
||||
|
||||
$config->bug->fieldList['story']['title'] = 'story';
|
||||
$config->bug->fieldList['story']['foreignKey'] = true;
|
||||
$config->bug->fieldList['story']['foreignKeySource'] = array('module' => 'bug', 'method' =>'getRelatedObjects', 'params' => 'story&id,title');
|
||||
$config->bug->fieldList['story']['title'] = 'story';
|
||||
$config->bug->fieldList['story']['control'] = 'select';
|
||||
$config->bug->fieldList['story']['dataSource'] = array('module' => 'bug', 'method' =>'getRelatedObjects', 'params' => 'story&id,title');
|
||||
|
||||
$config->bug->fieldList['task']['title'] = 'task';
|
||||
$config->bug->fieldList['task']['foreignKey'] = true;
|
||||
$config->bug->fieldList['task']['foreignKeySource'] = array('module' => 'bug', 'method' =>'getRelatedObjects', 'params' => 'task&id,name');
|
||||
$config->bug->fieldList['task']['title'] = 'task';
|
||||
$config->bug->fieldList['task']['dataSource'] = array('module' => 'bug', 'method' =>'getRelatedObjects', 'params' => 'task&id,name');
|
||||
|
||||
$config->bug->fieldList['steps']['title'] = 'steps';
|
||||
$config->bug->fieldList['steps']['title'] = 'steps';
|
||||
$config->bug->fieldList['steps']['control'] = 'textarea';
|
||||
|
||||
$config->bug->fieldList['status']['title'] = 'status';
|
||||
|
||||
$config->bug->fieldList['deadline']['title'] = 'deadline';
|
||||
$config->bug->fieldList['deadline']['title'] = 'deadline';
|
||||
$config->bug->fieldList['deadline']['control'] = 'date';
|
||||
|
||||
$config->bug->fieldList['activatedCount']['title'] = 'activatedCount';
|
||||
|
||||
@@ -84,11 +84,11 @@ $config->bug->fieldList['openedBy']['title'] = 'openedBy';
|
||||
|
||||
$config->bug->fieldList['openedDate']['title'] = 'openedDate';
|
||||
|
||||
$config->bug->fieldList['openedBuild']['title'] = 'openedBuild';
|
||||
$config->bug->fieldList['openedBuild']['foreignKey'] = true;
|
||||
$config->bug->fieldList['openedBuild']['foreignKeySource'] = array('module' => 'bug', 'method' =>'getRelatedObjects', 'params' => 'openedBuild&id,name');
|
||||
$config->bug->fieldList['openedBuild']['title'] = 'openedBuild';
|
||||
$config->bug->fieldList['openedBuild']['control'] = 'multiple';
|
||||
$config->bug->fieldList['openedBuild']['dataSource'] = array('module' => 'bug', 'method' =>'getRelatedObjects', 'params' => 'openedBuild&id,name');
|
||||
|
||||
$config->bug->fieldList['assignedTo']['title'] = 'assignedTo';
|
||||
$config->bug->fieldList['assignedTo']['title'] = 'assignedTo';
|
||||
|
||||
$config->bug->fieldList['assignedDate']['title'] = 'assignedDate';
|
||||
|
||||
@@ -109,13 +109,18 @@ $config->bug->fieldList['duplicateBug']['title'] = 'duplicateBug';
|
||||
$config->bug->fieldList['linkBug']['title'] = 'linkBug';
|
||||
|
||||
$config->bug->fieldList['case']['title'] = 'case';
|
||||
$config->bug->fieldList['case']['foreignKey'] = true;
|
||||
$config->bug->fieldList['case']['foreignKeySource'] = array('module' => 'bug', 'method' =>'getRelatedObjects', 'params' => 'case&id,title');
|
||||
$config->bug->fieldList['case']['dataSource'] = array('module' => 'bug', 'method' =>'getRelatedObjects', 'params' => 'case&id,title');
|
||||
|
||||
$config->bug->fieldList['lastEditedBy']['title'] = 'lastEditedBy';
|
||||
|
||||
$config->bug->fieldList['lastEditedDate']['title'] = 'lastEditedDate';
|
||||
|
||||
$config->bug->fieldList['files']['title'] = 'files';
|
||||
$config->bug->fieldList['feedbackBy']['title'] = 'feedbackBy';
|
||||
|
||||
$config->bug->fieldList['feedbackBy']['title'] = 'feedbackBy';
|
||||
$config->bug->fieldList['feedbackBy']['control'] = 'select';
|
||||
$config->bug->fieldList['feedbackBy']['values'] = 'user';
|
||||
|
||||
$config->bug->fieldList['notifyEmail']['title'] = 'notifyEmail';
|
||||
|
||||
if($config->systemMode == 'classic') $config->bug->exportFields = str_replace(' project,', '', $config->bug->exportFields);
|
||||
|
||||
@@ -3461,15 +3461,14 @@ class bugModel extends model
|
||||
$relatedObjectIdList[$bug->$object] = $bug->$object;
|
||||
}
|
||||
|
||||
if($object == 'openedBuild')
|
||||
{
|
||||
$relatedObjectIdList = array('trunk' => $this->lang->trunk) + $relatedObjectIdList;
|
||||
$object = 'build';
|
||||
}
|
||||
if($object == 'openedBuild') $object = 'build';
|
||||
|
||||
/* Get related objects title or names. */
|
||||
$table = $this->config->objectTables[$object];
|
||||
if($table) $relatedObjects = $this->dao->select($pairs)->from($table) ->where('id')->in($relatedObjectIdList)->fetchPairs();
|
||||
|
||||
if($object == 'build') $relatedObjects= array('trunk' => $this->lang->trunk) + $relatedObjects;
|
||||
|
||||
return $relatedObjects;
|
||||
}
|
||||
}
|
||||
|
||||
+30
-28
@@ -76,7 +76,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* createFromImport
|
||||
* Create from import.
|
||||
*
|
||||
* @param int $model
|
||||
* @param string $params
|
||||
@@ -111,7 +111,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* initPostFields
|
||||
* Init postFields.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -291,7 +291,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* init system datafields list.
|
||||
* Init system datafields list.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -496,7 +496,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* setListValue
|
||||
* Set list value.
|
||||
*
|
||||
* @param int $model
|
||||
* @param int $fieldList
|
||||
@@ -579,7 +579,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* updateChildrenDatas
|
||||
* Update children datas.
|
||||
*
|
||||
* @param int $datas
|
||||
* @access public
|
||||
@@ -623,7 +623,7 @@ class portModel extends model
|
||||
|
||||
|
||||
/**
|
||||
* initTmpFile
|
||||
* Init tmpFile.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -660,19 +660,13 @@ class portModel extends model
|
||||
unset($fields[$key]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//$objectDatas = $this->getNatureDatas($objectDatas);
|
||||
|
||||
|
||||
|
||||
if($created) $this->createTmpFile($tmpFile, $objectDatas);
|
||||
|
||||
return $objectDatas;
|
||||
}
|
||||
|
||||
/**
|
||||
* checkTmpFile
|
||||
* Check tmpFile.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -688,7 +682,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* checkRowsFromExcel
|
||||
* Check rows from excel.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -709,7 +703,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* createTmpFile
|
||||
* Create tmpFile.
|
||||
*
|
||||
* @param int $path
|
||||
* @param int $tmpFile
|
||||
@@ -728,7 +722,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* getNatureDatas
|
||||
* Get nature datas.
|
||||
*
|
||||
* @param int $datas
|
||||
* @access public
|
||||
@@ -766,7 +760,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* checkSuhosinInfo
|
||||
* Check suhosin info.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -774,14 +768,14 @@ class portModel extends model
|
||||
public function checkSuhosinInfo($datas = array())
|
||||
{
|
||||
/* Judge whether the editedTasks is too large and set session. */
|
||||
$countInputVars = count($datas) * 11;
|
||||
$countInputVars = count($datas) * 11; // Count all post datas
|
||||
$showSuhosinInfo = common::judgeSuhosinSetting($countInputVars);
|
||||
if($showSuhosinInfo) return extension_loaded('suhosin') ? sprintf($this->lang->suhosinInfo, $countInputVars) : sprintf($this->lang->maxVarsInfo, $countInputVars);
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* getDatasByFile
|
||||
* Get datas by file.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -792,7 +786,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* getPageDatas
|
||||
* Get pagelist for datas.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -826,7 +820,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* getImportFields
|
||||
* Get import fields.
|
||||
*
|
||||
* @param string $model
|
||||
* @access public
|
||||
@@ -849,7 +843,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* processRows4Fields
|
||||
* Process rows for fields.
|
||||
*
|
||||
* @param array $rows
|
||||
* @param array $fields
|
||||
@@ -890,8 +884,15 @@ class portModel extends model
|
||||
|
||||
$tmpArray->$field = $cellValue;
|
||||
}
|
||||
if(empty($tmpArray->name)) continue;
|
||||
$objectDatas[$currentRow] = $tmpArray;
|
||||
|
||||
if(!empty($tmpArray->title))
|
||||
{
|
||||
$objectDatas[$currentRow] = $tmpArray;
|
||||
}
|
||||
elseif(!empty($tmpArray->name))
|
||||
{
|
||||
$objectDatas[$currentRow] = $tmpArray;
|
||||
}
|
||||
unset($tmpArray);
|
||||
}
|
||||
|
||||
@@ -908,8 +909,9 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* saveImportDatas
|
||||
* Save import datas.
|
||||
*
|
||||
* @param int $model
|
||||
* @param int $datas
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -953,7 +955,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* processChildData
|
||||
* Process child datas (task, story).
|
||||
*
|
||||
* @param int $objectID
|
||||
* @param int $data
|
||||
@@ -982,7 +984,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* saveSubTable
|
||||
* Save SubTable datas.
|
||||
*
|
||||
* @param int $lastInsertID
|
||||
* @param int $datas
|
||||
@@ -1001,7 +1003,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* checkRequired
|
||||
* Check Required fields .
|
||||
*
|
||||
* @param int $model
|
||||
* @param int $line
|
||||
|
||||
@@ -90,39 +90,24 @@ $(function()
|
||||
<?php if($value['control'] == 'select'):?>
|
||||
<td><?php echo html::select("{$field}[$key]", $value['values'], !empty($object->$field) ? $object->$field : '', "class='form-control chosen'")?></td>
|
||||
|
||||
<?php elseif($value['control'] == 'multiple'):?>
|
||||
<?php if(!isset($value['values'][''])) $value['values'][''] = '';?>
|
||||
<td><?php echo html::select("{$field}[$key][]", $value['values'], !empty($object->$field) ? $object->$field : '', "multiple class='form-control chosen'")?></td>
|
||||
|
||||
<?php elseif($value['control'] == 'date'):?>
|
||||
<?php $dateMatch = $this->config->port->dateMatch;?>
|
||||
<?php if(!preg_match($dateMatch, $object->$field)) $object->$field = ''; ?>
|
||||
<td><?php echo html::input("{$field}[$key]", !empty($object->$field) ? $object->$field : '', "class='form-control form-date autocomplete='off'")?></td>
|
||||
|
||||
<?php elseif($value['control'] == 'datetime'):?>
|
||||
<td><?php echo html::input("{$field}[$key]", !empty($object->$field) ? $object->$field : '', "class='form-control form-datetime autocomplete='off'")?></td>
|
||||
|
||||
<?php elseif($value['control'] == 'hidden'):?>
|
||||
<?php echo html::hidden("{$field}[$key]", $object->$field)?>
|
||||
|
||||
<?php elseif($value['control'] == 'textarea'):?>
|
||||
<td><?php echo html::textarea("{$field}[$key]", $object->$field, "class='form-control' cols='50' rows='1'")?></td>
|
||||
|
||||
<?php elseif($field == 'estimate'):?>
|
||||
<td>
|
||||
<?php
|
||||
if(is_array($object->estimate))
|
||||
{
|
||||
echo "<table class='table-borderless'>";
|
||||
foreach($object->estimate as $account => $estimate)
|
||||
{
|
||||
echo '<tr>';
|
||||
echo '<td class="c-team">' . html::select("team[$key][]", $members, $account, "class='form-control chosen'") . '</td>';
|
||||
echo '<td class="c-estimate-1">' . html::input("estimate[$key][]", $estimate, "class='form-control' autocomplete='off'") . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::input("estimate[$key]", !empty($task->estimate) ? $task->estimate : '', "class='form-control'");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<?php else:?>
|
||||
<td><?php echo html::input("{$field}[$key]", !empty($object->$field) ? $object->$field : '', "class='form-control autocomplete='off'")?></td>
|
||||
<?php endif;?>
|
||||
|
||||
Reference in New Issue
Block a user