private function publishNow(Operation $operation, Form $form)
 {
     if ($form->get('campaignchain_hook_campaignchain_due')->has('execution_choice') && $form->get('campaignchain_hook_campaignchain_due')->get('execution_choice')->getData() == 'now') {
         $this->job->execute($operation->getId());
         $content = $this->contentService->getSlideshowByOperation($operation);
         $this->session->getFlashBag()->add('success', 'The slide show was published. <a href="' . $content->getUrl() . '">View it on SlideShare.net</a>.');
         return true;
     }
     return false;
 }
 public function getContent(Operation $operation)
 {
     return $this->getNewsItemByOperation($operation->getId());
 }
 public function getContent(Operation $operation)
 {
     return $this->getStatusByOperation($operation->getId());
 }
 public function getEditModalRenderOptions(Operation $operation)
 {
     // Get Webinar info.
     $webinar = $this->contentService->getWebinarByOperation($operation->getId());
     // TODO: Check if Webinar dates were edited on GoToWebinar.
     return array('template' => 'CampaignChainOperationGoToWebinarBundle::read_modal.html.twig', 'vars' => array('webinar' => $webinar, 'show_date' => true, 'operation' => $operation, 'activity' => $operation->getActivity()));
 }
 private function publishNow(Operation $operation, Form $form, $content)
 {
     if ($form->get('campaignchain_hook_campaignchain_due')->has('execution_choice') && $form->get('campaignchain_hook_campaignchain_due')->get('execution_choice')->getData() == 'now') {
         $this->job->execute($operation->getId());
         $content = $this->contentService->getNewsletterByOperation($operation);
         $this->session->getFlashBag()->add('success', 'The newsletter was published. <a href="' . $content->getArchiveUrl() . '">View it on MailChimp</a>.');
         return true;
     } else {
         // Unschedule the newsletter on MailChimp if it was scheduled there,
         // to let CampaignChain handle the scheduling.
         $remoteNewsletter = $this->getRemoteNewsletter();
         if ($remoteNewsletter['status'] == 'schedule') {
             $client = $this->getRestApiConnectionByOperation($operation);
             $client->campaigns->unschedule($content->getCampaignId());
         }
     }
     return false;
 }
 public function getContent(Operation $operation)
 {
     return $this->getWebinarByOperation($operation->getId());
 }
 public function getContent(Operation $operation)
 {
     return $this->getSocialMediaScheduleByOperation($operation->getId());
 }
 public function getContent(Operation $operation)
 {
     return $this->getSlideshowByOperation($operation->getId());
 }
 private function publishNow(Operation $operation, Form $form)
 {
     if ($form->get('campaignchain_hook_campaignchain_due')->has('execution_choice') && $form->get('campaignchain_hook_campaignchain_due')->get('execution_choice')->getData() == 'now') {
         $this->job->execute($operation->getId());
         $content = $this->contentService->getSocialMediaScheduleByOperation($operation);
         foreach ($content->getLocations() as $location) {
             $flashMsgPart = '<li><a href="' . $location->getUrl() . '">View it on ' . $location->getName() . ' (' . $location->getLocationModule()->getDisplayName() . ')</a></li>';
         }
         $this->session->getFlashBag()->add('success', 'The message was published on these Locations:' . '<ul>' . $flashMsgPart . '</ul>');
         return true;
     }
     return false;
 }
 public function getContent(Operation $operation)
 {
     return $this->getMessageByOperation($operation->getId());
 }