This commit is contained in:
Fabio Guachalla
2018-04-05 09:53:33 -04:00
committed by Paula Quispe
parent 7f6155702f
commit 991709f17f
7 changed files with 609 additions and 230 deletions

View File

@@ -1,103 +1,110 @@
<?php <?php
/** /** Permissions */
* cases_Resume.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/* Permissions */
switch ($RBAC->userCanAccess('PM_CASES')) { switch ($RBAC->userCanAccess('PM_CASES')) {
case - 2: case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login'); G::header('location: ../login/login');
die(); die();
break; break;
case - 1: case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login'); G::header('location: ../login/login');
die(); die();
break; break;
} }
$oCase = new Cases(); /** Render page */
$Fields = $oCase->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX']);
/* Render page */
require_once 'classes/model/Process.php'; require_once 'classes/model/Process.php';
require_once 'classes/model/Task.php'; require_once 'classes/model/Task.php';
//Get information about the case
$case = new Cases();
$fieldsCase = $case->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX']);
//Get the user logged
$userLogged = isset($RBAC->aUserInfo['USER_INFO']['USR_UID']) ? $RBAC->aUserInfo['USER_INFO']['USR_UID'] : '';
//Check the authorization
$objCase = new \ProcessMaker\BusinessModel\Cases();
$userCanAccess = $objCase->userAuthorization(
$userLogged,
$fieldsCase['PRO_UID'],
$fieldsCase['APP_UID'],
['PM_ALLCASES'],
['SUMMARY_FORM' => 'VIEW']
);
$objProc = new Process(); $objProc = new Process();
$aProc = $objProc->load($Fields['PRO_UID']); $fieldsProcess = $objProc->load($fieldsCase['PRO_UID']);
$Fields['PRO_TITLE'] = $aProc['PRO_TITLE']; $fieldsCase['PRO_TITLE'] = $fieldsProcess['PRO_TITLE'];
$objTask = new Task(); if (
$aTask = $objTask->load($Fields['TAS_UID']); isset($fieldsProcess['PRO_DYNAFORMS']['PROCESS']) &&
$Fields['TAS_TITLE'] = $aTask['TAS_TITLE']; !empty($fieldsProcess['PRO_DYNAFORMS']['PROCESS']) &&
$userCanAccess['objectPermissions']['SUMMARY_FORM'] &&
$objProc->isBpmnProcess($fieldsCase['PRO_UID'])
) {
/**We will to show the custom summary form only for BPMN process*/
$_REQUEST['APP_UID'] = $fieldsCase['APP_UID'];
$_REQUEST['DEL_INDEX'] = $fieldsCase['DEL_INDEX'];
$_REQUEST['DYN_UID'] = $fieldsProcess['PRO_DYNAFORMS']['PROCESS'];
require_once(PATH_METHODS . 'cases' . PATH_SEP . 'summary.php');
exit();
} else {
/**We will to show the default claim case form*/
$objTask = new Task();
$fieldsTask = $objTask->load($fieldsCase['TAS_UID']);
$fieldsCase['TAS_TITLE'] = $fieldsTask['TAS_TITLE'];
$fieldsCase['STATUS'] .= ' ( ' . G::LoadTranslation('ID_UNASSIGNED') . ' )';
$Fields['STATUS'] .= ' ( ' . G::LoadTranslation('ID_UNASSIGNED') . ' )'; //Now getting information about the PREVIOUS task. If is the first task then no previous, use 1
$appDelegation = new AppDelegation();
$appDelegation->Load(
$fieldsCase['APP_UID'],
($fieldsCase['DEL_PREVIOUS'] == 0 ? $fieldsCase['DEL_PREVIOUS'] = 1 : $fieldsCase['DEL_PREVIOUS'])
);
$fieldsDelegation = $appDelegation->toArray(BasePeer::TYPE_FIELDNAME);
//now getting information about the PREVIOUS task. If is the first task then no preious, use 1 try {
$oAppDel = new AppDelegation(); $userInfo = new Users();
$oAppDel->Load($Fields['APP_UID'], ($Fields['DEL_PREVIOUS'] == 0 ? $Fields['DEL_PREVIOUS'] = 1 : $Fields['DEL_PREVIOUS'])); $userInfo->load($fieldsDelegation['USR_UID']);
$fieldsCase['PREVIOUS_USER'] = $userInfo->getUsrFirstname() . ' ' . $userInfo->getUsrLastname();
} catch (Exception $error) {
$fieldsCase['PREVIOUS_USER'] = G::LoadTranslation('ID_NO_PREVIOUS_USR_UID');
}
$aAppDel = $oAppDel->toArray(BasePeer::TYPE_FIELDNAME); //To enable information (dynaforms, steps) before claim a case
try { $_SESSION['bNoShowSteps'] = true;
$oCurUser = new Users(); $G_MAIN_MENU = 'processmaker';
$oCurUser->load($aAppDel['USR_UID']); $G_SUB_MENU = 'caseOptions';
$Fields['PREVIOUS_USER'] = $oCurUser->getUsrFirstname() . ' ' . $oCurUser->getUsrLastname(); $G_ID_MENU_SELECTED = 'CASES';
} catch (Exception $oError) { $G_ID_SUB_MENU_SELECTED = '_';
$Fields['PREVIOUS_USER'] = G::LoadTranslation('ID_NO_PREVIOUS_USR_UID'); $headPublisher = headPublisher::getSingleton();
$headPublisher->addScriptCode("
if (typeof parent != 'undefined') {
if (parent.showCaseNavigatorPanel) {
parent.showCaseNavigatorPanel('{$fieldsCase['APP_STATUS']}');
}
}
");
$headPublisher->addScriptCode('
var Cse = {};
Cse.panels = {};
var leimnud = new maborak();
leimnud.make();
leimnud.Package.Load("rpc,drag,drop,panel,app,validator,fx,dom,abbr",{Instance:leimnud,Type:"module"});
leimnud.Package.Load("cases",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases.js"});
leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases_Step.js"});
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak);
');
$headPublisher = headPublisher::getSingleton();
$headPublisher->addScriptFile('/jscore/cases/core/cases_Step.js');
$fieldsCase['isIE'] = Bootstrap::isIE();
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_CatchSelfService.xml', '', $fieldsCase, 'cases_CatchExecute');
G::RenderPage('publish', 'blank');
} }
$objTask = new Task();
$aTask = $objTask->load($aAppDel['TAS_UID']);
$Fields['PREVIOUS_TASK'] = $aTask['TAS_TITLE'];
//To enable information (dynaforms, steps) before claim a case
$_SESSION['bNoShowSteps'] = true;
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'caseOptions';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = '_';
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addScriptCode("
if (typeof parent != 'undefined') {
if (parent.showCaseNavigatorPanel) {
parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}');
}
}");
$oHeadPublisher->addScriptCode('
var Cse = {};
Cse.panels = {};
var leimnud = new maborak();
leimnud.make();
leimnud.Package.Load("rpc,drag,drop,panel,app,validator,fx,dom,abbr",{Instance:leimnud,Type:"module"});
leimnud.Package.Load("cases",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases.js"});
leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases_Step.js"});
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak);
');
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addScriptFile('/jscore/cases/core/cases_Step.js');
$Fields['isIE'] = Bootstrap::isIE();
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_CatchSelfService.xml', '', $Fields, 'cases_CatchExecute');
G::RenderPage('publish', 'blank');

View File

@@ -1,32 +1,4 @@
<?php <?php
/**
* open.php Open Case main processor
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/**
*
* @author Erik Amaru Ortiz <erik@colosa.com>
* @date Jan 3th, 2010
*/
$tBarGmail = false; $tBarGmail = false;
if (isset($_GET['gmail']) && $_GET['gmail'] == 1) { if (isset($_GET['gmail']) && $_GET['gmail'] == 1) {
@@ -121,22 +93,29 @@ if (isset($_GET['actionFromList']) && ($_GET['actionFromList'] === 'to_revise'))
$script = 'cases_Open?'; $script = 'cases_Open?';
} }
// getting bpmn projects $process = new Process();
$c = new Criteria('workflow'); $fields = $process->load($case['PRO_UID']);
$c->addSelectColumn(BpmnProjectPeer::PRJ_UID); $isBpmn = $fields['PRO_BPMN'] === 1 ? true : false;
$ds = ProcessPeer::doSelectRS($c);
$ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$bpmnProjects = array();
while ($ds->next()) { $showCustomForm = false;
$row = $ds->getRow();
$bpmnProjects[] = $row['PRJ_UID']; /*----------------------------------********---------------------------------*/
$respView = $oCase->getAllObjectsFrom($case['PRO_UID'], $appUid, $case['TAS_UID'], $_SESSION['USER_LOGGED'], 'VIEW');
$viewSummaryForm = isset($respView['SUMMARY_FORM']) && $respView['SUMMARY_FORM'] === 1 ? true : false;
$isNoEmpty = isset($fields['PRO_DYNAFORMS']['PROCESS']) && !empty($fields['PRO_DYNAFORMS']['PROCESS']);
if ($isBpmn && $viewSummaryForm && $isNoEmpty) {
$showCustomForm = true;
} }
/*----------------------------------********---------------------------------*/
$oStep = new Step(); $oStep = new Step();
$oStep = $oStep->loadByProcessTaskPosition($case['PRO_UID'], $case['TAS_UID'], 1); $oStep = $oStep->loadByProcessTaskPosition($case['PRO_UID'], $case['TAS_UID'], 1);
$oHeadPublisher->assign('uri', $script . $uri); $oHeadPublisher->assign('uri', $script . $uri);
$oHeadPublisher->assign('_APP_NUM', '#: ' . $case['APP_NUMBER']); $oHeadPublisher->assign('_APP_NUM', '#: ' . $case['APP_NUMBER']);
$oHeadPublisher->assign('_PROJECT_TYPE', in_array($case['PRO_UID'], $bpmnProjects) ? 'bpmn' : 'classic'); $oHeadPublisher->assign('_PROJECT_TYPE', $isBpmn ? 'bpmn' : 'classic');
$oHeadPublisher->assign('_PRO_UID', $case['PRO_UID']); $oHeadPublisher->assign('_PRO_UID', $case['PRO_UID']);
$oHeadPublisher->assign('_APP_UID', $appUid); $oHeadPublisher->assign('_APP_UID', $appUid);
$oHeadPublisher->assign('_ENV_CURRENT_DATE', $conf->getSystemDate(date('Y-m-d'))); $oHeadPublisher->assign('_ENV_CURRENT_DATE', $conf->getSystemDate(date('Y-m-d')));
@@ -144,6 +123,7 @@ $oHeadPublisher->assign('_ENV_CURRENT_DATE_NO_FORMAT', date('Y-m-d-h-i-A'));
$oHeadPublisher->assign('idfirstform', is_null($oStep) ? '-1' : $oStep->getStepUidObj()); $oHeadPublisher->assign('idfirstform', is_null($oStep) ? '-1' : $oStep->getStepUidObj());
$oHeadPublisher->assign('appStatus', $case['APP_STATUS']); $oHeadPublisher->assign('appStatus', $case['APP_STATUS']);
$oHeadPublisher->assign('tbarGmail', $tBarGmail); $oHeadPublisher->assign('tbarGmail', $tBarGmail);
$oHeadPublisher->assign('showCustomForm', $showCustomForm);
if (!isset($_SESSION['APPLICATION']) || !isset($_SESSION['TASK']) || !isset($_SESSION['INDEX'])) { if (!isset($_SESSION['APPLICATION']) || !isset($_SESSION['TASK']) || !isset($_SESSION['INDEX'])) {
$_SESSION['PROCESS'] = $case['PRO_UID']; $_SESSION['PROCESS'] = $case['PRO_UID'];

View File

@@ -1603,3 +1603,73 @@ padding:3px 3px 3px 5px;
white-space:normal; white-space:normal;
} }
.cancelSummary {
color: #333;
background: #fff;
border:1px #ccc solid;
}
.claimCaseSummary {
color: #ffffff;
background-color: #337ab7;
border:1px #2e6da4 solid;
}
.claimCaseSummary .x-btn-text {
color: #fff;
padding: 6px 6px 6px 6px;
height: 28px !important;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
}
.cancelSummary .x-btn-text {
padding: 6px 6px 6px 6px;
height: 25px !important;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
}
.claimCaseSummary td {
color: #ffffff;
background: #337ab7;
border-color: #2e6da4;
}
.claimCaseSummary tbody:hover td {
color: #ffffff;
background: #286090;
border-color: #204d74;
}
.cancelSummary td {
color: #333;
background: #fff;
}
.cancelSummary tbody:hover td {
color: #333333;
background: #e6e6e6;
border-color: #adadad;
}
.cancelSummary .claimCaseSummary {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 12px !important;
font-weight: 400;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.navPanelBottom .x-toolbar-cell {
clear: both;
height: 50px;
}

View File

@@ -1795,3 +1795,73 @@ white-space:normal;
-moz-border-radius: 5px; -moz-border-radius: 5px;
vertical-align: middle; vertical-align: middle;
} }
.cancelSummary {
color: #333;
background: #fff;
border:1px #ccc solid;
}
.claimCaseSummary {
color: #ffffff;
background-color: #337ab7;
border:1px #2e6da4 solid;
}
.claimCaseSummary .x-btn-text {
color: #fff;
padding: 6px 6px 6px 6px;
height: 28px !important;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
}
.cancelSummary .x-btn-text {
padding: 6px 6px 6px 6px;
height: 25px !important;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
}
.claimCaseSummary td {
color: #ffffff;
background-color: #337ab7;
border-color: #2e6da4;
}
.claimCaseSummary tbody:hover td {
color: #ffffff;
background-color: #286090;
border-color: #204d74;
}
.cancelSummary td {
color: #333;
background: #fff;
}
.cancelSummary tbody:hover td {
color: #333333;
background-color: #e6e6e6;
border-color: #adadad;
}
.cancelSummary .claimCaseSummary {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 12px !important;
font-weight: 400;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.navPanelBottom .x-toolbar-cell {
clear: both;
height: 50px;
}

View File

@@ -1631,3 +1631,74 @@ td.x-cnotes-label {
color:#848484; color:#848484;
text-decoration: none; text-decoration: none;
} }
.cancelSummary {
color: #333;
background: #fff;
border:1px #ccc solid;
}
.claimCaseSummary {
color: #ffffff;
background-color: #337ab7;
border:1px #2e6da4 solid;
}
.claimCaseSummary .x-btn-text {
color: #fff;
padding: 6px 6px 6px 6px;
height: 28px !important;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
}
.cancelSummary .x-btn-text {
padding: 6px 6px 6px 6px;
height: 25px !important;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
}
.claimCaseSummary td {
color: #ffffff;
background: #337ab7;
border-color: #2e6da4;
}
.claimCaseSummary tbody:hover td {
color: #ffffff;
background: #286090;
border-color: #204d74;
}
.cancelSummary td {
color: #333;
background: #fff;
}
.cancelSummary tbody:hover td {
color: #333333;
background: #e6e6e6;
border-color: #adadad;
}
.cancelSummary .claimCaseSummary {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 12px !important;
font-weight: 400;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.navPanelBottom .x-toolbar-cell {
clear: both;
height: 50px;
}

View File

@@ -1176,3 +1176,74 @@ td.x-cnotes-label {
font: 11px arial,tahoma,helvetica,sans-serif; font: 11px arial,tahoma,helvetica,sans-serif;
color: #465070; color: #465070;
} }
.cancelSummary {
color: #333;
background: #fff;
border:1px #ccc solid;
}
.claimCaseSummary {
color: #ffffff;
background-color: #337ab7;
border:1px #2e6da4 solid;
}
.claimCaseSummary .x-btn-text {
color: #fff;
padding: 6px 6px 6px 6px;
height: 28px !important;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
}
.cancelSummary .x-btn-text {
padding: 6px 6px 6px 6px;
height: 25px !important;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
}
.claimCaseSummary td {
color: #ffffff;
background: #337ab7;
border-color: #2e6da4;
}
.claimCaseSummary tbody:hover td {
color: #ffffff;
background: #286090;
border-color: #204d74;
}
.cancelSummary td {
color: #333;
background: #fff;
}
.cancelSummary tbody:hover td {
color: #333333;
background: #e6e6e6;
border-color: #adadad;
}
.cancelSummary .claimCaseSummary {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 12px !important;
font-weight: 400;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.navPanelBottom .x-toolbar-cell {
clear: both;
height: 50px;
}

View File

@@ -1,11 +1,14 @@
var Actions = {}; var Actions = {},
var showCaseNavigatorPanel; hideCaseNavigatorPanel,
var hideCaseNavigatorPanel; informationMenu,
var informationMenu; caseMenuOpen = false,
var caseMenuOpen = false; menuSelectedTitle = [],
var menuSelectedTitle = []; _ENV_CURRENT_DATE,
var _ENV_CURRENT_DATE; winTree,
var winTree; buttonCancel,
buttonClaimCase,
navPanelBottom,
navPanel;
historyGridListChangeLogGlobal = {}; historyGridListChangeLogGlobal = {};
historyGridListChangeLogGlobal.idHistory = ''; historyGridListChangeLogGlobal.idHistory = '';
@@ -157,7 +160,7 @@ Ext.onReady(function(){
tb.add(menu); tb.add(menu);
} }
} }
var olink = document.location.href; var olink = document.location.href;
if(olink.search("gmail") != -1){ if(olink.search("gmail") != -1){
Ext.getCmp('stepsMenu').hide(); Ext.getCmp('stepsMenu').hide();
@@ -350,109 +353,217 @@ Ext.onReady(function(){
setNode(idfirstform); setNode(idfirstform);
} }
var navPanelWest = { var navPanelWest = {
id: 'navPanelWest', id: 'navPanelWest',
region: 'west', region: 'west',
xtype:'panel', xtype:'panel',
width: 250, width: 250,
height: 500, height: 500,
maxSize: 400, maxSize: 400,
split: true, split: true,
collapsible: false, collapsible: false,
margins: '0 0 0 0', margins: '0 0 0 0',
items:[casesStepTree] items:[casesStepTree]
}
var fnChangeStatus =function(){
alert('loaded');
}
var screenWidth = (PMExt.getBrowser().screen.width-140).toString() + 'px';
var navPanelCenter = {
id: 'navPanelCenter',
region: 'center', layout:'fit',forceLayout: true,
xtype:'panel',
items:[{
xtype:"tabpanel",
id: 'caseTabPanel',
deferredRender:false,
defaults:{autoScroll: true},
defaultType:"iframepanel",
activeTab: 0,
enableTabScroll: true,
//defaults: Ext.apply({}, Ext.isGecko? {style:{position:'absolute'},hideMode:'visibility'}:false),
items:[{
id: 'casesTab',
title: _('ID_CASE') +' ' + _APP_NUM,
frameConfig:{name:'openCaseFrame', id:'openCaseFrame'},
defaultSrc : uri,
loadMask:{msg: _('ID_LOADING_GRID') },
bodyStyle:{height: (PMExt.getBrowser().screen.height-60) + 'px', overflow:'hidden'},
width:screenWidth
}
],
listeners: {
tabchange: function(panel){
panel.ownerCt.doLayout();
},
render : function(panel){
Ext.each([this.el, this[this.collapseEl]] ,
function( elm ) {
elm.setVisibilityMode(Ext.Element.VISIBILITY).originalDisplay ='visible';
});
}
}
}]
};
var navPanel = {
id: 'navPanel',
region: 'center',
layout: 'border',
items:[navPanelWest, navPanelCenter],
tbar:[{
id: 'stepsMenu',
text: '&nbsp;&nbsp;'+_('ID_STEPS'),
pressed: false,
enableToggle:true,
tooltip: {
title: _('ID_CASES_STEPS'),
text:_('ID_SHOW_HIDE_CASES_STEPS')
},
iconCls: 'ICON_STEPS',
toggleHandler: togglePreview,
disabled: true
}, {
id: 'informationMenu',
text: _('ID_INFORMATION'),
menu: []
}, {
id: 'actionMenu',
text: _('ID_ACTIONS'),
menu: []
}, {
id: 'caseNotes',
pressed: false,
enableToggle:true,
text: '&nbsp;&nbsp;'+_('ID_CASES_NOTES'),
iconCls: 'button_menu_ext ICON_CASES_NOTES',
tooltip: {
title: _('ID_CASES_NOTES'),
text:_('ID_SHOW_CASES_NOTES')
},
toggleHandler:function(btn, pressed){
if(pressed){
openCaseNotesWindow();
}else{
closeCaseNotesWindow();
}
} }
}] var fnChangeStatus =function(){
} alert('loaded');
}
var screenWidth = (PMExt.getBrowser().screen.width-140).toString() + 'px';
var navPanelCenter = {
id: 'navPanelCenter',
region: 'center', layout:'fit',forceLayout: true,
xtype:'panel',
items:[{
xtype:"tabpanel",
id: 'caseTabPanel',
deferredRender:false,
defaults:{autoScroll: true},
defaultType:"iframepanel",
activeTab: 0,
enableTabScroll: true,
//defaults: Ext.apply({}, Ext.isGecko? {style:{position:'absolute'},hideMode:'visibility'}:false),
items:[{
id: 'casesTab',
title: _('ID_CASE') +' ' + _APP_NUM,
frameConfig:{name:'openCaseFrame', id:'openCaseFrame'},
defaultSrc : uri,
loadMask:{msg: _('ID_LOADING_GRID') },
bodyStyle:{height: (PMExt.getBrowser().screen.height-60) + 'px', overflow:'hidden'},
width:screenWidth
}
],
listeners: {
tabchange: function(panel){
panel.ownerCt.doLayout();
},
render : function(panel){
Ext.each([this.el, this[this.collapseEl]] ,
function( elm ) {
elm.setVisibilityMode(Ext.Element.VISIBILITY).originalDisplay ='visible';
});
}
}
}]
};
buttonCancel = new Ext.Button({
buttonAlign: 'center',
text: 'Cancel',
handler: redirectHistory,
cls: 'cancelSummary',
width: '100px',
flex: 1,
style: "height:36px"
});
buttonClaimCase = new Ext.Button({
buttonAlign: 'center',
ui: 'round',
text: 'Claim this case',
handler: claimCase,
cls: 'claimCaseSummary',
width: '120px',
flex: 1,
style: "height:36px"
});
navPanelBottom = {
id: 'navPanelBottom',
name: 'navPanelBottom',
cls: 'navPanelBottom',
region: 'south',
layout: 'column',
dock: 'bottom',
border: false,
margin: '0 0 0 0',
split: false,
collapsible: false,
hidden: false,
buttonAlign: 'center',
buttonHeight: 200,
buttons: [buttonCancel, buttonClaimCase]
};
/**
* Claim the case.
*/
function claimCase() {
Ext.Ajax.request({
url: 'cases_CatchExecute',
success: function (response, opts) {
Ext.Ajax.request({
url: 'ajaxListener',
params: {action : 'steps'},
success: function (response, opts) {
Ext.getCmp('navPanelBottom').hide();
Ext.getCmp('navPanel').doLayout();
//Reload frame pmDynaform
if (isBrowserIE()) {
document.getElementById('openCaseFrame').contentWindow.location.reload(true);
} else {
Ext.getCmp('navPanelCenter').getUpdater().getEl().update();
}
}
});
}
});
}
/**
* Redirect to unassigned inbox.
*/
function redirectHistory() {
if (isBrowserIE()) {
if (top.opener) {
//Is open the claim case in another tab
top.opener.location.reload();
top.close();
} else {
//When isIE with ux skin is not open another tab
javascript:history.back();
}
} else {
javascript:history.back();
}
}
navPanel = {
id: 'navPanel',
region: 'center',
layout: 'border',
items: [navPanelWest, navPanelCenter],
tbar: [{
id: 'stepsMenu',
text: '&nbsp;&nbsp;' + _('ID_STEPS'),
pressed: false,
enableToggle: true,
tooltip: {
title: _('ID_CASES_STEPS'),
text: _('ID_SHOW_HIDE_CASES_STEPS')
},
iconCls: 'ICON_STEPS',
toggleHandler: togglePreview,
disabled: true
}, {
id: 'informationMenu',
text: _('ID_INFORMATION'),
menu: []
}, {
id: 'actionMenu',
text: _('ID_ACTIONS'),
menu: []
}, {
id: 'caseNotes',
pressed: false,
enableToggle: true,
text: '&nbsp;&nbsp;' + _('ID_CASES_NOTES'),
iconCls: 'button_menu_ext ICON_CASES_NOTES',
tooltip: {
title: _('ID_CASES_NOTES'),
text: _('ID_SHOW_CASES_NOTES')
},
toggleHandler: function (btn, pressed) {
if (pressed) {
openCaseNotesWindow();
} else {
closeCaseNotesWindow();
}
}
}]
};
/**
* Get Parameters from URL
* @returns {*}
*/
function getParameterURL() {
var item,
key = false,
result = {},
url = location.search.substring(1),
regExp = /([^&=]+)=([^&]*)/g;
if (arguments.length > 0 && arguments[0].length > 1) {
key = arguments[0];
}
while (item = regExp.exec(url)) {
if (key !== false && decodeURIComponent(item[1]) === key) {
return decodeURIComponent(item[2]);
}
else if (key === false) {
result[decodeURIComponent(item[1])] = decodeURIComponent(item[2]);
}
}
return key === false ? result : null;
}
if (this.showCustomForm && this.showCustomForm === true && getParameterURL('action') === 'unassigned') {
navPanel.items[navPanel.items.length] = navPanelBottom;
}
var viewport = new Ext.Viewport({ var viewport = new Ext.Viewport({
layout: 'border', layout: 'border',
@@ -1891,4 +2002,3 @@ Ext.onReady(function(){
node.select(); node.select();
} }