* Code for task #7121.
This commit is contained in:
+3
-2
@@ -130,8 +130,9 @@ $filter->product->default->cookie['preProductID'] = 'int';
|
||||
$filter->product->index->cookie['preBranch'] = 'int';
|
||||
$filter->product->export->cookie['checkedItem'] = 'reg::checked';
|
||||
|
||||
$filter->program->index->cookie['programType'] = 'code';
|
||||
$filter->program->index->cookie['mine'] = 'code';
|
||||
$filter->program->index->cookie['programType'] = 'code';
|
||||
$filter->program->index->cookie['mine'] = 'code';
|
||||
$filter->program->export->cookie['checkedItem'] = 'reg::checked';
|
||||
|
||||
$filter->project->default->cookie['lastProject'] = 'int';
|
||||
$filter->project->default->cookie['projectMode'] = 'code';
|
||||
|
||||
@@ -130,7 +130,10 @@ $lang->mainNav->recent = '<i class="icon icon-menu-recent"></i> 近期|recent|i
|
||||
$lang->dividerMenu = ',admin,recent,';
|
||||
|
||||
$lang->menu = new stdclass();
|
||||
$lang->menu->project = '';
|
||||
$lang->menu->program = '主页|program|index';
|
||||
$lang->menu->product = $lang->productCommon . '|product|index|locate=no';
|
||||
$lang->menu->project = $lang->projectCommon . '|project|index|locate=no';
|
||||
$lang->menu->qa = '测试|qa|index';
|
||||
|
||||
/* 查询条中可以选择的对象列表。*/
|
||||
$lang->searchObjects['bug'] = 'Bug';
|
||||
@@ -521,6 +524,8 @@ $lang->navGroup['testsuite'] = 'program';
|
||||
$lang->navGroup['caselib'] = 'program';
|
||||
$lang->navGroup['feedback'] = 'program';
|
||||
|
||||
$lang->navGroup['group'] = 'company';
|
||||
|
||||
/* 错误提示信息。*/
|
||||
$lang->error = new stdclass();
|
||||
$lang->error->companyNotFound = "您访问的域名 %s 没有对应的公司。";
|
||||
|
||||
@@ -451,6 +451,7 @@ class commonModel extends model
|
||||
{
|
||||
global $app, $lang;
|
||||
|
||||
$lastMenu = end($lang->mainNav);
|
||||
echo "<ul class='nav nav-default'>\n";
|
||||
foreach($lang->mainNav as $group => $nav)
|
||||
{
|
||||
@@ -459,6 +460,7 @@ class commonModel extends model
|
||||
if($moduleName == $group) $active = 'active';
|
||||
if(zget($lang->navGroup, $moduleName, '') == $group) $active = 'active';
|
||||
if(common::hasPriv($currentModule, $currentMethod)) echo "<li class=$active>" . html::a(helper::createLink($currentModule, $currentMethod, $vars), $title) . '</li>';
|
||||
if(($lastMenu != $nav) && strpos($lang->dividerMenu, ",{$group},") !== false) echo "<li class='divider'></li>";
|
||||
}
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
|
||||
<?php if(empty($_GET['onlybody']) or $_GET['onlybody'] != 'yes'):?>
|
||||
<?php $this->app->loadConfig('sso');?>
|
||||
<?php if(!empty($config->sso->redirect)) js::set('ssoRedirect', $config->sso->redirect);?>
|
||||
<?php $isProgram = (isset($lang->navGroup[$moduleName]) && $lang->navGroup[$this->moduleName] == 'program');?>
|
||||
<?php $isProgram = (isset($lang->navGroup[$this->moduleName]) && $lang->navGroup[$this->moduleName] == 'program');?>
|
||||
<div id='menu'>
|
||||
<div id='menuHeader'>
|
||||
<?php $heading = $app->company->name;?>
|
||||
|
||||
@@ -8,3 +8,6 @@ $config->program->editor->start = array('id' => 'comment', 'tools' => 'simple
|
||||
$config->program->editor->activate = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->program->editor->finish = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->program->editor->suspend = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
|
||||
$config->program->list = new stdclass();
|
||||
$config->program->list->exportFields = 'id,name,code,type,category,status,begin,end,budget,PM,end,desc';
|
||||
|
||||
@@ -139,7 +139,6 @@ class program extends control
|
||||
public function finish($projectID)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
$projectID = $project->id;
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
@@ -156,11 +155,11 @@ class program extends control
|
||||
die(js::reload('parent.parent'));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->project->finish;
|
||||
$this->view->position[] = $this->lang->project->finish;
|
||||
$this->view->title = $this->lang->program->finish;
|
||||
$this->view->position[] = $this->lang->program->finish;
|
||||
$this->view->project = $project;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->actions = $this->loadModel('action')->getList('project', $projectID);
|
||||
$this->view->actions = $this->loadModel('action')->getList('project', $project->id);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -266,6 +265,58 @@ class program extends control
|
||||
$this->display('project', 'close');
|
||||
}
|
||||
|
||||
/**
|
||||
* Export program.
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function export($status, $orderBy)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$programLang = $this->lang->program;
|
||||
$programConfig = $this->config->program;
|
||||
|
||||
/* Create field lists. */
|
||||
$fields = $this->post->exportFields ? $this->post->exportFields : explode(',', $programConfig->list->exportFields);
|
||||
foreach($fields as $key => $fieldName)
|
||||
{
|
||||
$fieldName = trim($fieldName);
|
||||
$fields[$fieldName] = zget($programLang, $fieldName);
|
||||
unset($fields[$key]);
|
||||
}
|
||||
|
||||
$programs = $this->program->getList($status, $orderBy, null);
|
||||
$users = $this->loadModel('user')->getPairs('noletter');
|
||||
foreach($programs as $i => $program)
|
||||
{
|
||||
$program->PM = zget($users, $program->PM);
|
||||
$program->status = $this->processStatus('project', $program);
|
||||
$program->type = zget($programLang->typeList, $program->type);
|
||||
$program->category = zget($programLang->categoryList, $program->category);
|
||||
$program->budget = $program->budget . zget($programLang->unitList, $program->budgetUnit);
|
||||
|
||||
if($this->post->exportType == 'selected')
|
||||
{
|
||||
$checkedItem = $this->cookie->checkedItem;
|
||||
if(strpos(",$checkedItem,", ",{$program->id},") === false) unset($programs[$i]);
|
||||
}
|
||||
}
|
||||
if(isset($this->config->bizVersion)) list($fields, $projectStats) = $this->loadModel('workflowfield')->appendDataFromFlow($fields, $projectStats);
|
||||
|
||||
$this->post->set('fields', $fields);
|
||||
$this->post->set('rows', $programs);
|
||||
$this->post->set('kind', 'program');
|
||||
$this->fetch('file', 'export2' . $this->post->fileType, $_POST);
|
||||
}
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/*
|
||||
public function processErrors($errors)
|
||||
{
|
||||
foreach($errors as $field => $error)
|
||||
@@ -275,4 +326,5 @@ class program extends control
|
||||
|
||||
return $errors;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -5,4 +5,11 @@ $(function()
|
||||
var mine = $(this).is(':checked') ? 1 : 0;
|
||||
$.cookie('mine', mine, {expires:config.cookieLife, path:config.webRoot});
|
||||
})
|
||||
|
||||
$('#programTableList').on('sort.sortable', function(e, data)
|
||||
{
|
||||
var list = '';
|
||||
for(i = 0; i < data.list.length; i++) list += $(data.list[i].item).attr('data-id') + ',';
|
||||
$.post(createLink('project', 'updateOrder'), {'projects' : list, 'orderBy' : orderBy});
|
||||
});
|
||||
})
|
||||
|
||||
@@ -9,6 +9,7 @@ $lang->program->desc = '项目描述';
|
||||
$lang->program->code = '项目代号';
|
||||
$lang->program->begin = '计划开始日期';
|
||||
$lang->program->end = '计划完成日期';
|
||||
$lang->program->status = '项目状态';
|
||||
$lang->program->PM = '项目负责人';
|
||||
$lang->program->create = '添加项目';
|
||||
$lang->program->edit = '编辑项目';
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* The export view 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 <chunsheng@cnezsoft.com>
|
||||
* @package project
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../file/view/export.html.php';?>
|
||||
@@ -23,7 +23,7 @@
|
||||
<td colspan='2'><?php echo html::textarea('comment', '', "rows='6' class='form-control kindeditor' hidefocus='true'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'><?php echo html::submitButton($lang->project->finish) . ' ' . html::linkButton($lang->goback, $this->session->taskList, 'self', '', 'btn btn-wide'); ?></td>
|
||||
<td colspan='3' class='text-center form-actions'><?php echo html::submitButton($lang->program->finish); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/sortable.html.php';?>
|
||||
<?php js::set('status', $status);?>
|
||||
<?php js::set('orderBy', $orderBy);?>
|
||||
<?php if($programType == 'bygrid'):?>
|
||||
<style>
|
||||
#mainMenu{padding-left: 10px; padding-right: 10px;}
|
||||
@@ -31,6 +33,7 @@
|
||||
<?php echo html::a('javascript:setProgramType("bygrid")', "<i class='icon icon-cards-view'></i>", '', "title={$lang->program->bygrid} class='btn btn-icon " . ($programType == 'bygrid' ? 'text-primary' : '') . "'");?>
|
||||
<?php echo html::a('javascript:setProgramType("bylist")', "<i class='icon icon-bars'></i>", '', "title={$lang->program->bylist} class='btn btn-icon " . ($programType == 'bylist' ? 'text-primary' : '') . "'");?>
|
||||
</div>
|
||||
<?php common::printLink('program', 'export', "status=$status&orderBy=$orderBy", "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export'")?>
|
||||
<?php echo $lang->pageActions;?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,15 +81,22 @@
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
<?php else:?>
|
||||
<div class='main-table'>
|
||||
<table class='table has-sort-head table-fixed' id='projectList'>
|
||||
<?php $canOrder = (common::hasPriv('project', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
|
||||
<form class='main-table' id='programForm' method='post' data-ride='table'>
|
||||
<table class='table has-sort-head table-fixed' id='programList'>
|
||||
<?php $vars = "status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='c-id w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class='c-id w-80px'>
|
||||
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
|
||||
<label></label>
|
||||
</div>
|
||||
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
|
||||
</th>
|
||||
<th class='w-120px'><?php common::printOrderLink('code', $orderBy, $vars, $lang->program->code);?></th>
|
||||
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->program->name);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->project->status);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('category', $orderBy, $vars, $lang->program->category);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('type', $orderBy, $vars, $lang->program->type);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('begin', $orderBy, $vars, $lang->program->begin);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('end', $orderBy, $vars, $lang->program->end);?></th>
|
||||
@@ -94,17 +104,27 @@
|
||||
<th class='w-100px'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->program->PM);?></th>
|
||||
<th class='w-200px text-left'><?php echo $lang->program->desc;?></th>
|
||||
<th class='text-center w-200px'><?php echo $lang->actions;?></th>
|
||||
<?php if($canOrder):?>
|
||||
<th class='w-60px sort-default'><?php common::printOrderLink('order', $orderBy, $vars, $lang->project->orderAB);?></th>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class='sortable' id='projectTableList'>
|
||||
<tbody class='sortable' id='programTableList'>
|
||||
<?php foreach($projectList as $project):?>
|
||||
<tr data-id='<?php echo $project->id ?>' data-order='<?php echo $project->order ?>'>
|
||||
<td class='c-id'><?php printf('%03d', $project->id);?></td>
|
||||
<td class='c-id'>
|
||||
<div class="checkbox-primary">
|
||||
<input type='checkbox' name='projectIDList[<?php echo $project->id;?>]' value='<?php echo $project->id;?>' />
|
||||
<label></label>
|
||||
</div>
|
||||
<?php printf('%03d', $project->id);?>
|
||||
</td>
|
||||
<td class='text-left'><?php echo $project->code;?></td>
|
||||
<td class='text-left' title='<?php echo $project->name?>'>
|
||||
<?php echo html::a($this->createLink('project', 'task', 'projectID=' . $project->id), $project->name);?>
|
||||
</td>
|
||||
<td class='c-status'><span class="status-project status-<?php echo $project->status?>"><?php echo zget($lang->project->statusList, $project->status, '');?></span></td>
|
||||
<td class='text-left'><?php echo zget($lang->program->categoryList, $project->category, '');?></td>
|
||||
<td class='text-left'><?php echo zget($lang->program->typeList, $project->type, '');?></td>
|
||||
<td class='text-center'><?php echo $project->begin;?></td>
|
||||
<td class='text-center'><?php echo $project->end;?></td>
|
||||
@@ -119,14 +139,18 @@
|
||||
<?php common::printIcon('program', 'close', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
|
||||
<?php if(common::hasPriv('program', 'edit')) echo html::a($this->createLink("program", "edit", "projectID=$project->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
|
||||
</td>
|
||||
<?php if($canOrder):?>
|
||||
<td class='sort-handler'><i class="icon icon-move"></i></td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='table-footer'>
|
||||
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
Reference in New Issue
Block a user