From d2ae2951adb1a7154e69706b9275f992fb41a443 Mon Sep 17 00:00:00 2001
From: Uma <uma.s@vtiger.com>
Date: Wed, 25 Mar 2020 05:09:44 +0530
Subject: [PATCH] Fixes #89 Removed default landing page from configuration
 editor

---
 config.template.php                            |  3 ---
 .../Settings/Vtiger/ConfigEditorDetail.tpl     | 14 ++++++--------
 .../Settings/Vtiger/ConfigEditorEdit.tpl       |  2 +-
 modules/Install/models/ConfigFileUtils.php     |  3 ---
 modules/Install/views/Index.php                | 18 +++++++++---------
 5 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/config.template.php b/config.template.php
index 41abe8efc..5c8fe7c9c 100644
--- a/config.template.php
+++ b/config.template.php
@@ -119,9 +119,6 @@ $list_max_entries_per_page = '20';
 // history_max_viewed default value = 5
 $history_max_viewed = '5';
 
-// default_module default value = Home
-$default_module = 'Home';
-
 // default_action default value = index
 $default_action = 'index';
 
diff --git a/layouts/v7/modules/Settings/Vtiger/ConfigEditorDetail.tpl b/layouts/v7/modules/Settings/Vtiger/ConfigEditorDetail.tpl
index 859f3bec5..bc17c893b 100644
--- a/layouts/v7/modules/Settings/Vtiger/ConfigEditorDetail.tpl
+++ b/layouts/v7/modules/Settings/Vtiger/ConfigEditorDetail.tpl
@@ -28,20 +28,18 @@
                         <div class="row form-group"><div class="col-lg-4 col-md-4 col-sm-4 fieldLabel"><label>{if $FIELD_NAME == 'upload_maxsize'}{if $FIELD_DATA[$FIELD_NAME] gt 5}{vtranslate($FIELD_DETAILS['label'], $QUALIFIED_MODULE,$FIELD_DATA[$FIELD_NAME])}{else}{vtranslate($FIELD_DETAILS['label'], $QUALIFIED_MODULE,5)}{/if}{else}{vtranslate($FIELD_DETAILS['label'], $QUALIFIED_MODULE)}{/if}</label></div>
                             <div  class="col-lg-8 col-md-8 col-sm-8 fieldValue break-word">
                                 <div>
-                                    {if $FIELD_NAME == 'default_module'}
-                                        {vtranslate($FIELD_DATA[$FIELD_NAME], $FIELD_DATA[$FIELD_NAME])}
-                                    {else if $FIELD_DETAILS['fieldType'] == 'checkbox'}
+                                    {if $FIELD_DETAILS['fieldType'] == 'checkbox'}
                                         {vtranslate($FIELD_DATA[$FIELD_NAME], $QUALIFIED_MODULE)}
                                         {if $FIELD_NAME == 'email_tracking'}
                                             <div class="input-info-addon"><a class="fa fa-question-circle" data-toggle="tooltip" data-placement="right" title="{vtranslate('LBL_PERSONAL_EMAIL_TRACKING_INFO',$QUALIFIED_MODULE)}"></a></div>
-                                            {/if}
-                                        {else if $FIELD_NAME == 'default_reply_to'}
+                                        {/if}
+                                    {else if $FIELD_NAME == 'default_reply_to'}
                                             {vtranslate($FIELD_DATA[$FIELD_NAME])}
                                             <div class="input-info-addon"><a class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="{vtranslate('LBL_DEFAULT_REPLY_TO_INFO',$QUALIFIED_MODULE)}"></a></div>
-                                        {else}
+                                    {else}
                                             {$FIELD_DATA[$FIELD_NAME]}
-                                        {/if}
-                                        {if $FIELD_NAME == 'upload_maxsize'}
+                                    {/if}
+                                    {if $FIELD_NAME == 'upload_maxsize'}
                                         &nbsp;{vtranslate('LBL_MB', $QUALIFIED_MODULE)}
                                     {/if}
                                 </div>
diff --git a/layouts/v7/modules/Settings/Vtiger/ConfigEditorEdit.tpl b/layouts/v7/modules/Settings/Vtiger/ConfigEditorEdit.tpl
index 084309c97..aaf21c73b 100644
--- a/layouts/v7/modules/Settings/Vtiger/ConfigEditorEdit.tpl
+++ b/layouts/v7/modules/Settings/Vtiger/ConfigEditorEdit.tpl
@@ -35,7 +35,7 @@
 
 										<select class="select2-container inputElement select2 col-lg-11" name="{$FIELD_NAME}" >
 											{foreach key=optionName item=optionLabel from=$MODEL->getPicklistValues($FIELD_NAME)}
-												{if $FIELD_NAME != 'default_module' && $FIELD_NAME != 'default_reply_to'}
+												{if $FIELD_NAME != 'default_reply_to'}
 													<option {if $optionLabel == $FIELD_DATA[$FIELD_NAME]} selected {/if}>{vtranslate($optionLabel, $QUALIFIED_MODULE)}</option>
 												{else if $FIELD_NAME == 'default_reply_to'}
 													<option value="{$optionName}" {if $optionName == $FIELD_DATA[$FIELD_NAME]} selected {/if}>{vtranslate($optionName)}</option>
diff --git a/modules/Install/models/ConfigFileUtils.php b/modules/Install/models/ConfigFileUtils.php
index b5b89fc41..378d122b7 100644
--- a/modules/Install/models/ConfigFileUtils.php
+++ b/modules/Install/models/ConfigFileUtils.php
@@ -210,9 +210,6 @@ ini_set('memory_limit','64M');
 // history_max_viewed default value = 5
 \$history_max_viewed = '5';
 
-// default_module default value = Home
-\$default_module = 'Home';
-
 // default_action default value = index
 \$default_action = 'index';
 
diff --git a/modules/Install/views/Index.php b/modules/Install/views/Index.php
index 4e20ac2fd..f9e6f2e90 100644
--- a/modules/Install/views/Index.php
+++ b/modules/Install/views/Index.php
@@ -38,15 +38,15 @@ class Install_Index_view extends Vtiger_View_Controller {
 		$this->applyInstallFriendlyEnv();
 
 		date_default_timezone_set('Europe/London'); // to overcome the pre configuration settings
-		// Added to redirect to default module if already installed
-		$configFileName = 'config.inc.php';
-		if(is_file($configFileName) && filesize($configFileName) > 0) {
-			$defaultModule = vglobal('default_module');
-			$defaultModuleInstance = Vtiger_Module_Model::getInstance($defaultModule);
-			$defaultView = $defaultModuleInstance->getDefaultViewName();
-			header('Location:index.php?module='.$defaultModule.'&view='.$defaultView);
-			exit;
-		}
+//		// Added to redirect to default module if already installed
+//		$configFileName = 'config.inc.php';
+//		if(is_file($configFileName) && filesize($configFileName) > 0) {
+//			$defaultModule = vglobal('default_module');
+//			$defaultModuleInstance = Vtiger_Module_Model::getInstance($defaultModule);
+//			$defaultView = $defaultModuleInstance->getDefaultViewName();
+//			header('Location:index.php?module='.$defaultModule.'&view='.$defaultView);
+//			exit;
+//		}
 
 		parent::preProcess($request);
 		$viewer = $this->getViewer($request);
-- 
GitLab