Skip to content

Commit d3ffafd

Browse files
committed
Merge remote-tracking branch 'remotes/dev/release'
2 parents 177b2f1 + d45d286 commit d3ffafd

File tree

130 files changed

+5327
-619
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+5327
-619
lines changed

Diff for: CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
CHANGELOG for 1.0.0-beta5
2+
===================
3+
This changelog references the relevant changes (new features, changes and bugs) done in 1.0.0-beta5 versions.
4+
5+
* 1.0.0-beta5 (2013-12-05)
6+
* Reports creation wizard (Table reports)
7+
* B2B Sales Flow adjustments
8+
* Call entity
9+
* Add weather layer in the map on contact view page
10+
111
CHANGELOG for 1.0.0-beta4
212
===================
313
This changelog references the relevant changes (new features, changes and bugs) done in 1.0.0-beta4 versions.

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"require": {
1212
"php": ">=5.4.4",
13-
"oro/platform": "1.0.0-beta4"
13+
"oro/platform": "1.0.0-beta5
1414
},
1515
"minimum-stability": "dev"
1616
}

Diff for: src/OroCRM/Bundle/AccountBundle/Controller/AccountController.php

+24
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
use Oro\Bundle\SecurityBundle\Annotation\AclAncestor;
1919

2020
use Oro\Bundle\EntityConfigBundle\Config\ConfigInterface;
21+
use Oro\Bundle\EntityConfigBundle\Entity\OptionSetRelation;
22+
use Oro\Bundle\EntityConfigBundle\Entity\Repository\OptionSetRelationRepository;
2123
use Oro\Bundle\EntityConfigBundle\Metadata\EntityMetadata;
2224

2325
use Oro\Bundle\EntityExtendBundle\Extend\ExtendManager;
@@ -147,6 +149,7 @@ protected function update(Account $entity = null)
147149
/**
148150
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
149151
* @SuppressWarnings(PHPMD.NPathComplexity)
152+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
150153
* TODO: will be refactored via twig extension
151154
*/
152155
protected function getDynamicFields(Account $entity)
@@ -186,6 +189,27 @@ function (ConfigInterface $config) use ($viewProvider, $extendProvider) {
186189
$value = $value->format($configFormat);
187190
}
188191

192+
/** Prepare OptionSet field type */
193+
if ($field->getId()->getFieldType() == 'optionSet') {
194+
/** @var OptionSetRelationRepository */
195+
$osr = $configManager->getEntityManager()->getRepository(OptionSetRelation::ENTITY_NAME);
196+
197+
$model = $extendProvider->getConfigManager()->getConfigFieldModel(
198+
$field->getId()->getClassName(),
199+
$field->getId()->getFieldName()
200+
);
201+
202+
$value = $osr->findByFieldId($model->getId(), $entity->getId());
203+
array_walk(
204+
$value,
205+
function (&$item) {
206+
$item = ['title' => $item->getOption()->getLabel()];
207+
}
208+
);
209+
210+
$value['values'] = $value;
211+
}
212+
189213
/** Prepare Relation field type */
190214
if ($value instanceof PersistentCollection) {
191215
$collection = $value;

Diff for: src/OroCRM/Bundle/AccountBundle/Controller/Api/Rest/AccountController.php

+12-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,18 @@ class AccountController extends RestController implements ClassResourceInterface
2828
/**
2929
* REST GET list
3030
*
31-
* @QueryParam(name="page", requirements="\d+", nullable=true, description="Page number, starting from 1. Defaults to 1.")
32-
* @QueryParam(name="limit", requirements="\d+", nullable=true, description="Number of items per page. defaults to 10.")
31+
* @QueryParam(
32+
* name="page",
33+
* requirements="\d+",
34+
* nullable=true,
35+
* description="Page number, starting from 1. Defaults to 1."
36+
* )
37+
* @QueryParam(
38+
* name="limit",
39+
* requirements="\d+",
40+
* nullable=true,
41+
* description="Number of items per page. defaults to 10."
42+
* )
3343
* @ApiDoc(
3444
* description="Get all account items",
3545
* resource=true

Diff for: src/OroCRM/Bundle/AccountBundle/DependencyInjection/Configuration.php

-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
66
use Symfony\Component\Config\Definition\ConfigurationInterface;
77

8-
/**
9-
* This is the class that validates and merges configuration from your app/config files
10-
*
11-
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
12-
*/
138
class Configuration implements ConfigurationInterface
149
{
1510
/**

Diff for: src/OroCRM/Bundle/AccountBundle/Resources/config/services.yml

+1-1
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'

Diff for: src/OroCRM/Bundle/AccountBundle/Resources/views/Account/view.html.twig

+31-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
{% import 'OroDataGridBundle::macros.html.twig' as dataGrid %}
66
{% oro_title_set({params : {"%account.name%": entity.name|default('N/A')} }) %}
77
{% set audit_entity_class = 'OroCRM_Bundle_AccountBundle_Entity_Account' %}
8-
{% set gridName = 'account-contacts-view-grid' %}
98

109
{% block navButtons %}
1110
{% if resource_granted('orocrm_contact_create') %}
@@ -138,12 +137,37 @@
138137
EntityExtend fields END
139138
#}
140139

141-
{% set dataBlocks = dataBlocks|merge([{'title' : 'Contacts', 'subblocks': [{'title' : null, 'data' : [dataGrid.renderGrid(gridName, {account: entity.id}, { cssClass: 'inner-grid' })], 'useSpan': false}] }])%}
140+
{% set dataBlocks = dataBlocks|merge([{
141+
'title' : 'Contacts',
142+
'subblocks': [
143+
{
144+
'title' : null,
145+
'data' : [dataGrid.renderGrid('account-contacts-view-grid', {account: entity.id}, { cssClass: 'inner-grid' })],
146+
'useSpan': false
147+
}
148+
]
149+
}]) %}
142150

143-
{% set data =
144-
{
145-
'dataBlocks': dataBlocks,
146-
}
147-
%}
151+
{% if resource_granted('orocrm_call_view') %}
152+
{% set dataBlocks = dataBlocks|merge([{
153+
'title' : 'Calls',
154+
'subblocks': [
155+
{
156+
'title' : null,
157+
'data' : [
158+
oro_widget_render({
159+
'widgetType': 'buttons',
160+
'url': path('orocrm_call_widget_calls', {accountId: entity.id}),
161+
'alias': 'account_calls',
162+
'cssClass': 'inner-grid',
163+
})
164+
],
165+
'useSpan': false
166+
}
167+
]
168+
}]) %}
169+
{% endif %}
170+
171+
{% set data = {'dataBlocks': dataBlocks} %}
148172
{{ parent() }}
149173
{% endblock content_data %}

Diff for: src/OroCRM/Bundle/AccountBundle/Resources/views/Account/widget/contactDatagrid.html.twig

+55-54
Original file line numberDiff line numberDiff line change
@@ -26,64 +26,65 @@
2626

2727
<script type="text/javascript">
2828
{% set wid = app.request.get('_wid') %}
29-
require(['jquery', 'oro/datagrid/callback-listener', 'oro/widget-manager', 'oro/multiple-entity/model',
30-
'oro/formatter/name', 'oro/registry'],
31-
function($, CallbackListener, WidgetManager, MultipleEntityModel, nameFormatter, registry) {
32-
var addedModels = {};
33-
WidgetManager.getWidgetInstance({{ wid|json_encode|raw }}, function(widget) {
34-
if (widget.options.type == 'dialog') {
35-
widget.getWidget().css({
36-
'padding': 0,
37-
'max-height': 500,
38-
'overflow': 'auto'
39-
});
40-
}
41-
42-
widget.getAction('select', 'adopted', function(selectBtn) {
43-
selectBtn.click(function() {
44-
var addedVal = $('#appendContacts').val();
45-
var removedVal = $('#removeContacts').val();
46-
var appendedIds = addedVal.length ? addedVal.split(',') : [];
47-
var removedIds = removedVal.length ? removedVal.split(',') : [];
48-
widget.trigger('completeSelection', appendedIds, addedModels, removedIds);
49-
// remove datagrid when widget goes be removed
50-
registry.setElement('datagrid', {{ gridName|json_encode|raw }}, undefined);
51-
});
52-
});
29+
require(['jquery', 'routing', 'oro/datagrid/callback-listener', 'oro/widget-manager',
30+
'oro/multiple-entity/model', 'oro/formatter/name'],
31+
function($, routing, CallbackListener, WidgetManager, MultipleEntityModel, nameFormatter) {
32+
var addedModels = {};
33+
WidgetManager.getWidgetInstance({{ wid|json_encode|raw }}, function(widget) {
34+
if (widget.options.type == 'dialog') {
35+
widget.getWidget().css({
36+
'padding': 0,
37+
'max-height': 500,
38+
'overflow': 'auto'
5339
});
40+
}
5441
55-
$(function() {
56-
/** @type {oro.datagrid.CallbackListener} */
57-
new CallbackListener({
58-
datagridName: {{ gridName|json_encode|raw }},
59-
dataField: 'id',
60-
columnName: 'hasContact',
61-
processCallback: function (value, model, listener) {
62-
var isActive = model.get(listener.columnName);
63-
var id = model.get('id');
64-
if (isActive) {
65-
addedModels[id] = new MultipleEntityModel({
66-
'id': model.get('id'),
67-
'link': Routing.generate('orocrm_contact_info', {id: model.get('id')}),
68-
'label': nameFormatter.format(model.toJSON()),
69-
'extraData': [
70-
{
71-
'label': 'Phone',
72-
'value': model.get('primaryPhone')
73-
},
74-
{
75-
'label': 'Email',
76-
'value': model.get('primaryEmail')
77-
}
78-
]
79-
});
80-
} else if (addedModels.hasOwnProperty(id)) {
81-
delete addedModels[id];
82-
}
83-
}
84-
});
42+
widget.getAction('select', 'adopted', function(selectBtn) {
43+
selectBtn.click(function() {
44+
var addedVal = $('#appendContacts').val();
45+
var removedVal = $('#removeContacts').val();
46+
var appendedIds = addedVal.length ? addedVal.split(',') : [];
47+
var removedIds = removedVal.length ? removedVal.split(',') : [];
48+
widget.trigger('completeSelection', appendedIds, addedModels, removedIds);
8549
});
8650
});
51+
});
52+
53+
var gridName = {{ gridName|json_encode|raw }};
54+
55+
$(function () {
56+
/** @type {oro.datagrid.CallbackListener} */
57+
new CallbackListener({
58+
$gridContainer: $('#grid-' + gridName),
59+
gridName: gridName,
60+
dataField: 'id',
61+
columnName: 'hasContact',
62+
processCallback: function (value, model, listener) {
63+
var isActive = model.get(listener.columnName);
64+
var id = model.get('id');
65+
if (isActive) {
66+
addedModels[id] = new MultipleEntityModel({
67+
'id': model.get('id'),
68+
'link': routing.generate('orocrm_contact_info', {id: model.get('id')}),
69+
'label': nameFormatter.format(model.toJSON()),
70+
'extraData': [
71+
{
72+
'label': 'Phone',
73+
'value': model.get('primaryPhone')
74+
},
75+
{
76+
'label': 'Email',
77+
'value': model.get('primaryEmail')
78+
}
79+
]
80+
});
81+
} else if (addedModels.hasOwnProperty(id)) {
82+
delete addedModels[id];
83+
}
84+
}
85+
});
86+
});
87+
});
8788
</script>
8889

8990
<div class="widget-actions">

0 commit comments

Comments
 (0)