* Set menu in constructor of every module under devops.
This commit is contained in:
@@ -11,6 +11,20 @@
|
||||
*/
|
||||
class gitlab extends control
|
||||
{
|
||||
/**
|
||||
* The gitlab constructor.
|
||||
* @param string $moduleName
|
||||
* @param string $methodName
|
||||
*/
|
||||
public function __construct($moduleName = '', $methodName = '')
|
||||
{
|
||||
parent::__construct($moduleName, $methodName);
|
||||
|
||||
/* This is essential when changing tab(menu) from gitlab to repo. */
|
||||
/* Optional: common::setMenuVars('devops', $this->session->repoID); */
|
||||
$this->loadModel('ci')->setMenu();
|
||||
}
|
||||
|
||||
/**
|
||||
* Browse gitlab.
|
||||
*
|
||||
@@ -23,8 +37,6 @@ class gitlab extends control
|
||||
*/
|
||||
public function browse($orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* This is essential when changing tab(menu) from gitlab to repo. */
|
||||
common::setMenuVars('devops', $this->session->repoID);
|
||||
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
+14
-1
@@ -1,6 +1,20 @@
|
||||
<?php
|
||||
class mr extends control
|
||||
{
|
||||
/**
|
||||
* The mr constructor.
|
||||
* @param string $moduleName
|
||||
* @param string $methodName
|
||||
*/
|
||||
public function __construct($moduleName = '', $methodName = '')
|
||||
{
|
||||
parent::__construct($moduleName, $methodName);
|
||||
|
||||
/* This is essential when changing tab(menu) from gitlab to repo. */
|
||||
/* Optional: common::setMenuVars('devops', $this->session->repoID); */
|
||||
$this->loadModel('ci')->setMenu();
|
||||
}
|
||||
|
||||
/**
|
||||
* Browse mr.
|
||||
*
|
||||
@@ -20,7 +34,6 @@ class mr extends control
|
||||
|
||||
/* Save current URI to session. */
|
||||
$this->session->set('mrList', $this->app->getURI(true), 'repo');
|
||||
common::setMenuVars('devops', $this->session->repoID);
|
||||
|
||||
/* Sync GitLab MR to ZenTao Database. */
|
||||
$MRList = $this->mr->batchSyncMR($MRList);
|
||||
|
||||
Reference in New Issue
Block a user