This commit is contained in:
hufangzhou
2020-09-21 15:10:51 +08:00
5 changed files with 26 additions and 13 deletions
+21 -9
View File
@@ -94,11 +94,14 @@ class program extends control
/**
* Program create guide.
*
* @param int $programID
* @param string $from
* @access public
* @return void
*/
public function createGuide($programID = 0)
public function createGuide($programID = 0, $from = 'PRJ')
{
$this->view->from = $from;
$this->view->programID = $programID;
$this->display();
}
@@ -976,9 +979,18 @@ class program extends control
* @access public
* @return void
*/
public function PRJCreate($template = 'waterfall', $programID = 0, $parentProgramID = 0, $copyProgramID = '')
public function PRJCreate($template = 'waterfall', $programID = 0, $from = 'PRJ', $parentProgramID = 0, $copyProgramID = '')
{
$this->lang->navGroup->program = 'project';
if($from == 'PRJ')
{
$this->lang->navGroup->program = 'project';
}
else
{
$this->lang->navGroup->program = 'program';
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction();
}
if($_POST)
{
$projectID = $this->program->PRJCreate();
@@ -988,12 +1000,12 @@ class program extends control
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('PRJBrowse', array('programID' => $programID, 'browseType' => 'doing'))));
}
$name = '';
$code = '';
$team = '';
$whitelist = '';
$acl = 'open';
$privway = 'extend';
$name = '';
$code = '';
$team = '';
$whitelist = '';
$acl = 'open';
$privway = 'extend';
if($parentProgramID)
{
+2 -1
View File
@@ -36,13 +36,14 @@
</div>
</div>
<?php echo js::set('programID', $programID)?>
<?php echo js::set('from', $from)?>
<script>
$('#guideDialog').on('click', '.program-type-img', function()
{
var $this = $(this);
$('#guideDialog .program-type.active').removeClass('active');
$this.parent().addClass('active');
$('#guideBtn').removeClass('disabled').attr('href', createLink('program', 'PRJCreate', 'type=' + $this.data('type') + '&programID=' + programID));
$('#guideBtn').removeClass('disabled').attr('href', createLink('program', 'PRJCreate', 'type=' + $this.data('type') + '&programID=' + programID + '&from=' + from));
});
</script>
</div>
+1 -1
View File
@@ -28,7 +28,7 @@
</div>
<div class='pull-right'>
<?php if(isset($lang->pageActions)) echo $lang->pageActions;?>
<?php if(common::hasPriv('program', 'createguide')) echo html::a($this->createLink('program', 'createguide'), "<i class='icon icon-sm icon-plus'></i> " . $this->lang->program->PRJCreate, '', "class='btn btn-primary' data-toggle='modal'");?>
<?php if(common::hasPriv('program', 'createguide')) echo html::a($this->createLink('program', 'createguide', 'program=0&from=PGM'), "<i class='icon icon-sm icon-plus'></i> " . $this->lang->program->PRJCreate, '', "class='btn btn-primary' data-toggle='modal'");?>
</div>
</div>
<div id='mainContent' class='main-row'>
+1 -1
View File
@@ -32,7 +32,7 @@ js::set('browseType', $browseType);
<?php echo html::checkbox('PRJMine', array('1' => $lang->program->mine), '', $this->cookie->PRJMine ? 'checked=checked' : '');?>
</div>
<div class="btn-toolbar pull-right">
<?php common::printLink('program', 'createGuide', '', '<i class="icon icon-plus"></i>' . $lang->program->PRJCreate, '', 'class="btn btn-primary" data-toggle="modal" data-target="#guideDialog"');?>
<?php common::printLink('program', 'createGuide', "programID=$programID", '<i class="icon icon-plus"></i>' . $lang->program->PRJCreate, '', 'class="btn btn-primary" data-toggle="modal" data-target="#guideDialog"');?>
</div>
</div>
<div id='mainContent' class="main-row">