Beispiel #1
0
 function __construct($config)
 {
     parent::__construct($config);
     $id = JRequest::getInt('id');
     $ticketCode = JRequest::getVar('ticket_code');
     if ($id > 0) {
         $this->setId($id);
     }
     if ($ticketCode) {
         $this->setTicketCode($ticketCode);
     }
 }
Beispiel #2
0
 function store(&$data)
 {
     if ($data['id']) {
         $isNew = false;
     } else {
         $isNew = true;
     }
     parent::store($data);
     if ($isNew) {
         //Update country ID
         $db = $this->getDbo();
         $query = $db->getQuery(true);
         $query->update('#__osmembership_states')->set('state_id=id')->where('id=' . (int) $data['id']);
         $db->setQuery($query);
         $db->execute();
     }
     return true;
 }
Beispiel #3
0
 function __construct($config)
 {
     $config['table_name'] = '#__osmembership_subscribers';
     parent::__construct($config);
     $this->setId(JRequest::getInt('id'));
 }
Beispiel #4
0
 function __construct($config)
 {
     parent::__construct($config);
     $this->setId(JRequest::getInt('id'));
 }
Beispiel #5
0
 public function __construct($config)
 {
     $config['table_name'] = '#__osmembership_subscribers';
     parent::__construct($config);
 }
Beispiel #6
0
 /**
  * Handling publish, unpublish subscriber by clicking on publish button in the checkbox
  * Allows running OSMembership Plugins 
  * @see OSModel::publish()
  */
 function publish($cid, $state)
 {
     if (count($cid)) {
         if ($state == 1) {
             $row = $this->getTable('OsMembership', 'Subscriber');
             JPluginHelper::importPlugin('osmembership');
             $dispatcher = JDispatcher::getInstance();
             foreach ($cid as $id) {
                 $row->load($id);
                 if (!$row->published) {
                     $dispatcher->trigger('onMembershipActive', array($row));
                     OSMembershipHelper::sendMembershipApprovedEmail($row);
                 }
             }
         }
         parent::publish($cid, $state);
     }
     return true;
 }
Beispiel #7
0
 function __construct($config)
 {
     $config['table_name'] = '#__osmembership_upgraderules';
     parent::__construct($config);
 }
Beispiel #8
0
 /**
  * Delete related data
  * @see OSModel::delete()
  */
 function delete($cid = array())
 {
     $db = $this->getDbo();
     $query = $db->getQuery(true);
     $query->delete('#__osmembership_articles')->where('plan_id IN (' . implode(',', $cid) . ')');
     $db->setQuery($query);
     $db->execute();
     //Delete from URL tables as well
     if (JPluginHelper::isEnabled('osmembership', 'urls')) {
         $query->clear();
         $query->delete('#__osmembership_urls')->where('plan_id IN (' . implode(',', $cid) . ')');
         $db->setQuery($query);
         $db->execute();
     }
     return parent::delete($cid);
 }