Skip to content

Commit b795f7d

Browse files
committed
Merge pull request #227 from laboro/feature/contact_view_improve
CRM-657: Improve contact view to use responcive-cell design
2 parents 6abfc22 + b66a539 commit b795f7d

File tree

3 files changed

+51
-41
lines changed

3 files changed

+51
-41
lines changed

src/OroCRM/Bundle/CallBundle/Resources/config/datagrid.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,25 @@ datagrid:
120120
dateTime:
121121
label: orocrm.call.datagrid.date_time
122122
frontend_type: datetime
123+
filters:
124+
columns:
125+
contactName:
126+
type: string
127+
enabled: false
128+
data_name: contactName
129+
accountName:
130+
type: string
131+
enabled: false
132+
data_name: account.name
133+
subject:
134+
type: string
135+
data_name: call.subject
136+
phone:
137+
type: string
138+
data_name: phone
139+
dateTime:
140+
type: datetime
141+
data_name: call.callDateTime
123142
sorters:
124143
columns:
125144
contactName:

src/OroCRM/Bundle/CallBundle/Resources/views/Call/widget/update.html.twig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<div class="widget-content call-form">
22
{% if saved is defined and saved %}
33
<script type="text/javascript">
4-
require(['underscore', 'oro/translator', 'oro/widget-manager', 'oro/messenger', 'oro/registry'],
5-
function(_, __, widgetManager, messenger, registry) {
6-
widgetManager.getWidgetInstance({{ app.request.get('_wid')|json_encode|raw }}, function(widget) {
7-
messenger.notificationFlashMessage('success', __('Call logged successfully'));
8-
widget.trigger('contactCallLogged');
9-
widget.remove();
10-
});
11-
});
4+
require(['underscore', 'oro/translator', 'oro/widget-manager', 'oro/messenger'],
5+
function(_, __, widgetManager, messenger) {
6+
widgetManager.getWidgetInstance({{ app.request.get('_wid')|json_encode|raw }}, function(widget) {
7+
messenger.notificationFlashMessage('success', __('Call logged successfully'));
8+
widget.trigger('contactCallLogged');
9+
widget.remove();
10+
});
11+
});
1212
</script>
1313
{% else %}
1414

src/OroCRM/Bundle/ContactBundle/Resources/views/Contact/view.html.twig

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@
1010
{% set gridName = 'contacts-email-grid' %}
1111

1212
{% block navButtons %}
13-
{% if resource_granted('orocrm_call_create') %}
14-
{{ UI.clientButton({
15-
'dataUrl': path('orocrm_call_create', { 'contactId': entity.id }) ,
16-
'aCss': 'no-hash log-call-button',
17-
'iCss': 'icon-phone',
18-
'dataId': entity.id,
19-
'title' : 'Log call'|trans,
20-
'label' : 'Log call'|trans
21-
}) }}
22-
{% endif %}
2313
{% if resource_granted('oro_email_create') %}
2414
{{ UI.clientButton({
2515
'dataUrl': path('orocrm_contact_email_create', { 'contactId': entity.id }) ,
@@ -30,6 +20,16 @@
3020
'label' : 'Send email'|trans
3121
}) }}
3222
{% endif %}
23+
{% if resource_granted('orocrm_call_create') %}
24+
{{ UI.clientButton({
25+
'dataUrl': path('orocrm_call_create', { 'contactId': entity.id }) ,
26+
'aCss': 'no-hash log-call-button',
27+
'iCss': 'icon-phone',
28+
'dataId': entity.id,
29+
'title' : 'Log call'|trans,
30+
'label' : 'Log call'|trans
31+
}) }}
32+
{% endif %}
3333
{% if resource_granted('orocrm_contact_update') %}
3434
{{ UI.button({
3535
'path' : path('orocrm_contact_update', { 'id': entity.id }),
@@ -140,18 +140,11 @@
140140
})
141141
}}
142142
</div>
143-
</div>
144-
{# TODO: This is a temporary list of emails for demo purposes. It will be removed when 'display activities' functionality is implemented #}
145-
{#{% if resource_granted('oro_email_view') %}#}
146-
{#{{ render(controller('OroEmailBundle:Email:activities', {'emails': entity.emails})) }}#}
147-
{#{% endif %}#}
148143

149-
{% if resource_granted('oro_email_view') %}
150-
<div class="clearfix">
144+
{% if resource_granted('oro_email_view') %}
151145
<div class="responsive-cell contact-info-col">
152146
<div class="box-type1">
153147
<div class="title">
154-
<div class="pull-right widget-actions-container"></div>
155148
<span class="widget-title">{{ "Emails"|trans }}</span>
156149
</div>
157150
<div class="row-fluid">
@@ -160,22 +153,20 @@
160153
</div>
161154
</div>
162155
</div>
163-
</div>
164-
{% endif %}
156+
{% endif %}
165157

166-
{% if resource_granted('orocrm_call_view') %}
167-
<div class="clearfix">
168-
<div class="responsive-cell contact-info-col">
169-
{{
170-
oro_widget_render({
171-
'widgetType': 'block',
172-
'url': path('orocrm_call_widget_calls', {contactId: entity.id}),
173-
'title': 'Calls'|trans,
174-
'alias': 'contact_calls'
175-
})
176-
}}
177-
</div>
158+
{% if resource_granted('orocrm_call_view') %}
159+
<div class="responsive-cell contact-info-col">
160+
{{
161+
oro_widget_render({
162+
'widgetType': 'block',
163+
'url': path('orocrm_call_widget_calls', {contactId: entity.id}),
164+
'title': 'Calls'|trans,
165+
'alias': 'contact_calls'
166+
})
167+
}}
168+
</div>
169+
{% endif %}
178170
</div>
179-
{% endif %}
180171
</div>
181172
{% endblock content_data %}

0 commit comments

Comments
 (0)