$db->query();
} else {
    $db->setQuery("UPDATE #__extensions SET `enabled`='1' WHERE `type`='plugin' AND `element`='rsticketsprocontent' AND `folder`='search'");
    $db->query();
}
$plg_installer->install($this->parent->getPath('source') . DS . 'plg_user');
if (!RSTicketsProHelper::isJ16()) {
    $db->setQuery("UPDATE #__plugins SET published=1, ordering=900 WHERE `element`='rsticketspro' AND `folder`='user'");
    $db->query();
    require_once JPATH_SITE . DS . 'plugins' . DS . 'user' . DS . 'rsticketspro.php';
    plgUserRSTicketsPro::onLoginUser($user = array(), $options = array());
} else {
    $db->setQuery("UPDATE #__extensions SET `enabled`='1' WHERE `type`='plugin' AND `element`='rsticketspro' AND `folder`='user'");
    $db->query();
    require_once JPATH_SITE . DS . 'plugins' . DS . 'user' . DS . 'rsticketspro' . DS . 'rsticketspro.php';
    plgUserRSTicketsPro::onLoginUser($user = array(), $options = array());
}
// R2
$db->setQuery("SELECT lang FROM #__rsticketspro_emails WHERE `message` LIKE '%option=com_rstickets%' AND `message` NOT LIKE '%option=com_rsticketspro%'");
if ($db->getNumRows($db->query())) {
    $db->setQuery("UPDATE #__rsticketspro_emails SET `message`=REPLACE(`message`, 'option=com_rstickets', 'option=com_rsticketspro') WHERE `message` LIKE '%option=com_rstickets%' AND `message` NOT LIKE '%option=com_rsticketspro%'");
    $db->query();
}
$db->setQuery("SHOW COLUMNS FROM `#__rsticketspro_configuration` WHERE Field='value'");
$result = $db->loadObject();
if (strtolower($result->Type) != 'text') {
    $db->setQuery("ALTER TABLE `#__rsticketspro_configuration` CHANGE `value` `value` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL");
    if (!$db->query()) {
        $db->setQuery("ALTER TABLE `#__rsticketspro_configuration` CHANGE `value` `value` TEXT NOT NULL");
        $db->query();
    }
示例#2
0
 function save()
 {
     $row =& JTable::getInstance('RSTicketsPro_Staff', 'Table');
     $post = JRequest::get('post');
     $post['signature'] = JRequest::getVar('signature', '', 'post', 'none', JREQUEST_ALLOWHTML);
     if (!$row->bind($post)) {
         return JError::raiseWarning(500, $row->getError());
     }
     if ($row->store()) {
         $this->_db->setQuery("DELETE FROM #__rsticketspro_staff_to_department WHERE `user_id`='" . $row->user_id . "'");
         $this->_db->query();
         foreach ($post['department_id'] as $department_id) {
             $department_id = (int) $department_id;
             if (empty($department_id)) {
                 continue;
             }
             $this->_db->setQuery("INSERT INTO #__rsticketspro_staff_to_department SET `department_id`='" . $department_id . "', `user_id`='" . $row->user_id . "'");
             $this->_db->query();
         }
         $this->_id = $row->id;
         return true;
     } else {
         JError::raiseWarning(500, $row->getError());
         return false;
     }
     if (class_exists('plgUserRSTicketsPro')) {
         plgUserRSTicketsPro::onLoginUser($user = array(), $options = array());
     }
 }