* Finish task#95307, rename menu title and use new ui.
This commit is contained in:
@@ -133,8 +133,7 @@ $lang->my->dividerMenu = ',work,dynamic,';
|
||||
|
||||
/* Program menu. */
|
||||
$lang->program->homeMenu = new stdclass();
|
||||
$lang->program->homeMenu->browse = array('link' => "{$lang->program->list}|program|browse|", 'alias' => 'create,edit', 'subModule' => 'project');
|
||||
$lang->program->homeMenu->projectView = array('link' => "{$lang->program->projectView}|program|projectview|", 'alias' => 'create,edit', 'subModule' => 'project');
|
||||
$lang->program->homeMenu->browse = array('link' => "{$lang->program->projectView}|program|browse|", 'alias' => 'create,edit', 'subModule' => 'project');
|
||||
$lang->program->homeMenu->productView = array('link' => "{$lang->program->productView}|program|productview|", 'alias' => 'create,edit', 'subModule' => 'project');
|
||||
$lang->program->homeMenu->kanban = array('link' => "{$lang->program->kanban}|program|kanban|");
|
||||
|
||||
|
||||
@@ -1,30 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace zin;
|
||||
|
||||
$cols = array_values($config->program->dtable->fieldList);
|
||||
$data = array_values($programs);
|
||||
$cols = array_values($config->program->projectView->dtable->fieldList);
|
||||
|
||||
foreach($data as $row)
|
||||
$data = array();
|
||||
foreach($programs as $program)
|
||||
{
|
||||
if (!property_exists($row, 'progress'))
|
||||
if(empty($program->parent)) $program->parent = null;
|
||||
|
||||
/* Delay status. */
|
||||
if($program->status != 'done' and $program->status != 'closed' and $program->status != 'suspended')
|
||||
{
|
||||
if (isset($progressList[$row->id])) $row->progress = $progressList[$row->id];
|
||||
else $row->progress = '';
|
||||
$delay = helper::diffDate(helper::today(), $program->end);
|
||||
if($delay > 0) $program->postponed = true;
|
||||
}
|
||||
|
||||
if (!property_exists($row, 'actions')) $row->actions = array();
|
||||
/* PM. */
|
||||
if(!empty($program->PM))
|
||||
{
|
||||
$userName = zget($users, $program->PM);
|
||||
$program->PMAvatar = $usersAvatar[$program->PM];
|
||||
$program->PM = $userName;
|
||||
}
|
||||
|
||||
/* Calculate budget.*/
|
||||
$programBudget = $this->loadModel('project')->getBudgetWithUnit($program->budget);
|
||||
$program->budget = $program->budget != 0 ? zget($lang->project->currencySymbol, $program->budgetUnit) . ' ' . $programBudget : $lang->project->future;
|
||||
|
||||
/* Progress. */
|
||||
if(isset($progressList[$program->id])) $program->progress = round($progressList[$program->id]);
|
||||
|
||||
/* Set invested hours. */
|
||||
if(!isset($program->invested)) $program->invested = 0;
|
||||
|
||||
/* Actions. */
|
||||
$program->actions = array();
|
||||
$actions = $this->program->buildActions($program);
|
||||
foreach($actions as $action)
|
||||
{
|
||||
if(is_object($action)) $action->name = $program->type . '_' . $action->name;
|
||||
else $action = $program->type . '_' . $action;
|
||||
|
||||
if(isset($action->items)) foreach($action->items as $idx => $item) $action->items[$idx]->name = $program->type . '_' . $item->name;
|
||||
$program->actions[] = $action;
|
||||
}
|
||||
|
||||
$data[] = $program;
|
||||
}
|
||||
|
||||
jsVar('langManDay', $lang->program->manDay);
|
||||
jsVar('langPostponed', $lang->project->statusList['delay']);
|
||||
jsVar('summeryTpl', $summary);
|
||||
|
||||
featureBar
|
||||
(
|
||||
to::before(programMenu(set
|
||||
([
|
||||
'title' => $lang->program->all,
|
||||
'programs' => $data,
|
||||
'activeKey' => '7',
|
||||
'closeLink' => '#'
|
||||
]))),
|
||||
set::current($status),
|
||||
set::linkParams("status={key}&orderBy=$orderBy"),
|
||||
(hasPriv('project', 'batchEdit') && $programType != 'bygrid' && $hasProject === true) ? item
|
||||
@@ -38,28 +67,30 @@ featureBar
|
||||
|
||||
toolbar
|
||||
(
|
||||
hasPriv('project', 'create') ? item(set(array
|
||||
(
|
||||
'text' => $lang->project->create,
|
||||
'icon' => 'plus',
|
||||
'class' => 'btn secondary',
|
||||
'url' => createLink('project', 'createGuide', "programID=0&from=PGM"),
|
||||
))) : NULL,
|
||||
hasPriv('program', 'create') ? item(set(array
|
||||
(
|
||||
item(set
|
||||
([
|
||||
'text' => $lang->program->createProject,
|
||||
'icon' => 'plus',
|
||||
'class'=> 'btn secondary',
|
||||
'url' => createLink('program', 'exportTable')
|
||||
])),
|
||||
item(set
|
||||
([
|
||||
'text' => $lang->program->create,
|
||||
'icon' => 'plus',
|
||||
'class' => 'btn primary',
|
||||
'url' => createLink('program', 'create')
|
||||
))) : NULL
|
||||
'icon' => 'plus',
|
||||
'class'=> 'btn primary',
|
||||
'url' => createLink('program', 'create')
|
||||
])),
|
||||
);
|
||||
|
||||
dtable
|
||||
(
|
||||
set::cols($cols),
|
||||
set::data($data),
|
||||
set::rowHeight(40),
|
||||
set::footer(false)
|
||||
set::nested(true),
|
||||
set::onRenderCell(jsRaw('window.renderCell')),
|
||||
set::footPager(usePager()),
|
||||
set::footer(jsRaw('function(){return window.footerGenerator.call(this);}'))
|
||||
);
|
||||
|
||||
render();
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
<?php
|
||||
namespace zin;
|
||||
|
||||
$cols = array_values($config->program->projectView->dtable->fieldList);
|
||||
|
||||
$data = array();
|
||||
foreach($programs as $program)
|
||||
{
|
||||
if(empty($program->parent)) $program->parent = null;
|
||||
|
||||
/* Delay status. */
|
||||
if($program->status != 'done' and $program->status != 'closed' and $program->status != 'suspended')
|
||||
{
|
||||
$delay = helper::diffDate(helper::today(), $program->end);
|
||||
if($delay > 0) $program->postponed = true;
|
||||
}
|
||||
|
||||
/* PM. */
|
||||
if(!empty($program->PM))
|
||||
{
|
||||
$userName = zget($users, $program->PM);
|
||||
$program->PMAvatar = $usersAvatar[$program->PM];
|
||||
$program->PM = $userName;
|
||||
}
|
||||
|
||||
/* Calculate budget.*/
|
||||
$programBudget = $this->loadModel('project')->getBudgetWithUnit($program->budget);
|
||||
$program->budget = $program->budget != 0 ? zget($lang->project->currencySymbol, $program->budgetUnit) . ' ' . $programBudget : $lang->project->future;
|
||||
|
||||
/* Progress. */
|
||||
if(isset($progressList[$program->id])) $program->progress = round($progressList[$program->id]);
|
||||
|
||||
/* Set invested hours. */
|
||||
if(!isset($program->invested)) $program->invested = 0;
|
||||
|
||||
/* Actions. */
|
||||
$program->actions = array();
|
||||
$actions = $this->program->buildActions($program);
|
||||
foreach($actions as $action)
|
||||
{
|
||||
if(is_object($action)) $action->name = $program->type . '_' . $action->name;
|
||||
else $action = $program->type . '_' . $action;
|
||||
|
||||
if(isset($action->items)) foreach($action->items as $idx => $item) $action->items[$idx]->name = $program->type . '_' . $item->name;
|
||||
$program->actions[] = $action;
|
||||
}
|
||||
|
||||
$data[] = $program;
|
||||
}
|
||||
|
||||
jsVar('langManDay', $lang->program->manDay);
|
||||
jsVar('langPostponed', $lang->project->statusList['delay']);
|
||||
jsVar('summeryTpl', $summary);
|
||||
|
||||
featureBar
|
||||
(
|
||||
set::current($status),
|
||||
set::linkParams("status={key}&orderBy=$orderBy"),
|
||||
(hasPriv('project', 'batchEdit') && $programType != 'bygrid' && $hasProject === true) ? item
|
||||
(
|
||||
set::type('checkbox'),
|
||||
set::text($lang->project->edit),
|
||||
set::checked($this->cookie->editProject)
|
||||
) : NULL,
|
||||
li(searchToggle())
|
||||
);
|
||||
|
||||
toolbar
|
||||
(
|
||||
item(set
|
||||
([
|
||||
'text' => $lang->program->createProject,
|
||||
'icon' => 'plus',
|
||||
'class'=> 'btn secondary',
|
||||
'url' => createLink('program', 'exportTable')
|
||||
])),
|
||||
item(set
|
||||
([
|
||||
'text' => $lang->program->create,
|
||||
'icon' => 'plus',
|
||||
'class'=> 'btn primary',
|
||||
'url' => createLink('program', 'create')
|
||||
])),
|
||||
);
|
||||
|
||||
dtable
|
||||
(
|
||||
set::cols($cols),
|
||||
set::data($data),
|
||||
set::nested(true),
|
||||
set::onRenderCell(jsRaw('window.renderCell')),
|
||||
set::footPager(usePager()),
|
||||
set::footer(jsRaw('function(){return window.footerGenerator.call(this);}'))
|
||||
);
|
||||
|
||||
render();
|
||||
Reference in New Issue
Block a user