* Code for task #95517.

This commit is contained in:
tianshujie
2023-06-16 15:58:56 +08:00
parent 87bb89fc0c
commit 7ab3c360c7
6 changed files with 70 additions and 13 deletions
+5 -3
View File
@@ -310,9 +310,11 @@ $config->project->team->actionList['unlink']['hint'] = $lang->project->unlinkMem
$config->project->team->actionList['unlink']['url'] = 'javascript:deleteMember("{root}", "{account}", "{userID}")';
$config->project->actionList = array();
$config->project->actionList['start']['icon'] = 'play';
$config->project->actionList['start']['hint'] = $lang->project->start;
$config->project->actionList['start']['url'] = array('module' => 'project', 'method' => 'start', 'params' => 'projectID={id}');
$config->project->actionList['start']['icon'] = 'play';
$config->project->actionList['start']['hint'] = $lang->project->start;
$config->project->actionList['start']['url'] = array('module' => 'project', 'method' => 'start', 'params' => 'projectID={id}');
$config->project->actionList['start']['data-toggle'] = 'modal';
$config->project->actionList['start']['data-size'] = array('height' => '540px', 'width' => '800px');
$config->project->actionList['close']['icon'] = 'off';
$config->project->actionList['close']['hint'] = $lang->project->close;
+1 -1
View File
@@ -114,7 +114,7 @@ $config->project->dtable->fieldList['actions']['title'] = $lang->actions;
$config->project->dtable->fieldList['actions']['type'] = 'actions';
$config->project->dtable->fieldList['actions']['sortType'] = false;
$config->project->dtable->fieldList['actions']['list'] = $config->project->actionList;
$config->project->dtable->fieldList['actions']['menu'] = array(array('close|start|activate', 'other' => array('pause', 'activate|close')), 'edit', 'group', 'perm', 'more' => array('link', 'whitelist', 'delete'));
$config->project->dtable->fieldList['actions']['menu'] = array(array('start|activate|close', 'other' => array('pause', 'activate|close')), 'edit', 'group', 'perm', 'more' => array('link', 'whitelist', 'delete'));
global $app;
$app->loadLang('execution');
+7 -8
View File
@@ -1538,27 +1538,26 @@ class project extends control
/**
* Start a project.
*
* @param string $projectID
* @param int $projectID
* @access public
* @return void
*/
public function start(string $projectID)
public function start(int $projectID)
{
$projectID = (int)$projectID;
$project = $this->project->getByID($projectID);
$project = $this->project->getByID($projectID);
if(!empty($_POST))
{
$postData = form::data($this->config->project->form->start);
$postData = $this->projectZen->prepareStartExtras($postData);
$changes = $this->project->start($projectID, $postData);
if(dao::isError()) return print(js::error(dao::getError()));
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->projectZen->responseAfterStart($project, $changes, $this->post->comment);
return print(js::reload('parent.parent'));
$response['closeModal'] = true;
$response['load'] = true;
return $this->sendSuccess($response);
}
$this->projectZen->buildStartForm($project);
-1
View File
@@ -1,2 +1 @@
textarea {width: 704px !important;}
input[name="realEnd"] {width: 150px;}
+2
View File
@@ -0,0 +1,2 @@
.panel-form > .panel-heading.status-heading {justify-content: flex-start; padding-bottom: 0px;}
.panel-form > .panel-heading.status-heading > .panel-title {font-weight: 400; justify-content:flex-end; width: 5rem;}
+55
View File
@@ -0,0 +1,55 @@
<?php
declare(strict_types=1);
/**
* The start view file of project module of ZenTaoPMS.
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Shujie Tian<tianshujie@easycorp.ltd>
* @package project
* @link https://www.zentao.net
*/
namespace zin;
formPanel
(
set::title($lang->project->start),
set::headingClass('status-heading'),
set::titleClass('form-label .form-grid'),
set::shadow(false),
set::actions(array('submit')),
set::submitBtnText($lang->project->start),
to::headingActions
(
entityLabel
(
setClass('my-3 gap-x-3'),
set::level(1),
set::text($project->name),
set::entityID($project->id),
set::reverse(true),
)
),
formGroup
(
set::width('1/2'),
set::label($lang->project->realBegan),
set::name('realBegan'),
set::control('date'),
set::value(helper::today()),
),
formGroup
(
set::label($lang->comment),
editor
(
set::name('comment'),
set::rows('6'),
)
),
);
h::hr(set::class('mt-6'));
history();
/* ====== Render page ====== */
render('modalDialog');