AnsweredAssumed Answered

Quick reply latest email via panel-top

Question asked by Autchara Chaiprom on Feb 9, 2017
Latest reply on Feb 13, 2017 by Francesca Shiekh

Hi all,

I need to create quick reply latest email in Cases module.

So I override panel-top in Emails module and changed layout sub-panel in Cases module look good but I have no idea to get latest email via panel-top and pass to email compose drawer. 

 

Do you have any suggestion for me ?

 

 

Modified panel-top in Emails for Cases module

./custom/modules/Emails/clients/base/views/panel-top-for-cases/panel-top-for-cases.php

<?php
$viewdefs['Emails']['base']['view']['panel-top-for-cases'] = array(
    'type' => 'panel-top',
    'buttons' => array(
        array(
            'type' => 'actiondropdown',
            'name' => 'panel_dropdown',
            'css_class' => 'pull-right',
            'buttons' => array(
                // Compose new email
                array(
                    'type' => 'emailaction-paneltop',
                    'icon' => 'fa-plus',
                    'name' => 'email_compose_button',
                    'label' => ' ',
                    'acl_action' => 'create',
                    'set_recipient_to_parent' => true,
                    'set_related_to_parent' => true,
                    'tooltip' => 'LBL_CREATE_BUTTON_LABEL',
                ),
                // Try to custom button quick reply
                array(
                    'type' => 'emailaction-paneltop',
                    'icon' => 'fa-mail-reply',
                    'name' => 'email_reply_button',
                    'label' => ' Reply Latest Email',
                    'acl_action' => 'create',
                    'set_recipient_to_parent' => true,
                    'set_related_to_parent' => true,
                    'tooltip' => 'LBL_CREATE_BUTTON_LABEL',
                    'events' => array(
                        'click' => 'button:email_reply_button:click',
                    ),
                ),
                array(
                    'type' => 'link-action',
                    'name' => 'select_button',
                    'label' => 'LBL_ASSOC_RELATED_RECORD',
                    'css_class' => 'disabled',
                ),
            ),
        ),
    ),
);

 

Override subpanel in Cases module.

./custom/modules/Cases/clients/base/layouts/subpanels/subpanels.php

<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
$viewdefs['Cases']['base']['layout']['subpanels'] = array (
  'components' => array (
      ...
      array(
          'layout' => 'subpanel',
          'label' => 'LBL_EMAILS_SUBPANEL_TITLE',
          'override_subpanel_list_view' => 'subpanel-for-cases-archived_emails',
          'override_paneltop_view' => 'panel-top-for-cases',
          'context' => array (
              'link' => 'archived_emails',
          ),
      ),
      ...
  ),
  'type' => 'subpanels',
  'span' => 12,
);

 

Sugar 7.7

Thanks,

M

Outcomes