Skip to content

Commit 6abfc22

Browse files
committed
Merge pull request #226 from laboro/fix/call_issues
CRM-634: Call window has error when Assign option is set as None
2 parents 17d421f + eb269b3 commit 6abfc22

File tree

9 files changed

+98
-101
lines changed

9 files changed

+98
-101
lines changed

src/OroCRM/Bundle/AccountBundle/Resources/config/services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ services:
8888
tags:
8989
- { name: kernel.event_listener, event: oro_datagrid.datgrid.build.after.account-contacts-view-grid, method: onBuildAfter }
9090

91-
orocrm_account.event_listener.account_contacts_updagte_listener:
91+
orocrm_account.event_listener.account_contacts_update_listener:
9292
class: %oro_datagrid.event_listener.base_orm_relation.class%
9393
arguments:
9494
- 'account'

src/OroCRM/Bundle/CallBundle/Controller/CallController.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,22 @@ public function callsAction(Request $request)
8181
}
8282

8383
/**
84-
* @param int $contactId
84+
* @param int|null $contactId
8585
* @return Call
86+
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
8687
*/
8788
protected function initEntity($contactId = null)
8889
{
8990
$entity = new Call();
90-
$user = $this->container->get('security.context')->getToken()->getUser();
91-
$entity->setOwner($user);
9291

9392
$callStatus = $this->getDoctrine()
94-
->getRepository('OroCRMCallBundle:CallStatus')
95-
->findOneByStatus('completed');
93+
->getRepository('OroCRMCallBundle:CallStatus')
94+
->findOneByStatus('completed');
9695
$entity->setCallStatus($callStatus);
9796

9897
$callDirection = $this->getDoctrine()
99-
->getRepository('OroCRMCallBundle:CallDirection')
100-
->findOneByDirection('outgoing');
98+
->getRepository('OroCRMCallBundle:CallDirection')
99+
->findOneByDirection('outgoing');
101100
$entity->setDirection($callDirection);
102101

103102
if ($contactId) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ oro_menu_config:
2525

2626
oro_titles:
2727
orocrm_call_index: Calls
28-
orocrm_call_update: %%subject%% - Edit Call
29-
orocrm_call_create: Create Call
28+
orocrm_call_update: %%subject%% - Edit
29+
orocrm_call_create: Log Call

src/OroCRM/Bundle/CallBundle/Resources/translations/messages.en.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@ orocrm.call.controller.call.deleted.message: 'Call deleted successfully'
33
orocrm.call.phone.required.message: 'Phone number is required field'
44

55
orocrm.call.form.call.other: 'Other...'
6-
orocrm.call.form.call.owner: 'Owner'
7-
orocrm.call.form.call.subject: 'Subject'
8-
orocrm.call.form.call.notes: 'Notes'
9-
orocrm.call.form.call.dateTime: 'Call Date & Time'
10-
orocrm.call.form.call.relatedTo: 'Related To'
11-
orocrm.call.form.call.relatedContact: 'Related Contact'
12-
orocrm.call.form.call.phoneNumber: 'Phone Number'
13-
orocrm.call.form.call.contactPhoneNumber: 'Phone Number'
14-
orocrm.call.form.call.direction: 'Direction'
15-
orocrm.call.form.call.duration: 'Duration'
166

177
orocrm.call.datagrid.contact_name: 'Contact name'
188
orocrm.call.datagrid.account_name: 'Account name'
@@ -30,4 +20,4 @@ orocrm.call.datagrid.date_time: 'Call date'
3020
'Log call': 'Log call'
3121
'Call logged successfully': 'Call logged successfully'
3222
'Call deleted successfully': 'Call deleted successfully'
33-
'Phone number is required field': 'Phone number is required field'
23+
'Phone number is required field': 'Phone number is required field'

src/OroCRM/Bundle/CallBundle/Resources/views/Call/index.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<div class="btn-group">
99
{{ UI.addButton({
1010
'path' : path('orocrm_call_create'),
11-
'title' : 'Create call'|trans,
12-
'label' : 'Create call'|trans
11+
'title' : 'Log call'|trans,
12+
'label' : 'Log call'|trans
1313
}) }}
1414
</div>
1515
{% endif %}

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

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,42 +17,44 @@
1717
{% set id = 'call-log' %}
1818

1919
{% if form.vars.value.id %}
20-
{% set title = 'Update call log'|trans %}
20+
{% set title = 'Edit call'|trans %}
2121
{% else %}
22-
{% set title = 'Add call log'|trans %}
22+
{% set title = 'Log call'|trans %}
2323
{% endif %}
2424

25+
{% set formFields = [] %}
26+
{% if form.owner is defined %}
27+
{% set formFields = formFields|merge([form_row(form.owner)]) %}
28+
{% endif %}
29+
{% set formFields = formFields|merge([
30+
form_row(form.subject, {'label': 'Subject'|trans}),
31+
form_row(form.notes, {'label': 'Notes'|trans}),
32+
form_row(form.callDateTime, {'label': 'Call Date & Time'|trans}),
33+
form_row(form.relatedAccount, {'label': 'Related To'|trans}),
34+
form_row(form.relatedContact, {'label': 'Related Contact'|trans}),
35+
form_row(form.contactPhoneNumber, {'label': 'Phone Number'|trans}),
36+
form_widget(form.phoneNumber),
37+
form_row(form.direction, {'label': 'Direction'|trans}),
38+
form_row(form.duration, {'label': 'Duration'|trans}),
39+
form_row(form.callStatus),
40+
form_rest(form)
41+
]) %}
42+
2543
{% set dataBlocks = [{
26-
'title': title,
27-
'class': 'active',
28-
'subblocks': [
29-
{
30-
'title': title,
31-
'data': [
32-
form_row(form.owner, {'label': 'orocrm.call.form.call.owner'|trans}),
33-
form_row(form.subject, {'label': 'orocrm.call.form.call.subject'|trans}),
34-
form_row(form.notes, {'label': 'orocrm.call.form.call.notes'|trans}),
35-
form_row(form.callDateTime, {'label': 'orocrm.call.form.call.dateTime'|trans}),
36-
form_row(form.relatedAccount, {'label': 'orocrm.call.form.call.relatedTo'|trans}),
37-
form_row(form.relatedContact, {'label': 'orocrm.call.form.call.relatedContact'|trans}),
38-
form_row(form.contactPhoneNumber, {'label': 'orocrm.call.form.call.phoneNumber'|trans}),
39-
form_widget(form.phoneNumber),
40-
form_row(form.direction, {'label': 'orocrm.call.form.call.direction'|trans}),
41-
form_row(form.duration, {'label': 'orocrm.call.form.call.duration'|trans}),
42-
form_row(form.callStatus),
43-
form_rest(form)
44-
]
45-
}
46-
]
47-
}]
48-
%}
44+
'title': title,
45+
'class': 'active',
46+
'subblocks': [
47+
{
48+
'title': title,
49+
'data': formFields
50+
}
51+
]
52+
}] %}
4953

50-
{% set data =
51-
{
52-
'formErrors': form_errors(form)? form_errors(form) : null,
53-
'dataBlocks': dataBlocks,
54-
}
55-
%}
54+
{% set data = {
55+
'formErrors': form_errors(form)? form_errors(form) : null,
56+
'dataBlocks': dataBlocks,
57+
} %}
5658

5759
<script type="text/javascript">
5860
require(['jquery', 'orocrm/contactphone/view'],
@@ -89,7 +91,7 @@
8991
'entity': form.vars.value,
9092
'indexPath': path('orocrm_call_index'),
9193
'indexLabel': 'Calls'|trans,
92-
'entityTitle': 'New Call'|trans
94+
'entityTitle': 'Log call'|trans
9395
}
9496
%}
9597
{% endif %}

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,19 @@
2323
<form id="{{ form.vars.name }}" action="{{ path('orocrm_call_create', {'no_redirect': true }) }}" method="post">
2424
<fieldset class="form form-horizontal">
2525
<div class="span6">
26-
27-
{{ form_row(form.owner, {'label': 'orocrm.call.form.call.owner'|trans}) }}
28-
{{ form_row(form.subject, {'label': 'orocrm.call.form.call.subject'|trans}) }}
29-
{{ form_row(form.notes, {'label': 'orocrm.call.form.call.notes'|trans}) }}
30-
{{ form_row(form.callDateTime, {'label': 'orocrm.call.form.call.dateTime'|trans}) }}
31-
26+
{% if form.owner is defined %}{{ form_row(form.owner) }}{% endif %}
27+
{{ form_row(form.subject, {'label': 'Subject'|trans}) }}
28+
{{ form_row(form.notes, {'label': 'Notes'|trans}) }}
29+
{{ form_row(form.callDateTime, {'label': 'Call Date & Time'|trans}) }}
3230
</div>
3331
<div class="span6">
34-
35-
{{ form_row(form.relatedAccount, {'label': 'orocrm.call.form.call.relatedTo'|trans}) }}
36-
{{ form_row(form.relatedContact, {'label': 'orocrm.call.form.call.relatedContact'|trans}) }}
37-
{{ form_row(form.contactPhoneNumber, {'label': 'orocrm.call.form.call.phoneNumber'|trans}) }}
32+
{{ form_row(form.relatedAccount, {'label': 'Related To'|trans}) }}
33+
{{ form_row(form.relatedContact, {'label': 'Related Contact'|trans}) }}
34+
{{ form_row(form.contactPhoneNumber, {'label': 'Phone Number'|trans}) }}
3835
{{ form_widget(form.phoneNumber) }}
39-
{{ form_row(form.direction, {'label': 'orocrm.call.form.call.direction'|trans}) }}
40-
{{ form_row(form.duration, {'label': 'orocrm.call.form.call.duration'|trans}) }}
36+
{{ form_row(form.direction, {'label': 'Direction'|trans}) }}
37+
{{ form_row(form.duration, {'label': 'Duration'|trans}) }}
4138
{{ form_row(form.callStatus) }}
42-
4339
</div>
4440
{{ form_rest(form) }}
4541
<div class="widget-actions form-actions">

src/OroCRM/Bundle/SalesBundle/Resources/views/Lead/update.html.twig

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -85,32 +85,37 @@
8585
{% block content_data %}
8686
{% set id = 'lead-profile' %}
8787

88+
{% set formFields = [] %}
89+
{% if form.owner is defined %}
90+
{% set formFields = formFields|merge([form_row(form.owner)]) %}
91+
{% endif %}
92+
{% set formFields = formFields|merge([
93+
form_row(form.name, {'label': 'Lead Name'}),
94+
form_row(form.namePrefix, {'label': 'Name prefix'}),
95+
form_row(form.firstName, {'label': 'First name'}),
96+
form_row(form.middleName, {'label': 'Middle name'}),
97+
form_row(form.lastName, {'label': 'Last name'}),
98+
form_row(form.nameSuffix, {'label': 'Name suffix'}),
99+
form_row(form.contact, {'label': 'Contact'}),
100+
form_row(form.jobTitle, {'label': 'Job Title'}),
101+
102+
form_row(form.phoneNumber, {'label': 'Phone Number'}),
103+
form_row(form.email, {'label': 'Email'}),
104+
105+
form_row(form.account, {'label': 'Account'}),
106+
form_row(form.companyName, {'label': 'Company Name'}),
107+
form_row(form.website, {'label': 'Website'}),
108+
form_row(form.numberOfEmployees, {'label': 'Number Of Employees'}),
109+
form_row(form.industry, {'label': 'Industry'})
110+
]) %}
111+
88112
{% set dataBlocks = [{
89113
'title': 'General',
90114
'class': 'active',
91115
'subblocks': [
92116
{
93117
'title': 'Lead Information',
94-
'data': [
95-
form_row(form.owner, {'label': 'Owner'}),
96-
form_row(form.name, {'label': 'Lead Name'}),
97-
form_row(form.namePrefix, {'label': 'Name prefix'}),
98-
form_row(form.firstName, {'label': 'First name'}),
99-
form_row(form.middleName, {'label': 'Middle name'}),
100-
form_row(form.lastName, {'label': 'Last name'}),
101-
form_row(form.nameSuffix, {'label': 'Name suffix'}),
102-
form_row(form.contact, {'label': 'Contact'}),
103-
form_row(form.jobTitle, {'label': 'Job Title'}),
104-
105-
form_row(form.phoneNumber, {'label': 'Phone Number'}),
106-
form_row(form.email, {'label': 'Email'}),
107-
108-
form_row(form.account, {'label': 'Account'}),
109-
form_row(form.companyName, {'label': 'Company Name'}),
110-
form_row(form.website, {'label': 'Website'}),
111-
form_row(form.numberOfEmployees, {'label': 'Number Of Employees'}),
112-
form_row(form.industry, {'label': 'Industry'}),
113-
]
118+
'data': formFields
114119
},
115120
{
116121
'title': 'Address',

src/OroCRM/Bundle/SalesBundle/Resources/views/Opportunity/update.html.twig

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,30 @@
6565
{% block content_data %}
6666
{% set id = 'opportunity-profile' %}
6767

68+
{% set formFields = [] %}
69+
{% if form.owner is defined %}
70+
{% set formFields = formFields|merge([form_row(form.owner)]) %}
71+
{% endif %}
72+
{% set formFields = formFields|merge([
73+
form_row(form.name, {'label': 'Opportunity name'|trans}),
74+
form_row(form.contact, {'label': 'Contact'|trans}),
75+
form_row(form.account, {'label': 'Account'|trans}),
76+
form_row(form.probability, {'label': 'Probability'|trans}),
77+
form_row(form.budgetAmount, {'label': 'Budget amount'|trans}),
78+
form_row(form.customerNeed, {'label': 'Customer need'|trans}),
79+
form_row(form.proposedSolution, {'label': 'Proposed solution'|trans}),
80+
form_row(form.closeReason, {'label': 'Close reason'|trans}),
81+
form_row(form.closeRevenue, {'label': 'Close revenue'|trans}),
82+
form_row(form.closeDate, {'label': 'Close date'|trans})
83+
]) %}
84+
6885
{% set dataBlocks = [{
6986
'title': 'General',
7087
'class': 'active',
7188
'subblocks': [
7289
{
7390
'title': 'Opportunity Information',
74-
'data': [
75-
form_row(form.owner),
76-
form_row(form.name, {'label': 'Opportunity name'|trans}),
77-
form_row(form.contact, {'label': 'Contact'|trans}),
78-
form_row(form.account, {'label': 'Account'|trans}),
79-
form_row(form.probability, {'label': 'Probability'|trans}),
80-
form_row(form.budgetAmount, {'label': 'Budget amount'|trans}),
81-
form_row(form.customerNeed, {'label': 'Customer need'|trans}),
82-
form_row(form.proposedSolution, {'label': 'Proposed solution'|trans}),
83-
form_row(form.closeReason, {'label': 'Close reason'|trans}),
84-
form_row(form.closeRevenue, {'label': 'Close revenue'|trans}),
85-
form_row(form.closeDate, {'label': 'Close date'|trans})
86-
]
91+
'data': formFields
8792
}
8893
]
8994
}] %}

0 commit comments

Comments
 (0)