public function save()
 {
     $result = parent::save();
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     $db = new PHPWS_DB('analytics_tracker_owa');
     $db->addWhere('id', $this->id);
     $result = $db->select();
     if (PHPWS_Error::logIfError($result)) {
         return $result;
     }
     $db = new PHPWS_DB('analytics_tracker_owa');
     $db->addValue('id', $this->id);
     $db->addValue('owa_url', $this->owa_url);
     $db->addValue('owa_site_id', $this->owa_site_id);
     $db->addValue('owa_track_page_view', $this->owa_track_page_view);
     $db->addValue('owa_track_clicks', $this->owa_track_clicks);
     $db->addValue('owa_track_domstream', $this->owa_track_domstream);
     if (count($result) < 1) {
         $result = $db->insert(false);
     } else {
         $result = $db->update();
     }
     if (PHPWS_Error::logIfError($result)) {
         return $result;
     }
 }
 public static function saveObject(DbStorable $o)
 {
     $vars = $o->extractVars();
     $tableName = $o::getTableName();
     // Check if the key already exists
     $query = "SELECT * FROM {$tableName} WHERE id = {$vars['id']}";
     $result = \PHPWS_DB::getAll($query);
     if (count($result) > 0) {
         $exists = true;
     } else {
         $exists = false;
     }
     $db = new \PHPWS_DB($o->getTableName());
     foreach ($vars as $key => $value) {
         $db->addValue($key, $value);
     }
     if ($exists) {
         $db->addWhere('id', $vars['id']);
         $result = $db->update();
     } else {
         $result = $db->insert(false);
     }
     if (\PHPWS_Error::logIfError($result)) {
         throw new \Exception($result->toString());
     }
 }
Beispiel #3
0
 public function save()
 {
     $result = parent::save();
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     $db = new PHPWS_DB('analytics_tracker_piwik');
     $db->addWhere('id', $this->id);
     $result = $db->select();
     if (PHPWS_Error::logIfError($result)) {
         return $result;
     }
     $db = new PHPWS_DB('analytics_tracker_piwik');
     $db->addValue('id', $this->id);
     $db->addValue('piwik_url', $this->piwik_url);
     $db->addValue('piwik_id', $this->piwik_id);
     if (count($result) < 1) {
         $result = $db->insert(false);
     } else {
         $result = $db->update();
     }
     if (PHPWS_Error::logIfError($result)) {
         return $result;
     }
 }
Beispiel #4
0
/**
 * unregisters deleted keys from menu
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function menu_unregister_key(Key $key)
{
    PHPWS_Core::initModClass('menu', 'Menu_Link.php');
    if (empty($key) || empty($key->id)) {
        return FALSE;
    }
    $db = new PHPWS_DB('menu_links');
    $db->addWhere('key_id', $key->id);
    $result = $db->delete();
    if (PHPWS_Error::isError($result)) {
        PHPWS_Error::log($result);
    }
    $db2 = new PHPWS_DB('menu_assoc');
    $db2->addWhere('key_id', $key->id);
    $result = $db2->delete();
    if (PHPWS_Error::isError($result)) {
        PHPWS_Error::log($result);
    }
    $db3 = new PHPWS_DB('menus');
    $db3->addWhere('assoc_key', $key->id);
    $db3->addValue('assoc_key', 0);
    $db3->addValue('assoc_url', null);
    $db3->update();
    return true;
}
Beispiel #5
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function filecabinet_unregister($module, &$content)
{
    $db = new PHPWS_DB('folders');
    $db->addValue('module_created', null);
    $db->addWhere('module_created', $module);
    PHPWS_Error::logIfError($db->update());
    $content[] = dgettext('filecabinet', 'Unregistered from File Cabinet.');
    return true;
}
Beispiel #6
0
/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function layout_install(&$content, $branchInstall = FALSE)
{
    $page_title = 'Change this Site Name in Layout Meta Tags';
    $default_theme = 'bootstrap';
    if (!isset($error)) {
        $db = new PHPWS_DB('layout_config');
        $db->addValue('default_theme', $default_theme);
        $db->addValue('page_title', $page_title);
        $db->update();
        $content[] = dgettext('layout', 'Layout settings updated.');
        return true;
    } else {
        return $error;
    }
}
Beispiel #7
0
function purgeProperties()
{
    $last_purge = \PHPWS_Settings::get('properties', 'last_purge') + 86400;
    $current_time = time();
    if ($last_purge < $current_time) {
        \PHPWS_Settings::set('properties', 'last_purge', $current_time);
        \PHPWS_Settings::save('properties');
        $db = new PHPWS_DB('properties');
        $db->addWhere('timeout', time(), '<');
        $db->addValue('active', 0);
        $db->update();
        $db = new PHPWS_DB('prop_roommate');
        $db->addWhere('timeout', time(), '<');
        $db->delete();
    }
}
Beispiel #8
0
 function _saveFormData()
 {
     $error = NULL;
     /* Setup start and end values for the elements loop */
     $start = $this->_position;
     if ($this->_position + $this->_pageLimit > sizeof($this->_elements)) {
         $end = $this->_position + (sizeof($this->_elements) - $this->_position);
     } else {
         $end = $this->_position + $this->_pageLimit;
     }
     /* Loop through elements and setup query array for database interaction */
     for ($i = $start; $i < $end; $i++) {
         $elementInfo = explode(':', $this->_elements[$i]);
         $this->element = new $elementInfo[0]($elementInfo[1]);
         if ($this->element->isRequired() && (!isset($_REQUEST['PHAT_' . $this->element->getLabel()]) || $_REQUEST['PHAT_' . $this->element->getLabel()] == NULL)) {
             $error = PHPWS_Error::get(PHATFORM_REQUIRED_MISSING, 'phatform', 'PHAT_Form::_saveFormData');
         }
         if ($this->_editData) {
             $this->_userData[$this->element->getLabel()] = $_REQUEST['PHAT_' . $this->element->getLabel()];
         }
         if (isset($_REQUEST['PHAT_' . $this->element->getLabel()])) {
             if (is_string($_REQUEST['PHAT_' . $this->element->getLabel()]) && strlen($_REQUEST['PHAT_' . $this->element->getLabel()]) > PHAT_MAX_CHARS_TEXT_ENTRY) {
                 $error = PHPWS_Error::get(PHATFORM_TEXT_MAXSIZE_PASSED, 'phatform', 'PHAT_Form::_saveFormData', array($this->element->getLabel()));
             }
             $queryData[$this->element->getLabel()] = $_REQUEST['PHAT_' . $this->element->getLabel()];
         }
     }
     /* If no errors occured, move the user to the next page in this form */
     if (!PHPWS_Error::isError($error)) {
         if ($this->currentPage() != $this->numPages()) {
             $this->_position += $this->_pageLimit;
         } else {
             $this->_position = -1;
         }
     }
     if (!$this->_anonymous) {
         $queryData['user'] = Current_User::getUsername();
     } else {
         $queryData['user'] = '******';
     }
     $queryData['position'] = $this->_position;
     $queryData['updated'] = time();
     /* Check to see if this user has started entering data for this form yet */
     $db = new PHPWS_DB('mod_phatform_form_' . $this->getId());
     $db->addValue($queryData);
     if (isset($this->_dataId)) {
         $db->addWhere('id', $this->_dataId);
         $db->update();
     } else {
         $result = $db->insert();
         if (PHPWS_Error::isError($result)) {
             PHPWS_Error::log($result);
         } else {
             $this->_dataId = $result;
         }
     }
     return $error;
 }
Beispiel #9
0
 public function updateCore()
 {
     PHPWS_Core::initModClass('boost', 'Boost.php');
     $content[] = dgettext('boost', 'Updating core');
     require_once PHPWS_SOURCE_DIR . 'core/boost/update.php';
     $ver_info = PHPWS_Core::getVersionInfo(false);
     $content[] = dgettext('boost', 'Processing update file.');
     $result = core_update($content, $ver_info['version']);
     if ($result === true) {
         $db = new PHPWS_DB('core_version');
         $file_ver = PHPWS_Core::getVersionInfo();
         $db->addValue('version', $file_ver['version']);
         $result = $db->update();
         if (PHPWS_Error::isError($result)) {
             PHPWS_Error::log($result);
             $content[] = dgettext('boost', 'An error occurred updating the core.');
         } else {
             $content[] = dgettext('boost', 'Core successfully updated.');
         }
     } elseif (PHPWS_Error::isError($result)) {
         PHPWS_Error::log($result);
         $content[] = dgettext('boost', 'An error occurred updating the core.');
     } else {
         $content[] = dgettext('boost', 'An error occurred updating the core.');
     }
     return implode('<br />', $content);
 }
 public function updateSequenceTable()
 {
     $this->addColumn('id', 'max');
     $max_id = $this->select('one');
     if (PHPWS_Error::isError($max_id)) {
         return $max_id;
     }
     if ($max_id > 0) {
         $seq_table = $this->getTable(false) . '_seq';
         if (!$this->isTable($seq_table)) {
             $table = $this->addPrefix($this->getTable(false));
             $GLOBALS['PHPWS_DB']['connection']->nextId($table);
         }
         $seq = new PHPWS_DB($seq_table);
         $result = $seq->select('one');
         if (PHPWS_Error::logIfError($result)) {
             return false;
         }
         $seq->addValue('id', $max_id);
         if (!$result) {
             return $seq->insert(false);
         } else {
             return $seq->update();
         }
     }
     return true;
 }
Beispiel #11
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function pagesmith_update(&$content, $currentVersion)
{
    $home_dir = PHPWS_Boost::getHomeDir();
    switch ($currentVersion) {
        case version_compare($currentVersion, '1.0.1', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('ps_page');
            $result = $db->addTableColumn('front_page', 'smallint NOT NULL default 0');
            if (PHPWS_Error::logIfError($result)) {
                $content[] = "--- Unable to create table column 'front_page' on ps_page table.</pre>";
                return false;
            } else {
                $content[] = "--- Created 'front_page' column on ps_page table.";
            }
            $files = array('templates/page_list.tpl', 'javascript/update/head.js', 'conf/error.php', 'templates/page_templates/simple/page.tpl', 'templates/page_templates/twocolumns/page.tpl');
            pagesmithUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_0_1.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.0.2', '<'):
            $content[] = '<pre>';
            $dest_dir = $home_dir . 'javascript/modules/pagesmith/passinfo/';
            if (!is_dir($dest_dir)) {
                if (is_writable($home_dir . 'javascript/modules/pagesmith/') && @mkdir($dest_dir)) {
                    $content[] = '--- SUCCEEDED creating "javascript/modules/passinfo/" directory.';
                } else {
                    $content[] = 'PageSmith 1.0.2 requires the javascript/modules/pagesmith/ directory be writable.</pre>';
                    return false;
                }
            } elseif (!is_writable($dest_dir)) {
                $content[] = 'PageSmith 1.0.2 requires the javascript/modules/pagesmith/passinfo/ directory be writable.</pre>';
                return false;
            }
            $source_dir = PHPWS_SOURCE_DIR . 'mod/pagesmith/javascript/passinfo/';
            if (!PHPWS_File::copy_directory($source_dir, $dest_dir)) {
                $content[] = "--- FAILED copying to {$dest_dir}.</pre>";
                return false;
            } else {
                $content[] = "--- SUCCEEDED copying to {$dest_dir} directory.";
            }
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_0_2.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.0.3', '<'):
            $content[] = '<pre>';
            $source_dir = PHPWS_SOURCE_DIR . 'mod/pagesmith/templates/page_templates/text_only/';
            $dest_dir = $home_dir . 'templates/pagesmith/page_templates/text_only/';
            if (PHPWS_File::copy_directory($source_dir, $dest_dir)) {
                $content[] = "--- Successfully copied {$source_dir}\n    to {$dest_dir}\n";
            } else {
                $content[] = "--- Failed to copy {$source_dir} to {$dest_dir}</pre>";
                return false;
            }
            $files = array('conf/config.php');
            pagesmithUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_0_3.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.0.4', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('phpws_key');
            $db->addWhere('module', 'pagesmith');
            $db->addValue('edit_permission', 'edit_page');
            if (PHPWS_Error::logIfError($db->update())) {
                $content[] = 'Unable to update phpws_key table.</pre>';
                return false;
            } else {
                $content[] = 'Updated phpws_key table.';
            }
            $content[] = '1.0.4 changes
------------------
+ Fixed pagesmith edit permission.
+ PageSmith home pages were missing edit link.</pre>';
        case version_compare($currentVersion, '1.0.5', '<'):
            $content[] = '<pre>';
            pagesmithUpdateFiles(array('templates/page_templates/text_only/page.tpl'), $content);
            $content[] = '1.0.5 changes
----------------
+ Changed wording on move to front functionality
+ Added move to front to miniadmin
+ Fixed text_only template. Missing closing div tag.
</pre>';
        case version_compare($currentVersion, '1.0.6', '<'):
            $content[] = '<pre>
1.0.6 changes
-------------
+ Small fix to allow linkable images on cached pages.
</pre>';
        case version_compare($currentVersion, '1.0.7', '<'):
            $content[] = '<pre>';
            pagesmithUpdateFiles(array('templates/settings.tpl'), $content);
            $content[] = '1.0.7 changes
-------------
+ PageSmith can be set to automatically create a link when a new page
  is created.
+ Changing a page title now updates the menu link.
</pre>';
        case version_compare($currentVersion, '1.1.0', '<'):
            PHPWS_Core::initModClass('filecabinet', 'Cabinet.php');
            $content[] = '<pre>';
            Cabinet::convertImagesToFileAssoc('ps_block', 'type_id');
            $content[] = '--- Images converted for File Cabinet 2.0.0.';
            pagesmithUpdateFiles(array('javascript/passinfo/head.js', 'templates/page_templates/threesec/page.css', 'templates/page_templates/threesec/page.tpl', 'templates/page_templates/threesec/structure.xml', 'templates/page_templates/threesec/threesec.png'), $content);
            $content[] = '1.1.0 changes (unreleased)
-------------
+ PageSmith conforms to new File Cabinet update.
+ Added url parser to passinfo script to allow images to work with fck better.
</pre>';
        case version_compare($currentVersion, '1.2.1', '<'):
            $content[] = '<pre>';
            $source_tpl = PHPWS_SOURCE_DIR . 'mod/pagesmith/templates/page_templates/';
            $local_tpl = $home_dir . 'templates/pagesmith/page_templates/';
            $backup = $home_dir . 'templates/pagesmith/_page_templates/';
            $source_img = PHPWS_SOURCE_DIR . 'mod/pagesmith/img/folder_icons/';
            $local_img = $home_dir . 'images/mod/pagesmith/folder_icons/';
            if (is_dir($backup) || @PHPWS_File::copy_directory($local_tpl, $backup)) {
                $content[] = '--- Local page templates backed up to: ' . $backup;
            } else {
                $content[] = sprintf('--- Could not backup directory "%s" to "%s"</pre>', $local_tpl, $backup);
                return false;
            }
            if (PHPWS_File::copy_directory($source_tpl, $local_tpl)) {
                $content[] = '--- Local page templates updated.';
            } else {
                $content[] = sprintf('--- Could not copy directory "%s" to "%s"</pre>', $source_tpl, $local_tpl);
                return false;
            }
            if (PHPWS_File::copy_directory($source_img, $local_img)) {
                $content[] = '--- New page template icons copied locally.';
            } else {
                $content[] = sprintf('--- Could not copy directory "%s" to "%s"</pre>', $source_img, $local_img);
                return false;
            }
            if (!pagesmithSearchIndex()) {
                $content[] = '--- Unable to index pages in search. Check your error log.</pre>';
                return false;
            } else {
                $content[] = '--- Pages added to search';
            }
            $files = array('templates/pick_folder.tpl', 'templates/pick_template.tpl', 'templates/style.css', 'conf/folder_icons.php');
            pagesmithUpdateFiles($files, $content);
            $content[] = '1.2.1 changes
----------------
+ PageSmith now allows the sorting of templates
+ Page titles now added to search.
+ Wrong page ids don\'t 404. Send to message page.
+ Search indexing added to update and version raised.
+ Added search to pagesmith.
+ Changed to new url rewriting method.</pre>';
        case version_compare($currentVersion, '1.2.2', '<'):
            $content[] = '<pre>';
            $files = array('templates/page_list.tpl');
            pagesmithUpdateFiles($files, $content);
            $content[] = '
1.2.2 changes
---------------
+ Updated pagers to addSortHeaders.
+ Fixed direct access to page allowing view.
+ Front page does not alter page title.
+ Fixed some notices and a caching bug.
+ Changed wording on edit text windows.</pre>';
        case version_compare($currentVersion, '1.3.0', '<'):
            $db = new PHPWS_DB('ps_block');
            $db->dropTableColumn('btype');
            $db = new PHPWS_DB('ps_page');
            if (PHPWS_Error::logIfError($db->addTableColumn('parent_page', 'int NOT NULL default 0'))) {
                $content[] = 'Could not create ps_page.parent_page column.';
                return false;
            }
            if (PHPWS_Error::logIfError($db->addTableColumn('page_order', 'smallint NOT NULL default 0'))) {
                $content[] = 'Could not create ps_page.page_order column.';
                return false;
            }
            $db = new PHPWS_DB('ps_text');
            if (PHPWS_DB::getDBType() == 'mysql' || PHPWS_DB::getDBType() == 'mysqli') {
                if (PHPWS_Error::logIfError($db->alterColumnType('content', 'longtext NOT NULL'))) {
                    $content[] = 'Could not alter ps_text.content column.';
                }
            }
            $content[] = '<pre>';
            $files = array('javascript/passinfo/head.js', 'templates/page_form.tpl', 'javascript/delete_orphan/', 'javascript/confirm_delete/', 'javascript/update/head.js', 'templates/page_templates/threesec-tbl/', 'templates/orphans.tpl', 'templates/page_form.tpl', 'templates/page_frame.tpl', 'templates/page_list.tpl', 'templates/style.css', 'templates/sublist.tpl', 'templates/upload_template.tpl', 'img/add.png', 'img/delete.png', 'img/back.png', 'img/front.png');
            pagesmithUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_3_0.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.3.1', '<'):
            $content[] = '<pre>';
            $files = array('templates/page_templates/threesec/page.tpl', 'templates/page_templates/threesec-tbl/page.tpl', 'templates/settings.tpl');
            pagesmithUpdateFiles($files, $content);
            $content[] = '1.3.1 changes
---------------
+ Page cache refreshed on page save.
+ Updated threesec templates to conform with norm box-title,
  box-content layout
+ Added ability to lengthen or shorten pagesmith links.
+ Added fix so edit mode does not parse smarttags.</pre>';
        case version_compare($currentVersion, '1.3.2', '<'):
            $content[] = '<pre>';
            Users_Permission::registerPermissions('pagesmith', $content);
            pagesmithUpdateFiles(array('templates/page_templates/'), $content);
            $content[] = '1.3.2 changes
----------------
+ Update was missing a permission update
+ Wrong permission getting called on settings
+ All page templates now have a class called pagesmith-page
+ Removed padding from page templates</pre>';
        case version_compare($currentVersion, '1.3.3', '<'):
            $db = new PHPWS_DB('ps_text');
            if (PHPWS_Error::logIfError($db->alterColumnType('content', 'longtext'))) {
                $content[] = 'Could not alter ps_text.content column.';
                return false;
            } else {
                $content[] = 'Updated ps_text.content column';
            }
            $content[] = '<pre>';
            pagesmithUpdateFiles(array('javascript/disable_links/', 'javascript/update/head.js'), $content);
            $content[] = 'Version 1.3.3
--------------------------------------------------------------------
+ Made ps_text.content null instead of not null
+ Made a change in page editing. Text spaces receive text without
  formatting. Prior to this change the parseOutput was run before
  sending the data to the editor. This stripped data that may need
  editing.
  Now the text is sent to the editor without processing. After post
  the text IS processed. This fixed the filters. Anchors will be
  busted AFTER the edit post but I don\'t think they really need to
  work in edit mode.
+ Added javascript to prevent accidental link clicks in edit mode.
+ change_link was an id, changed to a class since there were several
  on a page.</pre>';
        case version_compare($currentVersion, '1.3.4', '<'):
            $content[] = '<pre>1.3.4 changes
-------------
+ Fixed link shortening
+ Restored missing placeholder width and height
+ Fixed lost text bug.
</pre>';
        case version_compare($currentVersion, '1.4.0', '<'):
            $content[] = '<pre>1.4.0 changes
-------------
+ Icon class implemented.
+ Fixed on disableLinks script.
+ Added black page check on saving. Prohibits empty content from being saved to the database.
+ Added option to turn off "Back to top" links.
+ Added default installation page.
+ PHP 5 strict fixes.</pre>';
        case version_compare($currentVersion, '1.4.1', '<'):
            $content[] = '<pre>1.4.1 changes
-------------
Fixed bug causing blank editors on edit.</pre>';
        case version_compare($currentVersion, '1.4.2', '<'):
            $content[] = '<pre>1.4.2 changes
-------------
+ Added conditionals to try and prevent blank page posting.
+ Updated javascript to jquery code.
+ Added some new templates.
.</pre>';
        case version_compare($currentVersion, '1.5.0', '<'):
            $content[] = '<pre>1.5.0 changes
---------------
+ New method of editing text. Click on text instead of edit image.
+ Javascript window replaced with Jquery dialog.
</pre>';
        case version_compare($currentVersion, '1.5.1', '<'):
            $content[] = '<pre>1.5.1 changes
---------------
+ Mouseover edit behavior changed.
+ Publish on date added.
</pre>';
        case version_compare($currentVersion, '1.5.2', '<'):
            $content[] = '<pre>1.5.2 changes
---------------
- Fixed error message
- Empty orphans are removed automatically.
- Dialog editor made modal.
</pre>';
        case version_compare($currentVersion, '1.5.3', '<'):
            $content[] = '<pre>1.5.3 changes
---------------
+ Edit hinting changed to Boostrap standard
+ Removed upload template tab and code
+ Font Awesome used in icons
+ Tweaked page listing.
+ Removed default background color from page template.
+ Fixed bug with pages saving untitled.
</pre>';
        case version_compare($currentVersion, '1.5.4', '<'):
            $content[] = '<pre>1.5.4 changes
---------------
+ Added titles to admin icons
+ Removed @ to prevent PHP warning message
+ Style changes to pager listing
+ Pop up width is relative to browser
</pre>';
        case version_compare($currentVersion, '1.6.0', '<'):
            $db = \Database::newDB();
            $table = $db->addTable('ps_page');
            $table->addFieldConditional('template', 'art');
            $table->addValue('template', 'banner');
            $db->update();
            $db->clearConditional();
            $table->reset();
            $c1 = $table->getFieldConditional('template', 'vtour');
            $c2 = $table->getFieldConditional('template', 'VTOUR');
            $db->addConditional($db->createConditional($c1, $c2, 'OR'));
            $table->addValue('template', 'threesec');
            $db->update();
            $content[] = '<pre>1.6.0 changes
---------------
+ Rewrote page templates to be Bootstrap compatible.
+ Removed art and vtour template.
</pre>';
        case version_compare($currentVersion, '1.6.1', '<'):
            $content[] = '<pre>1.6.1 changes
---------------
+ changed content editor pop up to use bootstrap modal instead of jquery dialog
+ Bootstrap styling to some UI elements
+ Back to top link pulled right with new icon
</pre>';
        case version_compare($currentVersion, '1.7.0', '<'):
            $content[] = <<<EOF
<pre>1.7.0 changes
------------------
+ Removed hardcoded h2 styles on some templates
+ Back to top default setting added
+ Clicking off edit window saves content
</pre>
EOF;
        case version_compare($currentVersion, '1.8.0', '<'):
            $db = \Database::newDB();
            $lb = $db->addTable('layout_box');
            $lb->addFieldConditional('module', 'pagesmith');
            $db->delete();
            $content[] = <<<EOF
<pre>1.8.0 changes
------------------
+ Removed all PageSmith pages from layout_box table. Was kept only for multiple front pages which no one used.
</pre>
EOF;
        case version_compare($currentVersion, '1.9.0', '<'):
            $db = \Database::newDB();
            $pp = $db->addTable('ps_page');
            $st = $pp->addDataType('show_title', 'smallint');
            $st->add();
            $content[] = <<<EOF
<pre>1.9.0 changes
------------------
+ Added: Ability to hide title
+ Changed: Pagesmith editing works within Bootstrap modals.
+ Changed: Adapted to work with CKEditor 4.
+ Changed: Front page is now Highlander style.
</pre>
EOF;
        case version_compare($currentVersion, '1.9.1', '<'):
            $db = \Database::newDB();
            $pp = $db->addTable('ps_page');
            if (!$pp->columnExists('hide_title') && $pp->columnExists('show_title')) {
                $dt = $pp->getDatatype('show_title');
                $dt->change('hide_title');
            }
            $content[] = <<<EOF
<pre>1.9.1 changes
------------------
+ Fixed: Code uses hide_title. Column name was show_title.
</pre>
EOF;
        case version_compare($currentVersion, '1.9.2', '<'):
            $content[] = <<<EOF
<pre>1.9.2 changes
------------------
+ Fixed: hide_title was not properly formated in install.sql
+ Fixed: Reduced edit popup window height.
+ Feature: Added save button to CKEditor that works in maximize.
+ Feature: Added page update check to page submission.
+ Change: Save button is styled and larger.
+ Change: New page defaults to Text Only template.
</pre>
EOF;
        case version_compare($currentVersion, '1.10.0', '<'):
            $db = \Database::newDB();
            $t1 = $db->addTable('ps_page');
            $dt = $t1->addDatatype('deleted', 'smallint');
            $dt->setDefault(0);
            $dt->add();
            $content[] = <<<EOF
<pre>
1.10.0 Changes
---------------
+ Deleted pages are kept in database
</pre>
EOF;
    }
    // end switch
    return true;
}
Beispiel #12
0
 function doMove()
 {
     if (!Current_User::authorized('wiki', 'edit_page') && !(PHPWS_Settings::get('wiki', 'allow_page_edit') && Current_User::isLogged()) || !$this->allow_edit) {
         Current_User::disallow(dgettext('wiki', 'User attempted to execute a wiki page move.'));
         return;
     }
     if (strlen($_POST['newpage']) == 0) {
         WikiManager::sendMessage(dgettext('wiki', 'Please supply a new page title'), array('page_op' => 'move', 'page' => $this->getTitle(FALSE)));
     }
     $db = new PHPWS_DB('wiki_pages');
     $db->addWhere('title', $_POST['newpage']);
     $result = $db->select();
     if ($result != NULL) {
         WikiManager::sendMessage(dgettext('wiki', 'Page with that name already exists!'), array('page_op' => 'move', 'page' => $this->getTitle(FALSE)));
     }
     $this->setTitle($_POST['newpage']);
     $db->reset();
     $db->saveObject($this);
     $db2 = new PHPWS_DB('wiki_pages_version');
     $db2->addWhere('title', $_POST['page']);
     $db2->addValue('title', $this->getTitle(FALSE));
     $db2->update();
     $db3 = new PHPWS_DB('phpws_key');
     $db3->addWhere('item_id', $this->getId());
     $db3->addWhere('module', 'wiki');
     $db3->addValue('title', $this->getTitle());
     $db3->addValue('url', (MOD_REWRITE_ENABLED ? 'wiki/' : 'index.php?module=wiki&page=') . $this->getTitle(FALSE));
     $db3->update();
     // Create redirect page
     $redirect = new WikiPage($_POST['page']);
     $redirect->setPagetext(sprintf(dgettext('wiki', 'This page has moved to %s.  Please modify links to point to the new location.'), $this->getTitle(FALSE)));
     $redirect->setOwnerId(Current_User::getId());
     $redirect->setEditorId(Current_User::getId());
     $redirect->setCreated(mktime());
     $redirect->setUpdated(mktime());
     $redirect->setComment(sprintf(dgettext('wiki', 'Moved page to %s.'), $this->getTitle(FALSE)));
     $redirect->save();
     PHPWS_Core::initModClass('version', 'Version.php');
     $version = new Version('wiki_pages');
     $version->setSource($redirect);
     $version->setApproved(1);
     $version->save();
     WikiManager::sendMessage(dgettext('wiki', 'Wiki Page Moved!'), array('page' => $this->getTitle(FALSE)), FALSE);
 }
Beispiel #13
0
/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function calendar_update(&$content, $version)
{
    switch ($version) {
        case version_compare($version, '1.2.2', '<'):
            $content[] = 'This package will not update any versions prior to 1.2.2.';
            return false;
        case version_compare($version, '1.3.0', '<'):
            $result = PHPWS_DB::importFile(PHPWS_SOURCE_DIR . 'mod/calendar/boost/sql_update_130.sql');
            if (PHPWS_Error::isError($result)) {
                PHPWS_Error::log($result);
                $content[] = '+ Unable to import new suggestion table.';
                return false;
            } else {
                $files = array('templates/admin/forms/edit_event.tpl', 'templates/view/day.tpl', 'templates/view/week.tpl', 'templates/view/month/grid.tpl', 'templates/view/month/list.tpl', 'templates/style.css', 'templates/user_main.tpl', 'templates/admin/approval.tpl', 'conf/config.php');
                if (PHPWS_Boost::updateFiles($files, 'calendar')) {
                    $content[] = '+ Template files updated successfully.';
                } else {
                    $content[] = '+ Unable to copy template files locally.';
                    $content[] = '<pre>' . implode("\n", $files) . '</pre>';
                }
                $content[] = '+ Suggestion table import successful';
                $content[] = '<pre>
1.3.0 Changes
-------------
+ Added ability to for anonymous users to make event suggestions.
+ Fixed some issues with javascript disabled users unable to make events.
+ First public schedule is made the default on creation.
</pre>';
            }
        case version_compare($version, '1.4.0', '<'):
            $content[] = "<pre>1.4.0 Changes\n-------------";
            $files = array('templates/admin/settings.tpl', 'conf/config.php');
            if (PHPWS_Boost::updateFiles($files, 'calendar')) {
                $content[] = '+ Successfully copied these files locally:';
            } else {
                $content[] = '+ Could not copy these files locally:';
            }
            $content[] = '    ' . implode("\n    ", $files);
            $content[] = '+ Bug #1648965. Clicking Day or Week from grid view pulls correct day
+ Changed "Today" link to view appropiate description to prevent
  confusion
+ Changed time defaults to %p to work with more installs
+ If start date is greater than end date, the event will be saved to
  the save day.
+ Bug #1648963. Fixed mini month not showing days with events.
+ Made event count linkable in grid view
+ Labeled some permissions "unrestricted only"
+ Added permissions checks for editing and deleting
+ Created checkPermissions function in schedule class to simplify code
+ Removed commented legacy code from Schedule.php
+ Added missing suggestion tables to install and uninstall
+ Fixed caching logic
+ Fixed default schedule loading in Calendar class
+ Fixed inability to create more than one schedule
+ Added option to disable month view caching
+ Caching now works on public calendars only.
+ Added translate functions.
+ Updated message translation files.</pre>';
        case version_compare($version, '1.4.1', '<'):
            $content[] = "<pre>1.4.1 Changes\n-------------";
            $files = array('templates/admin/forms/edit_event.tpl', 'javascript/check_date/head.js');
            if (PHPWS_Boost::updateFiles($files, 'calendar')) {
                $content[] = '+ Successfully updated the following files:';
            } else {
                $content[] = '+ Unable to update the following files:';
            }
            $content[] = '    ' . implode("\n    ", $files);
            $content[] = '+ Made noon the default time for new events.
+ Fixed Daylight Saving Time breaking repeats.
+ Delete event links made secure.
+ Days made linkable in month list view.
+ Added a sync dates button on the edit event form.';
        case version_compare($version, '1.5.0', '<'):
            $db = new PHPWS_DB('calendar_schedule');
            $result = $db->addTableColumn('show_upcoming', 'SMALLINT NOT NULL DEFAULT 0');
            if (PHPWS_Error::logIfError($result)) {
                $content[] = '--- Could not create show_upcoming column in calendar_schedule table.';
                return false;
            }
            $content[] = '<pre>';
            $files = array('img/calendar.png', 'conf/config.php', 'templates/admin/forms/edit_schedule.tpl', 'templates/style.css', 'templates/view/upcoming.tpl');
            if (PHPWS_Boost::updateFiles($files, 'calendar')) {
                $content[] = '-- Successfully updated the following files:';
            } else {
                $content[] = '-- Unable to update the following files:';
            }
            $content[] = '    ' . implode("\n    ", $files);
            $content[] = '
1.5.0 Changes
---------------------
+ Can now choose to show upcoming events.
+ Removed schedule created message when using javascript popup
+ Moved getEvents function in the Schedule class
+ Increase calendar event form\'s popup height
+ Reformated schedule form
+ Bug # 1699659 - Calendar will not show "Add Event" link if a
  schedule has not been created. Instead, the "Create schedule" link
  will appear.
+ Updated language format
</pre>';
        case version_compare($version, '1.5.1', '<'):
            $db = new PHPWS_DB('calendar_schedule');
            if (!$db->isTableColumn('show_upcoming')) {
                $result = $db->addTableColumn('show_upcoming', 'SMALLINT NOT NULL DEFAULT 0');
                if (PHPWS_Error::logIfError($result)) {
                    $content[] = '--- Could not create show_upcoming column in calendar_schedule table.</pre>';
                    return false;
                }
            }
            $content[] = '<pre>';
            $files = array('conf/config.php', 'templates/view/month/list.tpl', 'templates/view/day.tpl', 'templates/view/week.tpl');
            if (PHPWS_Boost::updateFiles($files, 'calendar')) {
                $content[] = '-- Successfully updated the following files:';
            } else {
                $content[] = '-- Unable to update the following files:';
            }
            $content[] = '    ' . implode("\n    ", $files);
            $content[] = '
1.5.1 Changes
---------------------
+ 1.5.0 installations sql import was missing the show_upcoming column.
+ Added define to prevent day month year printing on same day events.
+ "Add event" links added to some views.
+ Changed the default hour format to "I" (eye) from l (ell) in
  config.php. Some php configurations do not recognize it.
</pre>';
        case version_compare($version, '1.5.2', '<'):
            $content[] = '<pre>';
            calendarUpdateFiles(array('templates/style.css'), $content);
            $content[] = '1.5.2 changes
-----------
+ Removed calendar colors that matched default theme.
+ Added Spanish translation.</pre>';
        case version_compare($version, '1.5.3', '<'):
            $content[] = '<pre>';
            calendarUpdateFiles(array('templates/style.css'), $content);
            $content[] = '1.5.3 change
-----------
+ Fixed issues with js_calendar.</pre>';
        case version_compare($version, '1.6.0', '<'):
            $content[] = '<pre>';
            $files = array('templates/style.css', 'templates/admin/forms/blog.tpl', 'templates/admin/settings.tpl', 'templates/view/day.tpl', 'templates/view/event.tpl', 'templates/view/month/grid.tpl', 'templates/view/month/list.tpl');
            calendarUpdateFiles($files, $content);
            $content[] = '1.6.0 changes
-------------------
+ Month grid view can be set to show events
+ Calendar events can be posted in the blog
+ Paragraph tag around day message
+ Fixed comment in event tpl preventing bar from disappearing in user
  mode
+ Removed extra message tag from month list view.
+ Applied patch #1813081 from aDarkling</pre>';
        case version_compare($version, '1.6.1', '<'):
            $content[] = '<pre>
1.6.1 changes
-------------
+ Fixed call to absent function in Event.php</pre>';
        case version_compare($version, '1.6.2', '<'):
            $content[] = '<pre>';
            calendarUpdateFiles(array('conf/config.php', 'javascript/check_date/head.js'), $content);
            $content[] = '1.6.2 changes
-------------
+ Added a upcoming date format
+ Fixed: Day view doesn\'t allow you to add an event until you create a schedule.
+ Deleting the default public calendar resets the selection.
+ Fixed: Bug #1879356 - Events spanning multiple days do not autocorrect time.
</pre>';
        case version_compare($version, '1.6.3', '<'):
            $content[] = '<pre>1.6.3 changes
-------------
+ Added missing repeatYearly function.</pre>';
        case version_compare($version, '1.6.4', '<'):
            $content[] = '<pre>';
            calendarUpdateFiles(array('templates/admin/schedules.tpl'), $content);
            $content[] = '1.6.4 changes
-------------
+ Added missing pager navigation tags to schedule listing.</pre>';
        case version_compare($version, '1.7.0', '<'):
            $db = new PHPWS_DB('calendar_schedule');
            $db->addColumn('id');
            $schedules = $db->select('col');
            if (!empty($schedules)) {
                foreach ($schedules as $id) {
                    $event_db = new PHPWS_DB('calendar_event_' . $id);
                    $event_db->addColumn('key_id');
                    $keys = $event_db->select('col');
                    if (!empty($keys)) {
                        $key_db = new PHPWS_DB('phpws_key');
                        $key_db->addWhere('id', $keys);
                        $key_db->addValue('item_name', 'event' . $id);
                        PHPWS_Error::logIfError($key_db->update());
                    }
                }
            }
            $content[] = '<pre>';
            $files = array('img/', 'templates/admin/schedules.tpl', 'templates/view/month/grid.tpl', 'templates/view/month/list.tpl', 'templates/view/day.tpl', 'templates/view/event.tpl', 'templates/view/week.tpl', 'templates/ical.tpl', 'templates/style.css', 'templates/upload.tpl', 'templates/admin/settings.tpl');
            calendarUpdateFiles($files, $content);
            $content[] = '1.7.0 changes
-------------
+ Added ability to hide the mini grid calendar.
+ Increased edit event popup default size.
+ Moved some frequent functions closer to top of switch
+ Added ability to upload and download events using iCal format
+ Fixed: Calendar was saving all events from all schedules using the same item name.
+ Deleting a schedule will remove event keys as well.
+ Deleting an event clears the cache to prevent ghosts in grid view.
+ If a non existing event is accessed, calendar forwards to day view instead of 404.
+ Added check that removes the default public calendar if it is
  changed to private.
+ Fixed events showing on multiple schedules.
+ php 5 formatted.
</pre>';
        case version_compare($version, '1.7.1', '<'):
            $content[] = '<pre>';
            $files = array('templates/admin/settings.tpl');
            calendarUpdateFiles($files, $content);
            $content[] = '1.7.1 changes
------------------
+ Added option to enable rel="nofollow" on date links</pre>';
        case version_compare($version, '1.7.2', '<'):
            $content[] = '<pre>1.7.2 changes
------------------
+ Fixed event ical download</pre>';
        case version_compare($version, '1.7.3', '<'):
            $content[] = '<pre>1.7.3 changes
------------------
+ Fixed empty events check in Upcoming Events
+ PHP 5 strict fixes.</pre>';
        case version_compare($version, '1.7.4', '<'):
            $content[] = '<pre>1.7.4 changes
------------------
+ RSS added.</pre>';
        case version_compare($version, '1.7.5', '<'):
            $content[] = '<pre>1.7.5 changes
------------------
+ Added an explicit require for Time.php in Calendar, in an attempt to move off of the older autoload</pre>';
        case version_compare($version, '1.7.6', '<'):
            $content[] = '<pre>1.7.6 changes
------------------
+ Bootstrap styling added
+ Updated Font Awesome icons
+ Fixed schedule select with last Form updates
+ Fixed users not seeing public calendars
</pre>';
        case version_compare($version, '1.8.0', '<'):
            $content[] = <<<EOF
<pre>1.8.0
-------------
+ Added END_TIME_HOUR, END_TIME_MONTH, and END_TIME_YEAR
  template tags to the event view.
+ Added Bootstrap icons and navigation buttons.
+ Administrative forms switched over to modal windows.
+ Using new datetimepicker javascript.</pre>
EOF;
        case version_compare($version, '1.8.1', '<'):
            $content[] = <<<EOF
<pre>1.8.1
-------------
+ Rolled back array call specific to PHP 5.4.
+ Increased specificity of .date-label CSS class.
</pre>
EOF;
    }
    // end of switch
    return true;
}
Beispiel #14
0
 public function saveKey()
 {
     if (empty($this->key_id)) {
         $key = new Key();
     } else {
         $key = new Key($this->key_id);
         if (PHPWS_Error::isError($key->_error)) {
             $key = new Key();
         }
     }
     $key->setModule('signup');
     $key->setItemName('sheet');
     $key->setItemId($this->id);
     $key->setEditPermission('edit_sheet');
     if (MOD_REWRITE_ENABLED) {
         $key->setUrl('signup/sheet_id/' . $this->id);
     } else {
         $key->setUrl('index.php?module=signup&amp;sheet_id=' . $this->id);
     }
     $key->setTitle($this->title);
     $result = $key->save();
     if (PHPWS_Error::logIfError($result)) {
         return false;
     }
     if (!$this->key_id) {
         $this->key_id = $key->id;
         $db = new PHPWS_DB('signup_sheet');
         $db->addWhere('id', $this->id);
         $db->addValue('key_id', $this->key_id);
         PHPWS_Error::logIfError($db->update());
     }
     return true;
 }
Beispiel #15
0
 public function delete($permanent = false)
 {
     $db = new PHPWS_DB('ps_page');
     $db->addWhere('id', $this->id);
     if ($permanent) {
         $result = $db->delete();
         if (PHPWS_Error::logIfError($result)) {
             return false;
         }
         Key::drop($this->key_id);
         $db = new PHPWS_DB('ps_text');
         $db->addWhere('pid', $this->id);
         $result = $db->delete();
         $db = new PHPWS_DB('ps_block');
         $db->addWhere('pid', $this->id);
         $db->delete();
     } else {
         $db->addValue('deleted', 1);
         $db->addValue('last_updated', time());
         $result = $db->update();
         if (PHPWS_Error::logIfError($result)) {
             return false;
         }
         $key = new \Key($this->key_id);
         $key->active = 0;
         $key->save();
         $key->unregister();
     }
     $this->removeShortcuts();
     if ($this->parent_page) {
         $db = new PHPWS_DB('ps_page');
         $db->addWhere('parent_page', $this->parent_page);
         $db->addWhere('page_order', $this->page_order, '>');
         PHPWS_Error::logIfError($db->reduceColumn('page_order'));
     }
     return true;
 }
Beispiel #16
0
 public function moveDown()
 {
     $db = new PHPWS_DB('signup_slots');
     $db->addWhere('sheet_id', $this->sheet_id);
     $db->addColumn('id', null, null, true);
     $slot_count = $db->select('one');
     // If not already at bottom, move down one spot
     if ($this->s_order != $slot_count) {
         $db->resetColumns();
         $db->addWhere('s_order', $this->s_order + 1);
         $db->addValue('s_order', $this->s_order);
         $db->update();
         $this->s_order++;
         $this->save();
     }
 }
Beispiel #17
0
function properties_update(&$content, $currentVersion)
{
    switch ($currentVersion) {
        case version_compare($currentVersion, '1.1.0', '<'):
            $db = new PHPWS_DB('properties');
            $result = $db->addTableColumn('efficiency', 'smallint not null default 0');
            if (PHPWS_Error::isError($result)) {
                PHPWS_Error::log($result);
                $content[] = 'ERROR - could not add efficiency column';
                return false;
            }
            $content[] = '<pre>1.1.0 updates
---------------
+ Added efficiency option</pre>';
        case version_compare($currentVersion, '1.1.1', '<'):
            $db = new PHPWS_DB('prop_contacts');
            $result = $db->addTableColumn('company_url', 'VARCHAR( 255 ) NULL');
            if (PHPWS_Error::isError($result)) {
                PHPWS_Error::log($result);
                $content[] = 'ERROR - could not add company_url column';
                return false;
            }
            $content[] = '<pre>1.1.1 updates
---------------
+ Added company url
+ Property listing divided into tabs.</pre>';
        case version_compare($currentVersion, '1.2.0', '<'):
            $db = new PHPWS_DB('properties');
            $db->addWhere('pets_allowed', 1);
            $db->addColumn('id');
            $db->addColumn('pet_type');
            $db->setIndexBy('id');
            $cols = $db->select('col');
            if (!empty($cols)) {
                foreach ($cols as $id => $pets) {
                    if (empty($pets)) {
                        continue;
                    }
                    $db->reset();
                    $pets_array = null;
                    $pets_array = @unserialize($pets);
                    if (!is_array($pets_array)) {
                        continue;
                    } else {
                        $pets = implode(', ', $pets_array);
                    }
                    $db->addWhere('id', $id);
                    $db->addValue('pet_type', $pets);
                    $db->update();
                }
            }
            $db->reset();
            $result = $db->addTableColumn('pet_fee', 'int not null default 0');
            if (PHPWS_Error::isError($result)) {
                PHPWS_Error::log($result);
                $content[] = 'ERROR - could not add pet_fee column';
                return false;
            }
            $db->reset();
            $result = $db->addTableColumn('airconditioning', 'smallint not null default 0');
            if (PHPWS_Error::isError($result)) {
                PHPWS_Error::log($result);
                $content[] = 'ERROR - could not add airconditioning column';
                return false;
            }
            $db->reset();
            $result = $db->addTableColumn('heat_type', 'varchar(255) default null');
            if (PHPWS_Error::isError($result)) {
                PHPWS_Error::log($result);
                $content[] = 'ERROR - could not add heat_type column';
                return false;
            }
        case version_compare($currentVersion, '1.2.1', '<'):
            $content[] = '<pre>1.2.1 updates
---------------
- Improved look with Bootstrapping.</pre>';
        case version_compare($currentVersion, '1.2.2', '<'):
            $content[] = '<pre>1.2.2 updates
---------------
+ Added gas heat and fiber internet/tv.
</pre>';
        case version_compare($currentVersion, '1.3.0', '<'):
            $content[] = <<<EOF
<pre>1.3.0 updates
-----------------
+ Changed login box for IE users
+ Added ability to view properties by contact.
+ Contacts list compacted. Email links to contact name.
+ Fixed bad function call on error page.
+ Added error checks in case 1) the property does not exists or not active or
  2) the image files are not present.
+ Test for incactive properties preventing error.
+ Added Bootstrap styling and overhauled to work on mobile devices.
+ Last logged defaults to creation date.
+ Fixed Shared Bedroom and Bathroom settings on roommates page.
+ Fixed active/inactive buttons.
</pre>
EOF;
    }
    return true;
}
Beispiel #18
0
 public function saveKey($new_folder = true)
 {
     if (empty($this->key_id)) {
         $key = new Key();
     } else {
         $key = new Key($this->key_id);
         if (PHPWS_Error::isError($key->getError())) {
             $key = new Key();
         }
     }
     $key->setModule('filecabinet');
     $key->setItemName('folder');
     $key->setItemId($this->id);
     $key->setEditPermission('edit_folders');
     $key->setUrl($this->viewLink(false));
     $key->setTitle($this->title);
     $key->setSummary($this->description);
     $result = $key->save();
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     $this->key_id = $key->id;
     if ($new_folder) {
         $db = new PHPWS_DB('folders');
         $db->addWhere('id', $this->id);
         $db->addValue('key_id', $this->key_id);
         $result = $db->update();
         if (PHPWS_Error::isError($result)) {
             return $result;
         }
     }
     return true;
 }
Beispiel #19
0
function fc_update_parent_links()
{
    // Nulling the url column for images with 'parent' set as url
    $db = new PHPWS_DB('images');
    $db->addWhere('url', 'parent');
    $db->addValue('url', NULL);
    PHPWS_Error::logIfError($db->update());
    // remove superfluous column
    PHPWS_Error::logIfError($db->dropTableColumn('parent_id'));
}
Beispiel #20
0
function properties_update(&$content, $currentVersion)
{
    switch ($currentVersion) {
        case version_compare($currentVersion, '1.1.0', '<'):
            $db = new PHPWS_DB('properties');
            $result = $db->addTableColumn('efficiency', 'smallint not null default 0');
            if (PHPWS_Error::isError($result)) {
                PHPWS_Error::log($result);
                $content[] = 'ERROR - could not add efficiency column';
                return false;
            }
            $content[] = '<pre>1.1.0 updates
---------------
+ Added efficiency option</pre>';
        case version_compare($currentVersion, '1.1.1', '<'):
            $db = new PHPWS_DB('prop_contacts');
            $result = $db->addTableColumn('company_url', 'VARCHAR( 255 ) NULL');
            if (PHPWS_Error::isError($result)) {
                PHPWS_Error::log($result);
                $content[] = 'ERROR - could not add company_url column';
                return false;
            }
            $content[] = '<pre>1.1.1 updates
---------------
+ Added company url
+ Property listing divided into tabs.</pre>';
        case version_compare($currentVersion, '1.2.0', '<'):
            $db = new PHPWS_DB('properties');
            $db->addWhere('pets_allowed', 1);
            $db->addColumn('id');
            $db->addColumn('pet_type');
            $db->setIndexBy('id');
            $cols = $db->select('col');
            if (!empty($cols)) {
                foreach ($cols as $id => $pets) {
                    if (empty($pets)) {
                        continue;
                    }
                    $db->reset();
                    $pets_array = null;
                    $pets_array = @unserialize($pets);
                    if (!is_array($pets_array)) {
                        continue;
                    } else {
                        $pets = implode(', ', $pets_array);
                    }
                    $db->addWhere('id', $id);
                    $db->addValue('pet_type', $pets);
                    $db->update();
                }
            }
            $db->reset();
            $result = $db->addTableColumn('pet_fee', 'int not null default 0');
            if (PHPWS_Error::isError($result)) {
                PHPWS_Error::log($result);
                $content[] = 'ERROR - could not add pet_fee column';
                return false;
            }
            $db->reset();
            $result = $db->addTableColumn('airconditioning', 'smallint not null default 0');
            if (PHPWS_Error::isError($result)) {
                PHPWS_Error::log($result);
                $content[] = 'ERROR - could not add airconditioning column';
                return false;
            }
            $db->reset();
            $result = $db->addTableColumn('heat_type', 'varchar(255) default null');
            if (PHPWS_Error::isError($result)) {
                PHPWS_Error::log($result);
                $content[] = 'ERROR - could not add heat_type column';
                return false;
            }
        case version_compare($currentVersion, '1.2.1', '<'):
            $content[] = '<pre>1.2.1 updates
---------------
- Improved look with Bootstrapping.</pre>';
        case version_compare($currentVersion, '1.2.2', '<'):
            $content[] = '<pre>1.2.2 updates
---------------
+ Added gas heat and fiber internet/tv.
</pre>';
        case version_compare($currentVersion, '1.3.0', '<'):
            $content[] = <<<EOF
<pre>1.3.0 updates
-----------------
+ Changed login box for IE users
+ Added ability to view properties by contact.
+ Contacts list compacted. Email links to contact name.
+ Fixed bad function call on error page.
+ Added error checks in case 1) the property does not exists or not active or
  2) the image files are not present.
+ Test for incactive properties preventing error.
+ Added Bootstrap styling and overhauled to work on mobile devices.
+ Last logged defaults to creation date.
+ Fixed Shared Bedroom and Bathroom settings on roommates page.
+ Fixed active/inactive buttons.
</pre>
EOF;
        case version_compare($currentVersion, '1.4.0', '<'):
            if (!is_file(PHPWS_SOURCE_DIR . 'lib/vendor/autoload.php')) {
                $content[] = 'Composer is not installed. Be sure to run `composer install` in your installation\'s lib directory.';
                return false;
            }
            $db = \Database::getDB();
            $t1 = $db->addTable('prop_contacts');
            $dt = $t1->addDataType('private', 'smallint');
            $dt->setDefault(0);
            $dt->add();
            $dt2 = $t1->addDataType('approved', 'smallint');
            $dt2->setDefault(1);
            $dt2->add();
            $t1->addFieldConditional('company_name', 'private%', 'like');
            $t1->addValue('private', 1);
            $db->update();
            $old = $t1->getDataType('company_name');
            $new = clone $old;
            $new->setIsNull(true);
            $t1->alter($old, $new);
            $content[] = <<<EOF
<pre>1.4.0 updates
-----------------
+ Added Private Renter designation.
+ Added new manager signup.
</pre>
EOF;
        case version_compare($currentVersion, '1.4.1', '<'):
            $content[] = <<<EOF
<pre>1.4.1 updates
-----------------
+ New user signup requires all email settings to be set.
+ Invalid and duplicate email addresses are now checked on signup.
</pre>
EOF;
        case version_compare($currentVersion, '1.4.2', '<'):
            $content[] = <<<EOF
<pre>1.4.2 updates
-----------------
+ Fixed: New managers could log in before approved.
</pre>
EOF;
    }
    return true;
}
 public static function postMeta()
 {
     $values['page_title'] = strip_tags($_POST['page_title']);
     $values['meta_keywords'] = strip_tags($_POST['meta_keywords']);
     $values['meta_description'] = strip_tags($_POST['meta_description']);
     if (isset($_POST['index'])) {
         $index = 1;
     } else {
         $index = 0;
     }
     if (isset($_POST['follow'])) {
         $follow = 1;
     } else {
         $follow = 0;
     }
     PHPWS_Settings::set('layout', 'use_key_summaries', (int) isset($_POST['use_key_summaries']));
     PHPWS_Settings::save('layout');
     $values['meta_robots'] = $index . $follow;
     if (isset($_POST['key_id'])) {
         $key_id = (int) $_POST['key_id'];
     }
     if (isset($key_id)) {
         $values['key_id'] = $key_id;
         $db = new PHPWS_DB('layout_metatags');
         $db->addWhere('key_id', $key_id);
         $db->delete();
         if (isset($_POST['reset'])) {
             return true;
         }
         $db->reset();
         $db->addValue($values);
         return $db->insert();
     } else {
         $db = new PHPWS_DB('layout_config');
         $db->addValue($values);
         return $db->update();
     }
 }
Beispiel #22
0
/**
 *
 * @author theFergus <kevin at tux dot appstate dot edu>
 */
function hms_update(&$content, $currentVersion)
{
    $files = array();
    switch ($currentVersion) {
        case version_compare($currentVersion, '0.1.2', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_2.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/rlc_signup_form_page2.tmp';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = _('+ RLC application form template');
            $content[] = _('+ RLC application table');
        case version_compare($currentVersion, '0.1.3', '<'):
            $files[] = 'templates/student/rlc_signup_confirmation.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = _('+ Complete system for RLC applications');
        case version_compare($currentVersion, '0.1.4', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_4.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/display_final_rlc_assignments.tpl';
            $files[] = 'templates/admin/display_rlc_student_detail_form_questions.tpl';
            $files[] = 'templates/admin/make_new_rlc_assignments.tpl';
            $files[] = 'templates/admin/make_new_rlc_assignments_summary.tpl';
            $files[] = 'templates/admin/display_rlc_student_detail.tpl';
            $files[] = 'templates/admin/deadlines.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = _('+ RLC administration templates');
            $content[] = _('+ Deadline for Questionnaire replaced by deadlines for Profile and Application');
            $content[] = _('+ Deadline added for editing applications');
            $content[] = _('+ Deadline added for submitting RLC applications');
        case version_compare($currentVersion, '0.1.5', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_5.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/deadlines.tpl';
            $files[] = 'templates/admin/statistics.tpl';
            $files[] = 'templates/student/application_search.tpl';
            $files[] = 'templates/student/application_search_pager.tpl';
            $files[] = 'templates/student/application_search_results.tpl';
            $files[] = 'templates/student/contract.tpl';
            $files[] = 'templates/student/student_application.tpl';
            $files[] = 'templates/student/student_application_combined.tpl';
            $files[] = 'templates/student/student_application_redo.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = _('+ Fixed RLC deadline bug in deadlines.tpl');
            $content[] = _('+ Added Number of People Assigned');
            $content[] = _('+ Added Number of Applications Received');
            $content[] = _('+ Added Number of Learning Community Applications Received');
            $content[] = _('+ Refactored questionnaire references to application');
            $content[] = _('+ Added the contract verbage for when a student first logs in');
            $content[] = _('+ Completed Housing applications now go straight into the RLC application if the student said they were interested');
            $content[] = _('+ Added link to allow students to go to the RLC application on first login as soon as they complete an application');
            $content[] = _('+ Added link to the pdf of the contract for students that want to print it out');
        case version_compare($currentVersion, '0.1.6', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_6.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/misc/login.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = _('+ Modifying permissions for RLC admins to approve members and assign to rooms');
            $content[] = _('+ Added verbage for students to see before they login');
        case version_compare($currentVersion, '0.1.7', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_7.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/make_new_rlc_assignments_summary.tpl';
            $files[] = 'templates/admin/rlc_assignments_page.tpl';
            $files[] = 'templates/admin/add_floor.tpl';
            $files[] = 'templates/admin/display_room_data.tpl';
            $files[] = 'templates/admin/display_hall_data.tpl';
            $files[] = 'templates/admin/get_hall_floor_room.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Removed capacity_per_room';
            $content[] = '+ Added bedrooms_per_room';
            $content[] = '+ Added beds_per_bedroom';
            $content[] = '+ Added list of existing halls when adding new halls';
            $content[] = '+ Room assignments working - assignments now by bed instead of room';
        case version_compare($currentVersion, '0.1.8', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_8.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/display_learning_community_data.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/display_hall_data.tpl';
            $files[] = 'templates/admin/add_floor.tpl';
            $files[] = 'templates/admin/display_floor_data.tpl';
            $files[] = 'templates/student/student_application.tpl';
            $files[] = 'templates/admin/select_room_for_delete.tpl';
            $files[] = 'templates/admin/display_room_data.tpl';
            $files[] = 'templates/admin/verify_delete_room.tpl';
            $files[] = 'templates/admin/select_floor_for_delete_room.tpl';
            $files[] = 'templates/misc/side_thingie.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added abbreviation and capacity changes to Add RLC template. They now properly save and delete.';
            $content[] = '+ Deleting a building now deletes the bedrooms and beds in that building.';
            $content[] = '+ Hid Edit Building temporarily. Bedroom/bed maintenance needs to be finished first.';
            $content[] = '+ Editing a floor works again. Can not delete/add rooms from floor maintenance, must go through room menu.';
            $content[] = '+ Removed gender option from student_application.tpl';
        case version_compare($currentVersion, '0.1.9', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_9.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Sync\'d with the current live release.';
        case version_compare($currentVersion, '0.1.10', '<'):
            $files[] = 'templates/admin/assign_floor.tpl';
            $files[] = 'templates/admin/bed_and_id.tpl';
            $files[] = 'templates/admin/get_hall_floor.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/select_floor_for_edit.tpl';
            $files[] = 'templates/admin/select_residence_hall.tpl';
            $files[] = 'templates/admin/select_room_for_edit.tpl';
            $files[] = 'templates/student/student_application.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Changed templates regarding editing/deleting rooms and floors to be more user friendly';
            $content[] = '+ Changed to version 0.1.10 to get all dev sites and production site in sync';
            $content[] = '+ Changed HMS_Room so beds are deleted manually instead of through a db object';
            $content[] = '+ Added mechanism to handle mass assignment of an entire floor';
            $content[] = '+ Added student\'s name and gender to student application template';
            $content[] = '+ All locations where usernames are saved have been extended to size 32';
            $content[] = '+ All RLC question response lengths have been extended to 2048 characters';
            $content[] = '+ WSDL modified to reflect change in Web Services server location';
        case version_compare($currentVersion, '0.1.11', '<'):
            $content[] = '+ Fixed minor glitch where assignment by room range was pulling rooms incorrectly (did not take floor number into account)';
        case version_compare($currentVersion, '0.1.12', '<'):
            $files[] = 'templates/student/contract.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Contract text now shows in a scrollable iframe';
            $content[] = '+ PDF of the contract now opens in a new tab/window';
            $content[] = '+ Link to Acrobat download, opens in new tab/window';
            $content[] = '+ Added link to a FAQ page. We need to make sure there *is* a FAQ page.';
        case version_compare($currentVersion, '0.1.13', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_13.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/bed_and_id.tpl';
            $files[] = 'templates/misc/side_thingie.tpl';
            $files[] = 'templates/student/profile_form.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Jeremy\'s updates to the side bar and various debugging options';
            $content[] = '+ Alphabetization of hall drop-downs';
            $content[] = '+ Assign by floor should always show ascending room numbers';
            $content[] = '+ Fixed bug in assign by floor that kept *all* assignments from going through';
            $content[] = '+ At building creation, all deleteds should be set to 0 instead of NULL';
            $content[] = '+ Added mechanism to allow viewing of all available and assigned rooms/beds in a hall';
            $content[] = '+ Various bug and syntax fixes by Jeremy';
            $content[] = '+ Added meal plan option when assigning by an entire floor';
            $content[] = '+ Adjusted color of "optionally skipped" items in side thingie';
            $content[] = '+ Added a template for the profile form';
        case version_compare($currentVersion, '0.1.14', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_14.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/profile_form.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Updated profile_form template';
        case version_compare($currentVersion, '0.1.15', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_15.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/student_success_failure_message.tpl';
            $files[] = 'templates/admin/deadlines.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/display_final_rlc_assignments.tpl';
            $files[] = 'templates/admin/rlc_assignments_pager.tpl';
            $files[] = 'templates/admin/make_new_rlc_assignments_summary.tpl';
            $files[] = 'templates/student/rlc_application.tpl';
            $files[] = 'templates/student/profile_form.tpl';
            $files[] = 'templates/student/verify_single_student.tpl';
            $files[] = 'templates/admin/get_single_username.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added success/failure message template';
            $content[] = '+ Added unique constraint to user_id column in student profiles.';
            $content[] = '+ Added new deadlines (for profiles) to the deadlines page.';
            $content[] = '+ Allowed access to RLC assignments on the maintenance page.';
            $content[] = '+ Finalized Final RLC Assignments page.';
            $content[] = '+ Fixed formatting in the RLC Applicatition assignments pager and the corresponding summary.';
            $content[] = '+ Added student viewing of their RLC applications.';
        case version_compare($currentVersion, '0.1.16', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_16.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/profile_form.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added "writing" column to student_profiles table';
            $content[] = '+ Adjusted student profile template for reuse in viewing profiles';
            $content[] = '+ jtickle\'s additions for ordering RLC applications';
        case version_compare($currentVersion, '0.1.17', '<'):
            $content[] = '+ Added profile editing!';
        case version_compare($currentVersion, '0.1.18', '<'):
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/student/profile_form.tpl';
            $files[] = 'templates/profile_search.tpl';
            $files[] = 'templates/profile_search_pager.tpl';
            $files[] = 'templates/profile_search_results.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Yay for searching by student';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added profile searching!';
            $content[] = '+ Added code to prevent duplicate RLC Applications';
            $content[] = '+ Improved "Side Thingie" to show roomate status/deadlines';
        case version_compare($currentVersion, '0.1.19', '<'):
            $files[] = 'templates/admin/rlc_assignments_pager.tpl';
            $files[] = 'templates/admin/make_new_rlc_assignments.tpl';
            $files[] = 'templates/student/show_student_info.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/rlc_roster.tpl';
            $files[] = 'templates/admin/rlc_roster_table.tpl';
            $files[] = 'templates/admin/search_by_rlc.tpl';
            $files[] = 'templates/admin/full_name_gender_email.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Minor improvement to RLC Assignments pager';
            $content[] = '+ Yay for searching by student actually working';
            $content[] = '+ Yay for searching by RLC =)';
        case version_compare($currentVersion, '0.1.21', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_21.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/rlc_application.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '* Modified some text when viewing a RLC app for less clutter';
            $content[] = 'Roommate preference (or assigned roommate) listed in the RLC application export';
            $content[] = '+ Added support for an aggregate value in the application';
            $content[] = 'Calculating Aggregates...';
            $db = new PHPWS_DB('hms_application');
            $db->addColumn('id');
            $db->addColumn('term_classification');
            $db->addColumn('student_status');
            $db->addColumn('preferred_bedtime');
            $db->addColumn('room_condition');
            $result = $db->select();
            if (PEAR::isError($result)) {
                return $result;
            }
            /*
             * The following is weird, and I just wanted to take a few minutes
             * to explain exactly what the hell is going on here.  Any students
             * in the database at this point have filled out an application but
             * do not have the aggregate number that is used to autoassign
             * roommates.  What follows generates the appropriate aggregate
             * number for each student.  The aggregate number is a bitmask that
             * will end up looking like this:
             *
             * Bits Meaning
             * 43   term_classification
             * 2    student_status
             * 1    preferred_bedtime
             * 0    room_condition
             *
             * Unfortunately, this code is duplicated in HMS_Application.
             * Fortunately, this code should only be needed once.
             */
            $i = 0;
            foreach ($result as $row) {
                $aggregate = 0;
                $aggregate |= $row['term_classification'] - 1 << 3;
                $aggregate |= $row['student_status'] - 1 << 2;
                $aggregate |= $row['preferred_bedtime'] - 1 << 1;
                $aggregate |= $row['room_condition'] - 1;
                $db->reset();
                $db->addWhere('id', $row['id']);
                $db->addValue('aggregate', $aggregate);
                $result = $db->update();
                if (PEAR::isError($result)) {
                    return $result;
                }
                $i++;
            }
            $content[] = "+ Calculated {$i} aggregates.";
        case version_compare($currentVersion, '0.1.22', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_22.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/display_room_data.tpl';
            $files[] = 'templates/student/profile_search_pager.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = "* Fixed bug in pagination of student profile results";
            $content[] = '** Bug still exists where search values need to be set in $_SESSION';
            $content[] = "+ Added 'displayed room number' to room editing";
            $content[] = "+ Added 'displayed room number' to the assign by floor/mass assignment page";
            $content[] = "+ Fixed bug in assigned RLC members page where address/telephone number were displaying incorrectly or not at all";
        case version_compare($currentVersion, '0.1.23', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_23.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $content[] = '+ Increased length of the asu_username field for RLC assignments';
            $content[] = '+ Added stateful pagination when assigning people to RLCs';
            $content[] = '+ Corrected count when viewing the Learning Community Assignments';
        case version_compare($currentVersion, '0.1.24', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_24.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/show_student_info.tpl';
            $files[] = 'templates/admin/add_floor.tpl';
            $files[] = 'templates/admin/display_floor_data.tpl';
            $files[] = 'templates/admin/display_room_data.tpl';
            $files[] = 'templates/admin/display_hall_data.tpl';
            $files[] = 'templates/admin/add_room.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added a _deleted_ flag to hms_assignment';
            $content[] = '+ Added a timestamp field to hms_assignment';
            $content[] = '+ Added a move_student method to move a single student between rooms';
            $content[] = '+ Student Housing Application now a link when displaying other student information (results from a search)';
            $content[] = '+ Added a flag to hms_room for private rooms';
            $content[] = '+ Added a flag to hms_room for ra rooms';
            $content[] = '+ Added a flag to hms_room for freshman reserved rooms';
            $content[] = '+ Student\'s first, middle and last names now show beside the username at the building overview page of assigned rooms/students';
            $content[] = '+ Added method to add a room to a floor';
            $content[] = '+ Added pricing tier to the room. Always.';
            $content[] = '+ Added roommate status to the student search results.';
        case version_compare($currentVersion, '0.1.25', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_25.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/full_name_gender_email.tpl';
            $files[] = 'templates/admin/rlc_roster_table.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/verify_break_roommates.tpl';
            $files[] = 'templates/admin/confirm_remove_from_rlc.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Fixed numerous bugs that arrived with the _deleted_ flag';
            $content[] = '+ Added the ability to review RLC Applications after assignment';
            $content[] = '+ Fixed error reporting for assigning students to nonexistent rooms';
            $content[] = '+ Re-instated the ability to create and break roommates';
            $content[] = '+ Auto Assignment';
        case version_compare($currentVersion, '0.1.26', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_26.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $content[] = '+ Letters are ready!';
        case version_compare($currentVersion, '0.1.27', '<'):
            $files[] = 'templates/student/show_student_info.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added ability to change meal plans to student search screen';
        case version_compare($currentVersion, '0.1.28', '<'):
            $files[] = 'templates/admin/display_floor_Data.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added ability to change movein times per floor';
        case version_compare($currentVersion, '0.1.29', '<'):
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/get_hall_floor_room.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ OMG BANNER WORKS hopefully';
        case version_compare($currentVersion, '0.1.30', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_30.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/deadlines.tpl';
            $files[] = 'templates/student/main_menu_spring.tpl';
            $files[] = 'templates/student/main_menu_fall.tpl';
            $files[] = 'templates/student/student_application.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Added check to prevent students selecting themselves as roommates';
            $content[] = '+ Added check to make sure a requested roommate has a housing application';
            $content[] = '+ Cleaned up main menu, added checks for deadlines for menu options';
            $content[] = '+ Fixed colors for messages returned when setting deadlines (UI)';
            $content[] = '+ Added entry term to hms_application and rlc application tables';
            $content[] = '+ Added entry term to student application';
        case version_compare($currentVersion, '0.1.31', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_31.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/rlc_signup_form_page1.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Added some verbage and a link to the top of the RLC signup form.';
            $content[] = '+ Added activity log table';
        case version_compare($currentVersion, '0.1.32', '<'):
            $files[] = 'templates/admin/display_room_data.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Updated edit room template to disallow room gender changes is someone is assigned.';
        case version_compare($currentVersion, '0.1.33', '<'):
            $files[] = 'templates/admin/display_room_data.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.0', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_0.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/edit_terms.tpl';
            $files[] = 'templates/admin/term_pager.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Added term database and term admin to maintenance panel';
        case version_compare($currentVersion, '0.2.1', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_1.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $content[] = '+ Renamed entry_term column in hms_application to term';
        case version_compare($currentVersion, '0.2.2', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_2.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.3', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_3.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/edit_terms.tpl';
            $files[] = 'templates/admin/add_term.tpl';
            $fiels[] = 'maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Redesigned hall structure';
            $content[] = '+ Massive db update for hall structure changes';
            $content[] = '+ Seperated add term and edit term pages';
        case version_compare($currentVersion, '0.2.4', '<'):
            $files[] = 'templates/admin/assign_student.tpl';
            $files[] = 'templates/admin/unassign_student.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.5', '<'):
            $files[] = 'templates/admin/select_residence_hall.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.6', '<'):
            $files[] = 'templates/admin/assign_student_move_confirm.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.7', '<'):
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Maintenance template was phoned in, now properly updated';
        case version_compare($currentVersion, '0.2.8', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_8.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/select_room.tpl';
            $files[] = 'template/admin/maintenance.tpl';
            $files[] = 'templates/admin/edit_room.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Room selection for editing rooms now works';
            $content[] = '+ Added Queue system for "offline" editing of assignments';
            $content[] = '+ Room editing also works now';
        case version_compare($currentVersion, '0.2.9', '<'):
            $files[] = 'templates/admin/select_room.tpl';
            $files[] = 'templates/admin/edit_room.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'template/admin/assignment_pager_by_room.tpl';
            $files[] = 'javascript/assign_student/head.js';
            $fiels[] = 'javascript/select_room/head.js';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Added queue items to Maintenance panel';
            $content[] = '+ Removed "move student" link';
            $content[] = '+ Added assignment pager to room edit page';
        case version_compare($currentVersion, '0.2.10', '<'):
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/edit_room.tpl';
            $files[] = 'templates/admin/select_suite.tpl';
            $files[] = 'javascript/select_suite/head.js';
            $files[] = 'templates/admin/edit_suite.tpl';
            $files[] = 'templates/admin/room_pager_by_suite.tpl';
            $files[] = 'templates/admin/assignment_pager_by_suite.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Added ability to edit suites.';
            $content[] = '+ Fixed "DB Error" in queued assignments';
        case version_compare($currentVersion, '0.2.12', '<'):
            $files[] = 'javascript/autosuggest/autosuggest.js';
            $files[] = 'javascript/autosuggest/head.js';
            $files[] = 'javascript/autosuggest/zxml.js';
            $files[] = '/templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = 'Autoassigner baby!';
            $content[] = 'Autocompletion for usernames';
        case version_compare($currentVersion, '0.2.13', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_13.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/movein_time_pager.tpl';
            $files[] = 'templates/admin/edit_movein_time.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'javascript/select_floor/head.js';
            $files[] = 'templates/admin/select_floor.js';
            $files[] = 'templates/admin/display_floor_data.tpl';
            $files[] = 'templates/admin/edit_room.tpl';
            $files[] = 'templates/admin/select_room.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.14', '<'):
            $db = new PHPWS_DB();
            $result = $db->query('ALTER TABLE hms_floor DROP COLUMN ft_movein;');
            if (PEAR::isError($result)) {
                return $result;
            }
            $result = $db->query('ALTER TABLE hms_floor DROP COLUMN c_movein;');
            if (PEAR::isError($result)) {
                return $result;
            }
            $result = $db->query('ALTER TABLE hms_floor ADD COLUMN ft_movein_time_id smallint REFERENCES hms_movein_time(id);');
            if (PEAR::isError($result)) {
                return $result;
            }
            $result = $db->query('ALTER TABLE hms_floor ADD COLUMN rt_movein_time_id smallint REFERENCES hms_movein_time(id);');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/room_pager_by_floor.tpl';
            $files[] = 'templates/admin/edit_floor.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.15', '<'):
            $files[] = 'templates/admin/floor_pager_by_hall.tpl';
            $files[] = 'templates/admin/edit_residence_hall.tpl';
            $files[] = 'templates/admin/select_residence_hall.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.16', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_16.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/edit_room.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.17', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_17.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/select_bed.tpl';
            $files[] = 'templates/admin/edit_bed.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'javascript/select_bed/head.js';
            $files[] = 'templates/admin/bed_pager_by_room.tpl';
            $files[] = 'templates/admin/edit_room.tpl';
            $files[] = 'javascript/assign_student/head.js';
            $files[] = 'templates/admin/assign_student.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.18', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_18.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/deadlines.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.19', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_19.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/deadlines.tpl';
            $files[] = 'templates/student/freshmen_welcome_screen.tpl';
            $files[] = 'templates/student/freshmen_welcome_screen.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.20', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFIle(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_20.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.21', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFIle(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_21.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/welcome_screen_freshmen.tpl';
            $files[] = 'templates/student/welcome_screen_transfer.tpl';
            $files[] = 'templates/student/welcome_screen_no_entry_term.tpl';
            $files[] = 'templates/student/welcome_screen_deadline_past.tpl';
            $files[] = 'templates/student/welcome_screen_non_traditional.tpl';
            $files[] = 'templates/student/welcome_screen_too_soon.tpl';
            $files[] = 'templates/student/contact_page.tpl';
            $files[] = 'templates/student/contact_form_thankyou.tpl';
            $files[] = 'templates/student/rlc_signup_form_page1.tpl';
            $files[] = 'templates/student/rlc_singup_form_page2.tpl';
            $files[] = 'templates/student/rlc_singup_confirmation.tpl';
            $files[] = 'templates/student/student_application.tpl';
            $files[] = 'templates/student/main_menu_fall.tpl';
            $files[] = 'templates/admin/assign_student.tpl';
            $files[] = 'templates/admin/deadlines.tpl';
            $files[] = 'templates/admin/rlc_assignments_pager.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.22', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_22.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.23', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_23.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/roommate_accept_reject_form.tpl';
            $files[] = 'templates/student/select_roommate.tpl';
            $files[] = 'templates/student/requestor_handle_rlc_application.tpl';
            $files[] = 'templates/student/select_roommate_confirmation.tpl';
            $files[] = 'templates/student/roommate_accept_reject_screen.tpl';
            $files[] = 'templates/student/main_menu_fall.tpl';
            $files[] = 'templates/student/roommate_accept_done.tpl';
            $files[] = 'templates/student/roommate_reject_done.tpl';
            $files[] = 'templates/student/requested_roommate_list.tpl';
            $files[] = 'templates/student/roommate_accept_confirm.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.24', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_24.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.25', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_25.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/edit_floor.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.26', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_26.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/display_final_rlc_assignments.tpl';
            $files[] = 'templates/student/show_student_info.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.28', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_28.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/term_pager.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
        case version_compare($currentVersion, '0.2.29', '<'):
            PHPWS_Boost::registerMyModule('hms', 'users', $content);
            $files[] = 'templates/admin/permission_denied.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.30', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_30.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/make_new_rlc_assignments.tpl';
            $files[] = 'templates/admin/rlc_assignments_pager.tpl';
            $files[] = 'templates/admin/view_by_rlc_pager.tpl';
            $files[] = 'templates/admin/rlc_roster.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/log_pager.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.31', '<'):
            PHPWS_Boost::registerMyModule('hms', 'users', $content);
            // ust need to update the permissions
        // ust need to update the permissions
        case version_compare($currentVersion, '0.2.32', '<'):
            $files[] = 'templates/admin/show_confirmed_roommates.tpl';
            $files[] = 'templates/admin/roommate_pager.tpl';
            $files[] = 'templates/admin/create_roommate_group.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.33', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_33.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.34', '<'):
            $files[] = 'templates/admin/display_reports.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = 'Added Special Needs report.';
            $content[] = 'Reports now better suited for printing.';
        case version_compare($currentVersion, '0.2.35', '<'):
            $files[] = 'templates/admin/statistics.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $db = new PHPWS_Db();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_35.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $content[] = 'Updated Statistics Template';
            $content[] = 'Updated Term Information';
        case version_compare($currentVersion, '0.2.36', '<'):
            $db = new PHPWS_Db();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_36.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.40', '<'):
            PHPWS_Boost::registerMyModule('hms', 'users', $content);
            // ust need to update the permissions
        // ust need to update the permissions
        case version_compare($currentVersion, '0.2.41', '<'):
            $files[] = 'templates/admin/activity_log_pager.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
        case version_compare($currentVersion, '0.2.42', '<'):
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $db = new PHPWS_Db();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_42.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.45', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.2.46', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.2.49', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_49.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.50', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_50.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.51', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_51.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.52', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_52.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.0', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_0.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.1', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_1.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.2', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_2.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.3', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_3.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.5', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.3.7', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_7.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.8', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_8.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.9', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_9.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.10', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_10.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.11', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.3.13', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_13.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.16', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_16.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.17', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_17.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.18', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_18.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.19', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_19.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.20', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_20.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.21', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_21.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.31', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_31.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.0', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_0.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.1', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_1.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.2', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_2.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.3', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_3.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.4', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_4.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.5', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_5.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.6', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_6.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.7', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_7.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.9', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_9.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.12', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_12.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.13', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_13.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.14', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_14.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.15', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.18', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.19', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_19.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.22', '<'):
            $files[] = 'templates/admin/floor_assignment.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.23', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_23.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.24', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_24.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.26', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_26.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.28', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_28.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.30', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.32', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_32.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.33', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_33.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.34', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_34.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.35', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_35.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.37', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_37.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.38', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_38.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.39', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_39.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.42', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_42.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.43', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_43.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.44', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_44.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.45', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_45.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.47', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_47.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.48', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_48.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.49', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_49.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.50', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_50.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.51', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_51.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.52', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_52.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.53', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_53.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.55', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_55.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.61', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_61.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.63', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-63.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.66', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-66.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.67', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-67.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.68', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-68.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.69', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-69.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.70', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-70.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.71', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.72', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-72.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.73', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-73.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.74', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-74.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.75', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-75.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.77', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.78', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-78.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.79', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-79.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.80', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-80.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.81', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-81.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.82', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.83', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-83.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.84', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.85', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-85.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.86', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-86.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.87', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.88', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-88.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.89', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-89.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.90', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-90.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.91', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-91.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.92', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-92.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.0', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-00.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.1', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-01.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.2', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-02.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.3', '<'):
            PHPWS_Core::initCoreClass('Module.php');
            $module = new \PHPWS_Module('pulse', false);
            $pulse_version = $module->getVersion();
            if (version_compare($pulse_version, '2.0.0', '<')) {
                $content[] = '<p style="color:red;font-weight:bold">Pulse needs to be upgraded.</p>';
            }
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-03.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.4', '<'):
            $content[] = '<pre>Adding hms_hall_structure view.</pre>';
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-04.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.5', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-05.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.6', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-06.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
    }
    return TRUE;
}
Beispiel #23
0
 public function fixDocumentDirectories()
 {
     $directory = PHPWS_Settings::get('filecabinet', 'base_doc_directory');
     $db = new PHPWS_DB('documents');
     $db->addColumn('id');
     $db->addColumn('file_directory');
     $result = $db->select();
     if (empty($result) || PHPWS_Error::logIfError($result)) {
         return;
     }
     foreach ($result as $doc) {
         $db->reset();
         $db->addWhere('id', $doc['id']);
         $old_dir = $doc['file_directory'];
         $old_dir_array = explode('/', $old_dir);
         // space usually at end of array, but just in case
         $last_dir = array_pop($old_dir_array);
         if (empty($last_dir)) {
             $last_dir = array_pop($old_dir_array);
         }
         $new_dir = $directory . $last_dir . '/';
         if (!empty($last_dir)) {
             $db->addWhere('id', $doc['id']);
             $db->addValue('file_directory', $new_dir);
             PHPWS_Error::logIfError($db->update());
         }
     }
 }
 private function lengthenLinks()
 {
     $db = new PHPWS_DB('menu_links');
     $db->addColumn('id');
     $db->addColumn('url');
     $db->addColumn('key_id');
     $db->addWhere('url', 'pagesmith/[0-9]+$', 'regexp');
     $result = $db->select();
     if (empty($result)) {
         return true;
     } elseif (PHPWS_Error::logIfError($result)) {
         return false;
     }
     $db->reset();
     $db2 = new PHPWS_DB('phpws_key');
     foreach ($result as $link) {
         $link['url'] = preg_replace('@pagesmith/(\\d+)$@', 'index.php?module=pagesmith&uop=view_page&id=\\1', $link['url']);
         $db->addValue($link);
         $db->addWhere('id', $link['id']);
         if (!PHPWS_Error::logIfError($db->update()) && $link['key_id']) {
             $db2->addValue('url', $link['url']);
             $db2->addWhere('id', $link['key_id']);
             PHPWS_Error::logIfError($db2->update());
             $db2->reset();
         }
         $db->reset();
     }
 }
Beispiel #25
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function checkin_update(&$content, $current_version)
{
    switch (1) {
        case version_compare($current_version, '1.0.1', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('checkin_staff');
            if (PHPWS_Error::logIfError($db->addTableColumn('view_order', 'smallint not null default 0'))) {
                $content[] = 'Unable to create checkin_staff.view_order column.</pre>';
                return false;
            } else {
                $content[] = 'Created checkin_staff.view_order column.';
            }
            $db->addColumn('id');
            $staff_list = $db->select('col');
            if (!empty($staff_list)) {
                $count = 1;
                foreach ($staff_list as $staff_id) {
                    $db->reset();
                    $db->addWhere('id', $staff_id);
                    $db->addValue('view_order', $count);
                    PHPWS_Error::logIfError($db->update());
                    $count++;
                }
            }
            checkinUpdateFiles(array('templates/visitors.tpl', 'templates/waiting.tpl', 'templates/queue.tpl', 'templates/settings.tpl'), $content);
            $content[] = '1.0.1 changes
------------------
+ Fixed bug with pulling current staff member
+ Added refresh link to waiting and assignment page
+ Fixed report
</pre>';
        case version_compare($current_version, '1.0.2', '<'):
            $content[] = '<pre>';
            checkinUpdateFiles(array('templates/visitors.tpl', 'templates/waiting.tpl', 'templates/style.css'), $content);
            $content[] = '1.0.2 changes
--------------------
+ Fixed translation typo.
+ Added "Send back" condition</pre>';
        case version_compare($current_version, '1.0.3', '<'):
            $content[] = '<pre>';
            checkinUpdateFiles(array('templates/report.tpl'), $content);
            $content[] = '1.0.3 changes
--------------------
+ Removed error message from report if no reasons created
+ Added the time of arrival to the report
+ Changed report date entry interface
+ Upper cased names.
</pre>';
        case version_compare($current_version, '1.0.4', '<'):
            $content[] = '<pre>1.0.4 changes
---------------------
+ Fixed waiting time setting</pre>';
        case version_compare($current_version, '1.1.0', '<'):
            $content[] = '<pre>1.1.0 changes
---------------------
+ Added code to prevent refreshed duplicates
+ Fixed possible error in admin view
+ Added monthly and student reports
+ Added report for number of times a visitor has visited within 30 days.
+ PHP 5 Strict changes</pre>';
        case version_compare($current_version, '1.1.1', '<'):
            $content[] = '<pre>1.1.1 changes
---------------------
+ Reports limited to admins</pre>';
        case version_compare($current_version, '1.2', '<'):
            $db = new PHPWS_DB('checkin_staff');
            $db->addTableColumn('active', 'smallint not null default 1');
            $content[] = '<pre>1.2 changes
--------------
+ Fixed blue button on admin menu
+ Staff can now be deactivated so they appear on reports but do not receive visitors</pre>';
        case version_compare($current_version, '1.3', '<'):
            $db = new PHPWS_DB('checkin_visitor');
            $db->addTableColumn('email', 'varchar(255) NULL');
            $content[] = '<pre>1.3 changes
---------------
+ Option to collect visitor email addresses.</pre>';
        case version_compare($current_version, '1.4.0', '<'):
            $content[] = '<pre>1.4.0 changes
---------------
+ May now report by visitor name.</pre>';
        case version_compare($current_version, '1.5.0', '<'):
            $content[] = '<pre>';
            // Make changes to checkin_visitor table
            $db = new PHPWS_DB('checkin_visitor');
            if (PHPWS_Error::logIfError($db->addTableColumn('gender', 'varchar(20) default NULL'))) {
                $content[] = 'Unable to create checkin_visitor.gender column.</pre>';
                return false;
            } else {
                $content[] = 'Created checkin_visitor.gender column.';
            }
            if (PHPWS_Error::logIfError($db->addTableColumn('birthdate', 'varchar(20) default NULL'))) {
                $content[] = 'Unable to create checkin_visitor.birthdate column.</pre>';
                return false;
            } else {
                $content[] = 'Created checkin_visitor.birthdate column.';
            }
            // Make changes to checkin_staff table
            $db = new PHPWS_DB('checkin_staff');
            if (PHPWS_Error::logIfError($db->addTableColumn('birthdate_filter_end', 'varchar(20) default NULL', 'f_regexp'))) {
                $content[] = 'Unable to create checkin_staff.birthdate_filter_end column.</pre>';
                return false;
            } else {
                $content[] = 'Created checkin_staff.birthdate_filter_end column.';
            }
            if (PHPWS_Error::logIfError($db->addTableColumn('birthdate_filter_start', 'varchar(20) default NULL', 'f_regexp'))) {
                $content[] = 'Unable to create checkin_staff.birthdate_filter_start column.</pre>';
                return false;
            } else {
                $content[] = 'Created checkin_staff.birthdate_filter_start column.';
            }
            if (PHPWS_Error::logIfError($db->addTableColumn('gender_filter', 'varchar(20) default NULL', 'f_regexp'))) {
                $content[] = 'Unable to create checkin_staff.gender_filter column.</pre>';
                return false;
            } else {
                $content[] = 'Created checkin_staff.gender_filter column.';
            }
            if (PHPWS_Error::logIfError($db->query('ALTER TABLE checkin_staff CHANGE filter lname_filter varchar(255) default NULL'))) {
                $content[] = 'Unable to rename checkin_staff.filter column.</pre>';
                return false;
            } else {
                $content[] = 'Renamed checkin_staff.filter to checkin_staff.lname_filter.';
            }
            if (PHPWS_Error::logIfError($db->query('ALTER TABLE checkin_staff CHANGE f_regexp lname_regexp varchar(255) default NULL'))) {
                $content[] = 'Unable to rename checkin_staff.f_regexp column.</pre>';
                return false;
            } else {
                $content[] = 'Renamed checkin_staff.f_regexp to checkin_staff.lname_regexp.';
            }
            $content[] = '1.5.0 changes
---------------
+ Fixed the "print view" for daily reports.
+ Option to collect visitor gender.
+ Option to collect visitor birthdate.
+ Added staff filters for gender and birthdate.
+ Staff can now have more than one filter.</pre>';
        case version_compare($current_version, '1.5.1', '<'):
            $content[] = '<pre>1.5.1 changes
----------------
+ Fixed some bugs and notices</pre>';
    }
    return true;
}
Beispiel #26
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function signup_update(&$content, $currentVersion)
{
    switch ($currentVersion) {
        case version_compare($currentVersion, '1.0.1', '<'):
            $content[] = '<pre>';
            $files = array('templates/slot_setup.tpl');
            signupUpdateFiles($files, $content);
            $content[] = '1.0.1 changes
----------------
+ Added ability to reset slot order should it come unraveled.
+ Fixed reroute link that was hard coded to go to sheet id 1.</pre>';
        case version_compare($currentVersion, '1.0.2', '<'):
            $content[] = '<pre>1.0.2 changes
----------------
+ Changed email to send individually.
+ Fixed: "All slots full" message was not displaying.</pre>';
        case version_compare($currentVersion, '1.1.0', '<'):
            $content[] = '<pre>';
            PHPWS_Boost::registerMyModule('signup', 'users', $content);
            $db = new PHPWS_DB('signup_sheet');
            if (PHPWS_Error::logIfError($db->addTableColumn('contact_email', 'varchar(255) default NULL'))) {
                $content[] = '--- Failed creating new column on signup_sheet.</pre>';
                return false;
            } else {
                $content[] = '--- contact_email column created successfully on signup_sheet table.';
            }
            if (PHPWS_Error::logIfError($db->addTableColumn('multiple', 'smallint NOT NULL default 0'))) {
                $content[] = '--- Failed creating new column on signup_sheet.</pre>';
                return false;
            } else {
                $content[] = '--- "multiple" column created successfully on signup_sheet table.';
            }
            $files = array('templates/peep_pop.tpl', 'templates/slot_setup.tpl', 'templates/edit_sheet.tpl', 'templates/peeps.tpl', 'templates/slot_setup.tpl', 'img/edit.png', 'img/delete.png');
            signupUpdateFiles($files, $content);
            $content[] = '1.1.0 changes
----------------
+ Added way to update slots
+ Added user permissions to signup
+ Removed some unneeded, commented code
+ Added alphabetic reordering
+ Fixed ordering up and downs.
+ Changed slot form to selection method. Previously showed all slots
  causing long page loads on big signups.
+ Added contact email address for sheets.
+ Added url forwarding support.
+ Sheets can be set to allow multiple signups.
</pre>';
        case version_compare($currentVersion, '1.1.1', '<'):
            $content[] = '<pre>';
            signupUpdateFiles(array('templates/sheet_list.tpl', 'templates/slot_setup.tpl'), $content);
            $content[] = '1.1.1 changes
-------------------
+ Restricted users cannot create signup sheets.
+ Added search textfield to slot screen.
+ Added missing navigation links to sheet listing.</pre>';
        case version_compare($currentVersion, '1.1.2', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('signup_sheet');
            if (PHPWS_Error::logIfError($db->addTableColumn('contact_email', 'varchar(255) default NULL'))) {
                $content[] = '--- Failed creating new column on signup_sheet.</pre>';
                return false;
            } else {
                $content[] = '--- contact_email column created successfully on signup_sheet table.';
            }
            if (PHPWS_Error::logIfError($db->addTableColumn('multiple', 'smallint NOT NULL default 0'))) {
                $content[] = '--- Failed creating new column on signup_sheet.</pre>';
                return false;
            } else {
                $content[] = '--- "multiple" column created successfully on signup_sheet table.';
            }
            $content[] = '1.1.2 changes
-------------------
+ Install sql was missing new columns in signup_sheet table.
+ Removed the phone number parsing. Got in the way of extensions and
  the like.
</pre>';
        case version_compare($currentVersion, '1.2.0', '<'):
            $content[] = '<pre>1.2.0 changes
----------------
+ Fixed: signup errors reseting slot pick
+ Removed redundant error message
+ previous register fix would not list empty slots.
+ Removed string length on phone number
+ Only pulling registered users for slots open.
+ PHP 5 formatted.
</pre>';
        case version_compare($currentVersion, '1.2.1', '<'):
            $content[] = '<pre>1.2.1 changes
----------------
+ Removed reference symbols
+ Added dngettext for "openings(s)" translation
+ Rewrote getAllSlots. The slots filled number wasn\'t joining
  properly.
+ Fixed sheet view link.</pre>';
        case version_compare($currentVersion, '1.2.2', '<'):
            $content[] = '<pre>1.2.2 changes
----------------
+ Fixed url sent to key.</pre>';
        case version_compare($currentVersion, '1.3.0', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('signup_peeps');
            $db->addTableColumn('extra1', 'varchar(255) null');
            $db->addTableColumn('extra2', 'varchar(255) null');
            $db->addTableColumn('extra3', 'varchar(255) null');
            $db->query('update signup_peeps set extra1 = organization');
            $db = new PHPWS_DB('signup_sheet');
            $db->addTableColumn('extra1', 'varchar(255) null');
            $db->addTableColumn('extra2', 'varchar(255) null');
            $db->addTableColumn('extra3', 'varchar(255) null');
            $db->addValue('extra1', 'Organization');
            $db->update();
            $files = array('templates/applicants.tpl', 'templates/edit_peep.tpl', 'templates/peeps.tpl', 'templates/signup_form.tpl');
            signupUpdateFiles($files, $content);
            $content[] = '1.3.0 changes
--------------
+ Added extra 1 thru 3 to sheet and peeps for extra questions.
</pre>';
        case version_compare($currentVersion, '1.3.1', '<'):
            $content[] = '<pre>1.3.1 changes
-------------------
+ Fixed incorrect counting of people in slots.</pre>';
        case version_compare($currentVersion, '1.3.2', '<'):
            $content[] = '<pre>1.3.2 changes
-------------------
+ PHP 5 strict fixes.
+ Icon class added</pre>';
        case version_compare($currentVersion, '1.3.3', '<'):
            $content[] = '<pre>1.3.3 changes
-------------------
+ New additions by Chris Coley
 - Added move to bottom and top for slot ordering.
 - Phone number error checked.
 - Refined slot search, only slots with searched member.
 - Start and end times order options on sheet listing.
 - Added clearer instructions to sheet setup.
 - Emails sent according to last search.
 - UI additions to ease administration.
</pre>';
        case version_compare($currentVersion, '1.3.4', '<'):
            $content[] = '<pre>1.3.4 changes
-----------------
+ Fixed bad form on moving slot member</pre>';
        case version_compare($currentVersion, '1.3.5', '<'):
            $db = \Database::newDB();
            $sp = $db->addTable('signup_peeps');
            if (!$sp->columnExists('extra1')) {
                $dt1 = \Database\Datatype::factory($sp, 'extra1', 'varchar');
                $dt1->add();
                $dt2 = \Database\Datatype::factory($sp, 'extra2', 'varchar');
                $dt2->add();
                $dt3 = \Database\Datatype::factory($sp, 'extra3', 'varchar');
                $dt3->add();
            }
            $content[] = '<pre>1.3.5 changes
----------------
+ Installation did not include the extra columns.
</pre>';
        case version_compare($currentVersion, '1.3.6', '<'):
            $db = \Database::newDB();
            $dbtype = $db->getDatabaseType();
            if ($dbtype == 'mysql') {
                $db->query('ALTER TABLE `signup_peeps` MODIFY extra1 VARCHAR(255) DEFAULT NULL');
                $db->query('ALTER TABLE `signup_peeps` MODIFY extra2 VARCHAR(255) DEFAULT NULL');
                $db->query('ALTER TABLE `signup_peeps` MODIFY extra3 VARCHAR(255) DEFAULT NULL');
            } else {
                $db->query('ALTER TABLE signup_peeps ALTER COLUMN extra1 DROP NOT NULL');
                $db->query('ALTER TABLE signup_peeps ALTER COLUMN extra2 DROP NOT NULL');
                $db->query('ALTER TABLE signup_peeps ALTER COLUMN extra3 DROP NOT NULL');
            }
            $content[] = '<pre>1.3.6 changes
----------------
+ Extra peer columns need to be null
</pre>';
    }
    return true;
}
Beispiel #27
0
 public function save()
 {
     if ($this->title != 'core') {
         $db = new PHPWS_DB('modules');
         $db->addWhere('title', $this->title);
         $db->delete();
         $db->resetWhere();
         if (!$this->getProperName()) {
             $this->setProperName($this->getProperName(true));
         }
         $result = $db->saveObject($this);
         if (PHPWS_Error::isError($result)) {
             return $result;
         }
         return $this->saveDependencies();
     } else {
         $db = new PHPWS_DB('core_version');
         $db->addValue('version', $this->version);
         $result = $db->update();
         if (PHPWS_Error::isError($result)) {
             return $result;
         }
     }
 }
 public function execute(CommandContext $context)
 {
     if (!Current_User::allow('hms', 'assignment_notify')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to send assignment notifications.');
     }
     PHPWS_Core::initModClass('hms', 'Term.php');
     PHPWS_Core::initModClass('hms', 'HMS_Email.php');
     PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
     PHPWS_Core::initModClass('hms', 'HMS_Movein_Time.php');
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     PHPWS_Core::initModClass('hms', 'HMS_RLC_Assignment.php');
     // Check if any move-in times are set for the selected term
     $moveinTimes = HMS_Movein_Time::get_movein_times_array(Term::getSelectedTerm());
     // If the array of move-in times ONLY has the zero-th element ['None'] then it's no good
     // Or, of course, if the array is null or emtpy it is no good
     if (count($moveinTimes) <= 1 || is_null($moveinTimes) || empty($moveinTimes)) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'There are no move-in times set for ' . Term::getPrintableSelectedTerm());
         $context->goBack();
     }
     // Keep track of floors missing move-in times
     $missingMovein = array();
     $term = Term::getSelectedTerm();
     $db = new PHPWS_DB('hms_assignment');
     $db->addWhere('email_sent', 0);
     $db->addWhere('term', $term);
     $result = $db->getObjects("HMS_Assignment");
     if (PHPWS_Error::logIfError($result)) {
         throw new DatabaseException($result->toString());
     }
     foreach ($result as $assignment) {
         //get the students real name from their asu_username
         $student = StudentFactory::getStudentByUsername($assignment->getUsername(), $term);
         //get the location of their assignment
         PHPWS_Core::initModClass('hms', 'HMS_Bed.php');
         $bed = new HMS_Bed($assignment->getBedId());
         $room = $bed->get_parent();
         $location = $bed->where_am_i() . ' - Bedroom ' . $bed->bedroom_label;
         // Lookup the floor and hall to make sure the
         // assignment notifications flag is true for this hall
         $floor = $room->get_parent();
         $hall = $floor->get_parent();
         if ($hall->assignment_notifications == 0) {
             continue;
         }
         // Get the student type for determining move-in time
         $type = $student->getType();
         // Check for an accepted and confirmed RLC assignment
         $rlcAssignment = HMS_RLC_Assignment::getAssignmentByUsername($student->getUsername(), $term);
         // If there is an assignment, make sure the student "confirmed" the rlc invite
         if (!is_null($rlcAssignment)) {
             if ($rlcAssignment->getStateName() != 'confirmed' && $rlcAssignment->getStateName() != 'selfselect-assigned') {
                 $rlcAssignment = null;
             }
         }
         // Make sure this is re-initialized
         $moveinTimeId = null;
         $rlcSetMoveinTime = false;
         // Determine the move-in time
         if (!is_null($rlcAssignment)) {
             // If there is a 'confirmed' RLC assignment, use the RLC's move-in times
             $rlc = $rlcAssignment->getRlc();
             if ($type == TYPE_CONTINUING) {
                 $moveinTimeId = $rlc->getContinuingMoveinTime();
             } else {
                 if ($type == TYPE_TRANSFER) {
                     $moveinTimeId = $rlc->getTransferMoveinTime();
                 } else {
                     if ($type == TYPE_FRESHMEN) {
                         $moveinTimeId = $rlc->getFreshmenMoveinTime();
                     }
                 }
             }
         }
         // If there's a non-null move-in time ID at this point, then we know the RLC must have set it
         if (!is_null($moveinTimeId)) {
             $rlcSetMoveinTime = true;
         }
         // If the RLC didn't set a movein time, set it according to the floor
         // TODO: Find continuing students by checking the student's application term
         // against the term we're wending assignment notices for
         if (is_null($moveinTimeId)) {
             if ($type == TYPE_CONTINUING) {
                 $moveinTimeId = $assignment->get_rt_movein_time_id();
             } else {
                 if ($type == TYPE_TRANSFER) {
                     $moveinTimeId = $assignment->get_t_movein_time_id();
                 } else {
                     $moveinTimeId = $assignment->get_f_movein_time_id();
                 }
             }
         }
         // Check for missing move-in times
         if ($moveinTimeId == NULL) {
             //test($assignment, 1); // Will only happen if there's no move-in time set for the floor,student type
             // Lets only keep a set of the floors
             if (!in_array($floor, $missingMovein)) {
                 $missingMovein[] = $floor;
             }
             // Missing move-in time, so skip to the next assignment
             continue;
         }
         // TODO: Grab all the move-in times and index them in an array by ID so we don't have to query the DB every single time
         $movein_time_obj = new HMS_Movein_Time($moveinTimeId);
         $movein_time = $movein_time_obj->get_formatted_begin_end();
         // Add a bit of text if the move-in time was for an RLC
         if ($rlcSetMoveinTime) {
             $movein_time .= ' (for the ' . $rlc->get_community_name() . ' Residential Learning Community)';
         }
         //get the list of roommates
         $roommates = array();
         $beds = $room->get_beds();
         foreach ($beds as $bed) {
             $roommate = $bed->get_assignee();
             if ($roommate == false || is_null($roommate) || $roommate->getUsername() == $student->getUsername()) {
                 continue;
             }
             $roommates[] = $roommate->getFullName() . ' (' . $roommate->getUsername() . '@appstate.edu) - Bedroom ' . $bed->bedroom_label;
         }
         // Send the email
         HMS_Email::sendAssignmentNotice($student->getUsername(), $student->getName(), $term, $location, $roommates, $movein_time);
         // Mark the student as having received an email
         $db->reset();
         $db->addWhere('asu_username', $assignment->getUsername());
         $db->addWhere('term', $term);
         $db->addValue('email_sent', 1);
         $rslt = $db->update();
         if (PHPWS_Error::logIfError($rslt)) {
             throw new DatabaseException($result->toString());
         }
     }
     // Check for floors with missing move-in times.
     if (empty($missingMovein) || is_null($missingMovein)) {
         // Ther are none, so show a success message
         NQ::simple('hms', hms\NotificationView::SUCCESS, "Assignment notifications sent.");
     } else {
         // Show a warning for each floor that was missing a move-in time
         foreach ($missingMovein as $floor) {
             $hall = $floor->get_parent();
             $text = $floor->getLink($hall->getHallName() . " floor ") . " move-in times not set.";
             NQ::simple('hms', hms\NotificationView::WARNING, $text);
         }
     }
     $context->goBack();
 }
Beispiel #29
0
 public function update()
 {
     $this->updated = time();
     $this->timeout = $this->updated + 86400 * 30;
     $db = new \PHPWS_DB('properties');
     $db->addValue('updated', $this->updated);
     $db->addValue('timeout', $this->timeout);
     $db->addWhere('id', $this->id);
     $db->update();
 }
Beispiel #30
0
 public static function menuFix()
 {
     $db = new PHPWS_DB('access_shortcuts');
     $sc = $db->select();
     if (empty($sc)) {
         return;
     }
     $menu_db = new PHPWS_DB('menu_links');
     foreach ($sc as $shortcut) {
         extract($shortcut);
         $url = str_replace(':', '/', $url);
         $menu_db->addWhere('url', $url);
         $menu_db->addWhere('url', "./{$url}", '=', 'or');
         $menu_db->addValue('url', './' . $keyword);
         $menu_db->update();
         $menu_db->reset();
     }
 }