Merge pull request #392 from marcoAntonioNina/BUG-8853

BUG 8853 Adding the cases from "unassigned Folder" to simplified... SOLVED
This commit is contained in:
julceslauhub
2012-07-25 09:06:19 -07:00
4 changed files with 85 additions and 63 deletions

View File

@@ -60,7 +60,6 @@ class Home extends Controller
$this->setVar('skin', $skin);
$this->setView("home/$template");
$this->render();
}
@@ -167,8 +166,7 @@ class Home extends Controller
$_SESSION['APPLICATION'] = $lastApp['APP_UID'];
$_SESSION['PROCESS'] = $lastApp['PRO_UID'];
$_SESSION['TASK'] = $lastApp['TAS_UID'];
$steps = $apps->getSteps($lastApp['APP_UID'], $lastApp['DEL_INDEX'], $lastApp['TAS_UID'], $lastApp['PRO_UID']);
$lastStep = array_pop($steps);
$lastStep['title'] = G::LoadTranslation('ID_FINISH');
@@ -184,35 +182,44 @@ class Home extends Controller
$this->render();
}
public function appList($httpData)
{
// setting default list applications types [default: todo]
$httpData->t = isset($httpData->t)? $httpData->t : 'todo';
public function appList($httpData)
{
// setting default list applications types [default: todo]
$httpData->t = isset($httpData->t)? $httpData->t : 'todo';
// setting main list title
switch ($httpData->t) {
case 'todo' : $title = 'My Inbox'; break;
case 'draft' : $title = 'My Drafts'; break;
default: $title = ucwords($httpData->t);
// setting main list title
switch ($httpData->t) {
case 'todo':
$title = 'My Inbox';
break;
case 'draft':
$title = 'My Drafts';
break;
case 'unassigned':
$title = 'Unassigned Inbox';
break;
default:
$title = ucwords($httpData->t);
break;
}
// getting apps data
$cases = $this->getAppsData($httpData->t);
// settings html template
$this->setView('home/appList');
// settings vars and rendering
$this->setVar('cases', $cases['data']);
$this->setVar('cases_count', $cases['totalCount']);
$this->setVar('title', $title);
$this->setVar('appListStart', $this->appListLimit);
$this->setVar('appListLimit', 10);
$this->setVar('listType', $httpData->t);
$this->render();
}
// getting apps data
$cases = $this->getAppsData($httpData->t);
// settings html template
$this->setView('home/appList');
// settings vars and rendering
$this->setVar('cases', $cases['data']);
$this->setVar('cases_count', $cases['totalCount']);
$this->setVar('title', $title);
$this->setVar('appListStart', $this->appListLimit);
$this->setVar('appListLimit', 10);
$this->setVar('listType', $httpData->t);
$this->render();
}
public function getApps($httpData)
{
$cases = $this->getAppsData($httpData->t, $httpData->start, $httpData->limit);

View File

@@ -2,9 +2,15 @@
global $G_TMP_MENU;
global $RBAC;
$G_TMP_MENU->AddIdRawOption("S_HOME", "home/appList?t=todo", G::LoadTranslation("ID_HOME"), "/images/simplified/in-set-grey.png", null, null, null);
$G_TMP_MENU->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);
$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_UNASSIGNED", "home/appList?t=unassigned", G::LoadTranslation("ID_UNASSIGNED"),
"/images/simplified/folder-grey3.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);
}

View File

@@ -27,47 +27,56 @@
/* Permissions */
switch ($RBAC->userCanAccess('PM_CASES'))
{
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
if ( isset ( $_POST['form']['BTN_CANCEL'] ) ) {
if (isset($_POST['form']['BTN_CANCEL'])) {
header ( "Location: ../cases/main");
die;
}
}
/* Includes */
G::LoadClass('case');
/* Includes */
G::LoadClass('case');
$oCase = new Cases();
$sAppUid = $_SESSION['APPLICATION'];
$iDelIndex = $_SESSION['INDEX'];
$oCase = new Cases();
$sAppUid = $_SESSION['APPLICATION'];
$iDelIndex = $_SESSION['INDEX'];
$oAppDelegation = new AppDelegation();
$aDelegation = $oAppDelegation->load($sAppUid, $iDelIndex);
//if there are no user in the delegation row, this case is still in selfservice
if ( $aDelegation['USR_UID'] == "" ) {
$oAppDelegation = new AppDelegation();
$aDelegation = $oAppDelegation->load($sAppUid, $iDelIndex);
//if there are no user in the delegation row, this case is still in selfservice
if ( $aDelegation['USR_UID'] == "" ) {
$oCase->setCatchUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'] );
}
else {
} else {
G::SendMessageText(G::LoadTranslation('ID_CASE_ALREADY_DERIVATED'), 'error');
}
}
die('<script type="text/javascript">
$validation = (SYS_SKIN != 'uxs')? 'true' : 'false';
die('<script type="text/javascript">
if ('.$validation.') {
if (window.parent.frames.length != 0) {
parent.location = "open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned";
parent.location = "open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] .
'&action=unassigned";
} else {
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' .
$_SESSION['INDEX'] . '&action=unassigned";
}
else {
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned";
}
</script>');
} else {
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' .
$_SESSION['INDEX'] . '&action=unassigned";
}
</script>'
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB