* [bug#58493] adjust release linked system data.
This commit is contained in:
@@ -652,16 +652,17 @@ class release extends control
|
||||
*
|
||||
* @param int $systemID
|
||||
* @param string $linkedRelease
|
||||
* @param int $releaseID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxLoadSystemBlock(int $systemID, string $linkedRelease = '')
|
||||
public function ajaxLoadSystemBlock(int $systemID, string $linkedRelease = '', int $releaseID = 0)
|
||||
{
|
||||
$system = $this->loadModel('system')->fetchByID($systemID);
|
||||
$children = explode(',', $system->children);
|
||||
|
||||
$appList = $this->system->getByIdList($children);
|
||||
$releases = $this->release->getListBySystem($children);
|
||||
$releases = $this->release->getListBySystem($children, $releaseID);
|
||||
|
||||
$this->view->appList = $appList;
|
||||
$this->view->releases = $releases;
|
||||
|
||||
@@ -9,7 +9,7 @@ window.loadSystemBlock = function()
|
||||
if(typeof linkedRelease == 'undefined') linkedRelease = '';
|
||||
|
||||
$('#systemBlock').removeClass('hidden');
|
||||
loadTarget($.createLink('release', 'ajaxLoadSystemBlock', `systemID=${systemID}&release=${linkedRelease}`), 'systemItems');
|
||||
loadTarget($.createLink('release', 'ajaxLoadSystemBlock', `systemID=${systemID}&release=${linkedRelease}&releaseID=${releaseID}`), 'systemItems');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -220,14 +220,16 @@ class releaseModel extends model
|
||||
* Get releases by system.
|
||||
*
|
||||
* @param array $systemList
|
||||
* @param int $filterRelease
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getListBySystem(array $systemList): array
|
||||
public function getListBySystem(array $systemList, int $filterRelease = 0): array
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_RELEASE)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('system')->in($systemList)
|
||||
->beginIF($filterRelease)->andWhere('id')->ne($filterRelease)->fi()
|
||||
->orderBy('id DESC')
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ jsVar('oldStatus', $release->status);
|
||||
jsVar('linkedRelease', $release->releases);
|
||||
jsVar('productID', zget($product, 'id', 0));
|
||||
jsVar('releaseBuilds', $release->build);
|
||||
jsVar('releaseID', $release->id);
|
||||
|
||||
formPanel
|
||||
(
|
||||
@@ -138,6 +139,3 @@ formPanel
|
||||
),
|
||||
formHidden('product', $release->product)
|
||||
);
|
||||
|
||||
/* ====== Render page ====== */
|
||||
render();
|
||||
|
||||
Reference in New Issue
Block a user