private function delete() { // Because we're halfway between an "old way" and a "new way", delete // takes input from query instead of JSON. Beg your pardon but this // is the quickest way to get this thing out the door. $facultyId = $_REQUEST['faculty_id']; $departmentId = $_REQUEST['department_id']; $sql = "DELETE FROM intern_faculty_department WHERE faculty_id = {$facultyId} AND department_id = {$departmentId}"; $result = \PHPWS_DB::query($sql); if (\PHPWS_Error::logIfError($result)) { header('HTTP/1.1 500 Internal Server Error'); exit; } header('HTTP/1.1 204 No Content'); exit; }
public function _buildBackupTable($table) { $db = new PHPWS_DB($table); $result = $db->getTableColumns(TRUE); foreach ($result as $col) { if ($col['name'] == 'id') { continue; } $allColumns[] = $col; } $columns = PHPWS_DB::parseColumns($allColumns); $columns[] = 'backup_id int NOT NULL'; $columns[] = 'backup_order smallint NOT NULL'; $sql = 'CREATE TABLE ' . Backup::getBackupTableName($table) . ' (' . implode(', ', $columns) . ')'; return PHPWS_DB::query($sql); }
public function execute(CommandContext $context) { if (!UserStatus::isAdmin() || !Current_User::allow('hms', 'edit_terms')) { PHPWS_Core::initModClass('hms', 'exception/PermissionException.php'); throw new PermissionException('You do not have permission to edit terms.'); } $successCmd = CommandFactory::getCommand('ShowEditTerm'); $errorCmd = CommandFactory::getCommand('ShowCreateTerm'); $year = $context->get('year_drop'); $sem = $context->get('term_drop'); if (!isset($year) || is_null($year) || empty($year)) { NQ::simple('hms', hms\NotificationView::ERROR, 'You must provide a year.'); $errorCmd->redirect(); } if (!isset($sem) || is_null($sem) || empty($sem)) { NQ::simple('hms', hms\NotificationView::ERROR, 'You must provide a semester.'); $errorCmd->redirect(); } // Check to see if the specified term already exists if (!Term::isValidTerm($year . $sem)) { $term = new Term(NULL); $term->setTerm($year . $sem); $term->setBannerQueue(1); try { $term->save(); } catch (DatabaseException $e) { NQ::simple('hms', hms\NotificationView::ERROR, 'There was an error saving the term. Please try again or contact ESS.'); $errorCmd->redirect(); } } else { $term = new Term($year . $sem); // The term already exists, make sure there are no halls for this term $db = new PHPWS_DB('hms_residence_hall'); $db->addWhere('term', $term->getTerm()); $num = $db->count(); if (!is_null($num) && $num > 0) { NQ::simple('hms', hms\NotificationView::ERROR, 'One or more halls already exist for this term, so nothing can be copied.'); $errorCmd->redirect(); } } $text = Term::toString($term->getTerm()); $copy = $context->get('copy_pick'); $copyAssignments = false; $copyRoles = false; // If you want to copy roles and/or assignments // you must also copy the hall structure. if (isset($copy['struct'])) { // Copy hall structure if (isset($copy['assign'])) { // Copy assignments. $copyAssignments = true; } if (isset($copy['role'])) { // Copy roles. $copyRoles = true; } } else { // either $copy == 'nothing', or the view didn't specify... either way, we're done NQ::simple('hms', hms\NotificationView::SUCCESS, "{$text} term created successfully."); $successCmd->redirect(); } # Figure out which term we're copying from, if there isn't one then use the "current" term. $fromTerm = $context->get('from_term'); if (is_null($fromTerm)) { $fromTerm = Term::getCurrentTerm(); } PHPWS_Core::initModClass('hms', 'HMS_Residence_Hall.php'); PHPWS_Core::initModClass('hms', 'HousingApplication.php'); $db = new PHPWS_DB(); try { $db->query('BEGIN'); # Get the halls from the current term $halls = HMS_Residence_Hall::get_halls($fromTerm); set_time_limit(36000); foreach ($halls as $hall) { $hall->copy($term->getTerm(), $copyAssignments, $copyRoles); } $db->query('COMMIT'); } catch (Exception $e) { $db->query('ROLLBACK'); PHPWS_Error::log(print_r($e, true), 'hms'); NQ::simple('hms', hms\NotificationView::ERROR, 'There was an error copying the hall structure and/or assignments. The term was created, but nothing was copied.'); $errorCmd->redirect(); } if ($copyAssignments) { NQ::simple('hms', hms\NotificationView::SUCCESS, "{$text} term created successfully. The hall structure and assignments were copied successfully."); } else { NQ::simple('hms', hms\NotificationView::SUCCESS, "{$text} term created successfully and hall structure copied successfully."); } Term::setSelectedTerm($term->getTerm()); $successCmd->redirect(); }
/** * @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; }
function _confirmArchive() { if (isset($_REQUEST['PHAT_ArchiveConfirm'])) { include PHPWS_SOURCE_DIR . 'mod/phatform/inc/Archive.php'; $error = NULL; $error = archive($this->getId()); if (PHPWS_Error::isError($error)) { PHPWS_Error::log($error); javascript('alert', array('content' => dgettext('phatform', 'Failed to archive.'))); unset($_REQUEST['PHAT_ArchiveConfirm']); unset($error); $_REQUEST['PHAT_FORM_OP'] = 'ArchiveConfirm'; $this->action(); return; } $this->_saved = 0; $this->_position = 0; $sql = 'UPDATE mod_phatform_forms SET saved=\'' . $this->_saved . "' WHERE id='" . $this->getId() . "'"; PHPWS_DB::query($sql); $sql = 'DROP TABLE mod_phatform_form_' . $this->getId(); PHPWS_DB::query($sql); $table = 'mod_phatform_form_' . $this->getId() . '_seq'; if (PHPWS_DB::isTable($table)) { $sql = 'DROP TABLE ' . $table; PHPWS_DB::query($sql); } $_REQUEST['PHAT_FORM_OP'] = 'EditAction'; $_REQUEST['PHAT_Submit'] = 1; $this->action(); } else { if (isset($_REQUEST['PHAT_ArchiveCancel'])) { $_REQUEST['PHAT_MAN_OP'] = 'List'; $_SESSION['PHAT_FormManager']->action(); } else { $hiddens['module'] = 'phatform'; $hiddens['PHAT_FORM_OP'] = 'ArchiveConfirm'; foreach ($hiddens as $key => $value) { $eles[] = PHPWS_Form::formHidden($key, $value); } $elements[0] = implode("\n", $eles); $confirmTags['WARNING_TAG'] = dgettext('phatform', 'WARNING!'); $confirmTags['MESSAGE'] = dgettext('phatform', 'You have chosen to edit a saved form! All current data will be archived and cleared if you chose to continue! Make sure you export your data from your form before you continue!'); $confirmTags['CANCEL_BUTTON'] = PHPWS_Form::formSubmit(dgettext('phatform', 'Cancel'), 'PHAT_ArchiveCancel'); $confirmTags['CONFIRM_BUTTON'] = PHPWS_Form::formSubmit(dgettext('phatform', 'Confirm'), 'PHAT_ArchiveConfirm'); $elements[0] .= PHPWS_Template::processTemplate($confirmTags, 'phatform', 'form/archiveConfirm.tpl'); $content = PHPWS_Form::makeForm('PHAT_FormArchiveConfirm', 'index.php', $elements); $GLOBALS['CNT_phatform']['title'] = dgettext('phatform', 'Form') . ': ' . $this->getLabel(); $GLOBALS['CNT_phatform']['content'] .= $content; } } }
/** * Imports a SQL dump into the database. * This function can not be called statically. * @returns True if successful, false if not successful and report_errors = false or * Error object if report_errors = true */ public static function import($text, $report_errors = true) { PHPWS_DB::touchDB(); // first_import makes sure at least one query was completed // successfully $first_import = false; $sqlArray = PHPWS_Text::sentence($text); $error = false; foreach ($sqlArray as $sqlRow) { if (empty($sqlRow) || preg_match("/^[^\\w\\d\\s\\(\\)]/i", $sqlRow)) { continue; } $sqlCommand[] = $sqlRow; if (preg_match("/;\$/", $sqlRow)) { $query = implode(' ', $sqlCommand); $sqlCommand = array(); if (!DB_ALLOW_TABLE_INDEX && preg_match('/^create index/i', $query)) { continue; } PHPWS_DB::homogenize($query); $result = PHPWS_DB::query($query); if (DB::isError($result)) { if ($report_errors) { return $result; } else { PHPWS_Error::log($result); $error = true; } } $first_import = true; } } if (!$first_import) { if ($report_errors) { return PHPWS_Error::get(PHPWS_DB_IMPORT_FAILED, 'core', 'PHPWS_DB::import'); } else { PHPWS_Error::log(PHPWS_DB_IMPORT_FAILED, 'core', 'PHPWS_DB::import'); $error = true; } } if ($error) { return false; } else { return true; } }
public static function rollback() { // if transaction not started, return false. if (!$GLOBALS['DB_Transaction']) { return false; } $GLOBALS['DB_Transaction'] = false; return PHPWS_DB::query('ROLLBACK'); }
/** * @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; }
/** * * @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; }
/** * Provides a list of option sets currently stored in the database * * @return array The listing of option sets * @access public */ function getOptionSets() { $sql = 'SELECT id, label FROM mod_phatform_options'; $optionResult = PHPWS_DB::query($sql); $options[0] = ''; while ($row = $optionResult->fetchrow(MDB2_FETCHMODE_ASSOC)) { $options[$row['id']] = $row['label']; } if (sizeof($options) > 1) { return $options; } else { return NULL; } }
function cleanUpArchive() { if (isset($_REQUEST['ARCHIVE_filename'])) { $db = new PHPWS_DB('mod_phatform_forms'); $db->addWhere('archiveFileName', $_REQUEST['ARCHIVE_filename']); $result = $db->select(); if ($result) { $sql = 'DROP TABLE ' . $result[0]['archiveTableName']; if (PHPWS_DB::query($sql)) { $result = $db->delete(); if ($result) { return dgettext('phatform', 'Successfully deleted table associated with the archive with filename ') . "<b>'" . $_REQUEST['ARCHIVE_filename'] . "'</b>."; } else { return dgettext('phatform', 'There was a problem deleting viewing archive table associated for filename ') . "<b>'" . $_REQUEST['ARCHIVE_filename'] . "'</b>."; } } else { return dgettext('phatform', 'There was a problem deleting viewing archive table associated for filename ') . "<b>'" . $_REQUEST['ARCHIVE_filename'] . "'</b>."; } } } }
/** * Updates simple attributes for multiple items at once. * * This function is called when multiple items are requested to be hidden, approved, or * visable. It simply creates an sql statement based on the type of request on the item * ids contained in the $_REQUEST['PHPWS_MAN_ITEMS'] array and executes it on the database. * Note: should only be called by managerAction() * * @param string $column The name of the column to update. * @param mixed $value The value to set the column to. * @return boolean TRUE on success and FALSE on failure. * @access private */ function _doMassUpdate($column, $value) { if (is_array($_REQUEST['PHPWS_MAN_ITEMS']) && sizeof($_REQUEST['PHPWS_MAN_ITEMS']) > 0) { if (isset($this->_table)) { $table = $this->_table; } else { $table = $this->_tables[$this->listName]; } /* Begin sql update statement */ $sql = 'UPDATE ' . $table . " SET {$column}='{$value}' WHERE id='"; /* Set flag to know when to add sql for checking against extra ids */ $flag = FALSE; foreach ($_REQUEST['PHPWS_MAN_ITEMS'] as $itemId) { if ($flag) { $sql .= " OR id='"; } $sql .= $itemId . "'"; $flag = TRUE; } /* Execute query and test for failure */ $result = PHPWS_DB::query($sql); if ($result) { return TRUE; } else { return FALSE; } } }
/** * @author Matthew McNaney <mcnaney at gmail dot com> * @version $Id$ */ function access_update(&$content, $version) { switch (1) { case version_compare($version, '0.1.0', '<'): if (PHPWS_Boost::updateFiles(array('conf/config.php'), 'access')) { $content[] = '- Copied config.php locally.'; } else { $content[] = '- Unable to copy config.php locally.'; } $content[] = '- Added rewrite conditionals to .htaccess write.'; case version_compare($version, '0.1.1', '<'): $content[] = '<pre>'; $files = array('templates/main.tpl', 'templates/box.tpl', 'templates/shortcut_menu.tpl'); if (PHPWS_Boost::updateFiles($files, 'access')) { $content[] = '-- Copied following template files locally:'; } else { $content[] = '-- Failed to copy the following files locally:'; } $content[] = implode("\n", $files); $content[] = '+ Fixed header tags (Bug #1652279)'; $content[] = '</pre>'; case version_compare($version, '0.1.2', '<'): $content[] = '<pre> 0.1.2 changes --------------- + Added translate functions. </pre> '; case version_compare($version, '0.2.0', '<'): $content[] = '<pre> 0.2.0 changes ---------------'; $files = array('conf/error.php', 'templates/forms/administrator.tpl', 'templates/forms/update_file.tpl', 'img/access.png'); if (PHPWS_Boost::updateFiles($files, 'access')) { $content[] = '+ The following files were updated successfully.'; } else { $content[] = '+ The following files were not updated successfully.'; } $content[] = ' ' . implode("\n ", $files); $content[] = '+ Update panel shows the current .htaccess file as well as the one the admin is about to save. + Changed the admin panel to turn off different components. + Rewrite engine enabled by default. + Shortcuts now separated by dashes and not underlines + Keywords in shortcuts parsed better. + Admins can now edit shortcut keywords from the admin panel. + Deny/Allow tab changed to Allow/Deny since it is set that way every where else. + Allow/Deny can now be disabled in the Admin panel. + Added a way to restore the default .htaccess file. + Removed symbolic link option from htaccess writes. + New control panel icon. </pre> '; case version_compare($version, '0.2.1', '<'): $content[] = '<pre>0.2.1 changes --------------- + Updated to new language format.</pre>'; case version_compare($version, '0.2.2', '<'): $content[] = '<pre>'; $files = array('conf/error.php', 'templates/forms/administrator.tpl', 'templates/forms/update_file.tpl', 'img/access.png', 'conf/config.php'); if (PHPWS_Boost::updateFiles($files, 'access')) { $content[] = '+ The following files were updated successfully.'; } else { $content[] = '+ The following files were not updated successfully.'; } $content[] = ' ' . implode("\n ", $files); $content[] = ' 0.2.2 changes --------------- + The default rewrite conditional was missing a file check. + Previous update had updated files going to incorrect directory. + Template was removing curly brackets from review mode. Fixed. </pre>'; case version_compare($version, '0.2.3', '<'): $content[] = '<pre> 0.2.3 changes --------------- + Fixed bug #1690698: Cannot create a new .htaccess file if original is deleted. Thanks singletrack + Fixed bug #1690544: If the .htaccess file is not writable or missing, give the user a warning message.</pre>'; case version_compare($version, '1.0.0', '<'): $content[] = '<pre>'; $files = array('templates/forms/allow_deny.tpl', 'templates/forms/shortcut_list.tpl'); if (PHPWS_Boost::updateFiles($files, 'access')) { $content[] = '--- The following files were updated successfully.'; } else { $content[] = '--- The following files were not updated successfully.'; } $content[] = implode("\n", $files); $content[] = '1.0.0 changes --------------- + Rewritten for phpwebsite 1.5.0 changes. + addIP and removeIP allow modules to restrict users. </pre>'; case version_compare($version, '1.0.1', '<'): $content[] = '<pre>1.0.1 changes --------------- + Fixed Access option not appearing on MiniAdmin + .html completely removed from shortcuts </pre>'; case version_compare($version, '1.0.2', '<'): $content[] = '<pre>1.0.2 changes --------------- + Removed htaccess file. Now expect core/inc/htaccess. </pre>'; case version_compare($version, '1.1.0', '<'): PHPWS_Boost::updateFiles(array('templates/htaccess.tpl'), 'access'); $content[] = '<pre>1.1.0 changes --------------- + New ability to added a RewriteBase to a .htaccess file. + Updated to PHP 5 standards. </pre>'; case version_compare($version, '1.1.1', '<'): $content[] = '<pre>1.1.1 changes --------------- + Reformated shortcut creation method. Should work with old version as well as any new longer links.</pre>'; case version_compare($version, '1.1.2', '<'): $content[] = '<pre>1.1.2 changes --------------- + Fixed some error notices + Fixed access shortcuts to work with GET arrays</pre>'; case version_compare($version, '1.1.3', '<'): $content[] = '<pre>1.1.3 changes --------------- + Access forces bad urls to 404 error </pre>'; case version_compare($version, '1.1.4', '<'): $content[] = '<pre>1.1.4 changes --------------- + Trimming the title to prevent extra spaces in shortcuts </pre>'; case version_compare($version, '1.1.5', '<'): $module = new PHPWS_Module('access'); PHPWS_Error::logIfError($module->save()); $content[] = '<pre>1.1.5 changes --------------- + Lowered Access priority to assure its init.php is called early.</pre>'; case version_compare($version, '1.1.6', '<'): $content[] = '<pre>1.1.6 changes --------------- + Added link check on url setting to prevent ./ from suffixing and breaking storage.</pre>'; case version_compare($version, '1.1.7', '<'): $content[] = '<pre>1.1.7 changes --------------- + Code changes to make PHP 5 strict compatible.</pre>'; case version_compare($version, '1.1.8', '<'): $content[] = '<pre>1.1.8 changes --------------- + Fixed shortcuts not working with some older pages + Pager links added to shortcut list</pre>'; case version_compare($version, '1.1.9', '<'): $content[] = '<pre>1.1.9 changes --------------- + Fixed a bug in Access module which was causing the RewriteBase? to be set to the empty string</pre>'; case version_compare($version, '1.2.0', '<'): $sql = "ALTER TABLE access_shortcuts CHANGE keyword keyword VARCHAR( 255 ) NOT NULL DEFAULT ''"; PHPWS_DB::query($sql); $content[] = '<pre>1.2.0 changes --------------- + Shortcut length increased and observed in code.</pre>'; case version_compare($version, '1.2.1', '<'): $sql = "ALTER TABLE access_shortcuts CHANGE keyword keyword VARCHAR( 255 ) NOT NULL DEFAULT ''"; PHPWS_DB::query($sql); $content[] = '<pre>1.2.1 changes --------------- + Added tools to shortcuts to give all pages shortcuts and to autoforward on id calls. + Made sure the varchar is changed since the install did not reflect the change.</pre>'; case version_compare($version, '1.2.2', '<'): $content[] = '<pre>1.2.2 changes -------------- + Fixed autoforwarding</pre>'; case version_compare($version, '1.3.0', '<'): $content[] = '<pre>1.3.0 changes -------------- + Bootstrap changes, use of modal + Various bug fixes </pre>'; } return true; }