diff --git a/module/block/control.php b/module/block/control.php
index bd6344b39e..c9326f5618 100644
--- a/module/block/control.php
+++ b/module/block/control.php
@@ -216,7 +216,7 @@ class block extends control
if($module == 'program')
{
$program = $this->loadModel('project')->getByID($this->session->PRJ);
- $commonField = $program->template . 'common';
+ $commonField = $program->model . 'common';
}
$inited = empty($this->config->$module->$commonField->blockInited) ? '' : $this->config->$module->$commonField->blockInited;
@@ -415,25 +415,25 @@ class block extends control
if($mode == 'getblocklist')
{
- $template = '';
+ $model = '';
$block = $this->block->getByID($id);
$dashboard = $this->get->dashboard;
/* Create a program block. */
if($dashboard == 'program')
{
- $program = $this->loadModel('project')->getByID($this->session->PRJ);
- $template = $program->template;
+ $program = $this->loadModel('project')->getByID($this->session->PRJ);
+ $model = $program->model;
}
/* Edit a program block. */
if($id and $block->module == 'program')
{
- $template = $block->type;
+ $model = $block->type;
$dashboard = 'program';
}
- $blocks = $this->block->getAvailableBlocks($module, $dashboard, $template);
+ $blocks = $this->block->getAvailableBlocks($module, $dashboard, $model);
if(!$this->selfCall)
{
echo $blocks;
@@ -446,7 +446,7 @@ class block extends control
echo '
lang->program->switcherMenu;?>
- loadModel('program')->getPRJSwitcher($this->program->getPairs(), $this->session->PRJ, $app->rawModule, $app->rawMethod);?>
+ loadModel('program')->getPRJSwitcher($this->session->PRJ, $app->rawModule, $app->rawMethod);?>
loadModel('custom')->getModeSwitcher();?>
diff --git a/module/program/model.php b/module/program/model.php
index 87d7f1bedf..4dd42c2b2a 100644
--- a/module/program/model.php
+++ b/module/program/model.php
@@ -766,7 +766,7 @@ class programModel extends model
* @access private
* @return void
*/
- public function getPRJSwitcher($programs, $programID, $currentModule, $currentMethod, $extra = '')
+ public function getPRJSwitcher($programID, $currentModule, $currentMethod)
{
$this->loadModel('project');
$currentProgramName = '';
@@ -778,11 +778,10 @@ class programModel extends model
}
if($currentModule == 'program' && $currentMethod == 'browse') $currentProgramName = $this->lang->program->all;
- $dropMenuLink = helper::createLink('program', 'ajaxGetDropMenu', "objectID=$programID&module=$currentModule&method=$currentMethod&extra=$extra");
+ $dropMenuLink = helper::createLink('program', 'ajaxGetDropMenu', "objectID=$programID&module=$currentModule&method=$currentMethod");
$output = "
";
- //if($isMobile) $output = "
{$currentProjectName} ";
return $output;
}
diff --git a/module/program/view/index.html.php b/module/program/view/index.html.php
index 3c4a8b38e1..4136db8f6e 100644
--- a/module/program/view/index.html.php
+++ b/module/program/view/index.html.php
@@ -10,5 +10,5 @@
*/
?>
-fetch('block', 'dashboard', "module=program&type={$program->template}");?>
+fetch('block', 'dashboard', "module=program&type={$program->model}");?>
diff --git a/module/programplan/model.php b/module/programplan/model.php
index 05af5a22a3..647e974671 100644
--- a/module/programplan/model.php
+++ b/module/programplan/model.php
@@ -70,8 +70,8 @@ class programplanModel extends model
$projects = $this->getProjectsByProduct($productID);
$plans = $this->dao->select('*')->from(TABLE_PROJECT)
- ->where('program')->eq($programID)
- ->andWhere('template')->eq('')
+ ->where('type')->eq('stage')
+ ->andWhere('parent')->eq($programID)
->beginIF($type != 'all')->andWhere('parent')->eq($planID)->fi()
->andWhere('deleted')->eq(0)
->beginIF($productID)->andWhere('id')->in($projects)->fi()