* adjust for upgrade.
This commit is contained in:
@@ -5,3 +5,5 @@ ALTER TABLE `zt_task` ADD `v1` varchar(40) NOT NULL AFTER `lines`;
|
||||
ALTER TABLE `zt_task` ADD `v2` varchar(40) NOT NULL AFTER `v1`;
|
||||
ALTER TABLE `zt_task` ADD `mr` mediumint(8) unsigned NOT NULL AFTER `repo`;
|
||||
ALTER TABLE `zt_bug` ADD `mr` mediumint(8) unsigned NOT NULL AFTER `repo`;
|
||||
|
||||
UPDATE `zt_grouppriv` SET `method`='addReview' where `module`='mr' and `method`='addBug';
|
||||
|
||||
+1
-1
@@ -793,7 +793,7 @@ class mrModel extends model
|
||||
*/
|
||||
public function getReview($repoID, $MRID, $revision = '')
|
||||
{
|
||||
if(empty($repoID) OR empty($MRID)) return array();
|
||||
if(empty($repoID) or empty($MRID)) return array();
|
||||
|
||||
$reviews = array();
|
||||
$bugs = $this->dao->select('t1.*, t2.realname')->from(TABLE_BUG)->alias('t1')
|
||||
|
||||
@@ -735,10 +735,6 @@ class upgradeModel extends model
|
||||
$this->updateObjectBranch();
|
||||
$this->updateProjectStories();
|
||||
$this->appendExec('15_7_1');
|
||||
case '16_0_beta1':
|
||||
$this->saveLogs('Execute 16_0_beta1');
|
||||
$this->adjustPriv16_0_beta1();
|
||||
$this->appendExec('16_0_beta1');
|
||||
}
|
||||
|
||||
$this->deletePatch();
|
||||
@@ -5408,24 +5404,4 @@ class upgradeModel extends model
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust priv 16_0_beta1.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function adjustPriv16_0_beta1()
|
||||
{
|
||||
$groups = $this->dao->select('`group`')->from(TABLE_GROUPPRIV)->where('module')->eq('mr')->andWhere('method')->eq('addBug')->fetchPairs('group', 'group');
|
||||
foreach($groups as $groupID)
|
||||
{
|
||||
$groupPriv = new stdclass();
|
||||
$groupPriv->group = $groupID;
|
||||
$groupPriv->module = 'mr';
|
||||
$groupPriv->method = 'addReview';
|
||||
$this->dao->replace(TABLE_GROUPPRIV)->data($groupPriv)->exec();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user