* Adjust code for upgrade module.
This commit is contained in:
+26
-25
@@ -23,9 +23,9 @@ class upgrade extends control
|
||||
$upgradeFile = $this->app->wwwRoot . 'upgrade.php';
|
||||
if(!file_exists($upgradeFile)) $this->locate($this->createLink('my', 'index'));
|
||||
|
||||
if((version_compare($this->config->installedVersion, '15', '<')
|
||||
|| strpos($this->config->installedVersion, 'biz') !== false
|
||||
|| strpos($this->config->installedVersion, 'pro') !== false)
|
||||
if((version_compare($this->config->installedVersion, '15', '<')
|
||||
|| strpos($this->config->installedVersion, 'biz') !== false
|
||||
|| strpos($this->config->installedVersion, 'pro') !== false)
|
||||
&& strpos($this->config->installedVersion, 'max') === false)
|
||||
{
|
||||
/* Judge upgrade step. */
|
||||
@@ -60,7 +60,7 @@ class upgrade extends control
|
||||
|
||||
/**
|
||||
* Backup.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -74,7 +74,7 @@ class upgrade extends control
|
||||
|
||||
/**
|
||||
* Select the version of old zentao.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -90,7 +90,7 @@ class upgrade extends control
|
||||
|
||||
/**
|
||||
* Confirm the version.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -110,7 +110,7 @@ class upgrade extends control
|
||||
|
||||
/**
|
||||
* Execute the upgrading.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -124,7 +124,7 @@ class upgrade extends control
|
||||
$result = $this->upgrade->deleteFiles();
|
||||
if($result)
|
||||
{
|
||||
$result[] = $this->lang->upgrade->afterDeleted;
|
||||
$result[] = $this->lang->upgrade->afterDeleted;
|
||||
|
||||
$this->view->result = 'fail';
|
||||
$this->view->errors = $result;
|
||||
@@ -152,8 +152,8 @@ class upgrade extends control
|
||||
|
||||
/**
|
||||
* Guide to 15 version.
|
||||
*
|
||||
* @param string $fromVersion
|
||||
*
|
||||
* @param string $fromVersion
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -174,7 +174,7 @@ class upgrade extends control
|
||||
|
||||
/**
|
||||
* Merge program tips.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -197,6 +197,7 @@ class upgrade extends control
|
||||
{
|
||||
$this->session->set('upgrading', true);
|
||||
$this->app->loadLang('program');
|
||||
$this->app->loadLang('project');
|
||||
$this->app->loadLang('product');
|
||||
|
||||
if($_POST)
|
||||
@@ -295,7 +296,7 @@ class upgrade extends control
|
||||
$noMergedSprintCount = $this->dao->select('count(*) as count')->from(TABLE_PROJECT)->where('grade')->eq(0)->andWhere('path')->eq('')->fetch('count');
|
||||
|
||||
/* When all products and projects merged then finish and locate afterExec page. */
|
||||
if(empty($noMergedProductCount) and empty($noMergedSprintCount))
|
||||
if(empty($noMergedProductCount) and empty($noMergedSprintCount))
|
||||
{
|
||||
$this->upgrade->initUserView();
|
||||
$this->upgrade->setDefaultPriv();
|
||||
@@ -379,7 +380,7 @@ class upgrade extends control
|
||||
$productGroup = array();
|
||||
foreach($sprintProducts as $sprintID => $products)
|
||||
{
|
||||
if(count($products) > 1)
|
||||
if(count($products) > 1)
|
||||
{
|
||||
unset($noMergedSprints[$sprintID]);
|
||||
$productGroup[] = array_keys($products);
|
||||
@@ -471,7 +472,7 @@ class upgrade extends control
|
||||
|
||||
/**
|
||||
* Merge Repos.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -509,7 +510,7 @@ class upgrade extends control
|
||||
public function ajaxGetProjectPairsByProgram($programID = 0)
|
||||
{
|
||||
$projects = array('' => '') + $this->upgrade->getProjectPairsByProgram($programID);
|
||||
die(html::select('projects', $projects, '', 'class="form-control prj-exist" onchange="getPGMStatus(\'project\', this.value)"'));
|
||||
die(html::select('projects', $projects, '', 'class="form-control prj-exist" onchange="getProgramStatus(\'project\', this.value)"'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -528,9 +529,9 @@ class upgrade extends control
|
||||
|
||||
/**
|
||||
* After execute.
|
||||
*
|
||||
* @param string $fromVersion
|
||||
* @param string $processed
|
||||
*
|
||||
* @param string $fromVersion
|
||||
* @param string $processed
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -567,7 +568,7 @@ class upgrade extends control
|
||||
|
||||
/**
|
||||
* Consistency.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -588,7 +589,7 @@ class upgrade extends control
|
||||
|
||||
/**
|
||||
* Check extension.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -634,9 +635,9 @@ class upgrade extends control
|
||||
|
||||
/**
|
||||
* Ajax update file.
|
||||
*
|
||||
* @param string $type
|
||||
* @param int $lastID
|
||||
*
|
||||
* @param string $type
|
||||
* @param int $lastID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -666,7 +667,7 @@ class upgrade extends control
|
||||
|
||||
/**
|
||||
* Ajax get product name.
|
||||
*
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -683,7 +684,7 @@ class upgrade extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetPGMStatus($programID)
|
||||
public function ajaxGetProgramStatus($programID)
|
||||
{
|
||||
die($this->dao->select('status')->from(TABLE_PROGRAM)->where('id')->eq($programID)->fetch('status'));
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ $(function()
|
||||
$('#source .cell').height($('#source').height());
|
||||
$('#programBox .cell').height($('#programBox').height() - 20);
|
||||
|
||||
PGMBegin = $('.PGMParams #begin').val();
|
||||
PGMEnd = $('.PGMParams #end').val();
|
||||
setPGMBegin(PGMBegin);
|
||||
setPGMEnd(PGMEnd);
|
||||
setPRJPM();
|
||||
programBegin = $('.programParams #begin').val();
|
||||
programEnd = $('.programParams #end').val();
|
||||
setProgramBegin(programBegin);
|
||||
setProgramEnd(programEnd);
|
||||
setProjectPM();
|
||||
|
||||
setProgramByProduct($(':checkbox:checked[data-productid]'));
|
||||
|
||||
@@ -23,23 +23,23 @@ $(function()
|
||||
{
|
||||
$('[data-line=' + value + ']').prop('checked', false)
|
||||
}
|
||||
setPGMBegin(PGMBegin);
|
||||
setPGMEnd(PGMEnd);
|
||||
setPRJPM();
|
||||
setProgramBegin(programBegin);
|
||||
setProgramEnd(programEnd);
|
||||
setProjectPM();
|
||||
})
|
||||
|
||||
var PGMOriginEnd = $('#end').val();
|
||||
var programOriginEnd = $('#end').val();
|
||||
$('#longTime').change(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
PGMOriginEnd = $('#end').val();
|
||||
programOriginEnd = $('#end').val();
|
||||
$('#end').val('').attr('disabled', 'disabled');
|
||||
$('#days').val('');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#end').val(PGMOriginEnd).removeAttr('disabled');
|
||||
$('#end').val(programOriginEnd).removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -66,19 +66,19 @@ $(function()
|
||||
$('[data-product=' + firstProduct.val() + ']').prop('checked', true);
|
||||
|
||||
/* Replace program name. */
|
||||
$('#PGMName').val($(this).text());
|
||||
$('#programName').val($(this).text());
|
||||
|
||||
/* Replace project name. */
|
||||
var productID = $(target).find('.lineGroup .productList input[name*="product"]').val();
|
||||
var link = createLink('upgrade', 'ajaxGetProductName', 'productID=' + productID);
|
||||
$.post(link, function(data)
|
||||
{
|
||||
$('#PRJName').val(data);
|
||||
$('#projectName').val(data);
|
||||
})
|
||||
|
||||
setPGMBegin(PGMBegin);
|
||||
setPGMEnd(PGMEnd);
|
||||
setPRJPM();
|
||||
setProgramBegin(programBegin);
|
||||
setProgramEnd(programEnd);
|
||||
setProjectPM();
|
||||
})
|
||||
|
||||
$('[name^=products]').change(function()
|
||||
@@ -97,9 +97,9 @@ $(function()
|
||||
{
|
||||
$('[data-product=' + value + ']').prop('checked', false)
|
||||
}
|
||||
setPGMBegin(PGMBegin);
|
||||
setPGMEnd(PGMEnd);
|
||||
setPRJPM();
|
||||
setProgramBegin(programBegin);
|
||||
setProgramEnd(programEnd);
|
||||
setProjectPM();
|
||||
|
||||
hiddenProject();
|
||||
})
|
||||
@@ -116,9 +116,9 @@ $(function()
|
||||
|
||||
setProgramByProduct($(':checkbox[data-productid=' + productID + ']'));
|
||||
}
|
||||
setPGMBegin(PGMBegin);
|
||||
setPGMEnd(PGMEnd);
|
||||
setPRJPM();
|
||||
setProgramBegin(programBegin);
|
||||
setProgramEnd(programEnd);
|
||||
setProjectPM();
|
||||
|
||||
hiddenProject();
|
||||
})
|
||||
@@ -152,7 +152,7 @@ function getProjectByProgram(obj)
|
||||
})
|
||||
|
||||
getLineByProgram();
|
||||
getPGMStatus('program', programID);
|
||||
getProgramStatus('program', programID);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -198,7 +198,7 @@ function toggleProgram(obj)
|
||||
$('form .pgm-no-exist').removeClass('hidden');
|
||||
$('form .pgm-exist').addClass('hidden');
|
||||
$programs.attr('disabled', 'disabled');
|
||||
$('.PGMStatus').show();
|
||||
$('.programStatus').show();
|
||||
|
||||
$('form #newProject0').prop('checked', true);
|
||||
$('form #newLine0').prop('checked', true);
|
||||
@@ -209,7 +209,7 @@ function toggleProgram(obj)
|
||||
{
|
||||
$('form .pgm-exist').removeClass('hidden');
|
||||
$('form .pgm-no-exist').addClass('hidden');
|
||||
$('.PGMStatus').hide();
|
||||
$('.programStatus').hide();
|
||||
|
||||
if(!$('#newProgram0').prop('disabled'))
|
||||
{
|
||||
@@ -217,7 +217,7 @@ function toggleProgram(obj)
|
||||
}
|
||||
|
||||
var programID = $('#programs').val();
|
||||
getPGMStatus('program', programID);
|
||||
getProgramStatus('program', programID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ function toggleLine(obj)
|
||||
{
|
||||
$('form .line-exist').removeClass('hidden');
|
||||
$('form .line-no-exist').addClass('hidden');
|
||||
$('.PGMStatus').hide();
|
||||
$('.programStatus').hide();
|
||||
$lines.removeAttr('disabled');
|
||||
|
||||
$('form #newProgram0').prop('checked', false);
|
||||
@@ -270,20 +270,20 @@ function toggleProject(obj)
|
||||
|
||||
var $projects = $obj.closest('table').find('#projects');
|
||||
var $programs = $obj.closest('table').find('#programs');
|
||||
var $PGMParams = $obj.closest('table').find('.PGMParams');
|
||||
var $programParams = $obj.closest('table').find('.programParams');
|
||||
if($obj.prop('checked'))
|
||||
{
|
||||
$('form .prj-no-exist').removeClass('hidden');
|
||||
$('form .prj-exist').addClass('hidden');
|
||||
$PGMParams.removeClass('hidden');
|
||||
$programParams.removeClass('hidden');
|
||||
$projects.attr('disabled', 'disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('form .prj-exist').removeClass('hidden');
|
||||
$('form .prj-no-exist').addClass('hidden');
|
||||
$PGMParams.addClass('hidden');
|
||||
$('#PRJStatus').closest('tr').removeClass('hidden');
|
||||
$programParams.addClass('hidden');
|
||||
$('#projectStatus').closest('tr').removeClass('hidden');
|
||||
$projects.removeAttr('disabled');
|
||||
|
||||
if($('#newProgram0').prop('checked'))
|
||||
@@ -306,23 +306,23 @@ function hiddenProject()
|
||||
{
|
||||
if($('[name^=sprints]:checked').length == 0)
|
||||
{
|
||||
$(".PGMParams input").attr('disabled' ,'disabled');
|
||||
$(".PGMParams select").attr('disabled' ,'disabled').trigger('chosen:updated');
|
||||
$('.PGMParams').hide();
|
||||
$(".programParams input").attr('disabled' ,'disabled');
|
||||
$(".programParams select").attr('disabled' ,'disabled').trigger('chosen:updated');
|
||||
$('.programParams').hide();
|
||||
|
||||
$(".PRJName input").attr('disabled' ,'disabled');
|
||||
$(".PRJName select").attr('disabled' ,'disabled').trigger('chosen:updated');
|
||||
$('.PRJName').hide();
|
||||
$(".projectName input").attr('disabled' ,'disabled');
|
||||
$(".projectName select").attr('disabled' ,'disabled').trigger('chosen:updated');
|
||||
$('.projectName').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$(".PRJName input").removeAttr('disabled');
|
||||
$(".PRJName select").removeAttr('disabled').trigger('chosen:updated');
|
||||
$('.PRJName').show();
|
||||
$(".projectName input").removeAttr('disabled');
|
||||
$(".projectName select").removeAttr('disabled').trigger('chosen:updated');
|
||||
$('.projectName').show();
|
||||
|
||||
$(".PGMParams input").removeAttr('disabled');
|
||||
$(".PGMParams select").removeAttr('disabled').trigger('chosen:updated');
|
||||
$('.PGMParams').show();
|
||||
$(".programParams input").removeAttr('disabled');
|
||||
$(".programParams select").removeAttr('disabled').trigger('chosen:updated');
|
||||
$('.programParams').show();
|
||||
|
||||
if($('#newProject0').is(':checked')) $('#projects').attr('disabled', 'disabled');
|
||||
}
|
||||
@@ -385,82 +385,82 @@ function setProgramByProduct(product)
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setPRJStatus()
|
||||
function setProjectStatus()
|
||||
{
|
||||
var PRJStatus = 'closed';
|
||||
var projectStatus = 'closed';
|
||||
$(':checkbox:checked[data-status]').each(function()
|
||||
{
|
||||
var status = $(this).attr('data-status');
|
||||
if(status == 'doing' || status == 'suspended')
|
||||
if(status == 'doing' || status == 'suspended')
|
||||
{
|
||||
PRJStatus = 'doing';
|
||||
projectStatus = 'doing';
|
||||
return false;
|
||||
}
|
||||
|
||||
if(status == 'wait') PRJStatus = 'wait';
|
||||
if(status == 'wait') projectStatus = 'wait';
|
||||
});
|
||||
if($(':checkbox:checked[data-status]').length == 0) PRJStatus = 'wait';
|
||||
if($(':checkbox:checked[data-status]').length == 0) projectStatus = 'wait';
|
||||
|
||||
$('#PRJStatus').val(PRJStatus);
|
||||
$('#PRJStatus').trigger('chosen:updated');
|
||||
$('#projectStatus').val(projectStatus);
|
||||
$('#projectStatus').trigger('chosen:updated');
|
||||
|
||||
setPGMStatus(PRJStatus);
|
||||
setProgramStatus(projectStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set program status.
|
||||
*
|
||||
* @param string $PRJStatus
|
||||
* @param string $projectStatus
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setPGMStatus(PRJStatus)
|
||||
function setProgramStatus(projectStatus)
|
||||
{
|
||||
var PGMStatus = 'wait';
|
||||
if(PRJStatus != 'wait') PGMStatus = 'doing';
|
||||
if(PRJStatus == 'closed') PGMStatus = 'closed';
|
||||
var programStatus = 'wait';
|
||||
if(projectStatus != 'wait') programStatus = 'doing';
|
||||
if(projectStatus == 'closed') programStatus = 'closed';
|
||||
|
||||
$('#PGMStatus').val(PGMStatus);
|
||||
$('#PGMStatus').trigger('chosen:updated');
|
||||
$('#programStatus').val(programStatus);
|
||||
$('#programStatus').trigger('chosen:updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set program begin time.
|
||||
*
|
||||
* @param string $PGMBegin
|
||||
* @param string $programBegin
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setPGMBegin(PGMBegin)
|
||||
function setProgramBegin(programBegin)
|
||||
{
|
||||
$(':checkbox:checked[data-begin]').each(function()
|
||||
{
|
||||
begin = $(this).attr('data-begin').substr(0, 10);
|
||||
if(begin == '0000-00-00') return true;
|
||||
|
||||
if(begin < PGMBegin)
|
||||
if(begin < programBegin)
|
||||
{
|
||||
PGMBegin = begin;
|
||||
$('.PGMParams #begin').val(PGMBegin);
|
||||
programBegin = begin;
|
||||
$('.programParams #begin').val(programBegin);
|
||||
}
|
||||
});
|
||||
|
||||
setPRJStatus();
|
||||
setProjectStatus();
|
||||
}
|
||||
|
||||
/*
|
||||
* Set program end time.
|
||||
*
|
||||
* @param string $PGMEnd
|
||||
* @param string $programEnd
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setPGMEnd(PGMEnd)
|
||||
function setProgramEnd(programEnd)
|
||||
{
|
||||
var length = $(':checkbox:checked[data-end]').length;
|
||||
if(length == 0)
|
||||
{
|
||||
$('.PGMParams #end').val('');
|
||||
$('.programParams #end').val('');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -469,10 +469,10 @@ function setPGMEnd(PGMEnd)
|
||||
end = $(this).attr('data-end').substr(0, 10);
|
||||
if(end == '0000-00-00') return true;
|
||||
|
||||
if(end > PGMEnd)
|
||||
if(end > programEnd)
|
||||
{
|
||||
PGMEnd = end;
|
||||
$('.PGMParams #end').val(PGMEnd);
|
||||
programEnd = end;
|
||||
$('.programParams #end').val(programEnd);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -483,7 +483,7 @@ function setPGMEnd(PGMEnd)
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setPRJPM()
|
||||
function setProjectPM()
|
||||
{
|
||||
var PM = [];
|
||||
$(':checkbox:checked[data-pm]').each(function()
|
||||
@@ -607,12 +607,12 @@ function computeEndDate(delta)
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function getPGMStatus(objectType, objectID)
|
||||
function getProgramStatus(objectType, objectID)
|
||||
{
|
||||
var link = createLink('upgrade', 'ajaxGetPGMStatus', 'objectID=' + objectID);
|
||||
var link = createLink('upgrade', 'ajaxGetProgramStatus', 'objectID=' + objectID);
|
||||
$.post(link, function(data)
|
||||
{
|
||||
if(objectType == 'program') $('#PGMStatus').val(data).trigger("chosen:updated");
|
||||
if(objectType == 'project') $('#PRJStatus').val(data).trigger("chosen:updated");
|
||||
if(objectType == 'program') $('#programStatus').val(data).trigger("chosen:updated");
|
||||
if(objectType == 'project') $('#projectStatus').val(data).trigger("chosen:updated");
|
||||
})
|
||||
}
|
||||
|
||||
+10
-10
@@ -25,7 +25,7 @@ $lang->upgrade->warnningContent = <<<EOT
|
||||
<pre>
|
||||
1. Nutzen Sie phpMyAdmin um die Sicherung zu erstellen.
|
||||
2. Nutzen Sie mysql Befehle um das Backup zu erstellen.
|
||||
$> mysqldump -u <span class='text-danger'>username</span> -p <span class='text-danger'>dbname</span> > <span class='text-danger'>dateiname</span>
|
||||
$> mysqldump -u <span class='text-danger'>username</span> -p <span class='text-danger'>dbname</span> > <span class='text-danger'>dateiname</span>
|
||||
Passen Sie den roten Text entsprechend Ihres Systems an.
|
||||
e.g. mysqldump -u root -p zentao >zentao.bak
|
||||
</pre>
|
||||
@@ -98,15 +98,15 @@ $lang->upgrade->mergeProgramDesc = <<<EOD
|
||||
<p>These iterations can be selected to fall under a new project.</p>
|
||||
EOD;
|
||||
|
||||
$lang->upgrade->line = 'Product Line';
|
||||
$lang->upgrade->program = 'Merge Project';
|
||||
$lang->upgrade->existPGM = 'Existing programs';
|
||||
$lang->upgrade->existPRJ = 'Existing projects';
|
||||
$lang->upgrade->existLine = 'Existing' . $lang->productCommon . ' lines';
|
||||
$lang->upgrade->product = $lang->productCommon;
|
||||
$lang->upgrade->project = 'Iteration';
|
||||
$lang->upgrade->repo = 'Repo';
|
||||
$lang->upgrade->mergeRepo = 'Merge Repo';
|
||||
$lang->upgrade->line = 'Product Line';
|
||||
$lang->upgrade->program = 'Merge Project';
|
||||
$lang->upgrade->existProgram = 'Existing programs';
|
||||
$lang->upgrade->existProject = 'Existing projects';
|
||||
$lang->upgrade->existLine = 'Existing' . $lang->productCommon . ' lines';
|
||||
$lang->upgrade->product = $lang->productCommon;
|
||||
$lang->upgrade->project = 'Iteration';
|
||||
$lang->upgrade->repo = 'Repo';
|
||||
$lang->upgrade->mergeRepo = 'Merge Repo';
|
||||
|
||||
$lang->upgrade->newProgram = 'Create';
|
||||
$lang->upgrade->projectEmpty = 'Project must be not empty.';
|
||||
|
||||
+10
-10
@@ -25,7 +25,7 @@ $lang->upgrade->warnningContent = <<<EOT
|
||||
<pre>
|
||||
1. Use phpMyAdmin to backup.
|
||||
2. Use mysqlCommand to backup.
|
||||
$> mysqldump -u <span class='text-danger'>username</span> -p <span class='text-danger'>dbname</span> > <span class='text-danger'>filename</span>
|
||||
$> mysqldump -u <span class='text-danger'>username</span> -p <span class='text-danger'>dbname</span> > <span class='text-danger'>filename</span>
|
||||
Change the red text into corresponding Username and Database name.
|
||||
e.g. mysqldump -u root -p zentao >zentao.bak
|
||||
</pre>
|
||||
@@ -99,15 +99,15 @@ $lang->upgrade->mergeProgramDesc = <<<EOD
|
||||
<p>These iterations can be selected to fall under a new project.</p>
|
||||
EOD;
|
||||
|
||||
$lang->upgrade->line = 'Product Line';
|
||||
$lang->upgrade->program = 'Merge Project';
|
||||
$lang->upgrade->existPGM = 'Existing programs';
|
||||
$lang->upgrade->existPRJ = 'Existing projects';
|
||||
$lang->upgrade->existLine = 'Existing' . $lang->productCommon . ' lines';
|
||||
$lang->upgrade->product = $lang->productCommon;
|
||||
$lang->upgrade->project = 'Iteration';
|
||||
$lang->upgrade->repo = 'Repo';
|
||||
$lang->upgrade->mergeRepo = 'Merge Repo';
|
||||
$lang->upgrade->line = 'Product Line';
|
||||
$lang->upgrade->program = 'Merge Project';
|
||||
$lang->upgrade->existProgram = 'Existing programs';
|
||||
$lang->upgrade->existProject = 'Existing projects';
|
||||
$lang->upgrade->existLine = 'Existing' . $lang->productCommon . ' lines';
|
||||
$lang->upgrade->product = $lang->productCommon;
|
||||
$lang->upgrade->project = 'Iteration';
|
||||
$lang->upgrade->repo = 'Repo';
|
||||
$lang->upgrade->mergeRepo = 'Merge Repo';
|
||||
|
||||
$lang->upgrade->newProgram = 'Create';
|
||||
$lang->upgrade->projectEmpty = 'Project must be not empty.';
|
||||
|
||||
+10
-10
@@ -25,7 +25,7 @@ $lang->upgrade->warnningContent = <<<EOT
|
||||
<pre>
|
||||
1. Utilisez phpMyAdmin pour faire la sauvegarde.
|
||||
2. Utilisez une commande mysql pour faire la sauvegarde.
|
||||
$> mysqldump -u <span class='text-danger'>username</span> -p <span class='text-danger'>dbname</span> > <span class='text-danger'>filename</span>
|
||||
$> mysqldump -u <span class='text-danger'>username</span> -p <span class='text-danger'>dbname</span> > <span class='text-danger'>filename</span>
|
||||
Changez le texte en rouge par les code user et le nom de la base qui correspondent.
|
||||
e.g. mysqldump -u root -p zentao >zentao.bak
|
||||
</pre>
|
||||
@@ -99,15 +99,15 @@ $lang->upgrade->mergeProgramDesc = <<<EOD
|
||||
<p>These iterations can be selected to fall under a new project.</p>
|
||||
EOD;
|
||||
|
||||
$lang->upgrade->line = 'Product Line';
|
||||
$lang->upgrade->program = 'Merge Project';
|
||||
$lang->upgrade->existPGM = 'Existing programs';
|
||||
$lang->upgrade->existPRJ = 'Existing projects';
|
||||
$lang->upgrade->existLine = 'Existing' . $lang->productCommon . ' lines';
|
||||
$lang->upgrade->product = $lang->productCommon;
|
||||
$lang->upgrade->project = 'Iteration';
|
||||
$lang->upgrade->repo = 'Repo';
|
||||
$lang->upgrade->mergeRepo = 'Merge Repo';
|
||||
$lang->upgrade->line = 'Product Line';
|
||||
$lang->upgrade->program = 'Merge Project';
|
||||
$lang->upgrade->existProgram = 'Existing programs';
|
||||
$lang->upgrade->existProject = 'Existing projects';
|
||||
$lang->upgrade->existLine = 'Existing' . $lang->productCommon . ' lines';
|
||||
$lang->upgrade->product = $lang->productCommon;
|
||||
$lang->upgrade->project = 'Iteration';
|
||||
$lang->upgrade->repo = 'Repo';
|
||||
$lang->upgrade->mergeRepo = 'Merge Repo';
|
||||
|
||||
$lang->upgrade->newProgram = 'Create';
|
||||
$lang->upgrade->projectEmpty = 'Project must be not empty.';
|
||||
|
||||
+10
-10
@@ -25,7 +25,7 @@ $lang->upgrade->warnningContent = <<<EOT
|
||||
<pre>
|
||||
1. Sử dụng phpMyAdmin để sao lưu.
|
||||
2. Sử dụng mysqlCommand để sao lưu.
|
||||
$> mysqldump -u <span class='text-danger'>username</span> -p <span class='text-danger'>dbname</span> > <span class='text-danger'>filename</span>
|
||||
$> mysqldump -u <span class='text-danger'>username</span> -p <span class='text-danger'>dbname</span> > <span class='text-danger'>filename</span>
|
||||
Thay đổi văn bản màu đỏ thành tên người dùng và cơ sở dữ liệu tương ứng.
|
||||
ví dụ: mysqldump -u root -p zentao >zentao.bak
|
||||
</pre>
|
||||
@@ -99,15 +99,15 @@ $lang->upgrade->mergeProgramDesc = <<<EOD
|
||||
<p>These iterations can be selected to fall under a new project.</p>
|
||||
EOD;
|
||||
|
||||
$lang->upgrade->line = 'Product Line';
|
||||
$lang->upgrade->program = 'Merge Project';
|
||||
$lang->upgrade->existPGM = 'Existing programs';
|
||||
$lang->upgrade->existPRJ = 'Existing projects';
|
||||
$lang->upgrade->existLine = 'Existing' . $lang->productCommon . ' lines';
|
||||
$lang->upgrade->product = $lang->productCommon;
|
||||
$lang->upgrade->project = 'Iteration';
|
||||
$lang->upgrade->repo = 'Repo';
|
||||
$lang->upgrade->mergeRepo = 'Merge Repo';
|
||||
$lang->upgrade->line = 'Product Line';
|
||||
$lang->upgrade->program = 'Merge Project';
|
||||
$lang->upgrade->existProgram = 'Existing programs';
|
||||
$lang->upgrade->existProject = 'Existing projects';
|
||||
$lang->upgrade->existLine = 'Existing' . $lang->productCommon . ' lines';
|
||||
$lang->upgrade->product = $lang->productCommon;
|
||||
$lang->upgrade->project = 'Iteration';
|
||||
$lang->upgrade->repo = 'Repo';
|
||||
$lang->upgrade->mergeRepo = 'Merge Repo';
|
||||
|
||||
$lang->upgrade->newProgram = 'Create';
|
||||
$lang->upgrade->projectEmpty = 'Project must be not empty.';
|
||||
|
||||
@@ -25,7 +25,7 @@ $lang->upgrade->warnningContent = <<<EOT
|
||||
<pre>
|
||||
1. 可以通过phpMyAdmin进行备份。
|
||||
2. 使用mysql命令行的工具。
|
||||
$> mysqldump -u <span class='text-danger'>username</span> -p <span class='text-danger'>dbname</span> > <span class='text-danger'>filename</span>
|
||||
$> mysqldump -u <span class='text-danger'>username</span> -p <span class='text-danger'>dbname</span> > <span class='text-danger'>filename</span>
|
||||
要将上面红色的部分分别替换成对应的用户名和禅道系统的数据库名。
|
||||
比如: mysqldump -u root -p zentao >zentao.bak
|
||||
</pre>
|
||||
@@ -85,15 +85,15 @@ $lang->upgrade->to15Mode['new'] = '全新项目集管理模式';
|
||||
$lang->upgrade->selectedModeTips['classic'] = '后续您还可以在后台-自定义里面切换为全新项目集管理的模式。';
|
||||
$lang->upgrade->selectedModeTips['new'] = '切换为项目集管理模式需要对之前的数据进行归并处理,系统会引导您完成这个操作。';
|
||||
|
||||
$lang->upgrade->line = '产品线';
|
||||
$lang->upgrade->program = '目标项目集和项目';
|
||||
$lang->upgrade->existPGM = '已有项目集';
|
||||
$lang->upgrade->existPRJ = '已有项目';
|
||||
$lang->upgrade->existLine = '已有' . $lang->productCommon . '线';
|
||||
$lang->upgrade->product = $lang->productCommon;
|
||||
$lang->upgrade->project = '迭代';
|
||||
$lang->upgrade->repo = '版本库';
|
||||
$lang->upgrade->mergeRepo = '归并版本库';
|
||||
$lang->upgrade->line = '产品线';
|
||||
$lang->upgrade->program = '目标项目集和项目';
|
||||
$lang->upgrade->existProgram = '已有项目集';
|
||||
$lang->upgrade->existProject = '已有项目';
|
||||
$lang->upgrade->existLine = '已有' . $lang->productCommon . '线';
|
||||
$lang->upgrade->product = $lang->productCommon;
|
||||
$lang->upgrade->project = '迭代';
|
||||
$lang->upgrade->repo = '版本库';
|
||||
$lang->upgrade->mergeRepo = '归并版本库';
|
||||
|
||||
$lang->upgrade->newProgram = '新建';
|
||||
$lang->upgrade->projectEmpty = '所属项目不能为空!';
|
||||
|
||||
@@ -23,7 +23,7 @@ $lang->upgrade->warnningContent = <<<EOT
|
||||
<pre>
|
||||
1. 可以通過phpMyAdmin進行備份。
|
||||
2. 使用mysql命令行的工具。
|
||||
$> mysqldump -u <span class='text-danger'>username</span> -p <span class='text-danger'>dbname</span> > <span class='text-danger'>filename</span>
|
||||
$> mysqldump -u <span class='text-danger'>username</span> -p <span class='text-danger'>dbname</span> > <span class='text-danger'>filename</span>
|
||||
要將上面紅色的部分分別替換成對應的用戶名和禪道系統的資料庫名。
|
||||
比如: mysqldump -u root -p zentao >zentao.bak
|
||||
</pre>
|
||||
@@ -77,14 +77,14 @@ $lang->upgrade->mergeProgramDesc = <<<EOD
|
||||
<p>可以選擇這些迭代歸屬於某個新項目下。</p>
|
||||
EOD;
|
||||
|
||||
$lang->upgrade->line = '產品綫';
|
||||
$lang->upgrade->program = '目標項目集和項目';
|
||||
$lang->upgrade->existPGM = '已有項目集';
|
||||
$lang->upgrade->existPRJ = '已有項目';
|
||||
$lang->upgrade->product = $lang->productCommon;
|
||||
$lang->upgrade->project = '迭代';
|
||||
$lang->upgrade->repo = '版本庫';
|
||||
$lang->upgrade->mergeRepo = '歸併版本庫';
|
||||
$lang->upgrade->line = '產品綫';
|
||||
$lang->upgrade->program = '目標項目集和項目';
|
||||
$lang->upgrade->existProgram = '已有項目集';
|
||||
$lang->upgrade->existProject = '已有項目';
|
||||
$lang->upgrade->product = $lang->productCommon;
|
||||
$lang->upgrade->project = '迭代';
|
||||
$lang->upgrade->repo = '版本庫';
|
||||
$lang->upgrade->mergeRepo = '歸併版本庫';
|
||||
|
||||
$lang->upgrade->newProgram = '新建';
|
||||
$lang->upgrade->projectEmpty = '項目不能爲空!';
|
||||
|
||||
+123
-125
@@ -17,7 +17,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -857,8 +857,8 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Check consistency.
|
||||
*
|
||||
* @param string $version
|
||||
*
|
||||
* @param string $version
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
@@ -941,8 +941,8 @@ class upgradeModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Useless Files
|
||||
*
|
||||
* Delete Useless Files
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -1329,9 +1329,9 @@ class upgradeModel extends model
|
||||
/* Get products of projects and tasks. */
|
||||
$projectProducts = $this->dao->select('project,product')->from($this->config->db->prefix . 'projectProduct')->where('project')->in(array_keys($projects))->fetchGroup('project', 'product');
|
||||
$taskProducts = $this->dao->select('t1.id, t2.product')->from(TABLE_TASK)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
|
||||
->where('t1.id')->in(array_keys($tasks))
|
||||
->fetchPairs('id');
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
|
||||
->where('t1.id')->in(array_keys($tasks))
|
||||
->fetchPairs('id');
|
||||
|
||||
/* Process project actions. */
|
||||
foreach($projects as $projectID)
|
||||
@@ -2038,7 +2038,7 @@ class upgradeModel extends model
|
||||
{
|
||||
$this->saveLogs('Run Method ' . __FUNCTION__);
|
||||
$this->loadModel('product')->fixOrder();
|
||||
$this->loadModel('project')->fixOrder();
|
||||
$this->loadModel('execution')->fixOrder();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2275,28 +2275,28 @@ class upgradeModel extends model
|
||||
$this->saveLogs($this->dao->get());
|
||||
}
|
||||
}
|
||||
if(count($objects) < $limit)
|
||||
if(count($objects) < $limit)
|
||||
{
|
||||
$editorKeys = array_keys($editors);
|
||||
foreach($editorKeys as $i => $objectType)
|
||||
{
|
||||
$editorKeys = array_keys($editors);
|
||||
foreach($editorKeys as $i => $objectType)
|
||||
if($type == $objectType)
|
||||
{
|
||||
if($type == $objectType)
|
||||
{
|
||||
$nextType = isset($editorKeys[$i + 1]) ? $editorKeys[$i + 1] : '';
|
||||
break;
|
||||
}
|
||||
$nextType = isset($editorKeys[$i + 1]) ? $editorKeys[$i + 1] : '';
|
||||
break;
|
||||
}
|
||||
$result['type'] = empty($nextType) ? 'finish' : $nextType;
|
||||
$result['count'] = count($objects);
|
||||
$result['lastID'] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$result['type'] = $type;
|
||||
$result['count'] = count($objects);
|
||||
$result['lastID'] = $object->$idField;
|
||||
}
|
||||
return $result;
|
||||
$result['type'] = empty($nextType) ? 'finish' : $nextType;
|
||||
$result['count'] = count($objects);
|
||||
$result['lastID'] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$result['type'] = $type;
|
||||
$result['count'] = count($objects);
|
||||
$result['lastID'] = $object->$idField;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2645,7 +2645,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Adjust priv for 11.4.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -2666,8 +2666,8 @@ class upgradeModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Priv for 11.5
|
||||
*
|
||||
* Add Priv for 11.5
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -2689,7 +2689,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Add unique key for stage.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -2982,7 +2982,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Move data to notify.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3030,7 +3030,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Adjust priv 9.8.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3073,7 +3073,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Fix task finishedBy.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3099,7 +3099,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Fix assignedTo for closed tasks, but assignedTo is not closed.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3195,7 +3195,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Fix project closedBy and closedDate.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3231,7 +3231,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Set the value of deleted product line to 0.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3245,8 +3245,8 @@ class upgradeModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Add unique key to team table.
|
||||
*
|
||||
* Add unique key to team table.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3278,7 +3278,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Adjust priv for 10_0_alpha.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3300,7 +3300,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Fix project statistic block.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -3385,10 +3385,10 @@ class upgradeModel extends model
|
||||
}
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove custom menu.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3409,7 +3409,7 @@ class upgradeModel extends model
|
||||
->andWhere('owner')->eq($mainMenu->owner)
|
||||
->exec();
|
||||
$this->saveLogs($this->dao->get());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3422,7 +3422,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Init user view.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3437,7 +3437,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Init Xuanxuan.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3475,7 +3475,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Update xuanxuan for 11_5.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3504,7 +3504,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Adjust webhook type list when webhook use bearychat.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -3550,7 +3550,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Adjust priv for 11.6.2.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3572,7 +3572,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Adjust priv for 11.6.4.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -3611,7 +3611,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Fix group acl.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3654,7 +3654,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Adjust 11.7 priv.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -3692,7 +3692,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Fix bug typeList.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3748,7 +3748,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Remove editor and translate.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3770,7 +3770,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Set concept setted.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3804,7 +3804,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Adjust priv 12.0.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3828,7 +3828,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Save repo from svn and git config.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3895,7 +3895,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Fix fromCaseVersion field for zt_case table.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3923,8 +3923,8 @@ class upgradeModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust priv 12.5.
|
||||
*
|
||||
* Adjust priv 12.5.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -3963,8 +3963,8 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Save Logs.
|
||||
*
|
||||
* @param string $log
|
||||
*
|
||||
* @param string $log
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -3981,9 +3981,9 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Create program.
|
||||
*
|
||||
* @param array $productIdList
|
||||
* @param array $projectIdList
|
||||
*
|
||||
* @param array $productIdList
|
||||
* @param array $projectIdList
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
@@ -3997,9 +3997,9 @@ class upgradeModel extends model
|
||||
{
|
||||
/* Insert program. */
|
||||
$program = new stdclass();
|
||||
$program->name = $data->PGMName;
|
||||
$program->name = $data->programName;
|
||||
$program->type = 'program';
|
||||
$program->status = $data->PGMStatus;
|
||||
$program->status = $data->programStatus;
|
||||
$program->begin = isset($data->begin) ? $data->begin : helper::now();
|
||||
$program->end = isset($data->end) ? $data->end : LONG_TIME;
|
||||
$program->openedBy = $account;
|
||||
@@ -4009,7 +4009,7 @@ class upgradeModel extends model
|
||||
|
||||
$this->app->loadLang('program');
|
||||
$this->app->loadLang('project');
|
||||
$this->lang->project->name = $this->lang->program->PGMName;
|
||||
$this->lang->project->name = $this->lang->program->name;
|
||||
|
||||
$this->dao->insert(TABLE_PROJECT)->data($program)
|
||||
->batchcheck('name,begin', 'notempty')
|
||||
@@ -4027,13 +4027,13 @@ class upgradeModel extends model
|
||||
->exec();
|
||||
|
||||
$this->loadModel('action')->create('program', $programID, 'openedbysystem');
|
||||
if($data->PGMStatus == 'closed') $this->loadModel('action')->create('program', $programID, 'closedbysystem');
|
||||
if($data->programStatus == 'closed') $this->loadModel('action')->create('program', $programID, 'closedbysystem');
|
||||
}
|
||||
else
|
||||
{
|
||||
$programID = $data->programID ? $data->programID : $data->programs;
|
||||
$this->dao->update(TABLE_PROGRAM)->set('status')->eq($data->PGMStatus)->where('id')->eq($programID)->exec();
|
||||
if($data->PGMStatus == 'closed') $this->loadModel('action')->create('program', $programID, 'openedbysystem');
|
||||
$this->dao->update(TABLE_PROGRAM)->set('status')->eq($data->programStatus)->where('id')->eq($programID)->exec();
|
||||
if($data->programStatus == 'closed') $this->loadModel('action')->create('program', $programID, 'openedbysystem');
|
||||
}
|
||||
|
||||
if(isset($data->newLine))
|
||||
@@ -4074,11 +4074,11 @@ class upgradeModel extends model
|
||||
|
||||
/* Insert project. */
|
||||
$project = new stdclass();
|
||||
$project->name = $data->PRJName;
|
||||
$project->name = $data->projectName;
|
||||
$project->type = 'project';
|
||||
$project->model = 'scrum';
|
||||
$project->parent = $programID;
|
||||
$project->status = $data->PRJStatus;
|
||||
$project->status = $data->projectStatus;
|
||||
$project->begin = $data->begin;
|
||||
$project->end = isset($data->end) ? $data->end : LONG_TIME;
|
||||
$project->PM = $data->PM;
|
||||
@@ -4090,8 +4090,6 @@ class upgradeModel extends model
|
||||
$project->lastEditedDate = helper::now();
|
||||
$project->acl = $data->acl;
|
||||
|
||||
$this->lang->project->name = $this->lang->program->PRJName;
|
||||
|
||||
$programDate = $this->dao->select('begin,end')->from(TABLE_PROGRAM)->where('id')->eq($programID)->fetch();
|
||||
if($data->begin < $programDate->begin) $this->dao->update(TABLE_PROGRAM)->set('begin')->eq($data->begin)->where('id')->eq($programID)->exec();
|
||||
if($data->end > $programDate->end) $this->dao->update(TABLE_PROGRAM)->set('end')->eq($data->end)->where('id')->eq($programID)->exec();
|
||||
@@ -4111,25 +4109,25 @@ class upgradeModel extends model
|
||||
->exec();
|
||||
|
||||
$this->loadModel('action')->create('project', $projectID, 'openedbysystem');
|
||||
if($data->PRJStatus == 'closed') $this->loadModel('action')->create('project', $projectID, 'closedbysystem');
|
||||
if($data->projectStatus == 'closed') $this->loadModel('action')->create('project', $projectID, 'closedbysystem');
|
||||
}
|
||||
else
|
||||
{
|
||||
$projectID = $data->projects;
|
||||
$this->dao->update(TABLE_PROJECT)->set('status')->eq($data->PRJStatus)->where('id')->eq($projectID)->exec();
|
||||
if($data->PRJStatus == 'closed') $this->loadModel('action')->create('project', $projectID, 'openedbysystem');
|
||||
$this->dao->update(TABLE_PROJECT)->set('status')->eq($data->projectStatus)->where('id')->eq($projectID)->exec();
|
||||
if($data->projectStatus == 'closed') $this->loadModel('action')->create('project', $projectID, 'openedbysystem');
|
||||
}
|
||||
|
||||
return array($programID, $projectID, $lineID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace program or PRJ id for product and project linked objects.
|
||||
*
|
||||
* @param int $programID
|
||||
* Replace program or project id for product and project linked objects.
|
||||
*
|
||||
* @param int $programID
|
||||
* @param int $projectID
|
||||
* @param int $lineID
|
||||
* @param array $productIdList
|
||||
* @param array $productIdList
|
||||
* @param array $projectIdList
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -4137,8 +4135,8 @@ class upgradeModel extends model
|
||||
public function processMergedData($programID, $projectID, $lineID, $productIdList = array(), $sprintIdList = array())
|
||||
{
|
||||
/* Product linked objects. */
|
||||
$this->dao->update(TABLE_STORY)->set('PRJ')->eq($programID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_RELEASE)->set('PRJ')->eq($programID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_STORY)->set('project')->eq($programID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_RELEASE)->set('project')->eq($programID)->where('product')->in($productIdList)->exec();
|
||||
|
||||
/* Compute product acl. */
|
||||
$products = $this->dao->select('id,program,acl')->from(TABLE_PRODUCT)->where('id')->in($productIdList)->fetchAll();
|
||||
@@ -4158,16 +4156,16 @@ class upgradeModel extends model
|
||||
|
||||
if(!$projectID) die(js::alert($this->lang->upgrade->projectEmpty));
|
||||
|
||||
$this->dao->update(TABLE_BUG)->set('PRJ')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_CASE)->set('PRJ')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_TESTREPORT)->set('PRJ')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_TESTSUITE)->set('PRJ')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_BUILD)->set('PRJ')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_DOC)->set('PRJ')->eq($projectID)->where("lib IN(SELECT id from " . TABLE_DOCLIB . " WHERE type = 'product' and product " . helper::dbIN($productIdList) . ')')->exec();
|
||||
$this->dao->update(TABLE_BUG)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_CASE)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_TESTREPORT)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_TESTSUITE)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_BUILD)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec();
|
||||
$this->dao->update(TABLE_DOC)->set('project')->eq($projectID)->where("lib IN(SELECT id from " . TABLE_DOCLIB . " WHERE type = 'product' and product " . helper::dbIN($productIdList) . ')')->exec();
|
||||
|
||||
/* Project linked objects. */
|
||||
$this->dao->update(TABLE_TASK)->set('PRJ')->eq($projectID)->where('project')->in($sprintIdList)->exec();
|
||||
$this->dao->update(TABLE_DOC)->set('PRJ')->eq($projectID)->where("lib IN(SELECT id from " . TABLE_DOCLIB . " WHERE type = 'project' and project " . helper::dbIN($sprintIdList) . ')')->exec();
|
||||
$this->dao->update(TABLE_TASK)->set('project')->eq($projectID)->where('project')->in($sprintIdList)->exec();
|
||||
$this->dao->update(TABLE_DOC)->set('project')->eq($projectID)->where("lib IN(SELECT id from " . TABLE_DOCLIB . " WHERE type = 'project' and project " . helper::dbIN($sprintIdList) . ')')->exec();
|
||||
|
||||
/* Put sprint stories into project story mdoule. */
|
||||
$sprintStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)
|
||||
@@ -4197,28 +4195,28 @@ class upgradeModel extends model
|
||||
$this->dao->update(TABLE_PROJECT)->data($data)->where('id')->eq($sprint->id)->exec();
|
||||
}
|
||||
|
||||
/* Compute project date and status. */
|
||||
$linkedSprintIdList = $this->dao->select('id')->from(TABLE_PROJECT)->where('project')->eq($projectID)->fetchPairs();
|
||||
$linkedSprintIdList += $sprintIdList;
|
||||
$minRealBegan = $this->dao->select('date')->from(TABLE_ACTION)->where('objectID')->in($linkedSprintIdList)->andWhere('objectType')->eq('project')->andWhere('action')->eq('started')->orderBy('date_asc')->fetch('date');
|
||||
$maxRealEnd = $this->dao->select('date')->from(TABLE_ACTION)->where('objectID')->in($linkedSprintIdList)->andWhere('objectType')->eq('project')->andWhere('action')->eq('closed')->orderBy('date_desc')->fetch('date');
|
||||
/* Compute project date and status. */
|
||||
$linkedSprintIdList = $this->dao->select('id')->from(TABLE_PROJECT)->where('project')->eq($projectID)->fetchPairs();
|
||||
$linkedSprintIdList += $sprintIdList;
|
||||
$minRealBegan = $this->dao->select('date')->from(TABLE_ACTION)->where('objectID')->in($linkedSprintIdList)->andWhere('objectType')->eq('project')->andWhere('action')->eq('started')->orderBy('date_asc')->fetch('date');
|
||||
$maxRealEnd = $this->dao->select('date')->from(TABLE_ACTION)->where('objectID')->in($linkedSprintIdList)->andWhere('objectType')->eq('project')->andWhere('action')->eq('closed')->orderBy('date_desc')->fetch('date');
|
||||
|
||||
$data = new stdClass();
|
||||
$data->realBegan = $minRealBegan ? substr($minRealBegan, 0, 10) : '0000-00-00';
|
||||
$data = new stdClass();
|
||||
$data->realBegan = $minRealBegan ? substr($minRealBegan, 0, 10) : '0000-00-00';
|
||||
|
||||
$PRJStatus = $this->dao->select('status')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch('status');
|
||||
if($PRJStatus == 'closed')
|
||||
{
|
||||
$data->realEnd = substr($maxRealEnd, 0, 10);
|
||||
$data->closedDate = $maxRealEnd;
|
||||
}
|
||||
$projectStatus = $this->dao->select('status')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch('status');
|
||||
if($projectStatus == 'closed')
|
||||
{
|
||||
$data->realEnd = substr($maxRealEnd, 0, 10);
|
||||
$data->closedDate = $maxRealEnd;
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_PROJECT)->data($data)->where('id')->eq($projectID)->exec();
|
||||
$this->dao->update(TABLE_PROJECT)->data($data)->where('id')->eq($projectID)->exec();
|
||||
|
||||
/* Set product and project relation. */
|
||||
/* Set product and project relation. */
|
||||
foreach($productIdList as $productID)
|
||||
{
|
||||
$data = new stdclass();
|
||||
$data = new stdclass();
|
||||
$data->project = $projectID;
|
||||
$data->product = $productID;
|
||||
|
||||
@@ -4228,12 +4226,12 @@ class upgradeModel extends model
|
||||
$this->computeObjectMembers($programID, $projectID, $productIdList, $sprintIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute program and project members.
|
||||
*
|
||||
* @param int $programID
|
||||
/**
|
||||
* Compute program and project members.
|
||||
*
|
||||
* @param int $programID
|
||||
* @param int $projectID
|
||||
* @param array $productIdList
|
||||
* @param array $productIdList
|
||||
* @param array $sprintIdList
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -4327,7 +4325,7 @@ class upgradeModel extends model
|
||||
/* If have no products, add it. */
|
||||
if(isset($data->name))
|
||||
{
|
||||
$product = new stdclass();
|
||||
$product = new stdclass();
|
||||
$product->program = $data->program;
|
||||
$product->name = $data->name;
|
||||
$product->acl = 'open';
|
||||
@@ -4351,14 +4349,14 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Set program default priv.
|
||||
*
|
||||
* @param string $fromVersion
|
||||
*
|
||||
* @param string $fromVersion
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setDefaultPriv()
|
||||
{
|
||||
$groups = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->ne('limited')->andWhere('role')->ne('PRJAdmin')->fetchPairs();
|
||||
$groups = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->ne('limited')->andWhere('role')->ne('projectAdmin')->fetchPairs();
|
||||
foreach($groups as $groupID)
|
||||
{
|
||||
$data = new stdclass();
|
||||
@@ -4375,13 +4373,13 @@ class upgradeModel extends model
|
||||
}
|
||||
|
||||
/* If is project admin, have all project priv. */
|
||||
$PRJAdminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('PRJAdmin')->fetch('id');
|
||||
$projectAdminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('projectAdmin')->fetch('id');
|
||||
|
||||
$this->app->loadLang('group');
|
||||
foreach($this->lang->resource->program as $method => $methodLang)
|
||||
{
|
||||
$data = new stdclass();
|
||||
$data->group = $PRJAdminGroupID;
|
||||
$data->group = $projectAdminGroupID;
|
||||
$data->module = 'program';
|
||||
$data->method = $method;
|
||||
$this->dao->replace(TABLE_GROUPPRIV)->data($data)->exec();
|
||||
@@ -4390,7 +4388,7 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Set work to full.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -4402,8 +4400,8 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Append execute for pro and biz.
|
||||
*
|
||||
* @param string $fromVersion
|
||||
*
|
||||
* @param string $fromVersion
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -4492,9 +4490,9 @@ class upgradeModel extends model
|
||||
|
||||
/**
|
||||
* Process sprint concept.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return bool
|
||||
*/
|
||||
public function processSprintConcept()
|
||||
{
|
||||
@@ -4508,7 +4506,7 @@ class upgradeModel extends model
|
||||
->set('`value`')->eq($newValue)
|
||||
->set('`key`')->eq('sprintConcept')
|
||||
->where('id')->eq($productProject->id)
|
||||
->exec();
|
||||
->exec();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<caption class='strong'><?php echo $lang->upgrade->program;?></caption>
|
||||
<tr>
|
||||
<th>
|
||||
<span class="pgm-exist hidden"><?php echo $lang->upgrade->existPGM;?></span>
|
||||
<span class="pgm-no-exist"><?php echo $lang->program->PGMName;?></span>
|
||||
<span class="pgm-exist hidden"><?php echo $lang->upgrade->existProgram;?></span>
|
||||
<span class="pgm-no-exist"><?php echo $lang->program->name;?></span>
|
||||
</th>
|
||||
<td class='required'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select("programs", $programs, $programID, "class='form-control hidden pgm-exist' onchange='getProjectByProgram(this)'");?>
|
||||
<?php echo html::input("PGMName", isset($programName) ? $programName : '', "class='form-control pgm-no-exist'");?>
|
||||
<?php echo html::input("programName", isset($programName) ? $programName : '', "class='form-control pgm-no-exist'");?>
|
||||
<span class='input-group-addon'>
|
||||
<div class="checkbox-primary">
|
||||
<input type="checkbox" name="newProgram" value="0" checked onchange="toggleProgram(this)" id="newProgram0" />
|
||||
@@ -20,18 +20,18 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->PGMCommon . $lang->program->PGMStatus;?></th>
|
||||
<td><?php echo html::select('PGMStatus', $lang->program->statusList, '', "class='form-control chosen'");?></td>
|
||||
<th><?php echo $lang->program->common . $lang->program->status;?></th>
|
||||
<td><?php echo html::select('programStatus', $lang->program->statusList, '', "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr class='PRJName'>
|
||||
<tr class='projectName'>
|
||||
<th>
|
||||
<span class="prj-exist hidden"><?php echo $lang->upgrade->existPRJ;?></span>
|
||||
<span class="prj-no-exist"><?php echo $lang->program->PRJName;?></span>
|
||||
<span class="prj-exist hidden"><?php echo $lang->upgrade->existProject;?></span>
|
||||
<span class="prj-no-exist"><?php echo $lang->project->name;?></span>
|
||||
</th>
|
||||
<td class='required'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select("projects", $projects, '', "class='form-control hidden prj-exist' onchange='getPGMStatus(project, this.value)'");?>
|
||||
<?php echo html::input("PRJName", isset($sprintName) ? $sprintName : '', "class='form-control prj-no-exist'");?>
|
||||
<?php echo html::select("projects", $projects, '', "class='form-control hidden prj-exist' onchange='getProgramStatus(project, this.value)'");?>
|
||||
<?php echo html::input("projectName", isset($sprintName) ? $sprintName : '', "class='form-control prj-no-exist'");?>
|
||||
<?php if(count($projects)):?>
|
||||
<span class='input-group-addon'>
|
||||
<div class="checkbox-primary">
|
||||
@@ -43,9 +43,9 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class='PGMParams'>
|
||||
<th><?php echo $lang->program->PRJStatus;?></th>
|
||||
<td><?php echo html::select('PRJStatus', $lang->program->statusList, '', "class='form-control chosen'");?></td>
|
||||
<tr class='programParams'>
|
||||
<th><?php echo $lang->project->status;?></th>
|
||||
<td><?php echo html::select('projectStatus', $lang->project->statusList, '', "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr class='LineName'>
|
||||
<th>
|
||||
@@ -67,29 +67,29 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class='PGMParams'>
|
||||
<th><?php echo $lang->program->PRJPM;?></th>
|
||||
<tr class='programParams'>
|
||||
<th><?php echo $lang->project->PM;?></th>
|
||||
<td><?php echo html::select('PM', array('' => '') + $users, '', "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr class='PGMParams'>
|
||||
<th><?php echo $lang->program->dateRange;?></th>
|
||||
<tr class='programParams'>
|
||||
<th><?php echo $lang->project->dateRange;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::input('begin', date('Y-m-d'), "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->program->begin . "' required");?>
|
||||
<span class='input-group-addon'><?php echo $lang->program->to;?></span>
|
||||
<?php echo html::input('end', '', "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->program->end . "' required");?>
|
||||
<?php echo html::input('begin', date('Y-m-d'), "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->project->begin . "' required");?>
|
||||
<span class='input-group-addon'><?php echo $lang->project->to;?></span>
|
||||
<?php echo html::input('end', '', "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->project->end . "' required");?>
|
||||
<span class='input-group-addon' id='longTimeBox'>
|
||||
<div class="checkbox-primary">
|
||||
<input type="checkbox" name="longTime" value="1" id="longTime">
|
||||
<label for="longTime"><?php echo $lang->program->PRJLongTime;?></label>
|
||||
<label for="longTime"><?php echo $lang->project->longTime;?></label>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class='PGMParams'>
|
||||
<tr class='programParams'>
|
||||
<th><?php echo $lang->project->acl;?></th>
|
||||
<td><?php echo nl2br(html::radio('acl', $lang->program->PGMPRJAclList, 'open', '', 'block'));?></td>
|
||||
<td><?php echo nl2br(html::radio('acl', $lang->project->aclList, 'open', '', 'block'));?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class='table-foot text-center'><?php echo html::submitButton();?></div>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</tr>
|
||||
<?php else:?>
|
||||
<tr>
|
||||
<th class='w-100px'><?php echo $lang->upgrade->existPGM;?></th>
|
||||
<th class='w-100px'><?php echo $lang->upgrade->existProgram;?></th>
|
||||
<td><?php echo html::select("program", $programs, '', "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user