From 7f7486074d0fb4549ca9524cf36f65d8e4bd5bab Mon Sep 17 00:00:00 2001 From: "tim.niklas" <tim.niklas@web.de> Date: Mon, 1 Feb 2016 11:43:26 -0500 Subject: [PATCH] playing with notices --- include/utils/ListViewUtils.php | 2 +- includes/main/WebUI.php | 2 +- includes/runtime/BaseModel.php | 2 +- includes/runtime/Globals.php | 4 ++- includes/runtime/LanguageHandler.php | 52 ++++++++++------------------ modules/CustomView/CustomView.php | 30 ++++++++-------- modules/Install/views/Index.php | 1 + 7 files changed, 41 insertions(+), 52 deletions(-) diff --git a/include/utils/ListViewUtils.php b/include/utils/ListViewUtils.php index 293e03704..010ab83b3 100755 --- a/include/utils/ListViewUtils.php +++ b/include/utils/ListViewUtils.php @@ -667,7 +667,7 @@ function getEntityId($module, $entityName) { function decode_html($str) { global $default_charset;$default_charset='UTF-8'; // Direct Popup action or Ajax Popup action should be treated the same. - if ($_REQUEST['action'] == 'Popup' || $_REQUEST['file'] == 'Popup') + if ((isset($_REQUEST['action']) && $_REQUEST['action'] == 'Popup') || (isset($_REQUEST['file']) && $_REQUEST['file'] == 'Popup')) return html_entity_decode($str); else return html_entity_decode($str, ENT_QUOTES, $default_charset); diff --git a/includes/main/WebUI.php b/includes/main/WebUI.php index 16d55b722..034f0e081 100644 --- a/includes/main/WebUI.php +++ b/includes/main/WebUI.php @@ -40,7 +40,7 @@ class Vtiger_WebUI extends Vtiger_EntryPoint { */ function getLogin() { $user = parent::getLogin(); - if (!$user) { + if (!$user && isset($_SESSION['authenticated_user_id'])) { $userid = Vtiger_Session::get('AUTHUSERID', $_SESSION['authenticated_user_id']); if ($userid) { $user = CRMEntity::getInstance('Users'); diff --git a/includes/runtime/BaseModel.php b/includes/runtime/BaseModel.php index fa1724a9b..f155c6944 100644 --- a/includes/runtime/BaseModel.php +++ b/includes/runtime/BaseModel.php @@ -28,7 +28,7 @@ class Vtiger_Base_Model { * @return Value for the given key */ public function get($key){ - return $this->valueMap[$key]; + return isset($this->valueMap[$key]) ? $this->valueMap[$key] : false; } /** diff --git a/includes/runtime/Globals.php b/includes/runtime/Globals.php index 391848534..5d35714ee 100644 --- a/includes/runtime/Globals.php +++ b/includes/runtime/Globals.php @@ -15,8 +15,10 @@ * @return value of the given key */ function vglobal($key, $value=null) { + $returnVal = false; if($value !== null) { $GLOBALS[$key] = $value; } - return $GLOBALS[$key]; + $returnVal = isset($GLOBALS[$key]) ? $GLOBALS[$key] : false; + return $returnVal; } \ No newline at end of file diff --git a/includes/runtime/LanguageHandler.php b/includes/runtime/LanguageHandler.php index bbdfe980c..7a44e27dc 100644 --- a/includes/runtime/LanguageHandler.php +++ b/includes/runtime/LanguageHandler.php @@ -122,40 +122,24 @@ class Vtiger_Language_Handler { * @param <String> $module - module Name * @return <array> - array if module has language strings else returns empty array */ - public static function getModuleStringsFromFile($language, $module='Vtiger'){ - $module = str_replace(':', '.', $module); - if(empty(self::$languageContainer[$language][$module])){ - - - - - - $qualifiedName = 'languages.'.$language.'.'.$module; - $file = Vtiger_Loader::resolveNameToPath($qualifiedName); - - $languageStrings = $jsLanguageStrings = array(); - if(file_exists($file)){ - require $file; - self::$languageContainer[$language][$module]['languageStrings'] = $languageStrings; - self::$languageContainer[$language][$module]['jsLanguageStrings'] = $jsLanguageStrings; - } - - - - - - - - - - - - - - - } - return self::$languageContainer[$language][$module]; - } + public static function getModuleStringsFromFile($language, $module='Vtiger'){ + $module = str_replace(':', '.', $module); + if(empty(self::$languageContainer[$language][$module])){ + $qualifiedName = 'languages.'.$language.'.'.$module; + $file = Vtiger_Loader::resolveNameToPath($qualifiedName); + $languageStrings = $jsLanguageStrings = array(); + if(file_exists($file)){ + require $file; + self::$languageContainer[$language][$module]['languageStrings'] = $languageStrings; + self::$languageContainer[$language][$module]['jsLanguageStrings'] = $jsLanguageStrings; + } + } + $return = array(); + if(isset(self::$languageContainer[$language][$module])){ + $return = self::$languageContainer[$language][$module]; + } + return $return; + } /** * Function that returns current language diff --git a/modules/CustomView/CustomView.php b/modules/CustomView/CustomView.php index 34667e87f..0ee8adb10 100644 --- a/modules/CustomView/CustomView.php +++ b/modules/CustomView/CustomView.php @@ -14,20 +14,22 @@ require_once 'include/Webservices/Utils.php'; global $adv_filter_options; -$adv_filter_options = array("e" => "" . $mod_strings['equals'] . "", - "n" => "" . $mod_strings['not equal to'] . "", - "s" => "" . $mod_strings['starts with'] . "", - "ew" => "" . $mod_strings['ends with'] . "", - "c" => "" . $mod_strings['contains'] . "", - "k" => "" . $mod_strings['does not contain'] . "", - "l" => "" . $mod_strings['less than'] . "", - "g" => "" . $mod_strings['greater than'] . "", - "m" => "" . $mod_strings['less or equal'] . "", - "h" => "" . $mod_strings['greater or equal'] . "", - "b" => "" . $mod_strings['before'] . "", - "a" => "" . $mod_strings['after'] . "", - "bw" => "" . $mod_strings['between'] . "", -); +if(isset($mod_strings)){ + $adv_filter_options = array("e" => "" . $mod_strings['equals'] . "", + "n" => "" . $mod_strings['not equal to'] . "", + "s" => "" . $mod_strings['starts with'] . "", + "ew" => "" . $mod_strings['ends with'] . "", + "c" => "" . $mod_strings['contains'] . "", + "k" => "" . $mod_strings['does not contain'] . "", + "l" => "" . $mod_strings['less than'] . "", + "g" => "" . $mod_strings['greater than'] . "", + "m" => "" . $mod_strings['less or equal'] . "", + "h" => "" . $mod_strings['greater or equal'] . "", + "b" => "" . $mod_strings['before'] . "", + "a" => "" . $mod_strings['after'] . "", + "bw" => "" . $mod_strings['between'] . "", + ); +} class CustomView extends CRMEntity { diff --git a/modules/Install/views/Index.php b/modules/Install/views/Index.php index 3d7017986..920de186e 100644 --- a/modules/Install/views/Index.php +++ b/modules/Install/views/Index.php @@ -11,6 +11,7 @@ class Install_Index_view extends Vtiger_View_Controller { protected $debug = false; + protected $viewer = null; function loginRequired() { return false; -- GitLab