示例#1
0
 /**
  * Tests if the row is checked out
  *
  * @access	public
  * @param	int	A user id
  * @return	boolean	True if checked out
  * @since	0.9
  */
 function isCheckedOut($uid = 0)
 {
     if ($this->_loadData()) {
         if ($uid) {
             return $this->_data->checked_out && $this->_data->checked_out != $uid;
         } else {
             return $this->_data->checked_out;
         }
     } elseif ($this->_id < 1) {
         return false;
     } else {
         RedEventError::raiseWarning(0, 'Unable to Load Data');
         return false;
     }
 }
示例#2
0
 /**
  * Delete attendees
  *
  * @return true on sucess
  * @access private
  * @since 2.5
  */
 public function remove($cid = array())
 {
     $cid = JRequest::getVar('cid', array(), 'post', 'array');
     /* Check if anything is selected */
     if (!is_array($cid) || count($cid) < 1) {
         JError::raiseError(500, JText::_('COM_REDEVENT_Select_an_item_to_delete'));
     }
     $total = count($cid);
     /* Get all submitter ID's */
     $model = $this->getModel('registrations');
     if (!$model->remove($cid)) {
         RedEventError::raiseWarning(0, JText::_("COM_REDEVENT_CANT_DELETE_REGISTRATIONS") . ': ' . $model->getError());
         echo "<script> alert('" . $model->getError() . "'); window.history.go(-1); </script>\n";
     }
     $cache = JFactory::getCache('com_redevent');
     $cache->clean();
     $msg = $total . ' ' . JText::_('COM_REDEVENT_REGISTERED_USERS_DELETED');
     $this->setRedirect('index.php?option=com_redevent&view=registrations', $msg);
 }
示例#3
0
 /**
  * Delete attendees
  *
  * @return true on sucess
  * @access private
  * @since 0.9
  */
 function move($cid = array())
 {
     $cid = JRequest::getVar('cid', array(), 'post', 'array');
     $xref = JRequest::getInt('xref');
     $dest = JRequest::getInt('dest');
     $total = count($cid);
     $formid = JRequest::getInt('form_id');
     /* Check if anything is selected */
     if (!is_array($cid) || count($cid) < 1) {
         JError::raiseError(500, JText::_('COM_REDEVENT_Select_an_attendee_to_move'));
     }
     if (!$dest) {
         /* Create the view object */
         $view = $this->getView('attendees', 'html');
         /* Standard model */
         $view->setModel($this->getModel('attendees', 'RedeventModel'), true);
         /* set layout */
         $view->setLayout('move');
         /* Now display the view */
         $view->display();
         return;
     }
     /* Get all submitter ID's */
     $model = $this->getModel('attendees');
     if (!$model->move($cid, $dest)) {
         RedEventError::raiseWarning(0, JText::_("COM_REDEVENT_ATTENDEES_CANT_MOVE_REGISTRATIONS") . ': ' . $model->getError());
         echo "<script> alert('" . $model->getError() . "'); window.history.go(-1); </script>\n";
     }
     /* Check if we have space on the waiting list */
     $model_wait = $this->getModel('waitinglist');
     $model_wait->setXrefId($xref);
     $model_wait->UpdateWaitingList();
     $model_wait->setXrefId($dest);
     $model_wait->UpdateWaitingList();
     $cache = JFactory::getCache('com_redevent');
     $cache->clean();
     $msg = $total . ' ' . JText::_('COM_REDEVENT_ATTENDEES_MOVED');
     $this->setRedirect('index.php?option=com_redevent&view=attendees&xref=' . $dest, $msg);
 }