From 7b5deb054b848832afa2952ffffca395b144e650 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Thu, 14 Jun 2012 16:03:30 -0400 Subject: [PATCH] BUG 9294 "Simplified experience plugins" SOLVED - Request to enable and show the new submenus that have been created with plug-ins in the Simplified user experience. - Code added for show the new submenus that have been created with plug-ins --- workflow/engine/controllers/home.php | 32 +++++++++++++++++++++-- workflow/engine/menus/simplified.php | 10 +++++++ workflow/engine/templates/home/index.html | 28 +++++++++++++------- 3 files changed, 58 insertions(+), 12 deletions(-) create mode 100644 workflow/engine/menus/simplified.php diff --git a/workflow/engine/controllers/home.php b/workflow/engine/controllers/home.php index 95b3dd5dc..0d68a3220 100755 --- a/workflow/engine/controllers/home.php +++ b/workflow/engine/controllers/home.php @@ -86,7 +86,6 @@ class Home extends Controller G::loadClass('system'); $sysConf = System::getSystemConfiguration(PATH_CONFIG . 'env.ini'); - //Get ProcessStatistics Info $start = 0; $limit = ''; @@ -101,7 +100,34 @@ class Home extends Controller } unset($processList[0]); - + + //Get simplified options + global $G_TMP_MENU; + + $mnu = new Menu(); + $mnu->load('simplified'); + $arrayMnuOption = array(); + $mnuNewCase = array(); + + if (!empty($mnu->Options)) { + foreach ($mnu->Options as $index => $value) { + $option = array( + 'id' => $mnu->Id[$index], + 'url' => $mnu->Options[$index], + 'label' => $mnu->Labels[$index], + 'icon' => $mnu->Icons[$index], + 'class' => $mnu->ElementClass[$index] + ); + + if ($mnu->Id[$index] != 'S_NEW_CASE') { + $arrayMnuOption[] = $option; + } + else { + $mnuNewCase = $option; + } + } + } + $this->setView('home/index'); $this->setVar('usrUid', $this->userID); @@ -111,6 +137,8 @@ class Home extends Controller $this->setVar('userUxType', $this->userUxType); $this->setVar('clientBrowser', $this->clientBrowser['name']); $this->setVar('switchLink', $switchLink); + $this->setVar('arrayMnuOption', $arrayMnuOption); + $this->setVar('mnuNewCase', $mnuNewCase); $this->render(); } diff --git a/workflow/engine/menus/simplified.php b/workflow/engine/menus/simplified.php new file mode 100644 index 000000000..6b7e47297 --- /dev/null +++ b/workflow/engine/menus/simplified.php @@ -0,0 +1,10 @@ +AddIdRawOption("S_HOME", "home/appList?t=todo", G::LoadTranslation("ID_HOME"), "/images/simplified/in-set-grey.png", null, null, null); + +if ($RBAC->userCanAccess("PM_CASES") == 1) { + $G_TMP_MENU->AddIdRawOption("S_DRAFT", "home/appList?t=draft", G::LoadTranslation("ID_DRAFT"), "/images/simplified/folder-grey.png", null, null, null); + $G_TMP_MENU->AddIdRawOption("S_NEW_CASE", "#", G::LoadTranslation("ID_NEW_CASE"), "/images/simplified/plus-set-grey.png", null, null, null); +} diff --git a/workflow/engine/templates/home/index.html b/workflow/engine/templates/home/index.html index 2c1040610..ae709b407 100644 --- a/workflow/engine/templates/home/index.html +++ b/workflow/engine/templates/home/index.html @@ -86,29 +86,37 @@