Beispiel #1
0
/**
 * Uninstall file for PhatForm v2
 *
 * Rewritten to work with phpwebsite 1.0
 * @version $Id$
 */
function phatform_uninstall(&$content)
{
    $db = new PHPWS_DB('mod_phatform_forms');
    $db->addColumn('id');
    $db->addColumn('archiveTableName');
    $db->addWhere('saved', 1);
    $result = $db->select();
    if (!empty($result)) {
        foreach ($result as $form) {
            if (empty($form['archiveTableName'])) {
                $table = 'mod_phatform_form_' . $form['id'];
                if (PHPWS_DB::isTable($table)) {
                    PHPWS_DB::dropTable($table);
                }
            } else {
                $table = $form['archiveTableName'];
                PHPWS_DB::dropTable($table);
            }
        }
        $content[] = dgettext('phatform', 'Removed all dynamic Form Generator tables.');
    }
    PHPWS_DB::dropTable('mod_phatform_forms');
    PHPWS_DB::dropTable('mod_phatform_options');
    PHPWS_DB::dropTable('mod_phatform_textfield');
    PHPWS_DB::dropTable('mod_phatform_textarea');
    PHPWS_DB::dropTable('mod_phatform_dropbox');
    PHPWS_DB::dropTable('mod_phatform_multiselect');
    PHPWS_DB::dropTable('mod_phatform_radiobutton');
    PHPWS_DB::dropTable('mod_phatform_checkbox');
    $content[] = dgettext('phatform', 'All Form Generator static tables removed.');
    return TRUE;
}
Beispiel #2
0
/**
 * Uninstall file for access
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function access_uninstall(&$content)
{
    PHPWS_DB::dropTable('access_shortcuts');
    PHPWS_DB::dropTable('access_allow_deny');
    $content[] = dgettext('access', 'Access tables removed.');
    return TRUE;
}
Beispiel #3
0
/**
 * Uninstall file for block
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function block_uninstall(&$content)
{
    PHPWS_DB::dropTable('block');
    PHPWS_DB::dropTable('block_pinned');
    $content[] = dgettext('block', 'Block tables removed.');
    return true;
}
Beispiel #4
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function pagesmith_uninstall(&$content)
{
    PHPWS_DB::dropTable('ps_block');
    PHPWS_DB::dropTable('ps_text');
    PHPWS_DB::dropTable('ps_page');
    $content[] = 'Tables removed.';
    return TRUE;
}
Beispiel #5
0
/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function checkin_uninstall(&$content)
{
    PHPWS_DB::dropTable('checkin_staff');
    PHPWS_DB::dropTable('checkin_reasons');
    PHPWS_DB::dropTable('checkin_visitor');
    PHPWS_DB::dropTable('checkin_rtos');
    return true;
}
Beispiel #6
0
/**
 * Uninstall file for menu
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function menu_uninstall(&$content)
{
    PHPWS_DB::dropTable('menu_links');
    PHPWS_DB::dropTable('menus');
    PHPWS_DB::dropTable('menu_assoc');
    $content[] = dgettext('menu', 'Menu tables removed.');
    return TRUE;
}
Beispiel #7
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function signup_uninstall(&$content)
{
    PHPWS_DB::dropTable('signup_sheet');
    PHPWS_DB::dropTable('signup_peeps');
    PHPWS_DB::dropTable('signup_slots');
    $content[] = dgettext('signup', 'Signup tables dropped.');
    return true;
}
Beispiel #8
0
/**
 * Wiki for phpWebSite
 *
 * See docs/CREDITS for copyright information
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * @package Wiki
 * @author Greg Meiste <*****@*****.**>
 */
function wiki_uninstall(&$content)
{
    PHPWS_DB::dropTable('wiki_pages');
    PHPWS_DB::dropTable('wiki_images');
    PHPWS_DB::dropTable('wiki_interwiki');
    $content[] = dgettext('wiki', 'Wiki tables removed.');
    return TRUE;
}
Beispiel #9
0
/**
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @package Global
 * @license http://opensource.org/licenses/lgpl-3.0.html
 */
function analytics_uninstall(&$content)
{
    PHPWS_DB::dropTable('analytics_tracker_owa');
    PHPWS_DB::dropTable('analytics_tracker_piwik');
    PHPWS_DB::dropTable('analytics_tracker_google');
    PHPWS_DB::dropTable('analytics_tracker');
    $content[] = dgettext('analytics', 'Analytics tables removed.');
    return TRUE;
}
Beispiel #10
0
/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function calendar_uninstall(&$content)
{
    PHPWS_Core::initModClass('calendar', 'Schedule.php');
    // Need functions to remove old event tables
    $db = new PHPWS_DB('calendar_schedule');
    $schedules = $db->getObjects('Calendar_Schedule');
    if (PHPWS_Error::isError($schedules)) {
        return $schedules;
    } elseif (empty($schedules)) {
        $result = PHPWS_DB::dropTable('calendar_schedule');
        if (PHPWS_Error::isError($result)) {
            return $result;
        }
        $result = PHPWS_DB::dropTable('calendar_notice');
        if (PHPWS_Error::isError($result)) {
            return $result;
        }
        $result = PHPWS_DB::dropTable('calendar_suggestions');
        if (PHPWS_Error::isError($result)) {
            return $result;
        }
        return true;
    }
    $error = false;
    foreach ($schedules as $sch) {
        $result = $sch->delete();
        if (PHPWS_Error::isError($result)) {
            PHPWS_Error::log($result);
            $error = true;
        }
    }
    $result = PHPWS_DB::dropTable('calendar_schedule');
    if (PHPWS_Error::isError($result)) {
        return $result;
    }
    $result = PHPWS_DB::dropTable('calendar_notice');
    if (PHPWS_Error::isError($result)) {
        return $result;
    }
    $result = PHPWS_DB::dropTable('calendar_suggestions');
    if (PHPWS_Error::isError($result)) {
        return $result;
    }
    if (PHPWS_DB::isTable('converted')) {
        $db2 = new PHPWS_DB('converted');
        $db2->addWhere('convert_name', array('schedule', 'calendar'));
        $db2->delete();
        $content[] = dgettext('calendar', 'Removed convert flag.');
    }
    if (!$error) {
        $content[] = dgettext('calendar', 'Calendar tables removed.');
    } else {
        $content[] = dgettext('calendar', 'Some errors occurred when uninstalling Calendar.');
    }
    return true;
}
Beispiel #11
0
/**
 * See docs/AUTHORS and docs/COPYRIGHT for relevant info.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 *
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @package
 * @license http://opensource.org/licenses/gpl-3.0.html
 */
function properties_uninstall(&$content)
{
    PHPWS_DB::dropTable('properties');
    PHPWS_DB::dropTable('prop_contacts');
    PHPWS_DB::dropTable('prop_photo');
    PHPWS_DB::dropTable('prop_roommate');
    PHPWS_DB::dropTable('prop_report');
    PHPWS_DB::dropTable('prop_messages');
    PHPWS_DB::dropTable('prop_blocked');
    $content[] = 'Properties tables removed.';
    return TRUE;
}
Beispiel #12
0
/**
 * Description
 * @author Jeff Tickle <jtickle at tux dot appstate dot edu>
 */
function pulse_update(&$content, $currentVersion)
{
    switch ($currentVersion) {
        case version_compare($currentVersion, '1.9.1', '<'):
            if (PHPWS_Error::logIfError(PHPWS_DB::dropTable('pulse_schedule'))) {
                $content[] = 'Could not drop pulse_schedule table.';
                return;
            }
            $result = PHPWS_DB::importFile(PHPWS_SOURCE_DIR . 'mod/pulse/boost/install.sql');
            if (PHPWS_Error::logIfError($result)) {
                $content[] = 'Could not run install.sql.';
                return;
            }
            $content[] = '<pre>Replaced pulse_schedule table</pre>';
        case version_compare($currentVersion, '2.0.0', '<'):
            if (PHPWS_Error::logIfError(PHPWS_DB::dropTable('pulse_schedule'))) {
                $content[] = 'Could not drop pulse_schedule table.';
                return;
            }
            $db = Database::newDB();
            $db->begin();
            try {
                $pulse = new \pulse\PulseSchedule();
                $st = $pulse->createTable($db);
            } catch (\Exception $e) {
                $error_query = $pulse->createQuery();
                if (isset($st) && $db->tableExists($st->getName())) {
                    $st->drop();
                }
                $content[] = 'Query:' . $error_query;
                $db->rollback();
                throw $e;
            }
            $db->commit();
            $content[] = 'New Pulse Schedule table created. ALL OLD SCHEDULES HAVE BEEN REMOVED!';
    }
    return TRUE;
}
Beispiel #13
0
 /**
  * Fully deletes this form and it's elements
  *
  * @access public
  */
 function delete()
 {
     if (is_array($this->_elements)) {
         foreach ($this->_elements as $value) {
             $elementInfo = explode(':', $value);
             $this->element = new $elementInfo[0]($elementInfo[1]);
             $this->element->kill();
         }
     }
     /* If the form is saved archive all data in it's table and remove the table. */
     if ($this->isSaved()) {
         $this->report = new PHAT_Report();
         PHPWS_DB::dropTable('mod_phatform_form_' . $this->getId());
     }
     Key::drop($this->_key_id);
     $this->kill();
     $_SESSION['PHAT_FormManager']->form = null;
     $_SESSION['PHAT_FormManager']->_list();
 }
Beispiel #14
0
/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function branch_uninstall(&$content)
{
    PHPWS_DB::dropTable('branch_sites');
    return TRUE;
}
Beispiel #15
0
 public static function removePermissions($module)
 {
     $tableName = Users_Permission::getPermissionTableName($module);
     if (!PHPWS_DB::isTable($tableName)) {
         return FALSE;
     }
     $result = PHPWS_DB::dropTable($tableName, FALSE, FALSE);
     if (PHPWS_Error::isError($result)) {
         PHPWS_Error::log($result);
         return $result;
     }
     return TRUE;
 }
Beispiel #16
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function rss_uninstall()
{
    PHPWS_DB::dropTable('rss_channel');
    PHPWS_DB::dropTable('rss_feeds');
    return TRUE;
}
Beispiel #17
0
 /**
  * Deletes a schedule from the database
  */
 public function delete()
 {
     if (empty($this->id)) {
         return false;
     }
     $db = $this->getDB();
     $db->addWhere('id', $this->id);
     $result = $db->delete();
     if (!PHPWS_Error::isError($result)) {
         $db2 = new PHPWS_DB('phpws_key');
         $db2->addWhere('module', 'calendar');
         $db2->addWhere('item_name', 'event' . $this->id);
         PHPWS_Error::logIfError($db2->delete());
         return PHPWS_DB::dropTable($this->getEventTable());
     } else {
         if (PHPWS_Settings::get('calendar', 'public_schedule') == $this->id) {
             PHPWS_Settings::set('calendar', 'public_schedule', 0);
             PHPWS_Settings::save('calendar');
         }
         return $result;
     }
 }
Beispiel #18
0
/**
 * Uninstall file for blog
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function blog_uninstall(&$content)
{
    PHPWS_DB::dropTable('blog_entries');
    $content[] = dgettext('blog', 'Blog tables removed.');
    return TRUE;
}