* Delete unused file and add new file.

This commit is contained in:
Yagami
2020-09-22 15:09:52 +08:00
parent 5bff3486d4
commit dd48623aaa
19 changed files with 381 additions and 679 deletions

View File

@@ -19,7 +19,7 @@ ADD `planDuration` int(11) NOT NULL AFTER `parentVersion`,
ADD `realDuration` int(11) NOT NULL AFTER `planDuration`,
ADD `output` text NOT NULL AFTER `milestone`;
ALTER TABLE `zt_product` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`;
ALTER TABLE `zt_product` ADD `program` mediumint(8) unsigned NOT NULL AFTER `id`;
ALTER TABLE `zt_task` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`;
ALTER TABLE `zt_doc` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`;
ALTER TABLE `zt_story` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`;

View File

@@ -637,7 +637,7 @@ CREATE TABLE IF NOT EXISTS `zt_oauth` (
-- DROP TABLE IF EXISTS `zt_product`;
CREATE TABLE IF NOT EXISTS `zt_product` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`PRJ` mediumint(8) unsigned NOT NULL,
`program` mediumint(8) unsigned NOT NULL,
`name` varchar(90) NOT NULL,
`code` varchar(45) NOT NULL,
`line` mediumint(8) NOT NULL,

View File

@@ -1315,7 +1315,7 @@ class block extends control
$releases = array();
$count = isset($this->params->count) ? (int)$this->params->count : 15;
$products = $this->dao->select('id, name')->from(TABLE_PRODUCT)->where('PRJ')->eq($this->session->PRJ)->limit(15)->fetchPairs();
$products = $this->dao->select('id, name')->from(TABLE_PRODUCT)->where('program')->eq($this->session->PRJ)->limit(15)->fetchPairs();
$productIdList = array_keys($products);
if(!empty($productIdList))
{

View File

@@ -228,7 +228,7 @@ class blockModel extends model
$program = $this->loadModel('project')->getByID($programID);
/* Mark program block has init. */
$this->loadModel('setting')->setItem("$account.$module.{$program->template}common.blockInited", true);
$this->loadModel('setting')->setItem("$account.$module.{$program->model}common.blockInited", true);
}
else
{
@@ -264,12 +264,12 @@ class blockModel extends model
* @access public
* @return string
*/
public function getAvailableBlocks($module = '', $dashboard = '', $template = '')
public function getAvailableBlocks($module = '', $dashboard = '', $model = '')
{
$blocks = $this->lang->block->availableBlocks;
if($dashboard == 'program')
{
$blocks = $this->lang->block->modules[$template]['index']->availableBlocks;
$blocks = $this->lang->block->modules[$model]['index']->availableBlocks;
}
else
{

View File

@@ -16,7 +16,7 @@
<div class="panel-body conatiner-fluid">
<div class='table-row'>
<div class="col col-left hide-in-sm">
<h4><?php echo $lang->program->progress;?></h4>
<h4><?php echo $lang->program->PGMProgress;?></h4>
<span class='progress-num'><?php echo $progress . '%';?></span>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<?php echo $progress;?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $progress;?>%">

View File

@@ -272,7 +272,7 @@ class productModel extends model
{
return $this->dao->select('*')->from(TABLE_PRODUCT)
->where('deleted')->eq(0)
->beginIF($programID)->andWhere('PRJ')->eq($programID)->fi()
->beginIF($programID)->andWhere('program')->eq($programID)->fi()
->beginIF($line > 0)->andWhere('line')->eq($line)->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi()
->beginIF($status == 'noclosed')->andWhere('status')->ne('closed')->fi()
@@ -304,7 +304,7 @@ class productModel extends model
$products = $this->dao->select('*, IF(INSTR(" closed", status) < 2, 0, 1) AS isClosed')
->from(TABLE_PRODUCT)
->where('deleted')->eq(0)
->beginIF($programID)->andWhere('PRJ')->eq($programID)->fi()
->beginIF($programID)->andWhere('program')->eq($programID)->fi()
->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi()
->orderBy($orderBy)
@@ -418,7 +418,7 @@ class productModel extends model
{
$product = fixer::input('post')
->setIF($this->post->acl != 'custom', 'whitelist', '')
->setDefault('PRJ', $this->session->PRJ)
->setDefault('program', $this->session->PRJ)
->setDefault('status', 'normal')
->setDefault('createdBy', $this->app->user->account)
->setDefault('createdDate', helper::now())

View File

@@ -9,6 +9,21 @@ class program extends control
$this->programs = $this->program->getPairs();
}
/**
* Program create guide.
*
* @param int $programID
* @param string $from
* @access public
* @return void
*/
public function createGuide($programID = 0, $from = 'PRJ')
{
$this->view->from = $from;
$this->view->programID = $programID;
$this->display();
}
/**
* Program home page.
*
@@ -71,21 +86,6 @@ class program extends control
$this->display();
}
/**
* Program create guide.
*
* @param int $programID
* @param string $from
* @access public
* @return void
*/
public function createGuide($programID = 0, $from = 'PRJ')
{
$this->view->from = $from;
$this->view->programID = $programID;
$this->display();
}
/**
* Create a project.
*
@@ -189,43 +189,6 @@ class program extends control
$this->display();
}
/**
* Edit a program.
*
* @param int $programID
* @access public
* @return void
*/
public function edit($programID = 0)
{
$program = $this->program->getPGMByID($programID);
if($_POST)
{
$changes = $this->program->update($programID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => $this->processErrors(dao::getError())));
if($changes)
{
$actionID = $this->loadModel('action')->create('program', $programID, 'edited');
$this->action->logHistory($actionID, $changes);
}
$url = $this->session->PRJList ? $this->session->PRJList : inlink('browse');
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $url));
}
$parents = $this->program->getParentPairs();
unset($parents[$programID]);
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $program->PM);
$this->view->title = $this->lang->program->PGMEdit;
$this->view->position[] = $this->lang->program->PGMEdit;
$this->view->program = $program;
$this->view->parents = $parents;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->display();
}
/**
* Close a program.
*
@@ -329,8 +292,11 @@ class program extends control
* @access public
* @return void
*/
public function group($programID = 0)
public function PGMGroup($programID = 0)
{
$this->lang->navGroup->program = 'program';
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction();
$this->session->set('program', $programID);
$title = $this->lang->company->orgView . $this->lang->colon . $this->lang->group->browse;
$position[] = $this->lang->group->browse;
@@ -354,11 +320,11 @@ class program extends control
* @access public
* @return void
*/
public function createGroup($programID = 0)
public function PGMCreateGroup($programID = 0)
{
if(!empty($_POST))
{
$_POST['program'] = $programID;
$_POST['PRJ'] = $programID;
$this->group->create();
if(dao::isError()) die(js::error(dao::getError()));
die(js::closeModal('parent.parent', 'this'));
@@ -376,7 +342,7 @@ class program extends control
* @access public
* @return void
*/
public function editGroup($groupID)
public function PGMEditGroup($groupID)
{
if(!empty($_POST))
{
@@ -400,12 +366,12 @@ class program extends control
* @access public
* @return void
*/
public function copyGroup($groupID)
public function PGMCopyGroup($groupID)
{
if(!empty($_POST))
{
$group = $this->group->getByID($groupID);
$_POST['program'] = $group->program;
$_POST['PRJ'] = $group->PRJ;
$this->group->copy($groupID);
if(dao::isError()) die(js::error(dao::getError()));
die(js::closeModal('parent.parent', 'this'));
@@ -424,8 +390,11 @@ class program extends control
* @access public
* @return void
*/
public function manageView($groupID)
public function PGMManageView($groupID)
{
$this->lang->navGroup->program = 'program';
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction();
if($_POST)
{
$this->group->updateView($groupID);
@@ -442,8 +411,8 @@ class program 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->program)->orderBy('order_desc')->fetchPairs('id', 'name');
$this->view->projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('deleted')->eq('0')->andWhere('program')->eq($group->program)->orderBy('order_desc')->fetchPairs('id', 'name');
$this->view->products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('deleted')->eq('0')->andWhere('program')->eq($group->PRJ)->orderBy('order_desc')->fetchPairs('id', 'name');
$this->view->projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('deleted')->eq('0')->andWhere('parent')->eq($group->PRJ)->andWhere('type')->in('sprint,stage')->orderBy('order_desc')->fetchPairs('id', 'name');
$this->display();
}
@@ -455,8 +424,11 @@ class program extends control
* @access public
* @return void
*/
public function managePriv($type = 'byGroup', $param = 0, $menu = '', $version = '')
public function PGMManagePriv($type = 'byGroup', $param = 0, $menu = '', $version = '')
{
$this->lang->navGroup->program = 'program';
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction();
if($type == 'byGroup')
{
$groupID = $param;
@@ -473,7 +445,7 @@ class program extends control
if($type == 'byGroup') $result = $this->group->updatePrivByGroup($groupID, $menu, $version);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('group', "programID=$group->program")));
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('pgmgroup', "programID=$group->PRJ")));
}
if($type == 'byGroup')
@@ -499,15 +471,16 @@ class program extends control
$this->view->groupID = $groupID;
$this->view->menu = $menu;
$this->view->version = $version;
$program = $this->program->getPGMByID($group->program);
$program = $this->program->getPGMByID($group->PRJ);
/* Unset not program privs. */
foreach($this->lang->resource as $method => $label)
{
if(!in_array($method, $this->config->programPriv->{$program->template})) unset($this->lang->resource->$method);
if(!in_array($method, $this->config->programPriv->{$program->model})) unset($this->lang->resource->$method);
}
}
$this->display('group', 'managePriv');
$this->display();
}
/**
@@ -518,7 +491,7 @@ class program extends control
* @access public
* @return void
*/
public function manageGroupMember($groupID, $deptID = 0)
public function PGMManageGroupMember($groupID, $deptID = 0)
{
if(!empty($_POST))
{
@@ -553,8 +526,11 @@ class program extends control
* @access public
* @return void
*/
public function manageMembers($projectID, $dept = '')
public function PGMManageMembers($projectID, $dept = '')
{
$this->lang->navGroup->program = 'program';
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction();
$this->session->set('program', $projectID);
if(!empty($_POST))
{
@@ -572,8 +548,8 @@ class program extends control
$deptUsers = $dept === '' ? array() : $this->dept->getDeptUserPairs($dept);
$currentMembers = $this->project->getTeamMembers($projectID);
$title = $this->lang->program->manageMembers . $this->lang->colon . $project->name;
$position[] = $this->lang->program->manageMembers;
$title = $this->lang->program->PGMManageMembers . $this->lang->colon . $project->name;
$position[] = $this->lang->program->PGMManageMembers;
$this->view->title = $title;
$this->view->position = $position;
@@ -587,69 +563,6 @@ class program extends control
$this->display();
}
/**
* Delete a program.
*
* @param int $projectID
* @param varchar $confirm
* @access public
* @return void
*/
public function delete($programID, $confirm = 'no')
{
$childrenCount = $this->dao->select('count(*) as count')->from(TABLE_PROJECT)->where('parent')->eq($programID)->andWhere('template')->ne('')->andWhere('deleted')->eq(0)->fetch('count');
if($childrenCount) die(js::alert($this->lang->program->hasChildren));
$program = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($programID)->fetch();
if($confirm == 'no') die(js::confirm(sprintf($this->lang->program->confirmDelete, $program->name), $this->createLink('program', 'delete', "programID=$programID&confirm=yes")));
$this->dao->update(TABLE_PROJECT)->set('deleted')->eq(1)->where('id')->eq($programID)->exec();
$this->loadModel('action')->create('program', $programID, 'deleted', '', $extra = ACTIONMODEL::CAN_UNDELETED);
die(js::reload('parent'));
}
/**
* Activate a program.
*
* @param int $projectID
* @access public
* @return void
*/
public function activate($projectID)
{
$project = $this->program->getPGMByID($projectID);
if(!empty($_POST))
{
$this->loadModel('action');
$changes = $this->project->activate($projectID);
if(dao::isError()) die(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
$actionID = $this->action->create('program', $projectID, 'Activated', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($projectID);
die(js::reload('parent.parent'));
}
$newBegin = date('Y-m-d');
$dateDiff = helper::diffDate($newBegin, $project->begin);
$newEnd = date('Y-m-d', strtotime($project->end) + $dateDiff * 24 * 3600);
$this->view->title = $this->lang->project->activate;
$this->view->position[] = $this->lang->project->activate;
$this->view->project = $project;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->actions = $this->loadModel('action')->getList('project', $projectID);
$this->view->newBegin = $newBegin;
$this->view->newEnd = $newEnd;
$this->view->project = $project;
$this->display('project', 'activate');
}
/**
* Export program.
*
@@ -765,55 +678,6 @@ class program extends control
$this->display();
}
/**
* Ajax get program drop menu.
*
* @param int $programID
* @param varchar $module
* @access public
* @return void
*/
public function ajaxGetDropMenu($programID, $module, $method, $extra)
{
$this->loadModel('project');
$this->view->programID = $programID;
$this->view->module = $module;
$this->view->method = $method;
$this->view->extra = $extra;
$programs = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in(array_keys($this->programs))->orderBy('order desc')->fetchAll();
$programPairs = array();
foreach($programs as $program) $programPairs[$program->id] = $program->name;
$this->view->programs = $programs;
$this->display();
}
/**
* Ajax get program enter link.
*
* @param int $programID
* @access public
* @return void
*/
public function ajaxGetEnterLink($programID = 0)
{
$this->lang->navGroup->program = 'project';
$program = $this->program->getPGMByID($programID);
$programProjects = $this->project->getPairs('', $this->session->PRJ);
$programProject = key($programProjects);
if($program->template == 'waterfall')
{
$link = $this->createLink('programplan', 'browse', 'programID=' . $programID);
}
if($program->template == 'scrum')
{
$link = $programProject ? $this->createLink('project', 'task', 'projectID=' . $programProject) : $this->createLink('project', 'create', '', '', '', $programID);
}
die($link);
}
/**
* Gets the most recently created project.
*

View File

@@ -1,69 +0,0 @@
<?php js::set('programID', $programID);?>
<?php js::set('module', $module);?>
<?php js::set('method', $method);?>
<?php js::set('extra', $extra);?>
<?php
$iCharges = 0;
$others = 0;
$dones = 0;
$programNames = array();
$myProgramsHtml = '';
$normalProgramsHtml = '';
$closedProgramsHtml = '';
foreach($programs as $program)
{
if($program->status != 'done' and $program->status != 'closed' and $program->PM == $this->app->user->account) $iCharges++;
if($program->status != 'done' and $program->status != 'closed' and !($program->PM == $this->app->user->account)) $others++;
if($program->status == 'done' or $program->status == 'closed') $dones++;
$programNames[] = $program->name;
}
$programsPinYin = common::convert2Pinyin($programNames);
foreach($programs as $program)
{
$link = $this->createLink('program', 'index', "programID=$program->id", '', '', $program->id);
if($program->status != 'done' and $program->status != 'closed' and $program->PM == $this->app->user->account)
{
$myProgramsHtml .= html::a($link, "<i class='icon icon-folder-outline'></i> " . $program->name, '', "class='text-important' title='{$program->name}' data-id={$program->id} data-key='" . zget($programsPinYin, $program->name, '') . "'");
}
else if($program->status != 'done' and $program->status != 'closed' and !($program->PM == $this->app->user->account))
{
$normalProgramsHtml .= html::a($link, "<i class='icon icon-folder-outline'></i> " . $program->name, '', "title='{$program->name}' data-id={$program->id} data-key='" . zget($programsPinYin, $program->name, '') . "'");
}
else if($program->status == 'done' or $program->status == 'closed') $closedProgramsHtml .= html::a($link, "<i class='icon icon-folder-outline'></i> " . $program->name, '', "title='{$program->name}' data-id={$program->id} data-key='" . zget($programsPinYin, $program->name, '') . "'");
}
?>
<div class="table-row">
<div class="table-col col-left">
<div class='list-group'>
<?php
if(!empty($myProgramsHtml))
{
echo "<div class='heading'>{$lang->project->mine}</div>";
echo $myProgramsHtml;
if(!empty($myProgramsHtml))
{
echo "<div class='heading'>{$lang->project->other}</div>";
}
}
echo $normalProgramsHtml;
?>
</div>
<div class="col-footer">
<div class='pull-left'>
<?php echo html::a(helper::createLink('program', 'browse', 'status=all'), '<i class="icon icon-cards-view muted"></i> ' . $lang->project->all, '', 'class="not-list-item"'); ?>
</div>
<div class='pull-right'>
<span class='text-muted muted'> &nbsp; | &nbsp; </span>
<a class='toggle-right-col not-list-item'><?php echo $lang->project->doneProjects?><i class='icon icon-angle-right'></i></a>
</div>
</div>
</div>
<div class="table-col col-right">
<div class='list-group'>
<?php
echo $closedProgramsHtml;
?>
</div>
</div>
</div>

View File

@@ -1,163 +0,0 @@
<div class='row cell' id='cards'>
<?php foreach ($programs as $programID => $program):?>
<div class='col' data-id='<?php echo $programID?>'>
<div class='panel' data-url='<?php echo $this->createLink('program', 'index', "programID=$program->id", '', '', $program->id);?>'>
<div class='panel-heading'>
<strong class='program-name' title='<?php echo $program->name;?>'><?php echo $program->name;?></strong>
<?php if($program->template === 'waterfall'): ?>
<span class='program-type-label label label-warning label-outline'><?php echo $lang->program->waterfall; ?></span>
<?php else: ?>
<span class='program-type-label label label-info label-outline'><?php echo $lang->program->scrum; ?></span>
<?php endif; ?>
<nav class='panel-actions nav nav-default'>
<li class='dropdown'>
<a href='javascript:;' data-toggle='dropdown' class='panel-action'><i class='icon icon-ellipsis-v'></i></a>
<ul class='dropdown-menu pull-right'>
<li><?php common::printIcon('program', 'group', "programID=$program->id", $program, 'button', 'group');?></li>
<li><?php common::printIcon('program', 'manageMembers', "programID=$program->id", $program, 'button', 'persons');?></li>
<li><?php common::printicon('program', 'activate', "programid=$program->id", $program, 'button', '', '', 'iframe', true);?></li>
<li><?php if(common::hasPriv('program', 'edit')) echo html::a($this->createLink("program", "edit", "programID=$program->id"), "<i class='icon-edit'></i> " . $lang->edit, '', "");?></li>
<li><?php common::printIcon('program', 'start', "programID=$program->id", $program, 'button', '', '', 'iframe', true);?></li>
<li><?php common::printIcon('program', 'suspend', "programID=$program->id", $program, 'button', '', '', 'iframe', true);?></li>
<li><?php common::printIcon('program', 'close', "programID=$program->id", $program, 'button', '', '', 'iframe', true);?></li>
<li><?php if(common::hasPriv('program', 'delete')) echo html::a($this->createLink("program", "delete", "programID=$program->id"), "<i class='icon-trash'></i> " . $lang->delete, 'hiddenwin', "");?></li>
</ul>
</li>
</nav>
</div>
<div class='panel-body'>
<div class='program-infos'>
<span><i class='icon icon-group'></i> <?php printf($lang->program->membersUnit, $program->teamCount); ?></span>
<span><i class='icon icon-clock'></i> <?php printf($lang->program->hoursUnit, $program->estimate); ?></span>
<span><i class='icon icon-cost'></i> <?php echo $program->budget . '' . zget($lang->program->unitList, $program->budgetUnit);?></span>
</div>
<?php if($program->template === 'waterfall'): ?>
<div class='program-detail program-stages'>
<p class='text-muted'><?php echo $lang->program->ongoingStage; ?></p>
<?php
$programProjects = array();
foreach($program->projects as $project)
{
if(!$project->parent) $programProjects[] = $project;
}
?>
<?php if(empty($programProjects)): ?>
<div class='label label-outline'><?php echo zget($lang->project->statusList, $program->status);?></div>
<?php else: ?>
<div class='program-stages-container scrollbar-hover'>
<div class='program-stages-row'>
<?php foreach ($programProjects as $project): ?>
<div class='program-stage-item is-<?php echo $project->status;?><?php if($project->status !== 'wait') echo ' is-going'; ?>'>
<div><?php echo $project->name; ?></div>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>
<?php else: ?>
<?php $project = $program->projects ? current($program->projects) : '';?>
<div class='program-detail program-iteration'>
<p class='text-muted'><?php echo $lang->program->lastIteration; ?></p>
<?php if($project):?>
<div class='row'>
<div class='col-xs-5'><?php echo $project->name; ?></div>
<div class='col-xs-7'>
<div class="progress progress-text-left">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?php echo $project->hours->progress;?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $project->hours->progress;?>%">
<span class="progress-text"><?php echo $project->hours->progress;?>%</span>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach;?>
<div class='col-xs-12' id='cardsFooter'>
<?php $pager->show('right', 'pagerjs');?>
</div>
</div>
<style>
#mainMenu {padding-left: 10px; padding-right: 10px;}
#cards {margin: 0 10px;}
#cards > .col {width: 20%;}
#cards .panel {margin: 10px 0; border: 1px solid #DCDCDC; border-radius: 2px; box-shadow: none; height: 146px; cursor: pointer;}
#cards .panel:hover {border-color: #006AF1; box-shadow: 0 0 10px 0 rgba(0,0,100,.25);}
#cards .panel-heading {padding: 12px 24px 10px 16px;}
#cards .panel-body {padding: 0 16px 16px;}
#cards .panel-actions {padding: 7px 0;}
#cards .panel-actions .dropdown-menu > li > a {padding-left: 5px; text-align: left;}
#cards .panel-actions .dropdown-menu > li > a > i {opacity: .5; display: inline-block; margin-right: 4px; width: 18px; text-align: center;}
#cards .panel-actions .dropdown-menu > li > a:hover > i {opacity: 1;}
#cards .program-type-label {padding: 1px 2px;}
#cards .program-name {font-size: 16px; font-weight: normal; display: inline-block; max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;}
#cards .program-infos {font-size: 12px;}
#cards .program-infos > span {display: inline-block; line-height: 12px;}
#cards .program-infos > span > .icon {font-size: 12px; display: inline-block; position: relative; top: -1px}
#cards .program-infos > span + span {margin-left: 15px;}
#cards .program-detail {position: absolute; bottom: 16px; left: 16px; right: 16px; font-size: 12px;}
#cards .program-detail > p {margin-bottom: 8px;}
#cards .program-detail .progress {height: 4px;}
#cards .program-detail .progress-text-left .progress-text {width: 50px; left: -50px;}
#cards .pager {margin: 0; float: right;}
#cards .pager .btn {border: none}
#cards .program-stages-container {margin: 0 -16px -16px -16px; padding: 0 4px; height: 46px; overflow-x: auto; position: relative;}
#cards .program-stages:after {content: ' '; width: 30px; display: block; right: -16px; top: 16px; bottom: -6px; z-index: 1; background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); position: absolute;}
#cards .program-stages-row {position: relative; height: 30px; z-index: 0;}
#cards .program-stage-item {white-space: nowrap; position: absolute; top: 0; min-width: 48px; padding-top: 13px; color: #838A9D;}
#cards .program-stage-item > div {white-space: nowrap; overflow: visible; text-align: center; text-overflow: ellipsis;}
#cards .program-stage-item:before {content: ' '; display: block; width: 8px; height: 8px; border-radius: 50%; background: #D1D1D1; position: absolute; left: 50%; margin-left: -4px; top: 0; z-index: 1;}
#cards .program-stage-item + .program-stage-item:after {content: ' '; display: block; left: -50%; right: 50%; height: 2px; background-color: #D1D1D1; top: 3px; position: absolute; z-index: 0;}
#cards .program-stage-item.is-going {color: #333;}
#cards .program-stage-item.is-going::before {background-color: #0C64EB;}
</style>
<script>
$(function()
{
/* Auto resize cards size */
var minCardWidth = 280;
var $cards = $('#cards');
var resizeCards = function()
{
var cardsWidth = $cards.width();
var bestColsSize = 1;
while((cardsWidth / (bestColsSize + 1)) > minCardWidth)
{
bestColsSize++;
}
$cards.children('.col').css('width', (100 / bestColsSize) + '%');
};
resizeCards();
$(window).on('resize', resizeCards);
/* Auto resize stages */
$cards.find('.program-stages-container').each(function()
{
var $container = $(this);
var $row = $container.children();
var totalWidth = 0;
$row.children().each(function()
{
var $item = $(this);
$item.css('left', totalWidth);
totalWidth += $item.width();
});
$row.css('minWidth', totalWidth);
});
/* Make cards clickable */
$cards.on('click', '.panel', function(e)
{
if(!$(e.target).closest('.panel-actions').length)
{
window.location.href = $(this).data('url');
}
});
});
</script>

View File

@@ -1,126 +0,0 @@
<?php $canOrder = (common::hasPriv('program', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
<form class='main-table' id='programForm' method='post' data-ride='table' data-nested='true' data-expand-nest-child='false' data-checkable='false'>
<table class='table has-sort-head table-fixed table-nested' id='programList'>
<?php $vars = "status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='c-id w-80px'>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th class='w-100px'><?php common::printOrderLink('code', $orderBy, $vars, $lang->program->PGMCode);?></th>
<th class='table-nest-title'><?php common::printOrderLink('name', $orderBy, $vars, $lang->program->PGMName);?></th>
<th class='w-80px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->program->PGMStatus);?></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>
<th class='w-100px'><?php common::printOrderLink('budget', $orderBy, $vars, $lang->program->PGMBudget);?></th>
<th class='w-100px'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->program->PGMPM);?></th>
<th class='text-center w-240px'><?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 id='programTableList'>
<?php foreach($programs as $program):?>
<?php
$trClass = '';
$trAttrs = "data-id='$program->id' data-order='$program->order' data-parent='$program->parent'";
if($program->type == 'program')
{
$trAttrs .= " data-nested='true'";
if($program->parent == '0') $trClass .= ' is-top-level table-nest-child-hide';
else $trClass .= ' is-top-level table-nest-hide';
}
if($program->parent)
{
if($program->type != 'program') $trClass .= ' is-nest-child';
$trClass .= ' table-nest-hide';
$trAttrs .= " data-nest-parent='$program->parent' data-nest-path='$program->path'";
}
elseif($program->type != 'program')
{
$trClass .= ' no-nest';
}
$trAttrs .= " class='$trClass'";
?>
<tr <?php echo $trAttrs;?>>
<td class='c-id'>
<?php printf('%03d', $program->id);?>
</td>
<td class='text-left'><?php echo $program->code;?></td>
<td class='text-left pgm-title table-nest-title' title='<?php echo $program->name?>'>
<span class="table-nest-icon icon<?php if($program->isCat) echo ' table-nest-toggle' ?>"></span>
<?php echo $program->type == 'program' ? $program->name : html::a($this->createLink('program', 'index', "programID=$program->id", '', '', $program->id), $program->name);?>
</td>
<td class='c-status'><span class="status-program status-<?php echo $program->status?>"><?php echo zget($lang->project->statusList, $program->status, '');?></span></td>
<td class='text-center'><?php echo $program->begin;?></td>
<td class='text-center'><?php echo $program->end == '0000-00-00' ? '' : $program->end;?></td>
<td class='text-left'><?php echo $program->budget . ' ' . zget($lang->program->unitList, $program->budgetUnit);?></td>
<td><?php echo zget($users, $program->PM);?></td>
<td class='text-center c-actions'>
<?php common::printIcon('program', 'group', "programID=$program->id", $program, 'list', 'group');?>
<?php common::printIcon('program', 'manageMembers', "programID=$program->id", $program, 'list', 'persons');?>
<?php common::printIcon('program', 'start', "programID=$program->id", $program, 'list', '', '', 'iframe', true);?>
<?php common::printIcon('program', 'activate', "programID=$program->id", $program, 'list', '', '', 'iframe', true);?>
<?php common::printIcon('program', 'suspend', "programID=$program->id", $program, 'list', '', '', 'iframe', true);?>
<?php common::printIcon('program', 'close', "programID=$program->id", $program, 'list', '', '', 'iframe', true);?>
<?php if(common::hasPriv('program', 'edit')) echo html::a($this->createLink("program", "edit", "programID=$program->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
<?php common::printIcon('program', 'create', "template=&programID=$program->id", '', 'list', 'treemap-alt', '', '', '', '', $this->lang->program->PGMChildren);?>
<?php if(common::hasPriv('program', 'delete')) echo html::a($this->createLink("program", "delete", "programID=$program->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$lang->delete}'");?>
</td>
<?php if($canOrder):?>
<td class='sort-handler text-center'><i class="icon icon-move"></i></td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
</table>
<div class='table-footer'>
<?php $pager->show('right', 'pagerjs');?>
</div>
</form>
<style>
.w-240px {width:240px;}
#programTableList.sortable-sorting > tr {opacity: 0.7}
#programTableList.sortable-sorting > tr.drag-row {opacity: 1;}
#programTableList > tr.drop-not-allowed {opacity: 0.1!important}
</style>
<script>
$(function()
{
var $list = $('#programTableList');
$list.addClass('sortable').sortable(
{
reverse: orderBy === 'order_desc',
selector: 'tr',
dragCssClass: 'drag-row',
trigger: $list.find('.sort-handler').length ? '.sort-handler' : null,
canMoveHere: function($ele, $target)
{
return $ele.data('parent') === $target.data('parent');
},
start: function(e)
{
e.targets.filter('[data-parent!="' + e.element.attr('data-parent') + '"]').addClass('drop-not-allowed');
},
finish: function(e)
{
var orders = {};
e.list.each(function()
{
orders[$(this.item).data('id')] = this.order;
});
$.post(createLink('project', 'updateOrder'), {'projects' : orders, 'orderBy' : orderBy});
var $thead = $list.closest('table').children('thead');
$thead.find('.headerSortDown, .headerSortUp').removeClass('headerSortDown headerSortUp').addClass('header');
$thead.find('th.sort-default .header').removeClass('header').addClass('headerSortDown');
e.element.addClass('drop-success');
setTimeout(function(){e.element.removeClass('drop-success');}, 800);
$list.children('.drop-not-allowed').removeClass('drop-not-allowed');
}
});
});
</script>

View File

@@ -1,100 +0,0 @@
<?php
/**
* The edit view of program 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 program
* @version $Id: create.html.php 4728 2013-05-03 06:14:34Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('weekend', $config->project->weekend);?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->program->PGMEdit;?></h2>
</div>
<form class='form-indicator main-form form-ajax' method='post' target='hiddenwin' id='dataform'>
<table class='table table-form'>
<tr>
<th class='w-120px'><?php echo $lang->program->PGMParent;?></th>
<td class="col-main"><?php echo html::select('parent', $parents, $program->parent, "class='form-control chosen'");?></td>
<td></td><td></td>
</tr>
<tr>
<th class='w-120px'><?php echo $lang->program->PGMName;?></th>
<td class="col-main"><?php echo html::input('name', $program->name, "class='form-control' required");?></td>
</tr>
<tr>
<th><?php echo $lang->program->PGMCode;?></th>
<td><?php echo html::input('code', $program->code, "class='form-control' required");?></td><td></td><td></td>
</tr>
<tr>
<th><?php echo $lang->program->PGMPM;?></th>
<td><?php echo html::select('PM', $pmUsers, $program->PM, "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->program->PGMBudget;?></th>
<td><?php echo html::input('budget', $program->budget, "class='form-control'");?></td>
<td style='float:left'><?php echo html::select('budgetUnit', $lang->program->unitList, $program->budgetUnit, "class='form-control'");?></td><td></td>
</tr>
<tr>
<th><?php echo $lang->program->dateRange;?></th>
<td>
<div class='input-group'>
<?php echo html::input('begin', $program->begin, "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->program->begin . "' required");?>
<span class='input-group-addon'><?php echo $lang->program->to;?></span>
<?php echo html::input('end', $program->end == '0000-00-00' ? '' : $program->end, "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->program->end . "' required");?>
<span class='input-group-addon hidden' id='longTimeBox'>
<div class="checkbox-primary">
<input type="checkbox" name="longTime" value="1" id="longTime" <?php if($program->end == '0000-00-00') echo "checked";?>>
<label for="longTime"><?php echo $lang->program->longTime;?></label>
</div>
</span>
</div>
</td>
<td colspan='2'></td>
</tr>
<tr>
<th><?php echo $lang->program->realBegan;?></th>
<td><?php echo html::input('realBegan', $program->realBegan, "class='form-control form-date'");?></td><td></td><td></td>
</tr>
<tr>
<th><?php echo $lang->project->teamname;?></th>
<td><?php echo html::input('team', $program->team, "class='form-control'");?></td><td></td><td></td>
</tr>
<tr>
<th><?php echo $lang->program->PGMDesc;?></th>
<td colspan='3'>
<?php echo $this->fetch('user', 'ajaxPrintTemplates', 'type=program&link=desc');?>
<?php echo html::textarea('desc', $program->desc, "rows='6' class='form-control kindeditor' hidefocus='true'");?>
</td>
</tr>
<tr>
<th><?php echo $lang->program->auth;?></th>
<td colspan='3'><?php echo html::radio('privway', $lang->program->PGMAuthList, $program->auth, '', 'block');?></td>
</tr>
<tr>
<th><?php echo $lang->project->acl;?></th>
<td colspan='3'><?php echo nl2br(html::radio('acl', $lang->program->PGMAclList, $program->acl, "onclick='setWhite(this.value);'", 'block'));?></td>
</tr>
<tr id='whitelistBox' <?php if($program->acl != 'custom') echo "class='hidden'";?>>
<th><?php echo $lang->project->whitelist;?></th>
<td colspan='3'><?php echo html::checkbox('whitelist', $groups, $program->whitelist, '', '', 'inline');?></td>
</tr>
<tr>
<td colspan='4' class='text-center form-actions'>
<?php echo html::submitButton();?>
<?php echo html::backButton();?>
</td>
</tr>
</table>
<?php echo html::hidden('products[]') . html::hidden('plans[]');?>
</form>
</div>
</div>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -32,7 +32,7 @@
else $trClass .= ' is-top-level table-nest-hide';
}
if($program->parent)
if($program->parent and isset($programs[$program->parent]))
{
if($program->type != 'program') $trClass .= ' is-nest-child';
$trClass .= ' table-nest-hide';
@@ -64,25 +64,25 @@
<td><?php echo zget($users, $program->PM);?></td>
<td class='text-center c-actions'>
<?php if($program->type == 'program'):?>
<?php common::printIcon('program', 'pgmgroup', "programID=$program->id", $program, 'list', 'group');?>
<?php common::printIcon('program', 'pgmmanageMembers', "programID=$program->id", $program, 'list', 'persons');?>
<?php common::printIcon('program', 'prjstart', "programID=$program->id", $program, 'list', 'play', '', 'iframe', true);?>
<?php common::printIcon('program', 'pgmactivate', "programID=$program->id", $program, 'list', 'magic', '', 'iframe', true);?>
<?php common::printIcon('program', 'prjsuspend', "programID=$program->id", $program, 'list', 'pause', '', 'iframe', true);?>
<?php common::printIcon('program', 'pgmclose', "programID=$program->id", $program, 'list', 'off', '', 'iframe', true);?>
<?php if(common::hasPriv('program', 'pgmedit')) echo html::a($this->createLink("program", "pgmedit", "programID=$program->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
<?php common::printIcon('program', 'pgmcreate', "programID=$program->id", '', 'list', 'treemap-alt', '', '', '', '', $this->lang->program->PGMChildren);?>
<?php if(common::hasPriv('program', 'pgmdelete')) echo html::a($this->createLink("program", "pgmdelete", "programID=$program->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$lang->delete}'");?>
<?php common::printIcon('program', 'PGMGroup', "programID=$program->id", $program, 'list', 'group');?>
<?php common::printIcon('program', 'PGMManageMembers', "programID=$program->id", $program, 'list', 'persons');?>
<?php common::printIcon('program', 'PRJStart', "programID=$program->id", $program, 'list', 'play', '', 'iframe', true);?>
<?php common::printIcon('program', 'PGMActivate', "programID=$program->id", $program, 'list', 'magic', '', 'iframe', true);?>
<?php common::printIcon('program', 'PRJSuspend', "programID=$program->id", $program, 'list', 'pause', '', 'iframe', true);?>
<?php common::printIcon('program', 'PGMClose', "programID=$program->id", $program, 'list', 'off', '', 'iframe', true);?>
<?php if(common::hasPriv('program', 'PGMEdit')) echo html::a($this->createLink("program", "pgmedit", "programID=$program->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
<?php common::printIcon('program', 'PGMCreate', "programID=$program->id", '', 'list', 'treemap-alt', '', '', '', '', $this->lang->program->PGMChildren);?>
<?php if(common::hasPriv('program', 'PGMDelete')) echo html::a($this->createLink("program", "pgmdelete", "programID=$program->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$lang->delete}'");?>
<?php else:?>
<?php common::printIcon('program', 'prjgroup', "programID=$program->id", $program, 'list', 'group');?>
<?php common::printIcon('program', 'prjmanageMembers', "programID=$program->id", $program, 'list', 'persons');?>
<?php common::printIcon('program', 'prjstart', "programID=$program->id", $program, 'list', 'play', '', 'iframe', true);?>
<?php common::printIcon('program', 'prjactivate', "programID=$program->id", $program, 'list', 'magic', '', 'iframe', true);?>
<?php common::printIcon('program', 'prjsuspend', "programID=$program->id", $program, 'list', 'pause', '', 'iframe', true);?>
<?php common::printIcon('program', 'prjclose', "programID=$program->id", $program, 'list', 'off', '', 'iframe', true);?>
<?php if(common::hasPriv('program', 'prjedit')) echo html::a($this->createLink("program", "prjedit", "programID=$program->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
<?php common::printIcon('program', 'prjcreate', "programID=$program->id", '', 'list', 'treemap-alt', '', 'disabled', '', '', $this->lang->program->PGMChildren);?>
<?php if(common::hasPriv('program', 'prjdelete')) echo html::a($this->createLink("program", "prjdelete", "programID=$program->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$lang->delete}'");?>
<?php common::printIcon('program', 'PRJGroup', "programID=$program->id", $program, 'list', 'group');?>
<?php common::printIcon('program', 'PRJManageMembers', "programID=$program->id", $program, 'list', 'persons');?>
<?php common::printIcon('program', 'PRJStart', "programID=$program->id", $program, 'list', 'play', '', 'iframe', true);?>
<?php common::printIcon('program', 'PRJActivate', "programID=$program->id", $program, 'list', 'magic', '', 'iframe', true);?>
<?php common::printIcon('program', 'PRJSuspend', "programID=$program->id", $program, 'list', 'pause', '', 'iframe', true);?>
<?php common::printIcon('program', 'PRJClose', "programID=$program->id", $program, 'list', 'off', '', 'iframe', true);?>
<?php if(common::hasPriv('program','PRJEdit')) echo html::a($this->createLink("program", "prjedit", "programID=$program->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
<?php common::printIcon('program', 'PRJCreate', "programID=$program->id", '', 'list', 'treemap-alt', '', 'disabled', '', '', $this->lang->program->PGMChildren);?>
<?php if(common::hasPriv('program','PRJDelete')) echo html::a($this->createLink("program", "prjdelete", "programID=$program->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$lang->delete}'");?>
<?php endif;?>
</td>
<?php if($canOrder):?>

View File

@@ -18,7 +18,7 @@
<span class='btn btn-link btn-active-text'><span class='text'><?php echo $lang->group->browse;?></span></span>
</div>
<div class='btn-toolbar pull-right'>
<?php if(common::hasPriv('program', 'createGroup')) echo html::a($this->createLink('program', 'createGroup', "program=$programID", '', true), '<i class="icon-plus"></i> ' . $lang->group->create, '', 'class="btn btn-primary iframe" data-width="550"');?>
<?php if(common::hasPriv('program', 'pgmcreategroup')) echo html::a($this->createLink('program', 'pgmcreategroup', "program=$programID", '', true), '<i class="icon-plus"></i> ' . $lang->group->create, '', 'class="btn btn-primary iframe" data-width="550"');?>
</div>
</div>
<div id='mainContent' class='main-table'>
@@ -43,12 +43,12 @@
<td class='c-actions'>
<?php $lang->group->managepriv = $lang->group->managePrivByGroup;?>
<?php $disabled = $group->role == 'limited' ? 'disabled' : '';?>
<?php common::printIcon('program', 'manageView', "groupID=$group->id", $group, 'list', 'eye', '', $disabled);?>
<?php common::printIcon('program', 'managePriv', "type=byGroup&param=$group->id", $group, 'list', 'lock');?>
<?php common::printIcon('program', 'pgmmanageview', "groupID=$group->id", $group, 'list', 'eye', '', $disabled);?>
<?php common::printIcon('program', 'pgmmanagepriv', "type=byGroup&param=$group->id", $group, 'list', 'lock');?>
<?php $lang->group->managemember = $lang->group->manageMember;?>
<?php common::printIcon('program', 'manageGroupMember', "groupID=$group->id", $group, 'list', 'persons', '', 'iframe', 'yes', "data-width='90%'");?>
<?php common::printIcon('program', 'editGroup', "groupID=$group->id", $group, 'list', 'edit', '', 'iframe', 'yes', "data-width='550'");?>
<?php common::printIcon('program', 'copyGroup', "groupID=$group->id", $group, 'list', 'copy', '', "iframe $disabled", 'yes', "data-width='550'");?>
<?php common::printIcon('program', 'pgmmanagegroupmember', "groupID=$group->id", $group, 'list', 'persons', '', 'iframe', 'yes', "data-width='90%'");?>
<?php common::printIcon('program', 'pgmeditgroup', "groupID=$group->id", $group, 'list', 'edit', '', 'iframe', 'yes', "data-width='550'");?>
<?php common::printIcon('program', 'pgmcopygroup', "groupID=$group->id", $group, 'list', 'copy', '', "iframe $disabled", 'yes', "data-width='550'");?>
<?php
if(common::hasPriv('group', 'delete') and $group->role != 'limited')
{

View File

@@ -0,0 +1,109 @@
<?php include '../../common/view/header.html.php';?>
<?php js::set('projectID', $project->id);?>
<?php js::set('roles', $roles);?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<span class='btn btn-link btn-active-text'>
<?php echo html::a($this->createLink('project', 'managemembers', "projectID={$project->id}"), "<span class='text'> {$lang->project->manageMembers}</span>");?>
</span>
<div class='input-group space w-200px'>
<span class='input-group-addon'><?php echo $lang->project->selectDept?></span>
<?php echo html::select('dept', $depts, $dept, "class='form-control chosen' onchange='setDeptUsers(this)' data-placeholder='{$lang->project->selectDeptTitle}'");?>
</div>
</div>
</div>
<div id='mainContent' class='main-content'>
<form class='main-form' method='post' id='teamForm' target='hiddenwin'>
<table class='table table-form'>
<thead>
<tr class='text-center'>
<th><?php echo $lang->team->account;?></th>
<th><?php echo $lang->team->role;?></th>
<th class='w-100px'><?php echo $lang->team->days;?></th>
<th class='w-100px'><?php echo $lang->team->hours;?></th>
<th class='w-110px'><?php echo $lang->team->limited;?></th>
<th class="w-90px"> <?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php $i = 0; $memberCount = 0;?>
<?php foreach($currentMembers as $member):?>
<?php if(!isset($users[$member->account])) continue;?>
<?php unset($users[$member->account]);?>
<tr>
<td><input type='text' name='realnames[]' id='account<?php echo $i;?>' value='<?php echo $member->realname;?>' readonly class='form-control' /></td>
<td><input type='text' name='roles[]' id='role<?php echo $i;?>' value='<?php echo $member->role;?>' class='form-control' /></td>
<td><input type='text' name='days[] ' id='days<?php echo $i;?>' value='<?php echo $member->days;?>' class='form-control' /></td>
<td>
<input type='text' name='hours[]' id='hours<?php echo $i;?>' value='<?php echo $member->hours;?>' class='form-control' />
<input type='hidden' name='accounts[]' value='<?php echo $member->account;?>' />
</td>
<td><?php echo html::radio("limited[$i]", $lang->team->limitedList, $member->limited);?></td>
<td class='c-actions text-center'>
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
<a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
</td>
</tr>
<?php $i ++; $memberCount ++;?>
<?php endforeach;?>
<?php foreach($deptUsers as $deptAccount => $userName):?>
<?php if(!isset($users[$deptAccount])) continue;?>
<tr class='addedItem'>
<td><?php echo html::select("accounts[]", $users, $deptAccount, "class='form-control chosen' onchange='setRole(this.value, $i)'");?></td>
<td><input type='text' name='roles[]' id='role<?php echo $i;?>' class='form-control' value='<?php echo $roles[$deptAccount]?>'/></td>
<td><input type='text' name='days[]' id='days<?php echo $i;?>' class='form-control' value='<?php echo $project->days?>'/></td>
<td>
<input type='text' name='hours[]' id='hours<?php echo $i;?>' class='form-control' value='<?php echo $config->project->defaultWorkhours?>' />
</td>
<td><?php echo html::radio("limited[$i]", $lang->team->limitedList, 'no');?></td>
<td class='c-actions text-center'>
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
<a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
</td>
</tr>
<?php unset($users[$deptAccount]);?>
<?php $i ++; $memberCount ++;?>
<?php endforeach;?>
<?php for($j = 0; $j < 5; $j ++):?>
<tr class='addedItem'>
<td><?php echo html::select("accounts[]", $users, '', "class='form-control chosen' onchange='setRole(this.value, $i)'");?></td>
<td><input type='text' name='roles[]' id='role<?php echo ($i);?>' class='form-control' /></td>
<td><input type='text' name='days[]' id='days<?php echo ($i);?>' class='form-control' value='<?php echo $project->days?>'/></td>
<td>
<input type='text' name='hours[]' id='hours<?php echo ($i);?>' class='form-control' value='<?php echo $config->project->defaultWorkhours?>' />
</td>
<td><?php echo html::radio("limited[$i]", $lang->team->limitedList, 'no');?></td>
<td class='c-actions text-center'>
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
<a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
</td>
</tr>
<?php $i ++; $memberCount ++;?>
<?php endfor;?>
</tbody>
<tfoot><tr><td colspan='6' class='text-center form-actions'><?php echo html::submitButton() . ' ' . html::backButton(); ?></td></tr></tfoot>
</table>
<?php js::set('i', $i);?>
</form>
</div>
<div>
<?php $i = '%i%';?>
<table class='hidden'>
<tr id='addItem' class='hidden'>
<td><?php echo html::select("accounts[]", $users, '', "class='form-control' onchange='setRole(this.value, $i)'");?></td>
<td><input type='text' name='roles[]' id='role<?php echo ($i);?>' class='form-control' /></td>
<td><input type='text' name='days[]' id='days<?php echo ($i);?>' class='form-control' value='<?php echo $project->days?>'/></td>
<td>
<input type='text' name='hours[]' id='hours<?php echo ($i);?>' class='form-control' value='<?php echo $config->project->defaultWorkhours?>' />
</td>
<td><?php echo html::radio("limited[$i]", $lang->team->limitedList, 'no');?></td>
<td class='c-actions text-center'>
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
<a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
</td>
</tr>
</table>
</div>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -0,0 +1,187 @@
<?php
/**
* The manage privilege view of group 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 group
* @version $Id: managepriv.html.php 4129 2013-01-18 01:58:14Z wwccss $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php'; ?>
<style>
.table-bymodule select.form-control {height:250px}
.group-item {display:block; width:220px; float:left; font-size: 14px}
.group-item .checkbox-inline label{padding-left:8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.table.table-form tbody > tr:last-child td {border-top: 1px solid #ddd}
@-moz-document url-prefix(){.table.table-form tbody > tr:last-child td, .table.table-form tbody > tr:last-child th {border-bottom: 1px solid #ddd}}
#mainMenu #groupName{line-height:33px; float: left}
.checkbox-right{padding-left:0px !important;}
td.menus {border-right: 0;padding-right: 0;width: 220px !important;}
td.menus + td {border-left: 0;}
.menus .checkbox-primary {float: left; width: 220px;}
.menus .checkbox-primary:first-child {float: left; width: auto;}
.menus a {margin-left: 10px;}
</style>
<?php if($group->role == 'limited'):?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<a href='javascript:;' class='btn btn-link btn-active-text'><span class='text'><?php echo $group->name;?></span></a>
</div>
</div>
<div id='mainContent' class='main-content'>
<form class="load-indicator main-form form-ajax" id="managePrivForm" method="post" target='hiddenwin'>
<table class='table table-hover table-striped table-bordered'>
<thead>
<tr class='text-center'>
<th><?php echo $lang->group->module;?></th>
<th><?php echo $lang->group->method;?></th>
</tr>
</thead>
<tr class='<?php echo cycle('even, bg-gray');?>'>
<th class='text-right thWidth'><?php echo $lang->my->common;?></th>
<td id='my' class='pv-10px'>
<div class='checkbox-primary'>
<input type='checkbox' name='actions[my][]' value='limited' <?php if(isset($groupPrivs['my']['limited'])) echo "checked";?> />
<label class='priv' id="my-limited"><?php echo $lang->my->limited;?></label>
</div>
</td>
</tr>
<tr>
<th class='text-right'></th>
<td class='form-actions'>
<?php echo html::submitButton('', "onclick='setNoChecked()'");?>
<?php echo html::backButton();?>
<?php echo html::hidden('noChecked'); // Save the value of no checked.?>
</td>
</tr>
</table>
</form>
</div>
<?php else:?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<span id='groupName'><i class='icon-lock'></i> <?php echo $group->name;?> <i class="icon icon-chevron-right"></i></span>
<?php $params = "type=byGroup&param=$groupID";?>
<?php echo html::a(inlink('pgmmanagepriv', $params), "<span class='text'>{$lang->group->all}</span>", '', "class='btn btn-link btn-active-text'")?>
</div>
</div>
<div id='mainContent' class='main-content'>
<form class="load-indicator main-form form-ajax" id="managePrivForm" method="post" target='hiddenwin'>
<table class='table table-hover table-striped table-bordered' id='privList'>
<thead>
<tr class='text-center'>
<th class='thWidth'><?php echo $lang->group->module;?></th>
<th colspan='2'><?php echo $lang->group->method;?></th>
</tr>
</thead>
<?php foreach($lang->resource as $moduleName => $moduleActions):?>
<?php if(!count((array)$moduleActions)) continue;?>
<?php if(!$this->group->checkMenuModule($menu, $moduleName)) continue;?>
<?php
/* Check method in select version. */
if($version)
{
$hasMethod = false;
foreach($moduleActions as $action => $actionLabel)
{
if(strpos($changelogs, ",$moduleName-$actionLabel,") !== false)
{
$hasMethod = true;
break;
}
}
if(!$hasMethod) continue;
}
?>
<tr class='<?php echo cycle('even, bg-gray');?>'>
<th class='text-middle text-right thWidth'>
<div class="checkbox-primary checkbox-inline checkbox-right check-all">
<input type='checkbox' id='allChecker<?php echo $moduleName;?>'>
<label class='text-right' for='allChecker<?php echo $moduleName;?>'><?php echo $lang->$moduleName->common;?></label>
</div>
</th>
<?php if(isset($lang->$moduleName->menus)):?>
<td class='menus'>
<?php echo html::checkbox("actions[$moduleName]", array('browse' => $lang->$moduleName->browse), isset($groupPrivs[$moduleName]) ? $groupPrivs[$moduleName] : '');?>
<a href='javascript:;'><i class='icon icon-plus'></i></a>
<?php echo html::checkbox("actions[$moduleName]", $lang->$moduleName->menus, isset($groupPrivs[$moduleName]) ? $groupPrivs[$moduleName] : '');?>
</td>
<?php endif;?>
<td id='<?php echo $moduleName;?>' class='pv-10px' colspan='<?php echo !empty($lang->$moduleName->menus) ? 1 : 2?>'>
<?php $i = 1;?>
<?php foreach($moduleActions as $action => $actionLabel):?>
<?php if(!empty($lang->$moduleName->menus) and $action == 'browse') continue;;?>
<?php if(!empty($version) and strpos($changelogs, ",$moduleName-$actionLabel,") === false) continue;?>
<div class='group-item'>
<?php echo html::checkbox("actions[{$moduleName}]", array($action => $lang->$moduleName->$actionLabel), isset($groupPrivs[$moduleName][$action]) ? $action : '', '', 'inline');?>
</div>
<?php endforeach;?>
</td>
</tr>
<?php endforeach;?>
<tr>
<th class='text-right'>
<div class="checkbox-primary checkbox-inline checkbox-right check-all">
<input type='checkbox' id='allChecker'>
<label class='text-right' for='allChecker'><?php echo $lang->selectAll;?></label>
</div>
</th>
<td class='form-actions' colspan='2'>
<?php echo html::submitButton('', "onclick='setNoChecked()'", 'btn btn-wide btn-primary');?>
<?php echo html::backButton();?>
<?php echo html::hidden('noChecked'); // Save the value of no checked.?>
</td>
</tr>
</table>
</form>
</div>
<?php endif;?>
<?php js::set('groupID', $groupID);?>
<?php js::set('menu', $menu);?>
<script>
$(document).ready(function()
{
/**
* 隐藏列表标签。
* Hide tabs except the browse list tab.
*/
$('.menus input[name^=actions]:not(input[value=browse])').parent('.checkbox-primary').hide();
/**
* 切换列表标签的显示。
* Toggle display of tabs except the browse list tab.
*/
$('.menus .icon-plus').click(function()
{
$(this).toggleClass('icon-minus', 'icon-plus');
$('.menus input[name^=actions]:not(input[value=browse])').parent('.checkbox-primary').toggle();
})
/**
* 勾选浏览列表标签时,自动勾选下面的所有标签。
* Check all tabs when the Browse list tab is selected.
*/
$('.menus input[value=browse]').change(function()
{
$(this).parents('.menus').find('[name^=actions]').prop('checked', $(this).prop('checked'));
});
/**
* 勾选浏览列表标签下面的任意一个标签时,自动勾选浏览列表标签。
* Check the browse list tab when any one of the tabs is selected.
*/
$('.menus input[name^=actions]:not(input[value=browse])').click(function()
{
var $parent = $(this).parents('.menus');
$parent.find('input[value=browse]').prop('checked', $parent.find('input[name^=actions]:not(input[value=browse]):checked').length > 0);
})
});
</script>
<?php include '../../common/view/footer.html.php'; ?>

View File

@@ -41,7 +41,7 @@
<?php if($project->model == 'waterfall'):?>
<tr>
<th><?php echo $lang->program->PRJCategory;?></th>
<td><?php echo html::select('category', $lang->program->PRJCategoryList, $project->category, "class='form-control'");?></td><td></td><td></td>
<td><?php echo html::select('product', $lang->program->PRJCategoryList, $project->product, "class='form-control'");?></td><td></td><td></td>
</tr>
<?php endif;?>
<tr>

View File

@@ -99,7 +99,7 @@ class weeklyModel extends model
$report->ac = $this->getAC($program, $date);
$report->sv = $this->getSV($report->ev, $report->pv);
$report->cv = $this->getCV($report->ev, $report->ac);
$report->program = $program;
$report->PRJ = $program;
$report->weekStart = $this->getThisMonday($date);
$report->staff = $this->getStaff($program);
$report->workload = json_encode($this->getWorkloadByType($program, $date));

View File

@@ -20,7 +20,7 @@ class workestimationModel extends model
*/
public function getBudget($program)
{
return $this->dao->select('*')->from(TABLE_WORKESTIMATION)->where('program')->eq($program)->fetch();
return $this->dao->select('*')->from(TABLE_WORKESTIMATION)->where('PRJ')->eq($program)->fetch();
}
/**
@@ -48,7 +48,7 @@ class workestimationModel extends model
{
$budget = $this->getBudget($program);
$postBudget = fixer::input('post')->get();
$postBudget->program = $program;
$postBudget->PRJ = $program;
if(empty($budget))
{