Exemplo n.º 1
0
 /**
  * @param WidgetOptionsLoadEvent $event
  */
 public function loadAggregatedFieldsWidgetOptions(WidgetOptionsLoadEvent $event)
 {
     if ($event->getWidgetType() !== 'oro_report') {
         return;
     }
     $event->setWidgetOptions(array_merge_recursive($event->getWidgetOptions(), ['extensions' => ['orosegment/js/app/components/aggregated-field-condition-extension']]));
 }
 public function testGettersAndSetters()
 {
     $originalOptions = ['oo' => 'ov'];
     $options = ['option1' => 'val'];
     $event = new WidgetOptionsLoadEvent($originalOptions);
     $this->assertEquals($originalOptions, $event->getWidgetOptions());
     $event->setWidgetOptions($options);
     $this->assertEquals($options, $event->getWidgetOptions());
 }
 /**
  * @param WidgetOptionsLoadEvent $event
  */
 public function onLoad(WidgetOptionsLoadEvent $event)
 {
     $widgetOptions = $event->getWidgetOptions();
     $fieldsLoader = $widgetOptions['fieldsLoader'];
     $auditFilters = array_map(function ($filter) {
         if (isset($filter['dateParts'], $filter['dateParts']['value'])) {
             $filter['dateParts'] = ['value' => $filter['dateParts']['value']];
         }
         return $filter;
     }, $widgetOptions['metadata']['filters']);
     $event->setWidgetOptions(array_merge_recursive($widgetOptions, ['auditFilters' => $auditFilters, 'auditFieldsLoader' => ['entityChoice' => $fieldsLoader['entityChoice'], 'loadingMaskParent' => $fieldsLoader['loadingMaskParent'], 'router' => 'oro_api_get_audit_fields', 'routingParams' => [], 'fieldsData' => $this->getAuditFields(), 'confirmMessage' => $fieldsLoader['confirmMessage']], 'extensions' => ['orodataaudit/js/app/components/segment-component-extension']]));
 }
 /**
  * @param WidgetOptionsLoadEvent $event
  *
  * @return array
  */
 public function onLoad(WidgetOptionsLoadEvent $event)
 {
     $event->setWidgetOptions(array_merge_recursive($event->getWidgetOptions(), ['extensions' => ['oroactivitylist/js/app/components/segment-component-extension']]));
 }