BUG 000 Validacion para prevenir un error JS cuando el objeto parent no existe

- Cuando el contenido de un iframe (como los listados) es abierto en una ventana nueva y se accede
a los casos da un error JS porque se trata de acceder a un metodo del parent, que en este caso no existe

- Se agrego una validacion para prevenir este error
This commit is contained in:
Julio Cesar Laura
2012-04-17 12:10:57 -04:00
parent 0a84f9aed7
commit 8811f605ae
3 changed files with 29 additions and 14 deletions

View File

@@ -83,7 +83,12 @@ $G_SUB_MENU = 'caseOptions';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = '_';
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptCode("parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}}')");
$oHeadPublisher->addScriptCode("
if (typeof parent != 'undefined') {
if (parent.showCaseNavigatorPanel) {
parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}}');
}
}");
$oHeadPublisher->addScriptCode('
var Cse = {};
Cse.panels = {};

View File

@@ -84,7 +84,12 @@
/* Render page */
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptCode("parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}')");
$oHeadPublisher->addScriptCode("
if (typeof parent != 'undefined') {
if (parent.showCaseNavigatorPanel) {
parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}}');
}
}");
$oHeadPublisher->addScriptCode('
var Cse = {};

View File

@@ -64,7 +64,12 @@
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptCode("parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}');");
$oHeadPublisher->addScriptCode("
if (typeof parent != 'undefined') {
if (parent.showCaseNavigatorPanel) {
parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}}');
}
}");
// DEPRECATED this script call is marked for removal since almost all the interface is extJS based
$oHeadPublisher->addScriptCode('
var Cse = {};