From 26d1c49f6498d965eb04b853ffae845b85e211ac Mon Sep 17 00:00:00 2001 From: satish <satish.dvnk@vtiger.com> Date: Tue, 6 Feb 2018 14:22:30 +0530 Subject: [PATCH] minor changes added and unnecessary code removed --- layouts/v7/modules/Users/UserViewHeader.tpl | 2 +- .../v7/modules/Vtiger/uitypes/UserRole.tpl | 2 +- .../CustomerPortal/apis/DescribeModule.php | 5 ++-- .../apis/FetchRelatedRecords.php | 3 +-- .../modules/CustomerPortal/schema.xml | 26 +++++++++---------- .../CustomerPortal/settings/actions/Save.php | 1 - .../CustomerPortal/settings/models/Module.php | 7 ++--- 7 files changed, 21 insertions(+), 25 deletions(-) diff --git a/layouts/v7/modules/Users/UserViewHeader.tpl b/layouts/v7/modules/Users/UserViewHeader.tpl index 0b11b52f6..0aaa035d5 100644 --- a/layouts/v7/modules/Users/UserViewHeader.tpl +++ b/layouts/v7/modules/Users/UserViewHeader.tpl @@ -36,7 +36,7 @@ {$RECORD->getName()} </span> </div> - <div class="pull-right col-md-7"> + <div class="pull-right col-md-7 detailViewButtoncontainer"> <div class="btn-group pull-right"> {foreach item=DETAIL_VIEW_BASIC_LINK from=$DETAILVIEW_LINKS['DETAILVIEWBASIC']} <button class="btn btn-default {if $DETAIL_VIEW_BASIC_LINK->getLabel() eq 'LBL_EDIT'}{/if}" id="{$MODULE}_detailView_basicAction_{Vtiger_Util_Helper::replaceSpaceWithUnderScores($DETAIL_VIEW_BASIC_LINK->getLabel())}" diff --git a/layouts/v7/modules/Vtiger/uitypes/UserRole.tpl b/layouts/v7/modules/Vtiger/uitypes/UserRole.tpl index 1375eee39..ebf9e7b37 100644 --- a/layouts/v7/modules/Vtiger/uitypes/UserRole.tpl +++ b/layouts/v7/modules/Vtiger/uitypes/UserRole.tpl @@ -21,7 +21,7 @@ {/if} > {foreach item=PICKLIST_VALUE key=PICKLIST_NAME from=$PICKLIST_VALUES} - <option value="{$PICKLIST_VALUE}" {if $FIELD_MODEL->get('fieldvalue') eq $PICKLIST_VALUE} selected {/if}>{vtranslate($PICKLIST_NAME, $MODULE)}</option> + <option value="{$PICKLIST_VALUE}" {if $FIELD_MODEL->get('fieldvalue') eq $PICKLIST_VALUE} selected {/if}>{$PICKLIST_NAME}</option> {/foreach} </select> {/strip} \ No newline at end of file diff --git a/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/DescribeModule.php b/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/DescribeModule.php index 414910d1f..055779852 100644 --- a/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/DescribeModule.php +++ b/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/DescribeModule.php @@ -45,10 +45,11 @@ class CustomerPortal_DescribeModule extends CustomerPortal_API_Abstract { $value['default'] = Vtiger_Time_UIType::getTimeValueWithSeconds($value['default']); } $value['label'] = decode_html($value['label']); - if ($activeFields[$value['name']]) + if ($activeFields[$value['name']]) { $value['editable'] = true; - else + } else { $value['editable'] = false; + } $describeInfo['fields'][$key] = $value; $position = array_search($value['name'], $activeFieldKeys); diff --git a/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/FetchRelatedRecords.php b/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/FetchRelatedRecords.php index fe00f7068..3043d9cc2 100644 --- a/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/FetchRelatedRecords.php +++ b/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/apis/FetchRelatedRecords.php @@ -111,8 +111,7 @@ class CustomerPortal_FetchRelatedRecords extends CustomerPortal_API_Abstract { } } } - } - else { + } else { $activeFields = CustomerPortal_Utils::getActiveFields($module); $fields = implode(',', $activeFields); $limitCaluse = sprintf('ORDER BY modifiedtime DESC LIMIT %s,%s', ($page * $pageLimit), $pageLimit); diff --git a/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/schema.xml b/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/schema.xml index c33b366ff..9fb4a1f7d 100644 --- a/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/schema.xml +++ b/pkg/vtiger/modules/CustomerPortal/modules/CustomerPortal/schema.xml @@ -4,27 +4,27 @@ <table> <name>vtiger_customerportal_tabs</name> <sql><![CDATA[CREATE TABLE `vtiger_customerportal_tabs` ( - `tabid` int(19) NOT NULL, - `visible` int(1) default '1', - `sequence` int(1) default NULL, - PRIMARY KEY (`tabid`) -)]]></sql> + `tabid` int(19) NOT NULL, + `visible` int(1) default '1', + `sequence` int(1) default NULL, + PRIMARY KEY (`tabid`) + )]]></sql> </table> <table> <name>vtiger_customerportal_fields</name> <sql><![CDATA[CREATE TABLE `vtiger_customerportal_fields` ( - `tabid` int(19) NOT NULL, - `fieldid` int(19) default NULL, - `visible` int(1) default NULL -)]]></sql> + `tabid` int(19) NOT NULL, + `fieldid` int(19) default NULL, + `visible` int(1) default NULL + )]]></sql> </table> <table> <name>vtiger_customerportal_prefs</name> <sql><![CDATA[CREATE TABLE `vtiger_customerportal_prefs` ( - `tabid` int(11) NOT NULL, - `prefkey` varchar(100) default NULL, - `prefvalue` int(20) default NULL -)]]></sql> + `tabid` int(11) NOT NULL, + `prefkey` varchar(100) default NULL, + `prefvalue` int(20) default NULL + )]]></sql> </table> </tables> </schema> diff --git a/pkg/vtiger/modules/CustomerPortal/settings/actions/Save.php b/pkg/vtiger/modules/CustomerPortal/settings/actions/Save.php index 1b95d458d..0bd65003e 100644 --- a/pkg/vtiger/modules/CustomerPortal/settings/actions/Save.php +++ b/pkg/vtiger/modules/CustomerPortal/settings/actions/Save.php @@ -25,7 +25,6 @@ class Settings_CustomerPortal_Save_Action extends Settings_Vtiger_Index_Action { $moduleModel->set('shortcuts', $request->get('defaultShortcuts')); $moduleModel->set('moduleFieldsInfo', $request->get('moduleFieldsInfo')); $moduleModel->set('relatedModuleList', $request->get('relatedModuleList')); - $moduleModel->set('charts', $request->get('activeCharts')); $moduleModel->set('widgets', $request->get('activeWidgets')); $moduleModel->set('recordsVisible', $request->get('recordsVisible')); $moduleModel->set('recordPermissions', $request->get('recordPermissions')); diff --git a/pkg/vtiger/modules/CustomerPortal/settings/models/Module.php b/pkg/vtiger/modules/CustomerPortal/settings/models/Module.php index cf8f8cad1..bf5937465 100644 --- a/pkg/vtiger/modules/CustomerPortal/settings/models/Module.php +++ b/pkg/vtiger/modules/CustomerPortal/settings/models/Module.php @@ -125,12 +125,9 @@ class Settings_CustomerPortal_Module_Model extends Settings_Vtiger_Module_Model //Update the dashboard widgets, charts, announcement and support_notification details. $activeWidgets['widgets'] = $widgets; - $activeCharts['charts'] = $charts; $dashboardWidgets = json_encode($activeWidgets); - $dashboardCharts = json_encode($activeCharts); - if ($dashboardWidgets || $dashboardCharts) { - $db->pquery('UPDATE vtiger_customerportal_settings SET default_assignee = ? ,support_notification = ? - ,announcement = ?,widgets = ?,charts=?', array($defaultAssignee, $renewalPeriod, $announcement, $dashboardWidgets, $dashboardCharts)); + if ($dashboardWidgets) { + $db->pquery('UPDATE vtiger_customerportal_settings SET default_assignee=?, support_notification=?, announcement=?, widgets=?', array($defaultAssignee, $renewalPeriod, $announcement, $dashboardWidgets)); } //Update module field info if (!empty($moduleFieldsInfo)) { -- GitLab