* Finish task #36486.

This commit is contained in:
tianshujie98
2021-03-11 14:55:05 +08:00
parent 254705774c
commit c3eaf28e91
11 changed files with 67 additions and 22 deletions
+7 -6
View File
@@ -124,7 +124,7 @@ class project extends control
{
foreach($projects as $project)
{
if($project->parent == $programID)
if($project->parent == $programID)
{
$orderedProjects[] = $project;
unset($projects[$project->id]);
@@ -559,6 +559,7 @@ class project extends control
$this->view->title = $title;
$this->view->position = $position;
$this->view->groups = $groups;
$this->view->project = $this->dao->findById($projectID)->from(TABLE_PROJECT)->fetch();
$this->view->projectID = $projectID;
$this->view->programID = $programID;
$this->view->groupUsers = $groupUsers;
@@ -703,7 +704,7 @@ class project extends control
$this->view->position[] = $this->lang->group->manageView;
$this->view->group = $group;
$this->view->products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('deleted')->eq('0')->andWhere('program')->eq($group->project)->orderBy('order_desc')->fetchPairs('id', 'name');
$this->view->products = $this->loadModel('product')->getProductPairsByProject($projectID);
$this->view->projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('deleted')->eq('0')->andWhere('id')->eq($group->project)->orderBy('order_desc')->fetchPairs('id', 'name');
$this->display();
@@ -774,7 +775,7 @@ class project extends control
$project = $this->project->getByID($group->project);
foreach($this->lang->resource as $method => $label)
{
if(!in_array($method, $this->config->projectPriv->{$project->model})) unset($this->lang->resource->$method);
if(!in_array($method, $this->config->programPriv->{$project->model})) unset($this->lang->resource->$method);
}
}
@@ -798,7 +799,7 @@ class project extends control
if(!empty($_POST))
{
$this->project->manageMembers($projectID);
$this->execution->manageMembers($projectID);
$link = $this->createLink('project', 'manageMembers', "projectID=$projectID");
$this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success', 'locate' => $link));
}
@@ -995,7 +996,7 @@ class project extends control
$this->view->position[] = $this->lang->project->suspend;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->actions = $this->action->getList('project', $projectID);
$this->view->project = $this->project->getPGMByID($projectID);
$this->view->project = $this->project->getByID($projectID);
$this->display('project', 'suspend');
}
@@ -1287,7 +1288,7 @@ class project extends control
$response = array();
$response['result'] = true;
$response['message'] = $this->lang->project->changeProjectTip;
$response['message'] = $this->lang->project->changeProgramTip;
$multiLinkedProducts = $this->project->getMultiLinkedProducts($projectID);
if($multiLinkedProducts)
+5 -5
View File
@@ -2,10 +2,10 @@ $(function()
{
$('#parent').change(function()
{
var projectID = $(this).val();
var programID = $(this).val();
/* Determine whether the project can change the project set. */
link = createLink('project', 'ajaxCheckProduct', 'projectID=' + projectID + '&projectID=' + projectID);
link = createLink('project', 'ajaxCheckProduct', 'programID=' + programID + '&projectID=' + projectID);
$.getJSON(link, function(data)
{
var changed = true;
@@ -69,13 +69,13 @@ $(function()
/**
* Set aclList.
*
* @param int $projectID
* @param int $programID
* @access public
* @return void
*/
function setAclList(projectID)
function setAclList(programID)
{
if(projectID != 0)
if(programID != 0)
{
$('.aclBox').html($('#programAcl').html());
}
+1 -1
View File
@@ -203,7 +203,7 @@ $lang->project->confirmDelete = 'Do you want to delete this project?';
$lang->project->cannotChangeToCat = "The project has contents, so you cannot it to a parent project.";
$lang->project->cannotCancelCat = "There are child projects of this project. You cannot cancel the parent project mark.";
$lang->project->parentBeginEnd = "The begin and end date of the parent project: %s ~ %s";
$lang->project->parentBudget = "The budget of the parent project: %s";
$lang->project->parentBudget = "The budget of the parent project: ";
$lang->project->beginLetterParent = "The begin date of the parent project: %s. It cannot be < the begin date of its parent project.";
$lang->project->endGreaterParent = "The end date of the parent project: %s. It cannot be > the end date of its parent project.";
$lang->project->beginGreateChild = "The minimum start date of the project set: %s. The start date of the project cannot be less than the minimum start date of the project set.";
+1 -1
View File
@@ -203,7 +203,7 @@ $lang->project->confirmDelete = 'Do you want to delete this project?';
$lang->project->cannotChangeToCat = "The project has contents, so you cannot it to a parent project.";
$lang->project->cannotCancelCat = "There are child projects of this project. You cannot cancel the parent project mark.";
$lang->project->parentBeginEnd = "The begin and end date of the parent project: %s ~ %s";
$lang->project->parentBudget = "The budget of the parent project: %s";
$lang->project->parentBudget = "The budget of the parent project: ";
$lang->project->beginLetterParent = "The begin date of the parent project: %s. It cannot be < the begin date of its parent project.";
$lang->project->endGreaterParent = "The end date of the parent project: %s. It cannot be > the end date of its parent project.";
$lang->project->beginGreateChild = "The minimum start date of the project set: %s. The start date of the project cannot be less than the minimum start date of the project set.";
+1 -1
View File
@@ -203,7 +203,7 @@ $lang->project->confirmDelete = 'Do you want to delete this project?';
$lang->project->cannotChangeToCat = "The project has contents, so you cannot it to a parent project.";
$lang->project->cannotCancelCat = "There are child projects of this project. You cannot cancel the parent project mark.";
$lang->project->parentBeginEnd = "The begin and end date of the parent project: %s ~ %s";
$lang->project->parentBudget = "The budget of the parent project: %s";
$lang->project->parentBudget = "The budget of the parent project: ";
$lang->project->beginLetterParent = "The begin date of the parent project: %s. It cannot be < the begin date of its parent project.";
$lang->project->endGreaterParent = "The end date of the parent project: %s. It cannot be > the end date of its parent project.";
$lang->project->beginGreateChild = "The minimum start date of the project set: %s. The start date of the project cannot be less than the minimum start date of the project set.";
+1 -1
View File
@@ -203,7 +203,7 @@ $lang->project->confirmDelete = 'Do you want to delete this project?';
$lang->project->cannotChangeToCat = "The project has contents, so you cannot it to a parent project.";
$lang->project->cannotCancelCat = "There are child projects of this project. You cannot cancel the parent project mark.";
$lang->project->parentBeginEnd = "The begin and end date of the parent project: %s ~ %s";
$lang->project->parentBudget = "The budget of the parent project: %s";
$lang->project->parentBudget = "The budget of the parent project: ";
$lang->project->beginLetterParent = "The begin date of the parent project: %s. It cannot be < the begin date of its parent project.";
$lang->project->endGreaterParent = "The end date of the parent project: %s. It cannot be > the end date of its parent project.";
$lang->project->beginGreateChild = "The minimum start date of the project set: %s. The start date of the project cannot be less than the minimum start date of the project set.";
+1 -1
View File
@@ -204,7 +204,7 @@ $lang->project->confirmDelete = "您确定删除项目[%s]吗?";
$lang->project->cannotChangeToCat = "该项目已经有实际的内容,无法修改为父项目";
$lang->project->cannotCancelCat = "该项目下已经有子项目,无法取消父项目标记";
$lang->project->parentBeginEnd = "父项目起止时间:%s ~ %s";
$lang->project->parentBudget = "父项目预算:%s";
$lang->project->parentBudget = "父项目预算:";
$lang->project->beginLetterParent = "父项目的开始日期:%s,开始日期不能小于父项目的开始日期";
$lang->project->endGreaterParent = "父项目的完成日期:%s,完成日期不能大于父项目的完成日期";
$lang->project->beginGreateChild = "项目集的最小开始日期:%s,项目的开始日期不能小于项目集的最小开始日期";
+3 -3
View File
@@ -104,7 +104,7 @@ class projectModel extends model
public function getBudgetUnitList()
{
$budgetUnitList = array();
foreach(explode(',', $this->config->project->unitList) as $unit) $budgetUnitList[$unit] = zget($this->lang->project->unitList, $unit, '');
foreach(explode(',', $this->config->program->unitList) as $unit) $budgetUnitList[$unit] = zget($this->lang->project->unitList, $unit, '');
return $budgetUnitList;
}
@@ -662,7 +662,7 @@ class projectModel extends model
->setDefault('lastEditedDate', helper::now())
->add('type', 'project')
->join('whitelist', ',')
->stripTags($this->config->project->editor->prjcreate['id'], $this->config->allowedTags)
->stripTags($this->config->project->editor->create['id'], $this->config->allowedTags)
->remove('products,branch,plans,delta,newProduct,productName,future')
->get();
@@ -735,7 +735,7 @@ class projectModel extends model
if(isset($this->lang->project->$field)) $this->lang->project->$field = $this->lang->project->$field;
}
$project = $this->loadModel('file')->processImgURL($project, $this->config->project->editor->prjcreate['id'], $this->post->uid);
$project = $this->loadModel('file')->processImgURL($project, $this->config->project->editor->create['id'], $this->post->uid);
$this->dao->insert(TABLE_PROJECT)->data($project)
->autoCheck()
->batchcheck($requiredFields, 'notempty')
+1 -1
View File
@@ -171,7 +171,7 @@
<div id='projectAcl' class='hidden'>
<?php echo nl2br(html::radio('acl', $lang->project->aclList, $project->acl == 'project' ? 'private' : 'open', "onclick='setWhite(this.value);'", 'block'));?>
</div>
<div id='ProgramAcl' class='hidden'>
<div id='programAcl' class='hidden'>
<?php echo nl2br(html::radio('acl', $lang->project->aclList, $project->acl, "onclick='setWhite(this.value);'", 'block'));?>
</div>
<div class="modal fade" id="promptBox">
+2 -2
View File
@@ -44,7 +44,7 @@
<td class='c-actions'>
<?php $lang->group->managepriv = $lang->group->managePrivByGroup;?>
<?php $disabled = $group->role == 'limited' ? 'disabled' : '';?>
<?php common::printIcon('project', 'manageView', "groupID=$group->id&projectID=$projectID&projectID=$projectID", $group, 'list', 'eye', '', $disabled);?>
<?php common::printIcon('project', 'manageView', "groupID=$group->id&projectID=$projectID&programID=$project->parent", $group, 'list', 'eye', '', $disabled);?>
<?php common::printIcon('project', 'managePriv', "type=byGroup&param=$group->id", $group, 'list', 'lock');?>
<?php $lang->group->managemember = $lang->group->manageMember;?>
<?php common::printIcon('project', 'manageGroupMember', "groupID=$group->id", $group, 'list', 'persons', '', 'iframe', 'yes', "data-width='90%'");?>
@@ -54,7 +54,7 @@
if(common::hasPriv('group', 'delete') and $group->role != 'limited')
{
$deleteURL = $this->createLink('group', 'delete', "groupID=$group->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"groupList\", confirmDelete)", '<i class="icon icon-trash"></i>', '', "title='{$lang->group->delete}' class='btn'");
echo html::a("###", '<i class="icon icon-trash"></i>', '', "onclick='ajaxDelete(\"$deleteURL\", \"groupList\", confirmDelete)' title='{$lang->group->delete}' class='btn btn-icon'");
}
else
{
+44
View File
@@ -0,0 +1,44 @@
<?php
/**
* The suspend file of project module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang<wwccss@gmail.com>
* @package project
* @version $Id: suspend.html.php 935 2013-01-16 07:49:24Z wwccss@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<div id='mainContent' class='main-content'>
<div class='main-header'>
<h2>
<span class='prefix label-id'><strong><?php echo $project->id;?></strong></span>
<?php echo isonlybody() ? ("<span title='$project->name'>" . $project->name . '</span>') : html::a($this->createLink('project', 'view', 'project=' . $project->id), $project->name, '_blank');?>
<?php if(!isonlybody()):?>
<small><?php echo $lang->arrow . $lang->project->suspend;?></small>
<?php endif;?>
</h2>
</div>
<form class='load-indicator main-form' method='post' target='hiddenwin'>
<table class='table table-form'>
<tr class='hide'>
<th><?php echo $lang->project->status;?></th>
<td><?php echo html::hidden('status', 'suspended');?></td>
</tr>
<?php $this->printExtendFields($project, 'table');?>
<tr>
<th class='w-50px'><?php echo $lang->comment;?></th>
<td><?php echo html::textarea('comment', '', "rows='6' class='form-control kindeditor' hidefocus='true'");?></td>
</tr>
<tr>
<td colspan='2' class='text-center form-actions'><?php echo html::submitButton() . html::linkButton($lang->goback, $this->session->taskList, 'self', '', 'btn btn-wide'); ?></td>
</tr>
</table>
</form>
<hr class='small' />
<div class='main'><?php include '../../common/view/action.html.php';?></div>
</div>
<?php include '../../common/view/footer.html.php';?>