diff --git a/module/program/control.php b/module/program/control.php index 18f26c26cb..2bd7ebde20 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -158,12 +158,13 @@ class program extends control $this->view->title = $this->lang->program->PGMCreate; $this->view->position[] = $this->lang->program->PGMCreate; - $this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst'); - $this->view->poUsers = $this->user->getPairs('noclosed|nodeleted|pofirst'); - $this->view->users = $this->user->getPairs('noclosed|nodeleted'); - $this->view->parentProgram = $parentProgramID ? $this->dao->select('*')->from(TABLE_PROGRAM)->where('id')->eq($parentProgramID)->fetch() : 0; - $this->view->parents = $this->program->getParentPairs(); - $this->view->PGMList = $this->program->getPGMList(); + $this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst'); + $this->view->poUsers = $this->user->getPairs('noclosed|nodeleted|pofirst'); + $this->view->users = $this->user->getPairs('noclosed|nodeleted'); + $this->view->parentProgram = $parentProgramID ? $this->dao->select('*')->from(TABLE_PROGRAM)->where('id')->eq($parentProgramID)->fetch() : 0; + $this->view->parents = $this->program->getParentPairs(); + $this->view->PGMList = $this->program->getPGMList(); + $this->view->budgetUnitList = $this->program->getBudgetUnitList(); $this->display(); } @@ -200,12 +201,13 @@ class program extends control $this->view->title = $this->lang->program->PGMEdit; $this->view->position[] = $this->lang->program->PGMEdit; - $this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $program->PM); - $this->view->poUsers = $this->user->getPairs('noclosed|nodeleted|pofirst'); - $this->view->users = $this->user->getPairs('noclosed|nodeleted'); - $this->view->program = $program; - $this->view->parents = $parents; - $this->view->PGMList = $this->program->getPGMList(); + $this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $program->PM); + $this->view->poUsers = $this->user->getPairs('noclosed|nodeleted|pofirst'); + $this->view->users = $this->user->getPairs('noclosed|nodeleted'); + $this->view->program = $program; + $this->view->parents = $parents; + $this->view->PGMList = $this->program->getPGMList(); + $this->view->budgetUnitList = $this->program->getBudgetUnitList(); $this->display(); } diff --git a/module/program/js/common.js b/module/program/js/common.js index 7fd8dac776..5a7ff92d58 100644 --- a/module/program/js/common.js +++ b/module/program/js/common.js @@ -293,19 +293,17 @@ function setBudgetTipsAndAclList(parentProgramID) { if(parentProgramID != 0) { - $('.budgetSpan').removeClass('hidden'); - parentProgram = PGMList[parentProgramID]; programBudget = parentProgram.budget; PGMBudgetUnit = budgetUnitList[parentProgram.budgetUnit]; budgetNotes = programBudget != 0 ? (programBudget + PGMBudgetUnit) : future; - $('.budgetSpan').html(PGMParentBudget + budgetNotes); + $('#budget').attr('placeholder', PGMParentBudget + budgetNotes); $('.aclBox').html($('#subPGMAcl').html()); } else { - $('.budgetSpan').addClass('hidden'); + $('#budget').removeAttr('placeholder'); $('.aclBox').html($('#PGMAcl').html()); } } diff --git a/module/program/model.php b/module/program/model.php index f5ae1ddbb0..6bd4441406 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -663,6 +663,20 @@ class programModel extends model return !dao::isError(); } + /** + * Get budget unit list. + * + * @access public + * @return array + */ + public function getBudgetUnitList() + { + $budgetUnitList = array(); + foreach(explode(',', $this->config->program->unitList) as $unit) $budgetUnitList[$unit] = zget($this->lang->program->unitList, $unit, ''); + + return $budgetUnitList; + } + /** * Get program parent pairs * diff --git a/module/program/view/pgmcreate.html.php b/module/program/view/pgmcreate.html.php index 59c6955498..8e8b5bb21a 100644 --- a/module/program/view/pgmcreate.html.php +++ b/module/program/view/pgmcreate.html.php @@ -66,9 +66,10 @@