326 $coreWidget = clone $this;
327 $copyWidget =
new Widget();
328 $copyWidget->setBoardId($coreWidget->getBoardId());
329 $copyWidget->setWidgetClass($coreWidget->getWidgetClass());
330 $copyWidget->setViewKey($coreWidget->getViewKey());
331 $copyWidget->setGId($coreWidget->getGId());
332 $copyWidget->setWeight($coreWidget->getWeight());
333 $copyWidget->setOwnerId($USER->getID());
334 if ($coreWidget->getId())
336 $copyWidget->setParentWidgetId($coreWidget->getId());
340 $copyWidget->setParentWidgetId($coreWidget->getId());
343 $reports = $coreWidget->getReports();
349 $report->loadAttribute(
'configurations');
350 $reportCopy = $report->getCopy();
351 $reportCopy->setWidget($copyWidget);
352 $reportCopy->setWidgetId(
null);
353 $copyWidget->addReports($reportCopy);
363 $configuration->setId(
null);
364 $copyWidget->addConfigurations($configuration);