Hi Folks
I want to remove record-view from all modules in Sugar 7.9
I have tried below link too.
https://community.sugarcrm.com/message/81189?commentID=81189#comment-81189
Hi Folks
I want to remove record-view from all modules in Sugar 7.9
I have tried below link too.
https://community.sugarcrm.com/message/81189?commentID=81189#comment-81189
Try this solution
create record.js file
custom/clients/base/views/record/record.js
({
extendsFrom: "RecordView",
_render: function() {
this._super('_render');
var defaultLayout = this.closestComponent('sidebar');
if (defaultLayout && defaultLayout.isSidePaneVisible() ) {
defaultLayout.trigger('sidebar:toggle');
}
}
})
Hi Mehul,
Toggling the sidebar is the easiest way. But you want to remove completely, it isn't that much easy.
You have to remove sidebar components from the layouts.
1. Removing the sidebar from record layouts in general.
./custom/clients/base/layouts/record/record.php
<?php
/*
* Your installation or use of this SugarCRM file is subject to the applicable
* terms available at
* http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
* If you do not agree to all of the applicable terms or do not have the
* authority to bind the entity as an authorized representative, then do not
* install or use this SugarCRM file.
*
* Copyright (C) SugarCRM Inc. All rights reserved.
*/
$viewdefs['base']['layout']['record'] = array(
// 'components' => array(
// array(
// 'layout' => array(
// 'type' => 'default',
// 'name' => 'sidebar',
'components' => array(
array(
'layout' => array(
'type' => 'base',
'name' => 'main-pane',
'css_class' => 'main-pane span8',
'components' => array(
array(
'view' => 'record',
'primary' => true,
),
array(
'layout' => 'extra-info',
),
array(
'layout' => array(
'type' => 'filterpanel',
'last_state' => array(
'id' => 'record-filterpanel',
'defaults' => array(
'toggle-view' => 'subpanels',
),
),
'refresh_button' => true,
'availableToggles' => array(
array(
'name' => 'subpanels',
'icon' => 'fa-table',
'label' => 'LBL_DATA_VIEW',
),
array(
'name' => 'list',
'icon' => 'fa-table',
'label' => 'LBL_LISTVIEW',
),
array(
'name' => 'activitystream',
'icon' => 'fa-clock-o',
'label' => 'LBL_ACTIVITY_STREAM',
),
),
'components' => array(
array(
'layout' => 'filter',
'xmeta' => array(
'layoutType' => '',
),
'loadModule' => 'Filters',
),
array(
'view' => 'filter-rows',
),
array(
'view' => 'filter-actions',
),
array(
'layout' => 'activitystream',
'context' =>
array(
'module' => 'Activities',
),
),
array(
'layout' => 'subpanels',
),
),
),
),
),
),
),
// array(
// 'layout' => array(
// 'type' => 'base',
// 'name' => 'dashboard-pane',
// 'css_class' => 'dashboard-pane',
// 'components' => array(
// array(
// 'layout' => array(
// 'type' => 'dashboard',
// 'last_state' => array(
// 'id' => 'last-visit',
// )
// ),
// 'context' => array(
// 'forceNew' => true,
// 'module' => 'Home',
// ),
// 'loadModule' => 'Dashboards',
// ),
// ),
// ),
// ),
// array(
// 'layout' => array(
// 'type' => 'base',
// 'name' => 'preview-pane',
// 'css_class' => 'preview-pane',
// 'components' => array(
// array(
// 'layout' => 'preview',
// ),
// ),
// ),
// ),
),
// ),
// ),
// ),
);
2. Then you need to remove the sidebar buttons from the layouts.
custom/clients/base/views/record/record.php
<?php
/*
* Your installation or use of this SugarCRM file is subject to the applicable
* terms available at
* http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
* If you do not agree to all of the applicable terms or do not have the
* authority to bind the entity as an authorized representative, then do not
* install or use this SugarCRM file.
*
* Copyright (C) SugarCRM Inc. All rights reserved.
*/
$viewdefs['base']['view']['record'] = array(
'buttons' => array(
array(
'type' => 'button',
'name' => 'cancel_button',
'label' => 'LBL_CANCEL_BUTTON_LABEL',
'css_class' => 'btn-invisible btn-link',
'showOn' => 'edit',
'events' => array(
'click' => 'button:cancel_button:click',
),
),
array(
'type' => 'rowaction',
'event' => 'button:save_button:click',
'name' => 'save_button',
'label' => 'LBL_SAVE_BUTTON_LABEL',
'css_class' => 'btn btn-primary',
'showOn' => 'edit',
'acl_action' => 'edit',
),
array(
'type' => 'actiondropdown',
'name' => 'main_dropdown',
'primary' => true,
'showOn' => 'view',
'buttons' => array(
array(
'type' => 'rowaction',
'event' => 'button:edit_button:click',
'name' => 'edit_button',
'label' => 'LBL_EDIT_BUTTON_LABEL',
'acl_action' => 'edit',
),
array(
'type' => 'shareaction',
'name' => 'share',
'label' => 'LBL_RECORD_SHARE_BUTTON',
'acl_action' => 'view',
),
array(
'type' => 'pdfaction',
'name' => 'download-pdf',
'label' => 'LBL_PDF_VIEW',
'action' => 'download',
'acl_action' => 'view',
),
array(
'type' => 'pdfaction',
'name' => 'email-pdf',
'label' => 'LBL_PDF_EMAIL',
'action' => 'email',
'acl_action' => 'view',
),
array(
'type' => 'divider',
),
array(
'type' => 'rowaction',
'event' => 'button:find_duplicates_button:click',
'name' => 'find_duplicates_button',
'label' => 'LBL_DUP_MERGE',
'acl_action' => 'edit',
),
array(
'type' => 'rowaction',
'event' => 'button:duplicate_button:click',
'name' => 'duplicate_button',
'label' => 'LBL_DUPLICATE_BUTTON_LABEL',
'acl_module' => $module,
'acl_action' => 'create',
),
array(
'type' => 'divider',
),
array(
'type' => 'rowaction',
'event' => 'button:delete_button:click',
'name' => 'delete_button',
'label' => 'LBL_DELETE_BUTTON_LABEL',
'acl_action' => 'delete',
),
),
),
// array(
// 'name' => 'sidebar_toggle',
// 'type' => 'sidebartoggle',
// ),
),
'last_state' => array(
'id' => 'record_view',
'defaults' => array(
'show_more' => 'more'
),
),
);
3. The most difficult part, if you want to apply this into stock modules you need to remove also from custom record.php s located in:
./modules/Accounts/clients/base/views/record/record.php. And you need to specifically copy every single of them to your custom folder than modify them like this.
Ie. for Accounts has specific stock record.php customisiations. Notice commented parts. custom/modules/Accounts/clients/base/views/record/record.php
<?php
/*
* Your installation or use of this SugarCRM file is subject to the applicable
* terms available at
* http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
* If you do not agree to all of the applicable terms or do not have the
* authority to bind the entity as an authorized representative, then do not
* install or use this SugarCRM file.
*
* Copyright (C) SugarCRM Inc. All rights reserved.
*/
$viewdefs['Accounts']['base']['view']['record'] = array(
'buttons' => array(
array(
'type' => 'button',
'name' => 'cancel_button',
'label' => 'LBL_CANCEL_BUTTON_LABEL',
'css_class' => 'btn-invisible btn-link',
'showOn' => 'edit',
'events' => array(
'click' => 'button:cancel_button:click',
),
),
array(
'type' => 'rowaction',
'event' => 'button:save_button:click',
'name' => 'save_button',
'label' => 'LBL_SAVE_BUTTON_LABEL',
'css_class' => 'btn btn-primary',
'showOn' => 'edit',
'acl_action' => 'edit',
),
array(
'type' => 'actiondropdown',
'name' => 'main_dropdown',
'primary' => true,
'showOn' => 'view',
'buttons' => array(
array(
'type' => 'rowaction',
'event' => 'button:edit_button:click',
'name' => 'edit_button',
'label' => 'LBL_EDIT_BUTTON_LABEL',
'acl_action' => 'edit',
),
array(
'type' => 'shareaction',
'name' => 'share',
'label' => 'LBL_RECORD_SHARE_BUTTON',
'acl_action' => 'view',
),
array(
'type' => 'pdfaction',
'name' => 'download-pdf',
'label' => 'LBL_PDF_VIEW',
'action' => 'download',
'acl_action' => 'view',
),
array(
'type' => 'pdfaction',
'name' => 'email-pdf',
'label' => 'LBL_PDF_EMAIL',
'action' => 'email',
'acl_action' => 'view',
),
array(
'type' => 'divider',
),
array(
'type' => 'rowaction',
'event' => 'button:find_duplicates_button:click',
'name' => 'find_duplicates_button',
'label' => 'LBL_DUP_MERGE',
'acl_action' => 'edit',
),
array(
'type' => 'rowaction',
'event' => 'button:duplicate_button:click',
'name' => 'duplicate_button',
'label' => 'LBL_DUPLICATE_BUTTON_LABEL',
'acl_module' => 'Accounts',
'acl_action' => 'create',
),
array(
'type' => 'rowaction',
'event' => 'button:historical_summary_button:click',
'name' => 'historical_summary_button',
'label' => 'LBL_HISTORICAL_SUMMARY',
'acl_action' => 'view',
),
array(
'type' => 'rowaction',
'event' => 'button:audit_button:click',
'name' => 'audit_button',
'label' => 'LNK_VIEW_CHANGE_LOG',
'acl_action' => 'view',
),
array(
'type' => 'divider',
),
array(
'type' => 'rowaction',
'event' => 'button:delete_button:click',
'name' => 'delete_button',
'label' => 'LBL_DELETE_BUTTON_LABEL',
'acl_action' => 'delete',
),
),
),
// array(
// 'name' => 'sidebar_toggle',
// 'type' => 'sidebartoggle',
// ),
),
'panels' => array(
array(
'name' => 'panel_header',
'label' => 'LBL_PANEL_HEADER',
'header' => true,
'fields' => array(
array(
'name' => 'picture',
'type' => 'avatar',
'size' => 'large',
'dismiss_label' => true,
'readonly' => true,
),
array(
'name' => 'name',
),
array(
'name' => 'favorite',
'label' => 'LBL_FAVORITE',
'type' => 'favorite',
'dismiss_label' => true,
),
array(
'name' => 'follow',
'label'=> 'LBL_FOLLOW',
'type' => 'follow',
'readonly' => true,
'dismiss_label' => true,
),
)
),
array(
'name' => 'panel_body',
'label' => 'LBL_RECORD_BODY',
'columns' => 2,
'labelsOnTop' => true,
'placeholders' => true,
'fields' => array(
'website',
'industry',
'parent_name',
'account_type',
'assigned_user_name',
'phone_office',
array(
'name' => 'tag',
'span' => 12,
),
),
),
array(
'name' => 'panel_hidden',
'label' => 'LBL_RECORD_SHOWMORE',
'hide' => true,
'columns' => 2,
'labelsOnTop' => true,
'placeholders' => true,
'fields' => array(
array(
'name' => 'billing_address',
'type' => 'fieldset',
'css_class' => 'address',
'label' => 'LBL_BILLING_ADDRESS',
'fields' => array(
array(
'name' => 'billing_address_street',
'css_class' => 'address_street',
'placeholder' => 'LBL_BILLING_ADDRESS_STREET',
),
array(
'name' => 'billing_address_city',
'css_class' => 'address_city',
'placeholder' => 'LBL_BILLING_ADDRESS_CITY',
),
array(
'name' => 'billing_address_state',
'css_class' => 'address_state',
'placeholder' => 'LBL_BILLING_ADDRESS_STATE',
),
array(
'name' => 'billing_address_postalcode',
'css_class' => 'address_zip',
'placeholder' => 'LBL_BILLING_ADDRESS_POSTALCODE',
),
array(
'name' => 'billing_address_country',
'css_class' => 'address_country',
'placeholder' => 'LBL_BILLING_ADDRESS_COUNTRY',
),
),
),
array(
'name' => 'shipping_address',
'type' => 'fieldset',
'css_class' => 'address',
'label' => 'LBL_SHIPPING_ADDRESS',
'fields' => array(
array(
'name' => 'shipping_address_street',
'css_class' => 'address_street',
'placeholder' => 'LBL_SHIPPING_ADDRESS_STREET',
),
array(
'name' => 'shipping_address_city',
'css_class' => 'address_city',
'placeholder' => 'LBL_SHIPPING_ADDRESS_CITY',
),
array(
'name' => 'shipping_address_state',
'css_class' => 'address_state',
'placeholder' => 'LBL_SHIPPING_ADDRESS_STATE',
),
array(
'name' => 'shipping_address_postalcode',
'css_class' => 'address_zip',
'placeholder' => 'LBL_SHIPPING_ADDRESS_POSTALCODE',
),
array(
'name' => 'shipping_address_country',
'css_class' => 'address_country',
'placeholder' => 'LBL_SHIPPING_ADDRESS_COUNTRY',
),
array(
'name' => 'copy',
'label' => 'NTC_COPY_BILLING_ADDRESS',
'type' => 'copy',
'mapping' => array(
'billing_address_street' => 'shipping_address_street',
'billing_address_city' => 'shipping_address_city',
'billing_address_state' => 'shipping_address_state',
'billing_address_postalcode' => 'shipping_address_postalcode',
'billing_address_country' => 'shipping_address_country',
),
),
),
),
array(
'name' => 'phone_alternate',
'label' => 'LBL_PHONE_ALT',
),
'email',
'phone_fax',
'campaign_name',
'twitter',
array(
'name' => 'description',
'span' => 12,
),
'sic_code',
'ticker_symbol',
'annual_revenue',
'employees',
'ownership',
'rating',
array(
'name' => 'duns_num',
'readonly' => true,
),
array(
'name' => 'date_entered_by',
'readonly' => true,
'inline' => true,
'type' => 'fieldset',
'label' => 'LBL_DATE_ENTERED',
'fields' => array(
array(
'name' => 'date_entered',
),
array(
'type' => 'label',
'default_value' => 'LBL_BY',
),
array(
'name' => 'created_by_name',
),
),
),
'team_name',
array(
'name' => 'date_modified_by',
'readonly' => true,
'inline' => true,
'type' => 'fieldset',
'label' => 'LBL_DATE_MODIFIED',
'fields' => array(
array(
'name' => 'date_modified',
),
array(
'type' => 'label',
'default_value' => 'LBL_BY',
),
array(
'name' => 'modified_by_name',
),
),
),
),
),
),
);
4. Very last option because you have made some changes the layout will be shifted 20 pixel to right. To fix that you need to add following lines into
./custom/themes/custom.less
.main-pane.span12 {
margin-left: 0px !important;
}
5. If you run a Quick Repair and Rebuild then you will see that Accounts module and not customised all modules record view do not have sidepanels.
6. If you need to remove all the side-panels from listviews you need to change listview layouts like #1 and also for the buttons from headerpanes. (You have to remove from stock customisations as well. It can be find (modules/<MODULE_NAME>/clients/base/layout/<layoutname>/<layoutname>.php or modules/<MODULE_NAME>/clients/base/record/<layoutname>/<layoutname>.php)
I hope this helps
Best Regards
Tevfik Tümer
Developer Support Engineer