* Batch editing project interface.

This commit is contained in:
tianshujie98
2021-02-20 17:41:13 +08:00
parent 83c4669281
commit b0384bbc7f
4 changed files with 56 additions and 5 deletions
+14 -1
View File
@@ -415,6 +415,7 @@ class program extends control
setCookie("lastPGM", $programID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$this->app->session->set('PGMProject', $this->app->getURI(true));
$this->app->session->set('projectList', $this->app->getURI(true));
$this->lang->navGroup->program = 'program';
$this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true);
@@ -799,6 +800,7 @@ class program extends control
if($this->session->moreProjectLink) $this->lang->program->mainMenuAction = html::a($this->session->moreProjectLink, '<i class="icon icon-back"></i> ' . $this->lang->goback, '', "class='btn btn-link'");
$this->app->session->set('PRJBrowse', $this->app->getURI(true));
$this->loadModel('datatable');
$this->session->set('projectList', $this->app->getURI(true));
/* Load pager and get tasks. */
$this->app->loadClass('pager', $static = true);
@@ -1069,7 +1071,18 @@ class program extends control
$this->lang->program->menu = $this->lang->PRJ->menu;
}
$projectIdList = $this->post->projectIdList;
$projectIdList = $this->post->projectIdList ? $this->post->projectIdList : die(js::locate($this->session->projectList, 'parent'));
$projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($projectIdList)->fetchAll('id');
foreach($projects as $project) $appendPMUsers[$project->PM] = $project->PM;
$this->view->title = $this->lang->program->batchEdit;
$this->view->position[] = $this->lang->program->batchEdit;
$this->view->projectIdList = $projectIdList;
$this->view->projects = $projects;
$this->view->programList = $this->program->getParentPairs();
$this->view->PMUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $appendPMUsers);
$this->display();
}
+1 -1
View File
@@ -20,7 +20,7 @@ $(function()
if(data && !data.result)
{
$('#promptTable td').remove();
$('#promptTable tbody tr').remove();
for(var i in data.message)
{
var product = data.message[i];
+35
View File
@@ -11,4 +11,39 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php $requiredFields = $config->program->PRJEdit->requiredFields;?>
<div id="mainContent" class="main-content">
<div class="main-header">
<h2><?php echo $lang->product->batchEdit;?></h2>
</div>
<form method='post' class='load-indicator main-form' enctype='multipart/form-data' target='hiddenwin' id="batchEditForm">
<table class="table table-form">
<thead>
<tr>
<th class='w-10px'> <?php echo $lang->idAB;?></th>
<th class='w-150px'> <?php echo $lang->program->PGMParent;?></th>
<th class='w-200px required'><?php echo $lang->program->PRJName;?></th>
<th class="w-150px <?php echo strpos($requiredFields, 'PM') !== false ? 'required' : '';?>"> <?php echo $lang->program->PRJPM;?></th>
</tr>
</thead>
<tbody>
<?php foreach($projectIdList as $projectID):?>
<tr>
<td><?php echo sprintf('%03d', $projectID) . html::hidden("productIDList[$projectID]", $projectID);?></td>
<td><?php echo html::select('parents', $programList, $projects[$projectID]->parent, "class='form-control chosen'");?></td>
<td title='<?php echo $projects[$projectID]->name;?>'><?php echo html::input("names[$projectID]", $projects[$projectID]->name, "class='form-control'");?></td>
<td><?php echo html::select('PMs[$projectID]', $PMUsers, $projects[$projectID]->PM, "class='form-control chosen'");?></td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan="4" class="text-center form-actions">
<?php echo html::submitButton();?>
<?php echo html::backButton();?>
</td>
</tr>
</tfoot>
</table>
</div>
<?php include '../../common/view/footer.html.php';?>
+6 -3
View File
@@ -183,9 +183,12 @@
</div>
<div class="modal-body">
<table class='table table-form' id='promptTable'>
<tr>
<th class='text-left'><?php echo $lang->program->multiLinkedProductsTip;?></th>
</tr>
<thead>
<tr>
<th class='text-left'><?php echo $lang->program->multiLinkedProductsTip;?></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>