/**
  * Publishs / unpublish the booking
  *
  * @return  void
  */
 public function publish()
 {
     $cid = JFactory::getApplication()->input->get('cid', array(), 'array');
     if ($this->task == 'publish') {
         $status = MatukioHelperUtilsBooking::$ACTIVE;
     } else {
         $status = MatukioHelperUtilsBooking::$PENDING;
     }
     MatukioHelperUtilsBooking::changeStatusBooking($cid, $status, true);
     $msg = "";
     $link = 'index.php?option=com_matukio&view=bookings';
     $this->setRedirect($link, $msg);
 }
 /**
  * Cancels the booking
  *
  * @throws  Exception - if access is denied!
  * @return object
  */
 public function activateBooking()
 {
     if (!JFactory::getUser()->authorise('core.edit.own', 'com_matukio')) {
         throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
     }
     $eventid = JFactory::getApplication()->input->getInt('cid', 0);
     $link = JRoute::_("index.php?option=com_matukio&view=participants&cid=" . $eventid . "&art=2");
     $msg = JText::_("COM_MATUKIO_BOOKING_SET_ACTIVE_SUCCESSFULL");
     $booking_ids = JFactory::getApplication()->input->get('uid', array(), 'array');
     // Set db status to deleted @since 3.1
     MatukioHelperUtilsBooking::changeStatusBooking($booking_ids, MatukioHelperUtilsBooking::$ACTIVE, true);
     $this->setRedirect($link, $msg);
 }