Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/dev/1.10' into 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrebenchuk committed Jan 3, 2017
2 parents aa6a8f9 + a0c5a48 commit f82f1db
Show file tree
Hide file tree
Showing 95 changed files with 1,972 additions and 224 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"components/font-awesome": "~4.3.0",
"piwik/device-detector": "~3.0",
"oro/jsplumb": "~1.7",
"oro/moment-timezone": "0.3.*",
"oro/moment-timezone": "0.5.*",
"vakata/jstree": "^3.2",
"symfony/polyfill-php70":"1.*",
"liuggio/excelbundle": "~2.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,13 @@ define(function(require) {
* @param {ActivityModel} model
*/
onViewActivity: function(model) {
this.initComments(model);
if (model.get('is_loaded') === true) {
this.initComments(model);
} else {
model.once('change:contentHTML', function(model) {
this.initComments(model);
}, this);
}
},

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,7 @@ define(function(require) {
model = this.collection.findSameActivity(oldViewState.attrs);
if (model) {
view = this.getItemView(model);
model.set('is_loaded', false);
if (view && !oldViewState.collapsed) {
if (view && !oldViewState.collapsed && view.isCollapsed()) {
view.toggle();
view.getAccorditionBody().addClass('in');
view.getAccorditionToggle().removeClass('collapsed');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testBeforeSave()
$this->assertNotNull($address->getCreated());
$this->assertNotNull($address->getUpdated());

$this->assertEquals($address->getCreated(), $address->getUpdated());
$this->assertEquals($address->getCreated(), $address->getUpdated(), '', 1);
}

public function testGetRegionName()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace Oro\Bundle\CalendarBundle\Datagrid\MassAction;

use Doctrine\ORM\EntityManager;

use Oro\Bundle\DataGridBundle\Extension\MassAction\DeleteMassActionHandler as ParentHandler;

/**
* Class DeleteMassActionHandler
*
* @package Oro\Bundle\CalendarBundle\Datagrid\MassAction
*/
class DeleteMassActionHandler extends ParentHandler
{
/**
* {@inheritDoc}
*/
protected function processDelete($entity, EntityManager $manager)
{
if ($entity->getRecurringEvent()) {
$event = $entity->getRealCalendarEvent();
$event->setCancelled(true);

$childEvents = $event->getChildEvents();
foreach ($childEvents as $childEvent) {
$childEvent->setCancelled(true);
}
} else {
if ($entity->getRecurrence() && $entity->getRecurrence()->getId()) {
$manager->remove($entity->getRecurrence());
}

if ($entity->getRecurringEvent()) {
$event = $entity->getRealCalendarEvent();
$childEvents = $event->getChildEvents();
foreach ($childEvents as $childEvent) {
$manager->remove($childEvent);
}
}
$manager->remove($entity);
}

return $this;
}
}
10 changes: 9 additions & 1 deletion src/Oro/Bundle/CalendarBundle/Resources/config/datagrid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ datagrid:
type: orm
query:
select:
- partial event.{ id, start, recurrence }
- partial event.{ id, start, recurrence, cancelled }
- event.id
- CONCAT(CASE WHEN calendar.name IS NOT NULL THEN calendar.name ELSE CONCAT_WS(' ', owner.firstName, owner.lastName) END, '') AS name
- event.title
Expand Down Expand Up @@ -164,6 +164,14 @@ datagrid:
icon: trash
link: delete_link
action_configuration: ['@oro_calendar.datagrid.action_permission_provider', "getInvitationPermissions"]
mass_actions:
delete:
type: delete
icon: trash
label: oro.grid.action.delete
entity_name: Oro\Bundle\CalendarBundle\Entity\CalendarEvent
data_identifier: event.id
handler: oro_calendar.datagrid.mass_action.handler.delete
options:
entityHint: calendar_events
entity_pagination: true
Expand Down
4 changes: 4 additions & 0 deletions src/Oro/Bundle/CalendarBundle/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -410,3 +410,7 @@ services:
class: '%oro_calendar.validator.calendar_event.class%'
tags:
- { name: validator.constraint_validator, alias: oro_calendar.calendar_event_validator }

oro_calendar.datagrid.mass_action.handler.delete:
class: Oro\Bundle\CalendarBundle\Datagrid\MassAction\DeleteMassActionHandler
parent: oro_datagrid.extension.mass_action.handler.delete
Loading

0 comments on commit f82f1db

Please sign in to comment.