Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mmarum-sugarcrm/8744135 to your computer and use it in GitHub Desktop.
Save mmarum-sugarcrm/8744135 to your computer and use it in GitHub Desktop.
Adding a new view to base Record layout in Sugar 7
<?php
/*
* By installing or using this file, you are confirming on behalf of the entity
* subscribed to the SugarCRM Inc. product ("Company") that Company is bound by
* the SugarCRM Inc. Master Subscription Agreement ("MSA"), which is viewable at:
* http://www.sugarcrm.com/master-subscription-agreement
*
* If Company is not bound by the MSA, then by installing or using this file
* you are agreeing unconditionally that Company will be bound by the MSA and
* certifying that you have authority to bind Company accordingly.
*
* Copyright 2004-2013 SugarCRM Inc. All rights reserved.
*/
$viewdefs['base']['layout']['record'] = array(
'components' => array(
array(
'layout' => array(
'components' => array(
array(
'layout' => array(
'components' => array(
array(
'view' => 'record',
'primary' => true,
),
// Adds CustomStuff view to layout that is appended right after Record view
array(
'view' => 'custom-stuff',
),
array(
'layout' => 'extra-info',
),
array(
'layout' => array(
'name' => 'filterpanel',
'span' => 12,
'last_state' => array(
'id' => 'record-filterpanel',
'defaults' => array(
'toggle-view' => 'subpanels',
),
),
'availableToggles' => array(
array(
'name' => 'subpanels',
'icon' => 'icon-table',
'label' => 'LBL_DATA_VIEW',
),
array(
'name' => 'list',
'icon' => 'icon-table',
'label' => 'LBL_LISTVIEW',
),
array(
'name' => 'activitystream',
'icon' => 'icon-th-list',
'label' => 'LBL_ACTIVITY_STREAM',
),
),
'components' => array(
array(
'layout' => 'filter',
'targetEl' => '.filter',
'position' => 'prepend'
),
array(
'view' => 'filter-rows',
"targetEl" => '.filter-options'
),
array(
'view' => 'filter-actions',
"targetEl" => '.filter-options'
),
array(
'layout' => 'activitystream',
'context' =>
array(
'module' => 'Activities',
),
),
array(
'layout' => 'subpanels',
),
),
),
),
),
'type' => 'simple',
'name' => 'main-pane',
'span' => 8,
),
),
array(
'layout' => array(
'components' => array(
array(
'layout' => 'sidebar',
),
),
'type' => 'simple',
'name' => 'side-pane',
'span' => 4,
),
),
array(
'layout' => array(
'components' => array(
array(
'layout' => array(
'type' => 'dashboard',
'last_state' => array(
'id' => 'last-visit',
)
),
'context' => array(
'forceNew' => true,
'module' => 'Home',
),
),
),
'type' => 'simple',
'name' => 'dashboard-pane',
'span' => 4,
),
),
array(
'layout' => array(
'components' => array(
array(
'layout' => 'preview',
),
),
'type' => 'simple',
'name' => 'preview-pane',
'span' => 8,
),
),
),
'type' => 'default',
'name' => 'sidebar',
'span' => 12,
),
),
),
'type' => 'simple',
'name' => 'base',
'span' => 12,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment