diff --git a/.env b/.env new file mode 100644 index 00000000..21ad9a69 --- /dev/null +++ b/.env @@ -0,0 +1,83 @@ +# In all environments, the following files are loaded if they exist, +# the latter taking precedence over the former: +# +# * .env contains default values for the environment variables needed by the app +# * .env.local uncommitted file with local overrides +# * .env.$APP_ENV committed environment-specific defaults +# * .env.$APP_ENV.local uncommitted environment-specific overrides +# +# Real environment variables win over .env files. +# +# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. +# https://symfony.com/doc/current/configuration/secrets.html +# +# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). +# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration + +# Saml Authentication +SAML_IDP_ENTITYID="https://idp.example.edu/abc123" +SAML_IDP_SINGLESIGNONSERVICE="https://idp.example.edu/abc123/saml2" +SAML_IDP_SINGLELOGOUTSERVICE="https://idp.example.edu/abc123/saml2" +SAML_IDP_X509CERT="MIIC...." + +# Catalog +CATALOG_BANNER_WEB_URL="" + +# Schedules +SCHEDULES_EMAIL_ENABLED=false +SCHEDULES_EMAIL_SEND_MAIL_AS_USER=false +SCHEDULES_EMAIL_SEND_MAIL_AS=noreply@example.edu +SCHEDULES_IMAGE_FONT_FILE=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf + +# Sync +SYNC_ERROR_MAIL_TO="admin@example.edu" +SYNC_ERROR_MAIL_FROM="noreply@example.edu" +# A JSON encoded array of Block Codes that should be exposed to users. +SYNC_ALLOWED_BLOCK_CODES='["CC"]' +# Sync destination (this application's database) +SYNC_DESTINATION_DSN="mysql:host=database;port=3306;dbname=symfony;charset=utf8mb4" +SYNC_DESTINATION_USERNAME=symfony +SYNC_DESTINATION_PASSWORD=symfony +# The sync strategy to use. One of the following: +# 'sync.strategy.oci' +# 'sync.strategy.oci_with_cache' +# 'sync.strategy.pdo_msyql' +# Depending on which strategy is chosen, different additional parameters (below) +# need to be configured. +SYNC_STRATEGY='sync.strategy.oci' +# Sync source (using an Oracle connection) for Oci & OciWithCache sync strategies. +SYNC_SOURCE_OCI_TNS="(DESCRIPTION = (ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = reporting-database-prod.ec.example.edu)(PORT = 8000))) (CONNECT_DATA = (SID = SNAPSHOT)))" +SYNC_SOURCE_OCI_USERNAME="" +SYNC_SOURCE_OCI_PASSWORD="" +# Temporary Mysql/Mariadb database if using (OciWithCache) sync strategy. +SYNC_TEMP_DSN="mysql:host=database;port=3306;dbname=catalog_temp;charset=utf8mb4" +SYNC_TEMP_USERNAME=symfony +SYNC_TEMP_PASSWORD=symfony +# The OciWithCache sync strategy copies into the live database with +# mysqldump & mysql commands. If these are at different paths/names, then +#customize them. +SYNC_MYSQL_COMMAND=mysql +SYNC_MYSQLDUMP_COMMAND=mysqldump +# The PdoMysql sync strategy reads from a Mysql/Mariadb connection. +SYNC_SOURCE_PDOMYSQL_DSN="mysql:host=database;port=3306;dbname=catalog_temp;charset=utf8mb4" +SYNC_SOURCE_PDOMYSQL_USERNAME=symfony +SYNC_SOURCE_PDOMYSQL_PASSWORD=symfony + +###> symfony/framework-bundle ### +APP_ENV=dev +APP_SECRET=af0c5e8cb62edd2dd690260da18618a2 +###< symfony/framework-bundle ### + +###> doctrine/doctrine-bundle ### +# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url +# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml +# +# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" +# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" +DATABASE_URL="mysql://symfony:symfony@database:3306/symfony?serverVersion=10.3.27-MariaDB&charset=utf8mb4" +# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8" +###< doctrine/doctrine-bundle ### + +###> symfony/mailer ### +MAILER_DSN=null://null +###< symfony/mailer ### diff --git a/.env.test b/.env.test new file mode 100644 index 00000000..dc836d8a --- /dev/null +++ b/.env.test @@ -0,0 +1,7 @@ +# define your env variables for the test env here +KERNEL_CLASS='App\Kernel' +APP_SECRET='$ecretf0rt3st' +SYMFONY_DEPRECATIONS_HELPER=999999 +PANTHER_APP_ENV=panther +PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots +SCHEDULES_EMAIL_ENABLED=true diff --git a/.gitignore b/.gitignore index 1ac4c29f..2977cd7a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,32 @@ progress.txt vendor/ .phpunit.result.cache .php-cs-fixer.cache + +###> symfony/framework-bundle ### +/.env.local +/.env.local.php +/.env.*.local +/config/secrets/prod/prod.decrypt.private.php +/public/bundles/ +/var/ +/vendor/ +###< symfony/framework-bundle ### + +###> symfony/phpunit-bridge ### +.phpunit.result.cache +/phpunit.xml +###< symfony/phpunit-bridge ### + +###> phpunit/phpunit ### +/phpunit.xml +.phpunit.result.cache +###< phpunit/phpunit ### + +###> symfony/asset-mapper ### +/public/assets/ +/assets/vendor/ +###< symfony/asset-mapper ### +###> friendsofphp/php-cs-fixer ### +/.php-cs-fixer.php +/.php-cs-fixer.cache +###< friendsofphp/php-cs-fixer ### diff --git a/.gitmodules b/.gitmodules index fae6a73a..d81d9832 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,10 +7,3 @@ [submodule "library/lazy_sessions"] path = library/lazy_sessions url = https://github.com/middlebury/lazy_sessions.git -[submodule "docroot/javascript/jquery-week-calendar"] - path = docroot/javascript/jquery-week-calendar - url = https://github.com/themouette/jquery-week-calendar.git -[submodule "library/jsdifflib"] - path = library/jsdifflib - url = https://github.com/cemerick/jsdifflib.git - branch = master diff --git a/.lando.yml b/.lando.yml new file mode 100644 index 00000000..51b08a35 --- /dev/null +++ b/.lando.yml @@ -0,0 +1,74 @@ +name: coursecatalog +recipe: symfony +config: + webroot: public + php: 8.1 + database: mariadb:10.11 +services: + appserver: + build_as_root: + - apt update + - mkdir /opt/oracle + - rm -Rf /opt/oracle/* + # Fetch binaries directly from Oracle: + # https://www.oracle.com/database/technologies/instant-client/downloads.html + - curl https://download.oracle.com/otn_software/linux/instantclient/instantclient-basic-linux-arm64.zip > /opt/oracle/instantclient-basic.zip + - curl https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linux-arm64.zip > /opt/oracle/instantclient-sdk.zip + # Unzip + - unzip -o /opt/oracle/instantclient-basic.zip -d /opt/oracle + - unzip -o /opt/oracle/instantclient-sdk.zip -d /opt/oracle + # Add sqlplus command line Oracle client for debugging. + - curl https://download.oracle.com/otn_software/linux/instantclient/instantclient-sqlplus-linux-arm64.zip > /opt/oracle/instantclient-sqlplus.zip + - unzip -o /opt/oracle/instantclient-sqlplus.zip -d /opt/oracle + # Delete all of our downloads. + - rm /opt/oracle/*.zip + # Make a symlink to the versioned directory. + - ln -s /opt/oracle/instantclient_* /opt/oracle/instantclient + # Make OS aware of newly installed libraries + - echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclient.conf + - ldconfig -v + # Set the interpreter for the Oracle command-line tools. + # See: https://askubuntu.com/questions/1397724/no-such-file-or-directory-when-running-sqlplus-command + # This is not needed for the Oci8 PHP extension itself, but is needed to + # get sqlplus command-line Oracle client working for debugging. + - apt -y install patchelf + - patchelf --set-interpreter /lib/ld-linux-aarch64.so.1 /opt/oracle/instantclient/adrci + - patchelf --set-interpreter /lib/ld-linux-aarch64.so.1 /opt/oracle/instantclient/genezi + - patchelf --set-interpreter /lib/ld-linux-aarch64.so.1 /opt/oracle/instantclient/sqlplus + - patchelf --set-interpreter /lib/ld-linux-aarch64.so.1 /opt/oracle/instantclient/uidrvci + # Install libaio1 -- when missing was preventing the extension from loading. + - apt install libaio1 + # Install and enable OCI8 + - echo "instantclient,/opt/oracle/instantclient" | pecl install oci8-3.2.1 + - docker-php-ext-enable oci8 + overrides: + environment: + MAILER_DSN: smtp://mailpit:1025 + phpmyadmin: + type: phpmyadmin + hosts: + - database + mailpit: + scanner: false + api: 3 + type: lando + services: + image: axllent/mailpit + volumes: + - mailpit:/data + ports: + - 8025 # Web UI. + - 1025 # SMTP. + environment: + MP_MAX_MESSAGES: 5000 + MP_DATA_FILE: /data/mailpit.db + MP_SMTP_AUTH_ACCEPT_ANY: 1 + MP_SMTP_AUTH_ALLOW_INSECURE: 1 + command: '/mailpit' + volumes: + mailpit: +proxy: + mailpit: + - mail.coursecatalog.lndo.site:8025 + phpmyadmin: + - phpmyadmin.coursecatalog.lndo.site diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 15af8f2e..b8b7e5ae 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -5,6 +5,8 @@ ->notPath([ 'vendor', '#^library#', + '#^application/library/harmoni/Primitives/Collections-Text/SafeHTML/classes/HTMLSax3#', + '#^var#', ]) ; diff --git a/README.md b/README.md index 92005a27..12ae2a7c 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ Examples Examples of the the Course-Catalog in action at Middlebury College: -* [Main Search UI](https://catalog.middlebury.edu/catalogs/view/catalog/catalog%2FMCUG) (catalog app) -* [Section Details Page](https://catalog.middlebury.edu/offerings/view/catalog/catalog%2FMCUG/offering/section%2F201090%2F91241) (catalog app) -* [Department "courses" RSS feed](https://catalog.middlebury.edu/courses/topicxml/catalog/catalog%2FMCUG/topic/topic%2Fdepartment%2FBIOL) (catalog app) -* [Departments listing to feed to the Drupal content type form](https://catalog.middlebury.edu/topics/listdepartmentstxt/catalog/catalog%2FMCUG/) (catalog app) +* [Main Search UI](https://catalog.middlebury.edu/catalogs/view/catalog/catalog.MCUG) (catalog app) +* [Section Details Page](https://catalog.middlebury.edu/offerings/view/catalog/catalog.MCUG/offering/section.201090.91241) (catalog app) +* [Department "courses" RSS feed](https://catalog.middlebury.edu/courses/topicxml/catalog/catalog.MCUG/topic/topic.department.BIOL) (catalog app) +* [Departments listing to feed to the Drupal content type form](https://catalog.middlebury.edu/topics/listdepartmentstxt/catalog/catalog.MCUG/) (catalog app) * [Department Course Listing](http://www.middlebury.edu/academics/bio/courses) (Drupal "courses" content-type displaying a feed from the catalog app) * [Department Section Listing](http://www.middlebury.edu/academics/bio/courses/offerings) (Drupal "courses" content-type displaying a feed from the catalog app) * [Faculty Profile](http://www.middlebury.edu/academics/bio/faculty/node/48111) (Drupal "profile" content-type displaying a feed from the catalog app) @@ -39,16 +39,40 @@ These instructions assume that you have a POSIX machine running Apache with PHP cd coursecatalog git-submodule update --init --recursive ``` -3. Make a symbolic link to the `coursecatalog/docroot/` directory in a web-accessible directory or add a virtualhost rooted in the `coursecatalog/docroot/` directory. -4. Create a MySQL database for the catalogs data and a cache of Banner data. -5. Make copies of the example config files at `configuration.plist`, `frontend_config.ini`, and `update_config.ini` and edit values to match your environment. -6. Create the database tables defined in `application/library/banner/course/sql/table_creation.sql` -7. Run the script at `bin/update-from-banner.php` to dump Banner data into the the MySQL database: +3. Install additional dependencies with Composer: + ``` + composer install + ``` +4. Make a symbolic link to the `coursecatalog/docroot/` directory in a web-accessible directory or add a virtualhost rooted in the `coursecatalog/docroot/` directory. +5. Create a MySQL database for the catalogs data and a cache of Banner data. +6. Make copies of the example config files at `configuration.plist`, `frontend_config.ini`, and `update_config.ini` and edit values to match your environment. +7. Create the database tables defined in `application/library/banner/course/sql/table_creation.sql` +8. Run the script at `bin/update-from-banner.php` to dump Banner data into the the MySQL database: ``` php bin/update-from-banner.php php bin/build_indices.php ``` +## Development environment setup + +### Lando +Install Docker and Lando to provide a local containerized environment + +In the code directory, start the local containers with `lando start` + +### Copying the production database +Dump the production database to a non version-controlled file path like `var/catalog_prod.sql`. + +Strip out any `DEFINER` statements that will break the import: +``` +sed -i '' 's/DEFINER=[^*]*\*/\*/g' var/catalog_prod.sql +``` + +Import the database into the local container: +``` +lando db-import var/catalog_prod.sql +``` + Unit Tests ---------- diff --git a/application/autoload.php b/application/autoload.php deleted file mode 100755 index 99564396..00000000 --- a/application/autoload.php +++ /dev/null @@ -1,27 +0,0 @@ -setFallbackAutoloader(true); - -require_once BASE_PATH.'/vendor/autoload.php'; diff --git a/application/controllers/AdminController.php b/application/controllers/AdminController.php deleted file mode 100755 index c76ba5a2..00000000 --- a/application/controllers/AdminController.php +++ /dev/null @@ -1,283 +0,0 @@ -view->csrf_key = $this->_helper->csrfKey(); - - if (!$this->_helper->auth()->isAuthenticated()) { - $this->_helper->auth()->login(); - } - - $config = Zend_Registry::getInstance()->config; - if (!isset($config->admin->administrator_ids)) { - throw new PermissionDeniedException('No admins are defined for this application.'); - } - $admins = explode(',', $config->admin->administrator_ids); - if (!in_array($this->_helper->auth()->getUserId(), $admins)) { - throw new PermissionDeniedException('You are not authorized to administer this application.'.$admins[1]); - } - } - - /** - * List Admin Screens. - * - * @return void - * - * @since 7/29/10 - */ - public function indexAction() - { - } - - /** - * Manage term visibility. - * - * @return void - * - * @since 7/29/10 - */ - public function termsAction() - { - $db = Zend_Registry::get('db'); - - if ($this->_getParam('change_visibility')) { - // Verify our CSRF key - if (!$this->_getParam('csrf_key') == $this->_helper->csrfKey()) { - throw new PermissionDeniedException('Invalid CSRF Key. Please log in again.'); - } - - // Verify that this is a valid term. - $catalog = $this->_getParam('catalog'); - $term = $this->_getParam('term'); - $verifyStmt = $db->prepare('SELECT COUNT(*) FROM STVTERM WHERE STVTERM_CODE = ?'); - $verifyStmt->execute([$term]); - $valid = (int) $verifyStmt->fetchColumn(); - $verifyStmt->closeCursor(); - if (!$valid) { - throw new InvalidArgumentException('Invalid term-code: '.$term); - } - - // Disable the term - if ('true' == $this->_getParam('disabled')) { - $visibilityStmt = $db->prepare('INSERT INTO catalog_term_inactive (catalog_id, term_code) VALUES (?, ?);'); - } - // Enable the term - else { - $visibilityStmt = $db->prepare('DELETE FROM catalog_term_inactive WHERE catalog_id = ? AND term_code = ?;'); - } - $visibilityStmt->execute([$catalog, $term]); - } - - $searches = $db->query('SELECT * FROM catalog_term_match')->fetchAll(); - - $catalogs = []; - $queries = []; - foreach ($searches as $search) { - $catalogs[] = $search['catalog_id']; - $queries[] = -" SELECT - '".$search['catalog_id']."' AS catalog, - STVTERM_CODE, - STVTERM_DESC - FROM - STVTERM - WHERE - STVTERM_CODE LIKE ('".$search['term_code_match']."')"; - } - $union = implode("\n\tUNION\n", $queries); - - $query = -"SELECT - t.*, - IF(i.term_code, 1, 0) AS manually_disabled, - count(SSBSECT_CRN) AS num_sections -FROM - (\n".$union."\n\t) AS t - LEFT JOIN catalog_term_inactive i ON (STVTERM_CODE = i.term_code AND i.catalog_id = ?) - LEFT JOIN course_catalog c ON i.catalog_id = c.catalog_id - LEFT JOIN ssbsect_scbcrse s ON (STVTERM_CODE = SSBSECT_TERM_CODE - AND SCBCRSE_COLL_CODE IN ( - SELECT coll_code - FROM course_catalog_college - WHERE catalog_id = ? - ) - AND SSBSECT_SSTS_CODE = 'A' - AND (c.prnt_ind_to_exclude IS NULL OR SSBSECT_PRNT_IND != c.prnt_ind_to_exclude) - ) -WHERE - catalog = ? -GROUP BY - STVTERM_CODE -ORDER BY - catalog ASC, STVTERM_CODE DESC"; - $stmt = $db->prepare($query); - - $this->view->catalogs = array_unique($catalogs); - - // print "
".$query.""; - if ($this->_getParam('catalog') && in_array($this->_getParam('catalog'), $this->view->catalogs)) { - $catalog = $this->_getParam('catalog'); - } else { - $catalog = $this->view->catalogs[0]; - } - - $stmt->execute([$catalog, $catalog, $catalog]); - $this->view->catalog = $catalog; - $this->view->terms = $stmt->fetchAll(); - } - - public function markupAction() - { - if (isset($_POST['sample_text']) && strlen($_POST['sample_text'])) { - $this->view->sampleText = $_POST['sample_text']; - } else { - $this->view->sampleText = "This is some text. Shakespeare wrote /The Merchant of Venice/ as well as /Macbeth/. Words can have slashes in them such as AC/DC, but this does not indicate italics.\n\nSpaces around slashes such as this / don't cause italics either. Quotes may be /\"used inside slashes\",/ or \"/outside of them/\". *Bold Text* should have asterisk characters around it. Like slashes, * can be used surrounded by spaces, or surrounded by letters or numbers and not cause bold formatting: 4*5 = 20 or 4 * 5 = 20. Numbers as well as text can be bold *42* or italic /85/"; - } - $this->view->sampleText = htmlspecialchars($this->view->sampleText); - $this->view->output = banner_course_Course::convertDescription($this->view->sampleText); - } - - public function masqueradeAction() - { - $masqueradeAuth = $this->_helper->auth->getMasqueradeHelper(); - - if ($this->_getParam('masquerade')) { - // Verify our CSRF key - if (!$this->_getParam('csrf_key') == $this->_helper->csrfKey()) { - throw new PermissionDeniedException('Invalid CSRF Key. Please log in again.'); - } - - $masqueradeAuth->changeUser($this->_getParam('masquerade')); - $this->_redirect('/', ['prependBase' => true, 'exit' => true]); - } - - $this->view->userId = $this->_helper->auth()->getUserId(); - $this->view->userName = $this->_helper->auth()->getUserDisplayName(); - } - - /* Manage archive export configurations */ - public function exportAction() - { - $db = Zend_Registry::get('db'); - - $this->view->configs = $db->query('SELECT * FROM archive_configurations')->fetchAll(); - - $this->view->config = null; - if ($this->_getParam('config') && -1 != $this->_getParam('config')) { - foreach ($this->view->configs as $config) { - if ($config['id'] == $this->_getParam('config')) { - $this->view->config = $config; - } - } - } - - // If user has selected a configuration to modify, get the latest revision. - if (isset($this->view->config)) { - $catalogId = $this->_helper->osidId->fromString($this->view->config['catalog_id']); - $this->view->catalogId = $this->view->config['catalog_id']; - } - } - - /** - * Manage catalog archive scheduling. - * - * @return void - * - * @since 1/16/2018 - */ - public function scheduleAction() - { - } - - /** - * Manage antirequisites. - * - * @return void - * - * @since 12/6/2017 - */ - public function antirequisitesAction() - { - $db = Zend_Registry::get('db'); - - // Delete any requested item. - if ($this->_getParam('delete')) { - // Verify our CSRF key - if (!$this->_getParam('csrf_key') == $this->_helper->csrfKey()) { - throw new PermissionDeniedException('Invalid CSRF Key. Please log in again.'); - } - - // Verify that this is a valid term. - $deleteStmt = $db->prepare('DELETE FROM antirequisites WHERE subj_code = ? AND crse_numb = ? AND subj_code_eqiv = ? AND crse_numb_eqiv = ?'); - $deleteStmt->execute([ - $this->_getParam('subj_code'), - $this->_getParam('crse_numb'), - $this->_getParam('subj_code_eqiv'), - $this->_getParam('crse_numb_eqiv'), - ]); - } - - // Add any chosen items. - if ($this->_getParam('add')) { - // Verify our CSRF key - if (!$this->_getParam('csrf_key') == $this->_helper->csrfKey()) { - throw new PermissionDeniedException('Invalid CSRF Key. Please log in again.'); - } - - // Verify that this is a valid term. - $insertStmt = $db->prepare('INSERT INTO antirequisites (subj_code, crse_numb, subj_code_eqiv, crse_numb_eqiv, added_by, comments) VALUES (?, ?, ?, ?, ?, ?)'); - foreach ($this->_getParam('equivalents_to_add') as $toAdd) { - $params = explode('/', $toAdd); - $params[] = $this->view->getUserDisplayName(); - $params[] = $this->_getParam($toAdd.'-comments'); - $insertStmt->execute($params); - } - } - - // Select our already-created antirequisites - $this->view->antirequisites = $db->query('SELECT * FROM antirequisites ORDER BY subj_code, crse_numb, subj_code_eqiv, crse_numb_eqiv')->fetchAll(); - - // Supply search results. - $this->view->search_subj_code = $this->_getParam('search_subj_code'); - $this->view->search_crse_numb = $this->_getParam('search_crse_numb'); - if ($this->_getParam('search_subj_code') && $this->_getParam('search_crse_numb')) { - $searchStmt = $db->prepare( - 'SELECT - *, - subj_code IS NOT NULL AS antirequisite - FROM - SCREQIV - LEFT JOIN antirequisites - ON (SCREQIV_SUBJ_CODE = subj_code AND SCREQIV_CRSE_NUMB = crse_numb - AND SCREQIV_SUBJ_CODE_EQIV = subj_code_eqiv AND SCREQIV_CRSE_NUMB_EQIV = crse_numb_eqiv) - WHERE - (SCREQIV_SUBJ_CODE = ? AND SCREQIV_CRSE_NUMB = ?) - OR (SCREQIV_SUBJ_CODE_EQIV = ? AND SCREQIV_CRSE_NUMB_EQIV = ?) - GROUP BY - SCREQIV_SUBJ_CODE, SCREQIV_CRSE_NUMB, SCREQIV_SUBJ_CODE_EQIV, SCREQIV_CRSE_NUMB_EQIV - ORDER BY - SCREQIV_SUBJ_CODE, SCREQIV_CRSE_NUMB, SCREQIV_SUBJ_CODE_EQIV, SCREQIV_CRSE_NUMB_EQIV - '); - $searchStmt->execute([ - $this->_getParam('search_subj_code'), - $this->_getParam('search_crse_numb'), - $this->_getParam('search_subj_code'), - $this->_getParam('search_crse_numb'), - ]); - $this->view->searchResults = $searchStmt->fetchAll(PDO::FETCH_OBJ); - } - } -} diff --git a/application/controllers/ArchiveController.php b/application/controllers/ArchiveController.php index ddd0a8be..8fb1fbb0 100644 --- a/application/controllers/ArchiveController.php +++ b/application/controllers/ArchiveController.php @@ -831,9 +831,9 @@ protected function getCourseData(osid_course_Course $course) // Look for different Section Descriptions $offeringQuery = $this->offeringSearchSession->getCourseOfferingQuery(); $offeringQuery->matchCourseId($course->getId(), true); - $offeringQuery->matchGenusType(new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:offering/LCT'), true); - $offeringQuery->matchGenusType(new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:offering/SEM'), true); - $offeringQuery->matchGenusType(new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:offering/IND'), true); + $offeringQuery->matchGenusType(new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:offering.LCT'), true); + $offeringQuery->matchGenusType(new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:offering.SEM'), true); + $offeringQuery->matchGenusType(new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:offering.IND'), true); foreach ($this->selectedTerms as $termId) { $offeringQuery->matchTermId($termId, true); } @@ -856,7 +856,7 @@ protected function getCourseData(osid_course_Course $course) $instructorsType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:record:instructors'); $identifiersType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:record:banner_identifiers'); $namesType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:record:person_names'); - $requirementType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/requirement'); + $requirementType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.requirement'); $enrollmentNumbersType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:record:enrollment_numbers'); while ($offerings->hasNext()) { $offering = $offerings->getNextCourseOffering(); @@ -1028,7 +1028,7 @@ protected function getCourseData(osid_course_Course $course) // Apply all course-level topics. $allTopics = $this->_helper->topics->topicListAsArray($course->getTopics()); $reqs = []; - $topicType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/requirement'); + $topicType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.requirement'); $topicTypeString = $this->_helper->osidType->toString($topicType); $topics = $this->_helper->topics->filterTopicsByType($allTopics, $topicType); foreach ($topics as $topic) { diff --git a/application/controllers/AuthController.php b/application/controllers/AuthController.php deleted file mode 100755 index 3956b925..00000000 --- a/application/controllers/AuthController.php +++ /dev/null @@ -1,32 +0,0 @@ -loginAction(); - } - - public function loginAction() - { - if ($this->_helper->auth()->login($this->_getParam('return'))) { - if ($this->_getParam('return')) { - $this->_redirect($this->_getParam('return'), ['prependBase' => false, 'exit' => true]); - } else { - $this->_redirect('/', ['prependBase' => true, 'exit' => true]); - } - } - } - - public function logoutAction() - { - $this->_helper->auth()->logout($this->_getParam('return')); - - if ($this->_getParam('return')) { - $this->_redirect($this->_getParam('return'), ['prependBase' => false, 'exit' => true]); - } else { - $this->_redirect('/', ['prependBase' => true, 'exit' => true]); - } - } -} diff --git a/application/controllers/BookmarksController.php b/application/controllers/BookmarksController.php deleted file mode 100755 index 88ea1d44..00000000 --- a/application/controllers/BookmarksController.php +++ /dev/null @@ -1,76 +0,0 @@ -bookmarks = $this->_helper->bookmarks(); - - // Verify our CSRF key - if (!$this->_getParam('csrf_key') == $this->_helper->csrfKey()) { - throw new PermissionDeniedException('Invalid CSRF Key. Please log in again.'); - } - - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(true); - $this->getResponse()->setHeader('Content-Type', 'text/xml'); - - echo ''; - } - - /** - * Bookmark a course. - * - * @return void - * - * @since 7/29/10 - */ - public function addAction() - { - $idString = $this->_getParam('course'); - if (!$idString) { - throw new InvalidArgumentException('No Course Id specified.'); - } - $id = $this->_helper->osidId->fromString($idString); - - $this->bookmarks->add($id); - - echo '
Important: This tool is for planning purposes only. It does not register you for classes.
- -For more help see: go/catalog-help
-Issues or Feedback? go/webbugs/Catalog/Planner
-".$additionalHtml.'
'; - $this->printException($e, $code, ob_get_clean()); - - if ($this->shouldLogException($e, $code)) { - error_log('PHP '.$e::class.': '.$e->getMessage().' in '.$e->getFile().' on line '.$e->getLine()); - } - } - - /** - * Print out a custom error page for an exception with the HTTP status code - * specified. - * - * @param object Exception $e - * @param int $code - * - * @return void - * - * @since 2/21/08 - */ - private function printException(Exception $e, $code, $additionalHtml = '') - { - // Debugging mode for development, rethrow the exception - if (ini_get('display_errors') && preg_match('/on|1/i', ini_get('display_errors'))) { - throw $e; - } - - // Normal production case - else { - $message = strip_tags($e->getMessage()); - $codeString = self::getCodeString($code); - $errorString = _('Error'); - if ($this->shouldLogException($e, $code)) { - $logMessage = _('This error has been logged.'); - } else { - $logMessage = ''; - } - echo <<< END - - ---$codeString
-$message
-
$logMessage
- $additionalHtml - - - -END; - } - } - - /** - * Answer a string that matches the HTTP error code given. - * - * @param int $code - * - * @return string - * - * @since 2/21/08 - * - * @static - */ - public static function getCodeString($code) - { - switch ($code) { - case 400: - return _('Bad Request'); - case 401: - return _('Unauthorized'); - case 402: - return _('Payment Required'); - case 403: - return _('Forbidden'); - case 404: - return _('Not Found'); - case 405: - return _('Method Not Allowed'); - case 406: - return _('Not Acceptable'); - case 407: - return _('Proxy Authentication Required'); - case 408: - return _('Request Timeout'); - case 409: - return _('Conflict'); - case 410: - return _('Gone'); - case 411: - return _('Length Required'); - case 412: - return _('Precondition Failed'); - case 413: - return _('Request Entity Too Large'); - case 414: - return _('Request-URI Too Long'); - case 415: - return _('Unsupported Media Type'); - case 416: - return _('Requested Range Not Satisfiable'); - case 417: - return _('Expectation Failed'); - case $code > 400 && $code < 500: - return _('Client Error'); - - case 500: - return _('Internal Server Error'); - case 501: - return _('Not Implemented'); - case 502: - return _('Bad Gateway'); - case 503: - return _('Service Unavailable'); - case 505: - return _('Gateway Timeout'); - case 505: - return _('HTTP Version Not Supported'); - - case $code > 500 && $code < 600: - return _('Server Error'); - - default: - return _('Error'); - } - } -} - -/* - * For systems that don't have gettext installed, we want to define a "_" function - * so that harmoni will still operate, if only in English - */ -if (!function_exists('gettext')) { - /** - * Returns the passed string to emulate untranslated language support for - * systems on which gettext isn't availible. - * - * @param string $string - * - * @return string - * - * @since 11/16/04 - */ - function _($string) - { - return $string; - } - - /** - * Returns the passed string to emulate untranslated language support for - * systems on which gettext isn't availible. - * - * @param string $string - * - * @return string - * - * @since 11/16/04 - */ - function gettext($string) - { - return $string; - } - - /** - * Returns the passed string unchanged. - * - * @param string $domain - * @param string $string - * - * @return string - */ - function dgettext($domain, $string) - { - return $string; - } - - /** - * Does nothing. Here to emulate untranslated language support for - * systems on which gettext isn't availible. - * - * @param string $string - * - * @return string - * - * @since 11/16/04 - */ - function textdomain($string) - { - if ($string) { - $_SESSION['__fake_text_domain'] = $string; - } - - if (isset($_SESSION['__fake_text_domain'])) { - return $_SESSION['__fake_text_domain']; - } else { - return 'en_US'; - } - } -} diff --git a/application/library/Paginator/Adaptor/CourseOfferingSearch.php b/application/library/Paginator/Adaptor/CourseOfferingSearch.php deleted file mode 100755 index bc84f333..00000000 --- a/application/library/Paginator/Adaptor/CourseOfferingSearch.php +++ /dev/null @@ -1,79 +0,0 @@ -session = $session; - $this->query = $query; - - if (null === $search) { - $this->search = $this->session->getCourseOfferingSearch(); - } else { - $this->search = $search; - } - } - - /** - * Returns the total number of rows in the collection. - * - * @since 6/2/09 - */ - public function count(): int - { - if (!isset($this->results)) { - $this->getItems(0, 20); - } - - return $this->results->getResultSize(); - } - - /** - * Returns an collection of items for a page. - * - * @param int $offset Page offset - * @param int $itemCountPerPage Number of items per page - * - * @return array - */ - public function getItems($offset, $itemCountPerPage) - { - $start = $offset + 1; - $end = $offset + $itemCountPerPage; - - $this->search->limitResultSet($start, $end); - $this->results = $this->session->getCourseOfferingsBySearch($this->query, $this->search); - - $offerings = []; - $list = $this->results->getCourseOfferings(); - while ($list->hasNext()) { - $offerings[] = $list->getNextCourseOffering(); - } - - return $offerings; - } -} diff --git a/application/library/Schedules.php b/application/library/Schedules.php deleted file mode 100755 index bf468029..00000000 --- a/application/library/Schedules.php +++ /dev/null @@ -1,154 +0,0 @@ -db = $db; - $this->userId = $userId; - $this->courseManager = $courseManager; - } - - private $db; - private $userId; - private $courseManager; - - /** - * Create a schedule. - * - * @return Schedule - * - * @since 8/2/10 - */ - public function createSchedule(osid_id_Id $termId) - { - $stmt = $this->db->prepare('INSERT INTO user_schedules (user_id, term_id_keyword, term_id_authority, term_id_namespace, name) VALUES (?, ?, ?, ?, ?);'); - $name = 'Untitled Schedule'; - $stmt->execute([ - $this->userId, - $termId->getIdentifier(), - $termId->getAuthority(), - $termId->getIdentifierNamespace(), - $name, - ]); - $id = $this->db->lastInsertId(); - - return new Schedule($id, $this->db, $this->userId, $this->courseManager, $name, $termId); - } - - /** - * Delete a schedule. - * - * @param string $scheduleId - * - * @return void - * - * @since 7/29/10 - */ - public function deleteSchedule($scheduleId) - { - $stmt = $this->db->prepare('DELETE FROM user_schedules WHERE id = ? AND user_id = ? LIMIT 1;'); - $stmt->execute([ - $scheduleId, - $this->userId, - ]); - } - - /** - * Answer a schedule by Id. - * - * @param string $scheduleId - * - * @return Schedule - * - * @since 8/2/10 - */ - public function getSchedule($scheduleId) - { - $stmt = $this->db->prepare('SELECT * FROM user_schedules WHERE id = ? AND user_id = ? LIMIT 1;'); - $stmt->execute([ - $scheduleId, - $this->userId, - ]); - $rows = $stmt->fetchAll(); - if (!count($rows)) { - throw new InvalidArgumentException('Schedule was not found.'); - } - - return new Schedule($rows[0]['id'], $this->db, $this->userId, $this->courseManager, $rows[0]['name'], new phpkit_id_Id($rows[0]['term_id_authority'], $rows[0]['term_id_namespace'], $rows[0]['term_id_keyword'])); - } - - /** - * Answer all schedules for the current user. - * - * @return array of Schedule objects - * - * @since 8/2/10 - */ - public function getSchedules() - { - $stmt = $this->db->prepare('SELECT * FROM user_schedules WHERE user_id = ?;'); - $stmt->execute([ - $this->userId, - ]); - - $schedules = []; - foreach ($stmt->fetchAll() as $row) { - $schedules[] = new Schedule($row['id'], $this->db, $this->userId, $this->courseManager, $row['name'], new phpkit_id_Id($row['term_id_authority'], $row['term_id_namespace'], $row['term_id_keyword'])); - } - - return $schedules; - } - - /** - * Answer schedules for the current user for a given term. - * - * @return array of Schedule objects - * - * @since 8/2/10 - */ - public function getSchedulesByTerm(osid_id_Id $termId) - { - $stmt = $this->db->prepare('SELECT * FROM user_schedules WHERE user_id = ? AND term_id_keyword = ? AND term_id_authority = ? AND term_id_namespace = ?;'); - $stmt->execute([ - $this->userId, - $termId->getIdentifier(), - $termId->getAuthority(), - $termId->getIdentifierNamespace(), - ]); - - $schedules = []; - foreach ($stmt->fetchAll() as $row) { - $schedules[] = new Schedule($row['id'], $this->db, $this->userId, $this->courseManager, $row['name'], new phpkit_id_Id($row['term_id_authority'], $row['term_id_namespace'], $row['term_id_keyword'])); - } - - return $schedules; - } -} diff --git a/application/library/apc/course/CourseManager.php b/application/library/apc/course/CourseManager.php index 91ab29df..4544ac37 100755 --- a/application/library/apc/course/CourseManager.php +++ b/application/library/apc/course/CourseManager.php @@ -28,13 +28,24 @@ public function __construct() { parent::__construct(); - $this->setId(new phpkit_id_URNInetId('urn:inet:middlebury.edu:id:implementations/apc_course')); + $this->setId(new phpkit_id_URNInetId('urn:inet:middlebury.edu:id:implementations.apc_course')); $this->setDisplayName('APC Caching Course Manager'); $this->setDescription('This is a CourseManager implementation that provides read-only, unauthenticated, access to course information stored in an underlying course manager.'); } // The underlying course manager. private $manager; + /** + * Allow access to the underlying database for test setup/tear down. + * + * @return PDO + * The backing database + */ + public function getDB() + { + return $this->manager->getDB(); + } + /********************************************************* * From OsidManager *********************************************************/ @@ -74,7 +85,7 @@ public function initialize(osid_OsidRuntimeManager $runtime) try { $implClassName = phpkit_configuration_ConfigUtil::getSingleValuedValue( $runtime->getConfiguration(), - new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:apc_course/impl_class_name'), + new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:apc_course.impl_class_name'), new phpkit_type_Type('urn', 'middlebury.edu', 'Primitives/String')); } catch (osid_NotFoundException $e) { throw new osid_ConfigurationErrorException($e->getMessage(), $e->getCode(), $e); diff --git a/application/library/banner/AbstractSession.php b/application/library/banner/AbstractSession.php index b70cd6c0..c800b4d0 100755 --- a/application/library/banner/AbstractSession.php +++ b/application/library/banner/AbstractSession.php @@ -145,11 +145,11 @@ protected function usesIsolatedView() public function getDatabaseIdString(osid_id_Id $id, $prefix = null) { if ('urn' != $id->getIdentifierNamespace()) { - throw new osid_NotFoundException('I only know about Ids in the urn namespace.'); + throw new osid_NotFoundException('I only know about Ids in the urn namespace, got: '.$id->getIdentifierNamespace()); } if ($id->getAuthority() != $this->manager->getIdAuthority()) { - throw new osid_NotFoundException('I only know about Ids under the '.$this->manager->getIdAuthority().' authority.'); + throw new osid_NotFoundException('I only know about Ids under the '.$this->manager->getIdAuthority().' authority, got: '.$id->getAuthority()); } if (null === $prefix) { @@ -159,7 +159,7 @@ public function getDatabaseIdString(osid_id_Id $id, $prefix = null) } if (!str_starts_with($id->getIdentifier(), $prefix)) { - throw new osid_NotFoundException('I only know about Ids with the '.$prefix.' prefix.'); + throw new osid_NotFoundException('I only know about Ids with the '.$prefix.' prefix, got: '.$id->getIdentifier()); } return substr($id->getIdentifier(), strlen($prefix)); @@ -195,7 +195,7 @@ public function getOsidIdFromString($databaseId, $prefix = null) */ public function getTermCodeFromTermId(osid_id_Id $id) { - $string = $this->getDatabaseIdString($id, 'term/'); + $string = $this->getDatabaseIdString($id, 'term.'); if (!preg_match('#^([0-9]{6})$#', $string)) { throw new osid_NotFoundException("String '$string' cannot be broken into a term-code"); } @@ -214,8 +214,8 @@ public function getTermCodeFromTermId(osid_id_Id $id) */ public function getTermCodeFromOfferingId(osid_id_Id $id) { - $string = $this->getDatabaseIdString($id, 'section/'); - if (!preg_match('#^([0-9]{6})/([0-9]{1,5})$#', $string, $matches)) { + $string = $this->getDatabaseIdString($id, 'section.'); + if (!preg_match('#^([0-9]{6})\.([0-9]{1,5})$#', $string, $matches)) { throw new osid_NotFoundException("String '$string' cannot be broken into a term-code and CRN."); } @@ -233,8 +233,8 @@ public function getTermCodeFromOfferingId(osid_id_Id $id) */ public function getCrnFromOfferingId(osid_id_Id $id) { - $string = $this->getDatabaseIdString($id, 'section/'); - if (!preg_match('#^([0-9]{6})/([0-9]{1,5})$#', $string, $matches)) { + $string = $this->getDatabaseIdString($id, 'section.'); + if (!preg_match('#^([0-9]{6})\.([0-9]{1,5})$#', $string, $matches)) { throw new osid_NotFoundException("String '$string' cannot be broken into a term-code and CRN."); } @@ -250,7 +250,7 @@ public function getCrnFromOfferingId(osid_id_Id $id) */ public function getSubjectFromCourseId(osid_id_Id $id) { - $string = $this->getDatabaseIdString($id, 'course/'); + $string = $this->getDatabaseIdString($id, 'course.'); if (!preg_match('#^([A-Z]{2,4})([A-Z0-9]{3,5})$#i', $string, $matches)) { throw new osid_NotFoundException("String '$string' cannot be broken into a subject-code and Number."); } @@ -267,7 +267,7 @@ public function getSubjectFromCourseId(osid_id_Id $id) */ public function getNumberFromCourseId(osid_id_Id $id) { - $string = $this->getDatabaseIdString($id, 'course/'); + $string = $this->getDatabaseIdString($id, 'course.'); if (!preg_match('#^([A-Z]{2,4})([A-Z0-9]{3,5})$#i', $string, $matches)) { throw new osid_NotFoundException("String '$string' cannot be broken into a subject-code and Number."); } diff --git a/application/library/banner/course/AbstractSession.php b/application/library/banner/course/AbstractSession.php index df804b2d..f5de7375 100755 --- a/application/library/banner/course/AbstractSession.php +++ b/application/library/banner/course/AbstractSession.php @@ -26,7 +26,7 @@ abstract class banner_course_AbstractSession extends banner_AbstractSession impl */ public function getCatalogDatabaseId(osid_id_Id $id) { - return $this->getDatabaseIdString($id, 'catalog/'); + return $this->getDatabaseIdString($id, 'catalog.'); } /** @@ -159,7 +159,7 @@ public function getOfferingIdFromTermCodeAndCrn($termCode, $crn) throw new osid_OperationFailedException('Both termCode and CRN must be specified.'); } - return $this->getOsidIdFromString($termCode.'/'.$crn, 'section/'); + return $this->getOsidIdFromString($termCode.'.'.$crn, 'section.'); } /** @@ -177,7 +177,7 @@ public function getCourseIdFromSubjectAndNumber($subjectCode, $number) throw new osid_OperationFailedException('Both subjectCode and number must be specified.'); } - return $this->getOsidIdFromString($subjectCode.$number, 'course/'); + return $this->getOsidIdFromString($subjectCode.$number, 'course.'); } /** @@ -189,8 +189,8 @@ public function getCourseIdFromSubjectAndNumber($subjectCode, $number) */ public function getTermCodeFromTermId(osid_id_Id $id) { - $string = $this->getDatabaseIdString($id, 'term/'); - if (!preg_match('#^([0-9]{6})(?:/(.{1,3}))?$#', $string, $matches)) { + $string = $this->getDatabaseIdString($id, 'term.'); + if (!preg_match('#^([0-9]{6})(?:\.(.{1,3}))?$#', $string, $matches)) { throw new osid_NotFoundException("String '$string' cannot be converted into a valid term code."); } @@ -206,8 +206,8 @@ public function getTermCodeFromTermId(osid_id_Id $id) */ public function getPartOfTermCodeFromTermId(osid_id_Id $id) { - $string = $this->getDatabaseIdString($id, 'term/'); - if (!preg_match('#^([0-9]{6})(?:/(.{1,3}))$#', $string, $matches)) { + $string = $this->getDatabaseIdString($id, 'term.'); + if (!preg_match('#^([0-9]{6})(?:\.(.{1,3}))$#', $string, $matches)) { throw new osid_NotFoundException("String '$string' cannot be converted into a valid part-of-term code."); } @@ -229,8 +229,8 @@ public function getScheduleCodeFromGenusType(osid_type_Type $genusType) throw new osid_NotFoundException("I only know about the '".$this->getIdAuthority()."' authority"); } - if (!preg_match('/^genera:offering\/([a-z]+)$/i', $genusType->getIdentifier(), $matches)) { - throw new osid_NotFoundException("I only know about identifiers beginning with 'genera:offering/'"); + if (!preg_match('/^genera:offering\.([a-z]+)$/i', $genusType->getIdentifier(), $matches)) { + throw new osid_NotFoundException("I only know about identifiers beginning with 'genera:offering.'"); } return $matches[1]; diff --git a/application/library/banner/course/Course.php b/application/library/banner/course/Course.php index 717d6d4b..e809754a 100755 --- a/application/library/banner/course/Course.php +++ b/application/library/banner/course/Course.php @@ -6,9 +6,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL) */ -include_once 'fsmparserclass.inc.php'; -include_once 'harmoni/Primitives/Collections-Text/HtmlString.class.php'; - /** *A Course
represents a canonical learning unit. A
* Course
is instantiated at a time and place through the creation of
@@ -799,7 +796,7 @@ public function getLinkSetIdsForTerm(osid_id_Id $termId)
}
$linkSetIds = array_unique($linkSetIds);
foreach ($linkSetIds as $key => $val) {
- $linkSetIds[$key] = $this->session->getOsidIdFromString($val, 'link_set/');
+ $linkSetIds[$key] = $this->session->getOsidIdFromString($val, 'link_set.');
}
return new phpkit_id_ArrayIdList($linkSetIds);
@@ -830,7 +827,7 @@ public function getLinkTypeIdsForTermAndSet(osid_id_Id $termId, osid_id_Id $link
$setId = substr($linkIdString, 1, 1);
// The type id is the first charactor.
$typeId = substr($linkIdString, 0, 1);
- if ($linkSetId->isEqual($this->session->getOsidIdFromString($setId, 'link_set/'))) {
+ if ($linkSetId->isEqual($this->session->getOsidIdFromString($setId, 'link_set.'))) {
$linkTypeIds[] = $typeId;
}
}
@@ -843,7 +840,7 @@ public function getLinkTypeIdsForTermAndSet(osid_id_Id $termId, osid_id_Id $link
}
foreach ($linkTypeIds as $key => $val) {
- $linkTypeIds[$key] = $this->session->getOsidIdFromString($val, 'link_type/');
+ $linkTypeIds[$key] = $this->session->getOsidIdFromString($val, 'link_type.');
}
return new phpkit_id_ArrayIdList($linkTypeIds);
diff --git a/application/library/banner/course/Course/AbstractList.php b/application/library/banner/course/Course/AbstractList.php
index 7f2da7cf..dff50e14 100755
--- a/application/library/banner/course/Course/AbstractList.php
+++ b/application/library/banner/course/Course/AbstractList.php
@@ -250,19 +250,22 @@ protected function includeInactive()
* Answer an object from a result row.
*
* @since 4/13/09
+ *
+ * @return osid_course_Course
+ * The object from a row
*/
final protected function getObjectFromRow(array $row)
{
return new banner_course_Course(
- $this->session->getOsidIdFromString($row['SCBCRSE_SUBJ_CODE'].$row['SCBCRSE_CRSE_NUMB'], 'course/'),
+ $this->session->getOsidIdFromString($row['SCBCRSE_SUBJ_CODE'].$row['SCBCRSE_CRSE_NUMB'], 'course.'),
$row['SCBCRSE_SUBJ_CODE'].' '.$row['SCBCRSE_CRSE_NUMB'],
(null === $row['SCBDESC_TEXT_NARRATIVE']) ? '' : $row['SCBDESC_TEXT_NARRATIVE'], // Description
$row['SCBCRSE_TITLE'],
$row['SCBCRSE_CREDIT_HR_HIGH'],
[
- $this->session->getOsidIdFromString($row['SCBCRSE_SUBJ_CODE'], 'topic/subject/'),
- $this->session->getOsidIdFromString($row['SCBCRSE_DEPT_CODE'], 'topic/department/'),
- $this->session->getOsidIdFromString($row['SCBCRSE_DIVS_CODE'], 'topic/division/'),
+ $this->session->getOsidIdFromString($row['SCBCRSE_SUBJ_CODE'], 'topic.subject.'),
+ $this->session->getOsidIdFromString($row['SCBCRSE_DEPT_CODE'], 'topic.department.'),
+ $this->session->getOsidIdFromString($row['SCBCRSE_DIVS_CODE'], 'topic.division.'),
],
$row['has_alternates'],
$this->session);
diff --git a/application/library/banner/course/Course/AbstractSession.php b/application/library/banner/course/Course/AbstractSession.php
index ed5b6f30..0cac8fb1 100755
--- a/application/library/banner/course/Course/AbstractSession.php
+++ b/application/library/banner/course/Course/AbstractSession.php
@@ -49,7 +49,7 @@ public function getRequirementTopicIdsForCourse(osid_id_Id $courseId)
self::$requirementTopics_stmt->execute($parameters);
$topicIds = [];
while ($row = self::$requirementTopics_stmt->fetch(PDO::FETCH_ASSOC)) {
- $topicIds[] = $this->getOsidIdFromString($row['SCRATTR_ATTR_CODE'], 'topic/requirement/');
+ $topicIds[] = $this->getOsidIdFromString($row['SCRATTR_ATTR_CODE'], 'topic.requirement.');
}
self::$requirementTopics_stmt->closeCursor();
@@ -89,7 +89,7 @@ public function getLevelTopicIdsForCourse(osid_id_Id $courseId)
self::$levelTopics_stmt->execute($parameters);
$topicIds = [];
while ($row = self::$levelTopics_stmt->fetch(PDO::FETCH_ASSOC)) {
- $topicIds[] = $this->getOsidIdFromString($row['SCRLEVL_LEVL_CODE'], 'topic/level/');
+ $topicIds[] = $this->getOsidIdFromString($row['SCRLEVL_LEVL_CODE'], 'topic.level.');
}
self::$levelTopics_stmt->closeCursor();
diff --git a/application/library/banner/course/Course/Catalog/Session.php b/application/library/banner/course/Course/Catalog/Session.php
index b27843ad..fafd9234 100755
--- a/application/library/banner/course/Course/Catalog/Session.php
+++ b/application/library/banner/course/Course/Catalog/Session.php
@@ -34,7 +34,7 @@ class banner_course_Course_Catalog_Session extends banner_course_Course_Abstract
*/
public function __construct(banner_course_CourseManagerInterface $manager)
{
- parent::__construct($manager, 'catalog/');
+ parent::__construct($manager, 'catalog.');
}
/**
@@ -242,7 +242,7 @@ public function getCatalogIdsByCourse(osid_id_Id $courseId)
$ids = [];
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
- $ids[] = $this->getOsidIdFromString($row['catalog_id'], 'catalog/');
+ $ids[] = $this->getOsidIdFromString($row['catalog_id'], 'catalog.');
}
$statement->closeCursor();
@@ -279,7 +279,7 @@ public function getCatalogsByCourse(osid_id_Id $courseId)
$catalogs = [];
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
$catalogs[] = new banner_course_CourseCatalog(
- $this->getOsidIdFromString($row['catalog_id'], 'catalog/'),
+ $this->getOsidIdFromString($row['catalog_id'], 'catalog.'),
$row['catalog_title']);
}
$statement->closeCursor();
diff --git a/application/library/banner/course/Course/Lookup/Session.php b/application/library/banner/course/Course/Lookup/Session.php
index ceeff4a1..e4180adb 100755
--- a/application/library/banner/course/Course/Lookup/Session.php
+++ b/application/library/banner/course/Course/Lookup/Session.php
@@ -52,7 +52,7 @@ class banner_course_Course_Lookup_Session extends banner_course_Course_AbstractS
*/
public function __construct(banner_course_CourseManagerInterface $manager, osid_id_Id $catalogId)
{
- parent::__construct($manager, 'course/');
+ parent::__construct($manager, 'course.');
$this->catalogId = $catalogId;
}
@@ -228,7 +228,7 @@ public function getCourse(osid_id_Id $courseId)
self::$getCourse_stmts[$catalogWhere] = $this->manager->getDB()->prepare($query);
}
- $courseIdString = $this->getDatabaseIdString($courseId, 'course/');
+ $courseIdString = $this->getDatabaseIdString($courseId, 'course.');
$parameters = array_merge(
[
@@ -241,19 +241,19 @@ public function getCourse(osid_id_Id $courseId)
self::$getCourse_stmts[$catalogWhere]->closeCursor();
if (!$row || !($row['SCBCRSE_SUBJ_CODE'] && $row['SCBCRSE_CRSE_NUMB'])) {
- throw new osid_NotFoundException("Could not find a course matching the id-component '$courseIdString' for the catalog '".$this->getDatabaseIdString($this->getCourseCatalogId(), 'catalog/')."'.");
+ throw new osid_NotFoundException("Could not find a course matching the id-component '$courseIdString' for the catalog '".$this->getDatabaseIdString($this->getCourseCatalogId(), 'catalog.')."'.");
}
return new banner_course_Course(
- $this->getOsidIdFromString($row['SCBCRSE_SUBJ_CODE'].$row['SCBCRSE_CRSE_NUMB'], 'course/'),
+ $this->getOsidIdFromString($row['SCBCRSE_SUBJ_CODE'].$row['SCBCRSE_CRSE_NUMB'], 'course.'),
$row['SCBCRSE_SUBJ_CODE'].' '.$row['SCBCRSE_CRSE_NUMB'],
(null === $row['SCBDESC_TEXT_NARRATIVE']) ? '' : $row['SCBDESC_TEXT_NARRATIVE'], // Description
$row['SCBCRSE_TITLE'],
$row['SCBCRSE_CREDIT_HR_HIGH'],
[
- $this->getOsidIdFromString($row['SCBCRSE_SUBJ_CODE'], 'topic/subject/'),
- $this->getOsidIdFromString($row['SCBCRSE_DEPT_CODE'], 'topic/department/'),
- $this->getOsidIdFromString($row['SCBCRSE_DIVS_CODE'], 'topic/division/'),
+ $this->getOsidIdFromString($row['SCBCRSE_SUBJ_CODE'], 'topic.subject.'),
+ $this->getOsidIdFromString($row['SCBCRSE_DEPT_CODE'], 'topic.department.'),
+ $this->getOsidIdFromString($row['SCBCRSE_DIVS_CODE'], 'topic.division.'),
],
$row['has_alternates'],
$this);
diff --git a/application/library/banner/course/Course/Search/Order.php b/application/library/banner/course/Course/Search/Order.php
index 537cdfdf..8076997d 100755
--- a/application/library/banner/course/Course/Search/Order.php
+++ b/application/library/banner/course/Course/Search/Order.php
@@ -131,6 +131,6 @@ public function orderByPrereqInfo()
*/
public function getCourseSearchOrderRecord(osid_type_Type $courseRecordType)
{
- throw new osid_UnsupportedException();
+ throw new osid_UnsupportedException('The CourseRecordType passed is not supported.');
}
}
diff --git a/application/library/banner/course/Course/Search/Query.php b/application/library/banner/course/Course/Search/Query.php
index bb0a662a..dbf36aa3 100755
--- a/application/library/banner/course/Course/Search/Query.php
+++ b/application/library/banner/course/Course/Search/Query.php
@@ -575,7 +575,7 @@ public function matchCourseCatalogId(osid_id_Id $courseCatalogId, $match)
course_catalog_college
WHERE
catalog_id = ?)',
- [$this->session->getDatabaseIdString($courseCatalogId, 'catalog/')],
+ [$this->session->getDatabaseIdString($courseCatalogId, 'catalog.')],
$match);
}
@@ -752,7 +752,7 @@ public function getTopicQuery()
*/
public function matchInstructorId(osid_id_Id $instructorId, $match)
{
- $this->addClause('instructor_id', 'WEB_ID = ?', [$this->session->getDatabaseIdString($instructorId, 'resource/person/')], $match);
+ $this->addClause('instructor_id', 'WEB_ID = ?', [$this->session->getDatabaseIdString($instructorId, 'resource.person.')], $match);
$this->addTableJoin('LEFT JOIN SSBSECT ON (SCBCRSE_SUBJ_CODE = SSBSECT_SUBJ_CODE AND SCBCRSE_CRSE_NUMB = SSBSECT_CRSE_NUMB)');
$this->addTableJoin('LEFT JOIN SYVINST ON (SYVINST_TERM_CODE = SSBSECT_TERM_CODE AND SYVINST_CRN = SSBSECT_CRN)');
@@ -810,7 +810,7 @@ public function getInstructorQuery()
*/
public function matchTermId(osid_id_Id $termId, $match)
{
- $this->addClause('term_id', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term/')], $match);
+ $this->addClause('term_id', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term.')], $match);
$this->addTableJoin('LEFT JOIN SSBSECT ON (SCBCRSE_SUBJ_CODE = SSBSECT_SUBJ_CODE AND SCBCRSE_CRSE_NUMB = SSBSECT_CRSE_NUMB)');
$this->addClause('active_sections', 'SSBSECT_SSTS_CODE = ? AND (course_catalog.prnt_ind_to_exclude IS NULL OR SSBSECT_PRNT_IND != course_catalog.prnt_ind_to_exclude)', ['A'], true);
@@ -867,7 +867,7 @@ public function getTermQuery()
*/
public function matchLocationId(osid_id_Id $instructorId, $match)
{
- $this->addClause('location_id', 'SSBSECT_CAMP_CODE = ?', [$this->session->getDatabaseIdString($instructorId, 'resource/place/campus/')], $match);
+ $this->addClause('location_id', 'SSBSECT_CAMP_CODE = ?', [$this->session->getDatabaseIdString($instructorId, 'resource.place.campus.')], $match);
$this->addTableJoin('LEFT JOIN SSBSECT ON (SCBCRSE_SUBJ_CODE = SSBSECT_SUBJ_CODE AND SCBCRSE_CRSE_NUMB = SSBSECT_CRSE_NUMB)');
$this->addClause('active_sections', 'SSBSECT_SSTS_CODE = ? AND (course_catalog.prnt_ind_to_exclude IS NULL OR SSBSECT_PRNT_IND != course_catalog.prnt_ind_to_exclude)', ['A'], true);
diff --git a/application/library/banner/course/Course/Search/Search.php b/application/library/banner/course/Course/Search/Search.php
index 5abdd0ad..837275ad 100755
--- a/application/library/banner/course/Course/Search/Search.php
+++ b/application/library/banner/course/Course/Search/Search.php
@@ -96,6 +96,6 @@ public function orderCourseResults(osid_course_CourseSearchOrder $courseSearchOr
*/
public function getCourseSearchRecord(osid_type_Type $courseSearchRecordType)
{
- throw new osid_UnsupportedException();
+ throw new osid_UnsupportedException('The CourseSearchRecordType passed is not supported.');
}
}
diff --git a/application/library/banner/course/Course/Search/Session.php b/application/library/banner/course/Course/Search/Session.php
index ffe6435d..0fbbb474 100755
--- a/application/library/banner/course/Course/Search/Session.php
+++ b/application/library/banner/course/Course/Search/Session.php
@@ -45,7 +45,7 @@ class banner_course_Course_Search_Session extends banner_course_Course_AbstractS
*/
public function __construct(banner_course_CourseManagerInterface $manager, osid_id_Id $catalogId)
{
- parent::__construct($manager, 'section/');
+ parent::__construct($manager, 'section.');
$this->catalogId = $catalogId;
}
diff --git a/application/library/banner/course/CourseCatalog/Lookup/Session.php b/application/library/banner/course/CourseCatalog/Lookup/Session.php
index 6ef0d69d..b0b09f6e 100755
--- a/application/library/banner/course/CourseCatalog/Lookup/Session.php
+++ b/application/library/banner/course/CourseCatalog/Lookup/Session.php
@@ -48,7 +48,7 @@ class banner_course_CourseCatalog_Lookup_Session extends banner_course_AbstractS
*/
public function __construct(banner_course_CourseManagerInterface $manager)
{
- parent::__construct($manager, 'catalog/');
+ parent::__construct($manager, 'catalog.');
}
/**
diff --git a/application/library/banner/course/CourseManager.php b/application/library/banner/course/CourseManager.php
index 7507cac2..d504a41f 100755
--- a/application/library/banner/course/CourseManager.php
+++ b/application/library/banner/course/CourseManager.php
@@ -35,7 +35,7 @@ public function __construct()
{
parent::__construct();
- $this->setId(new phpkit_id_URNInetId('urn:inet:middlebury.edu:id:implementations/banner_course'));
+ $this->setId(new phpkit_id_URNInetId('urn:inet:middlebury.edu:id:implementations.banner_course'));
$this->setDisplayName('Banner Course Manager');
$this->setDescription('This is a CourseManager implementation that provides read-only, unauthenticated, access to course information stored in Banner database tables.');
}
@@ -76,7 +76,7 @@ public function getIdAuthority()
*/
public function getCombinedCatalogId()
{
- return new phpkit_id_Id($this->getIdAuthority(), 'urn', 'catalog/all');
+ return new phpkit_id_Id($this->getIdAuthority(), 'urn', 'catalog.all');
}
/*********************************************************
@@ -118,17 +118,17 @@ public function initialize(osid_OsidRuntimeManager $runtime)
try {
$dsn = phpkit_configuration_ConfigUtil::getSingleValuedValue(
$runtime->getConfiguration(),
- new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course/pdo_dsn'),
+ new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course.pdo_dsn'),
new phpkit_type_Type('urn', 'middlebury.edu', 'Primitives/String'));
$username = phpkit_configuration_ConfigUtil::getSingleValuedValue(
$runtime->getConfiguration(),
- new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course/pdo_username'),
+ new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course.pdo_username'),
new phpkit_type_Type('urn', 'middlebury.edu', 'Primitives/String'));
$password = phpkit_configuration_ConfigUtil::getSingleValuedValue(
$runtime->getConfiguration(),
- new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course/pdo_password'),
+ new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course.pdo_password'),
new phpkit_type_Type('urn', 'middlebury.edu', 'Primitives/String'));
} catch (osid_NotFoundException $e) {
throw new osid_ConfigurationErrorException($e->getMessage(), $e->getCode(), $e);
@@ -137,7 +137,7 @@ public function initialize(osid_OsidRuntimeManager $runtime)
try {
$debug = phpkit_configuration_ConfigUtil::getSingleValuedValue(
$runtime->getConfiguration(),
- new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course/pdo_count_queries'),
+ new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course.pdo_count_queries'),
new phpkit_type_Type('urn', 'middlebury.edu', 'Primitives/Boolean'));
} catch (osid_ConfigurationErrorException $e) {
$debug = false;
@@ -147,7 +147,7 @@ public function initialize(osid_OsidRuntimeManager $runtime)
$driverOptions = [];
$options = phpkit_configuration_ConfigUtil::getMultiValuedValueOfAnyType(
$runtime->getConfiguration(),
- new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course/pdo_driver_options'));
+ new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course.pdo_driver_options'));
foreach ($options as $key => $value) {
$option = constant($key);
if (null === $option) {
@@ -172,10 +172,10 @@ public function initialize(osid_OsidRuntimeManager $runtime)
try {
$this->idAuthority = phpkit_configuration_ConfigUtil::getSingleValuedValue(
$runtime->getConfiguration(),
- new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course/id_authority'),
+ new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course.id_authority'),
new phpkit_type_Type('urn', 'middlebury.edu', 'Primitives/String'));
if (!strlen($this->idAuthority)) {
- throw new osid_ConfigurationErrorException('urn:inet:middlebury.edu:config:banner_course/id_authority must be specified.');
+ throw new osid_ConfigurationErrorException('urn:inet:middlebury.edu:config:banner_course.id_authority must be specified.');
}
} catch (osid_NotFoundException $e) {
throw new osid_ConfigurationErrorException($e->getMessage(), $e->getCode(), $e);
@@ -213,7 +213,7 @@ public function shutdown()
public function getCourseLookupSession()
{
return new banner_course_Course_Lookup_CombinedSession($this,
- new phpkit_id_URNInetId('urn:inet:'.$this->idAuthority.':catalog/all'));
+ new phpkit_id_URNInetId('urn:inet:'.$this->idAuthority.':catalog.all'));
}
/**
@@ -268,7 +268,7 @@ public function getCourseLookupSessionForCatalog(osid_id_Id $courseCatalogId)
public function getCourseSearchSession()
{
return new banner_course_Course_Search_Session($this,
- new phpkit_id_URNInetId('urn:inet:'.$this->idAuthority.':catalog/all'));
+ new phpkit_id_URNInetId('urn:inet:'.$this->idAuthority.':catalog.all'));
}
/**
diff --git a/application/library/banner/course/CourseOffering.php b/application/library/banner/course/CourseOffering.php
index 1d714f31..dc6ce2b8 100755
--- a/application/library/banner/course/CourseOffering.php
+++ b/application/library/banner/course/CourseOffering.php
@@ -117,7 +117,7 @@ public function __construct(array $row, banner_course_CourseOffering_SessionInte
$this->setGenusType(new phpkit_type_Type(
'urn', // namespace
$this->session->getIdAuthority(), // id authority
- 'genera:offering/'.$row['STVSCHD_CODE'], // identifier
+ 'genera:offering.'.$row['STVSCHD_CODE'], // identifier
'Course Offerings', // domain
trim($row['STVSCHD_DESC']), // display name
trim($row['STVSCHD_CODE']) // display label
@@ -350,10 +350,10 @@ public function getTermId()
{
$termCode = $this->row['SSBSECT_TERM_CODE'];
if (!empty($this->row['SSBSECT_PTRM_CODE']) && 1 != $this->row['SSBSECT_PTRM_CODE']) {
- $termCode .= '/'.$this->row['SSBSECT_PTRM_CODE'];
+ $termCode .= '.'.$this->row['SSBSECT_PTRM_CODE'];
}
- return $this->getOsidIdFromString($termCode, 'term/');
+ return $this->getOsidIdFromString($termCode, 'term.');
}
/**
@@ -387,16 +387,16 @@ public function getTopicIds()
if (!isset($this->topicIds)) {
$this->topicIds = [];
if ($this->row['SCBCRSE_DEPT_CODE']) {
- $this->topicIds[] = $this->getOsidIdFromString($this->row['SCBCRSE_DEPT_CODE'], 'topic/department/');
+ $this->topicIds[] = $this->getOsidIdFromString($this->row['SCBCRSE_DEPT_CODE'], 'topic.department.');
}
if ($this->row['SSBSECT_SUBJ_CODE']) {
- $this->topicIds[] = $this->getOsidIdFromString($this->row['SSBSECT_SUBJ_CODE'], 'topic/subject/');
+ $this->topicIds[] = $this->getOsidIdFromString($this->row['SSBSECT_SUBJ_CODE'], 'topic.subject.');
}
if ($this->row['SCBCRSE_DIVS_CODE']) {
- $this->topicIds[] = $this->getOsidIdFromString($this->row['SCBCRSE_DIVS_CODE'], 'topic/division/');
+ $this->topicIds[] = $this->getOsidIdFromString($this->row['SCBCRSE_DIVS_CODE'], 'topic.division.');
}
if ($this->row['GTVINSM_CODE']) {
- $this->topicIds[] = $this->getOsidIdFromString($this->row['GTVINSM_CODE'], 'topic/instruction_method/');
+ $this->topicIds[] = $this->getOsidIdFromString($this->row['GTVINSM_CODE'], 'topic.instruction_method.');
}
$this->topicIds = array_merge(
@@ -484,8 +484,8 @@ public function hasLocation()
public function getLocationId()
{
return $this->getOsidIdFromString(
- $this->row['SSRMEET_BLDG_CODE'].'/'.$this->row['SSRMEET_ROOM_CODE'],
- 'resource/place/room/');
+ $this->row['SSRMEET_BLDG_CODE'].'.'.$this->row['SSRMEET_ROOM_CODE'],
+ 'resource.place.room.');
}
/**
@@ -633,8 +633,8 @@ public function getCalendarId()
throw new osid_IllegalStateException('This version of the OSID does not support Learning Objectives');
return $this->getOsidIdFromString(
- $this->row['SSBSECT_TERM_CODE'].'/'.$this->row['SSBSECT_CRN'],
- 'CourseSchedule/');
+ $this->row['SSBSECT_TERM_CODE'].'.'.$this->row['SSBSECT_CRN'],
+ 'CourseSchedule.');
}
/**
@@ -879,7 +879,7 @@ public function getLinkSetId()
$linkId = substr($this->row['SSBSECT_LINK_IDENT'], 1, 1);
}
- return $this->getOsidIdFromString($linkId, 'link_set/');
+ return $this->getOsidIdFromString($linkId, 'link_set.');
}
/**
@@ -907,7 +907,7 @@ public function getLinkTypeId()
$linkId = substr($this->row['SSBSECT_LINK_IDENT'], 0, 1);
}
- return $this->getOsidIdFromString($linkId, 'link_type/');
+ return $this->getOsidIdFromString($linkId, 'link_type.');
}
/*********************************************************
diff --git a/application/library/banner/course/CourseOffering/AbstractList.php b/application/library/banner/course/CourseOffering/AbstractList.php
index f019e34e..ee507f06 100755
--- a/application/library/banner/course/CourseOffering/AbstractList.php
+++ b/application/library/banner/course/CourseOffering/AbstractList.php
@@ -329,6 +329,9 @@ protected function getHavingTerms()
* Answer an object from a result row.
*
* @since 4/13/09
+ *
+ * @return osid_course_CourseOffering
+ * The object from a row
*/
final protected function getObjectFromRow(array $row)
{
diff --git a/application/library/banner/course/CourseOffering/AbstractSession.php b/application/library/banner/course/CourseOffering/AbstractSession.php
index 94422035..2cb3e26f 100755
--- a/application/library/banner/course/CourseOffering/AbstractSession.php
+++ b/application/library/banner/course/CourseOffering/AbstractSession.php
@@ -28,7 +28,7 @@ public function getInstructorIdsForOffering(osid_id_Id $offeringId)
{
$ids = [];
foreach ($this->getInstructorDataForOffering($offeringId) as $row) {
- $ids[] = $this->getOsidIdFromString($row['WEB_ID'], 'resource/person/');
+ $ids[] = $this->getOsidIdFromString($row['WEB_ID'], 'resource.person.');
}
return new phpkit_id_ArrayIdList($ids);
@@ -46,7 +46,7 @@ public function getInstructorsForOffering(osid_id_Id $offeringId)
$people = [];
foreach ($this->getInstructorDataForOffering($offeringId) as $row) {
$people[] = new banner_resource_Resource_Person(
- $this->getOsidIdFromString($row['WEB_ID'], 'resource/person/'),
+ $this->getOsidIdFromString($row['WEB_ID'], 'resource.person.'),
$row['SYVINST_LAST_NAME'],
$row['SYVINST_FIRST_NAME']
);
@@ -190,7 +190,7 @@ public function getRequirementTopicIdsForCourseOffering(osid_id_Id $courseOfferi
self::$requirementTopics_stmt->execute($parameters);
$topicIds = [];
while ($row = self::$requirementTopics_stmt->fetch(PDO::FETCH_ASSOC)) {
- $topicIds[] = $this->getOsidIdFromString($row['SSRATTR_ATTR_CODE'], 'topic/requirement/');
+ $topicIds[] = $this->getOsidIdFromString($row['SSRATTR_ATTR_CODE'], 'topic.requirement.');
}
self::$requirementTopics_stmt->closeCursor();
@@ -231,7 +231,7 @@ public function getLevelTopicIdsForCourseOffering(osid_id_Id $courseOfferingId)
self::$levelTopics_stmt->execute($parameters);
$topicIds = [];
while ($row = self::$levelTopics_stmt->fetch(PDO::FETCH_ASSOC)) {
- $topicIds[] = $this->getOsidIdFromString($row['SCRLEVL_LEVL_CODE'], 'topic/level/');
+ $topicIds[] = $this->getOsidIdFromString($row['SCRLEVL_LEVL_CODE'], 'topic.level.');
}
self::$levelTopics_stmt->closeCursor();
@@ -271,7 +271,7 @@ public function getBlockTopicIdsForCourseOffering(osid_id_Id $courseOfferingId)
self::$blockTopics_stmt->execute($parameters);
$topicIds = [];
while ($row = self::$blockTopics_stmt->fetch(PDO::FETCH_ASSOC)) {
- $topicIds[] = $this->getOsidIdFromString($row['SSRBLCK_BLCK_CODE'], 'topic/block/');
+ $topicIds[] = $this->getOsidIdFromString($row['SSRBLCK_BLCK_CODE'], 'topic.block.');
}
self::$blockTopics_stmt->closeCursor();
diff --git a/application/library/banner/course/CourseOffering/Catalog/Session.php b/application/library/banner/course/CourseOffering/Catalog/Session.php
index 51655bf7..a427fdf9 100755
--- a/application/library/banner/course/CourseOffering/Catalog/Session.php
+++ b/application/library/banner/course/CourseOffering/Catalog/Session.php
@@ -35,7 +35,7 @@ class banner_course_CourseOffering_Catalog_Session extends banner_course_CourseO
*/
public function __construct(banner_course_CourseManagerInterface $manager)
{
- parent::__construct($manager, 'catalog/');
+ parent::__construct($manager, 'catalog.');
}
/**
@@ -245,7 +245,7 @@ public function getCatalogIdsByCourseOffering(osid_id_Id $courseOfferingId)
$ids = [];
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
- $ids[] = $this->getOsidIdFromString($row['catalog_id'], 'catalog/');
+ $ids[] = $this->getOsidIdFromString($row['catalog_id'], 'catalog.');
}
$statement->closeCursor();
@@ -283,7 +283,7 @@ public function getCatalogsByCourseOffering(osid_id_Id $courseOfferingId)
$catalogs = [];
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
$catalogs[] = new banner_course_CourseCatalog(
- $this->getOsidIdFromString($row['catalog_id'], 'catalog/'),
+ $this->getOsidIdFromString($row['catalog_id'], 'catalog.'),
$row['catalog_title']);
}
$statement->closeCursor();
diff --git a/application/library/banner/course/CourseOffering/GenusTypeList.php b/application/library/banner/course/CourseOffering/GenusTypeList.php
index 05644c3d..b766e7b0 100755
--- a/application/library/banner/course/CourseOffering/GenusTypeList.php
+++ b/application/library/banner/course/CourseOffering/GenusTypeList.php
@@ -115,13 +115,16 @@ private function getAllInputParameters()
* Answer an object from a result row.
*
* @since 4/13/09
+ *
+ * @return osid_type_Type
+ * An object for the row data
*/
protected function getObjectFromRow(array $row)
{
return new phpkit_type_Type(
'urn', // namespace
$this->session->getIdAuthority(), // id authority
- 'genera:offering/'.$row['STVSCHD_CODE'], // identifier
+ 'genera:offering.'.$row['STVSCHD_CODE'], // identifier
'Course Offerings', // domain
$row['STVSCHD_DESC'], // display name
$row['STVSCHD_CODE'] // display label
diff --git a/application/library/banner/course/CourseOffering/Lookup/Session.php b/application/library/banner/course/CourseOffering/Lookup/Session.php
index 10e34c1b..89497c39 100755
--- a/application/library/banner/course/CourseOffering/Lookup/Session.php
+++ b/application/library/banner/course/CourseOffering/Lookup/Session.php
@@ -47,7 +47,7 @@ class banner_course_CourseOffering_Lookup_Session extends banner_course_CourseOf
*/
public function __construct(banner_course_CourseManagerInterface $manager, osid_id_Id $catalogId)
{
- parent::__construct($manager, 'section/');
+ parent::__construct($manager, 'section.');
$this->catalogId = $catalogId;
}
@@ -264,7 +264,7 @@ public function getCourseOffering(osid_id_Id $courseOfferingId)
$row = self::$getOffering_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC);
self::$getOffering_stmts[$catalogWhere]->closeCursor();
- if (!$row['SSBSECT_CRN'] || !$row['SSBSECT_TERM_CODE']) {
+ if (!$row || !$row['SSBSECT_CRN'] || !$row['SSBSECT_TERM_CODE']) {
throw new osid_NotFoundException('Could not find a course offering matching the term code '.$this->getTermCodeFromOfferingId($courseOfferingId).' and the crn '.$this->getCrnFromOfferingId($courseOfferingId).'.');
}
diff --git a/application/library/banner/course/CourseOffering/Search/Query.php b/application/library/banner/course/CourseOffering/Search/Query.php
index e6a6e20f..103b6ba7 100755
--- a/application/library/banner/course/CourseOffering/Search/Query.php
+++ b/application/library/banner/course/CourseOffering/Search/Query.php
@@ -256,7 +256,7 @@ private function getGenusTypeCode(osid_type_Type $genusType)
return null;
}
- if (!preg_match('/^genera:offering\/([a-z]+)$/i', $genusType->getIdentifier(), $matches)) {
+ if (!preg_match('/^genera:offering\.([a-z]+)$/i', $genusType->getIdentifier(), $matches)) {
return null;
}
@@ -895,8 +895,8 @@ public function matchLocationId(osid_id_Id $resourceId, $match)
{
// Try room locations
try {
- $locationString = $this->session->getDatabaseIdString($resourceId, 'resource/place/room/');
- $locationParts = explode('/', $locationString);
+ $locationString = $this->session->getDatabaseIdString($resourceId, 'resource.place.room.');
+ $locationParts = explode('.', $locationString);
$this->addClause(
'location',
'(SSRMEET_BLDG_CODE = ? AND SSRMEET_ROOM_CODE = ?)',
@@ -906,7 +906,7 @@ public function matchLocationId(osid_id_Id $resourceId, $match)
// Try building locations
catch (osid_NotFoundException $e) {
try {
- $building = $this->session->getDatabaseIdString($resourceId, 'resource/place/building/');
+ $building = $this->session->getDatabaseIdString($resourceId, 'resource.place.building.');
$this->addClause(
'location',
'SSRMEET_BLDG_CODE = ?',
@@ -915,7 +915,7 @@ public function matchLocationId(osid_id_Id $resourceId, $match)
}
// Try campus locations
catch (osid_NotFoundException $e) {
- $campus = $this->session->getDatabaseIdString($resourceId, 'resource/place/campus/');
+ $campus = $this->session->getDatabaseIdString($resourceId, 'resource.place.campus.');
$this->addClause(
'location',
'SSBSECT_CAMP_CODE = ?',
@@ -1178,8 +1178,8 @@ public function matchCourseCatalogId(osid_id_Id $courseCatalogId, $match)
catalog_id = ?
))',
[
- $this->session->getDatabaseIdString($courseCatalogId, 'catalog/'),
- $this->session->getDatabaseIdString($courseCatalogId, 'catalog/'),
+ $this->session->getDatabaseIdString($courseCatalogId, 'catalog.'),
+ $this->session->getDatabaseIdString($courseCatalogId, 'catalog.'),
],
$match);
}
@@ -1273,7 +1273,7 @@ public function matchAnyURL($match)
*/
public function matchInstructorId(osid_id_Id $instructorId, $match)
{
- $this->addClause('instructor_id', 'WEB_ID = ?', [$this->session->getDatabaseIdString($instructorId, 'resource/person/')], $match);
+ $this->addClause('instructor_id', 'WEB_ID = ?', [$this->session->getDatabaseIdString($instructorId, 'resource.person.')], $match);
$this->addTableJoin('LEFT JOIN SYVINST ON (SYVINST_TERM_CODE = SSBSECT_TERM_CODE AND SYVINST_CRN = SSBSECT_CRN)');
}
diff --git a/application/library/banner/course/CourseOffering/Search/Search.php b/application/library/banner/course/CourseOffering/Search/Search.php
index f99063fb..58bb18b5 100755
--- a/application/library/banner/course/CourseOffering/Search/Search.php
+++ b/application/library/banner/course/CourseOffering/Search/Search.php
@@ -101,6 +101,6 @@ public function orderCourseOfferingResults(osid_course_CourseOfferingSearchOrder
*/
public function getCourseOfferingSearchRecord(osid_type_Type $courseOfferingSearchRecordType)
{
- throw new osid_UnsupportedException();
+ throw new osid_UnsupportedException('The CourseOfferingSearchRecordType passed is not supported.');
}
}
diff --git a/application/library/banner/course/CourseOffering/Search/Session.php b/application/library/banner/course/CourseOffering/Search/Session.php
index 3c645e4f..9073d072 100755
--- a/application/library/banner/course/CourseOffering/Search/Session.php
+++ b/application/library/banner/course/CourseOffering/Search/Session.php
@@ -47,7 +47,7 @@ class banner_course_CourseOffering_Search_Session extends banner_course_CourseOf
*/
public function __construct(banner_course_CourseManagerInterface $manager, osid_id_Id $catalogId)
{
- parent::__construct($manager, 'section/');
+ parent::__construct($manager, 'section.');
$this->catalogId = $catalogId;
}
@@ -269,12 +269,12 @@ public function buildIndex($displayStatus = false)
$offerings = $lookupSession->getCourseOfferings();
// Known topic types
- $this->subjectType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/subject');
- $this->departmentType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/department');
- $this->divisionType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/division');
- $this->requirementType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/requirement');
- $this->blockType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/block');
- $this->instructionMethodType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/instruction_method');
+ $this->subjectType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.subject');
+ $this->departmentType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.department');
+ $this->divisionType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.division');
+ $this->requirementType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.requirement');
+ $this->blockType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.block');
+ $this->instructionMethodType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.instruction_method');
// Known record types
$this->instructorsType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:record:instructors');
@@ -296,7 +296,7 @@ public function buildIndex($displayStatus = false)
if (!$insertStmt->execute([':term_code' => $termCode, ':crn' => $crn, ':text' => $text])) {
$info = $insertStmt->errorInfo();
- throw new osid_OperationFailedException('FullText update failed with code '.$info[0].'/'.$info[1].' - '.$info[2]);
+ throw new osid_OperationFailedException('FullText update failed with code '.$info[0].'.'.$info[1].' - '.$info[2]);
}
} catch (Exception $e) {
echo "\nError of type:\n\t".$e::class."\nwith message:\n\t".$e->getMessage()."\n";
diff --git a/application/library/banner/course/Term/Catalog/Session.php b/application/library/banner/course/Term/Catalog/Session.php
index b9aba1fa..c1e7c2d5 100755
--- a/application/library/banner/course/Term/Catalog/Session.php
+++ b/application/library/banner/course/Term/Catalog/Session.php
@@ -34,7 +34,7 @@ class banner_course_Term_Catalog_Session extends banner_course_AbstractSession i
*/
public function __construct(banner_course_CourseManagerInterface $manager)
{
- parent::__construct($manager, 'catalog/');
+ parent::__construct($manager, 'catalog.');
}
/**
@@ -232,14 +232,14 @@ public function getTermsByCatalogs(osid_id_IdList $courseCatalogIdList)
public function getCatalogIdsByTerm(osid_id_Id $termId)
{
$parameters = [
- ':section_term_code' => $this->getDatabaseIdString($termId, 'term/'),
+ ':section_term_code' => $this->getDatabaseIdString($termId, 'term.'),
];
$statement = $this->getGetCatalogsStatement();
$statement->execute($parameters);
$ids = [];
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
- $ids[] = $this->getOsidIdFromString($row['catalog_id'], 'catalog/');
+ $ids[] = $this->getOsidIdFromString($row['catalog_id'], 'catalog.');
}
$statement->closeCursor();
@@ -267,7 +267,7 @@ public function getCatalogIdsByTerm(osid_id_Id $termId)
public function getCatalogsByTerm(osid_id_Id $termId)
{
$parameters = [
- ':section_term_code' => $this->getDatabaseIdString($termId, 'term/'),
+ ':section_term_code' => $this->getDatabaseIdString($termId, 'term.'),
];
$statement = $this->getGetCatalogsStatement();
$statement->execute($parameters);
@@ -275,7 +275,7 @@ public function getCatalogsByTerm(osid_id_Id $termId)
$catalogs = [];
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
$catalogs[] = new banner_course_CourseCatalog(
- $this->getOsidIdFromString($row['catalog_id'], 'catalog/'),
+ $this->getOsidIdFromString($row['catalog_id'], 'catalog.'),
$row['catalog_title']);
}
$statement->closeCursor();
diff --git a/application/library/banner/course/Term/ForCourseList.php b/application/library/banner/course/Term/ForCourseList.php
index 1c17f68d..839566bc 100755
--- a/application/library/banner/course/Term/ForCourseList.php
+++ b/application/library/banner/course/Term/ForCourseList.php
@@ -110,11 +110,14 @@ private function getAllInputParameters()
* Answer an object from a result row.
*
* @since 4/13/09
+ *
+ * @return osid_course_Term
+ * An object for the row data
*/
protected function getObjectFromRow(array $row)
{
return new banner_course_Term(
- $this->session->getOsidIdFromString($row['STVTERM_CODE'], 'term/'),
+ $this->session->getOsidIdFromString($row['STVTERM_CODE'], 'term.'),
$row['STVTERM_DESC'],
$row['STVTERM_START_DATE'],
$row['STVTERM_END_DATE']);
diff --git a/application/library/banner/course/Term/Lookup/AllList.php b/application/library/banner/course/Term/Lookup/AllList.php
index b74ee291..647e9564 100755
--- a/application/library/banner/course/Term/Lookup/AllList.php
+++ b/application/library/banner/course/Term/Lookup/AllList.php
@@ -91,11 +91,14 @@ private function getAllInputParameters()
* Answer an object from a result row.
*
* @since 4/13/09
+ *
+ * @return osid_course_Term
+ * An object for the row data
*/
protected function getObjectFromRow(array $row)
{
return new banner_course_Term(
- $this->session->getOsidIdFromString($row['STVTERM_CODE'], 'term/'),
+ $this->session->getOsidIdFromString($row['STVTERM_CODE'], 'term.'),
$row['STVTERM_DESC'],
$row['STVTERM_START_DATE'],
$row['STVTERM_END_DATE']);
diff --git a/application/library/banner/course/Term/Lookup/Session.php b/application/library/banner/course/Term/Lookup/Session.php
index ec9bcd18..8996155b 100755
--- a/application/library/banner/course/Term/Lookup/Session.php
+++ b/application/library/banner/course/Term/Lookup/Session.php
@@ -48,7 +48,7 @@ class banner_course_Term_Lookup_Session extends banner_course_AbstractSession im
*/
public function __construct(banner_course_CourseManagerInterface $manager, ?osid_id_Id $catalogId = null)
{
- parent::__construct($manager, 'term/');
+ parent::__construct($manager, 'term.');
if (null === $catalogId) {
$this->catalogId = $manager->getCombinedCatalogId();
@@ -187,8 +187,8 @@ public function useIsolatedCourseCatalogView()
*/
public function getTerm(osid_id_Id $termId)
{
- $idString = $this->getDatabaseIdString($termId, 'term/');
- if (!preg_match('/^([0-9]{6})(?:\/([a-z0-9]{1,3}))?$/i', $idString, $matches)) {
+ $idString = $this->getDatabaseIdString($termId, 'term.');
+ if (!preg_match('/^([0-9]{6})(?:\.([a-z0-9]{1,3}))?$/i', $idString, $matches)) {
throw new osid_NotFoundException('Term id component \''.$idString.'\' could not be converted to a term code.');
}
@@ -250,12 +250,12 @@ protected function getBaseTerm($idString)
$row = self::$getTerm_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC);
self::$getTerm_stmts[$catalogWhere]->closeCursor();
- if (!$row['STVTERM_CODE']) {
+ if (!$row || !$row['STVTERM_CODE']) {
throw new osid_NotFoundException("Could not find a term matching the term code $idString.");
}
return new banner_course_Term(
- $this->getOsidIdFromString($row['STVTERM_CODE'], 'term/'),
+ $this->getOsidIdFromString($row['STVTERM_CODE'], 'term.'),
$row['STVTERM_DESC'],
$row['STVTERM_START_DATE'],
$row['STVTERM_END_DATE']);
@@ -321,7 +321,7 @@ protected function getPartOfTerm($termCode, $pTermCode)
$row = self::$getPartOfTerm_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC);
self::$getPartOfTerm_stmts[$catalogWhere]->closeCursor();
- if (!$row['STVTERM_CODE']) {
+ if (!$row || !$row['STVTERM_CODE']) {
throw new osid_NotFoundException("Could not find a term matching the term code $termCode and part-of-term code $pTermCode.");
}
@@ -341,7 +341,7 @@ protected function getPartOfTerm($termCode, $pTermCode)
}
return new banner_course_Term(
- $this->getOsidIdFromString($row['STVTERM_CODE'].'/'.$row['SOBPTRM_PTRM_CODE'], 'term/'),
+ $this->getOsidIdFromString($row['STVTERM_CODE'].'.'.$row['SOBPTRM_PTRM_CODE'], 'term.'),
$desc,
$startDate,
$endDate);
@@ -374,7 +374,7 @@ private function getCatalogParameters()
{
$params = [];
if (null !== $this->catalogId && !$this->catalogId->isEqual($this->getCombinedCatalogId())) {
- $params[':catalog_id'] = $this->getDatabaseIdString($this->catalogId, 'catalog/');
+ $params[':catalog_id'] = $this->getDatabaseIdString($this->catalogId, 'catalog.');
}
return $params;
diff --git a/application/library/banner/course/Topic/AbstractList.php b/application/library/banner/course/Topic/AbstractList.php
index bbd3bb52..c79e518c 100755
--- a/application/library/banner/course/Topic/AbstractList.php
+++ b/application/library/banner/course/Topic/AbstractList.php
@@ -562,14 +562,17 @@ abstract protected function includeSubjects();
* Answer an object from a result row.
*
* @since 4/13/09
+ *
+ * @return osid_course_Topic
+ * An object for the row data
*/
final protected function getObjectFromRow(array $row)
{
return new banner_course_Topic(
- $this->session->getOsidIdFromString($row['type'].'/'.$row['id'], 'topic/'),
+ $this->session->getOsidIdFromString($row['type'].'.'.$row['id'], 'topic.'),
trim($row['display_name']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/'.$row['type'])
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.'.$row['type'])
);
}
diff --git a/application/library/banner/course/Topic/Lookup/Session.php b/application/library/banner/course/Topic/Lookup/Session.php
index 8c9c5e3c..1243a96a 100755
--- a/application/library/banner/course/Topic/Lookup/Session.php
+++ b/application/library/banner/course/Topic/Lookup/Session.php
@@ -46,7 +46,7 @@ class banner_course_Topic_Lookup_Session extends banner_course_AbstractSession i
*/
public function __construct(banner_course_CourseManagerInterface $manager, osid_id_Id $catalogId)
{
- parent::__construct($manager, 'section/');
+ parent::__construct($manager, 'section.');
$this->catalogId = $catalogId;
}
@@ -215,8 +215,8 @@ public function getTopic(osid_id_Id $topicId)
*/
public function getTopicType(osid_id_Id $topicId)
{
- $string = $this->getDatabaseIdString($topicId, 'topic/');
- if (!preg_match('#(subject|department|division|requirement|level|block|instruction_method)/.+#', $string, $matches)) {
+ $string = $this->getDatabaseIdString($topicId, 'topic.');
+ if (!preg_match('#(subject|department|division|requirement|level|block|instruction_method)..+#', $string, $matches)) {
throw new osid_NotFoundException('Could not turn "'.$string.'" into a topic type.');
}
@@ -232,8 +232,8 @@ public function getTopicType(osid_id_Id $topicId)
*/
public function getTopicValue(osid_id_Id $topicId)
{
- $string = $this->getDatabaseIdString($topicId, 'topic/');
- if (!preg_match('#(subject|department|division|requirement|level|block|instruction_method)/(.+)#', $string, $matches)) {
+ $string = $this->getDatabaseIdString($topicId, 'topic.');
+ if (!preg_match('#(subject|department|division|requirement|level|block|instruction_method).(.+)#', $string, $matches)) {
throw new osid_NotFoundException('Could not turn "'.$string.'" into a topic type.');
}
@@ -278,22 +278,22 @@ private function getSubjectTopic(osid_id_Id $topicId)
$parameters = array_merge(
[
- ':subject_code' => $this->getDatabaseIdString($topicId, 'topic/subject/'),
+ ':subject_code' => $this->getDatabaseIdString($topicId, 'topic.subject.'),
],
$this->getCatalogParameters());
self::$getSubjectTopic_stmts[$catalogWhere]->execute($parameters);
$row = self::$getSubjectTopic_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC);
self::$getSubjectTopic_stmts[$catalogWhere]->closeCursor();
- if (!$row['STVSUBJ_CODE']) {
- throw new osid_NotFoundException('Could not find a topic matching the subject code '.$this->getDatabaseIdString($topicId, 'topic/subject/').'.');
+ if (!$row || !$row['STVSUBJ_CODE']) {
+ throw new osid_NotFoundException('Could not find a topic matching the subject code '.$this->getDatabaseIdString($topicId, 'topic.subject.').'.');
}
return new banner_course_Topic(
- $this->getOsidIdFromString($row['STVSUBJ_CODE'], 'topic/subject/'),
+ $this->getOsidIdFromString($row['STVSUBJ_CODE'], 'topic.subject.'),
trim($row['STVSUBJ_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/subject')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.subject')
);
}
@@ -339,10 +339,10 @@ private function getSubjectTopics()
$topics = [];
while ($row = self::$getSubjectTopics_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC)) {
$topics[] = new banner_course_Topic(
- $this->getOsidIdFromString($row['STVSUBJ_CODE'], 'topic/subject/'),
+ $this->getOsidIdFromString($row['STVSUBJ_CODE'], 'topic.subject.'),
trim($row['STVSUBJ_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/subject')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.subject')
);
}
self::$getSubjectTopics_stmts[$catalogWhere]->closeCursor();
@@ -388,22 +388,22 @@ private function getDepartmentTopic(osid_id_Id $topicId)
$parameters = array_merge(
[
- ':department_code' => $this->getDatabaseIdString($topicId, 'topic/department/'),
+ ':department_code' => $this->getDatabaseIdString($topicId, 'topic.department.'),
],
$this->getCatalogParameters());
self::$getDepartmentTopic_stmts[$catalogWhere]->execute($parameters);
$row = self::$getDepartmentTopic_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC);
self::$getDepartmentTopic_stmts[$catalogWhere]->closeCursor();
- if (!$row['STVDEPT_CODE']) {
- throw new osid_NotFoundException('Could not find a topic matching the department code '.$this->getDatabaseIdString($topicId, 'topic/department/').'.');
+ if (empty($row) || !$row['STVDEPT_CODE']) {
+ throw new osid_NotFoundException('Could not find a topic matching the department code '.$this->getDatabaseIdString($topicId, 'topic.department.').'.');
}
return new banner_course_Topic(
- $this->getOsidIdFromString($row['STVDEPT_CODE'], 'topic/department/'),
+ $this->getOsidIdFromString($row['STVDEPT_CODE'], 'topic.department.'),
trim($row['STVDEPT_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/department')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.department')
);
}
@@ -448,10 +448,10 @@ private function getDepartmentTopics()
$topics = [];
while ($row = self::$getDepartmentTopics_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC)) {
$topics[] = new banner_course_Topic(
- $this->getOsidIdFromString($row['STVDEPT_CODE'], 'topic/department/'),
+ $this->getOsidIdFromString($row['STVDEPT_CODE'], 'topic.department.'),
trim($row['STVDEPT_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/department')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.department')
);
}
self::$getDepartmentTopics_stmts[$catalogWhere]->closeCursor();
@@ -497,22 +497,22 @@ private function getDivisionTopic(osid_id_Id $topicId)
$parameters = array_merge(
[
- ':division_code' => $this->getDatabaseIdString($topicId, 'topic/division/'),
+ ':division_code' => $this->getDatabaseIdString($topicId, 'topic.division.'),
],
$this->getCatalogParameters());
self::$getDivisionTopic_stmts[$catalogWhere]->execute($parameters);
$row = self::$getDivisionTopic_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC);
self::$getDivisionTopic_stmts[$catalogWhere]->closeCursor();
- if (!$row['STVDIVS_CODE']) {
- throw new osid_NotFoundException('Could not find a topic matching the division code '.$this->getDatabaseIdString($topicId, 'topic/division/').'.');
+ if (!$row || !$row['STVDIVS_CODE']) {
+ throw new osid_NotFoundException('Could not find a topic matching the division code '.$this->getDatabaseIdString($topicId, 'topic.division.').'.');
}
return new banner_course_Topic(
- $this->getOsidIdFromString($row['STVDIVS_CODE'], 'topic/division/'),
+ $this->getOsidIdFromString($row['STVDIVS_CODE'], 'topic.division.'),
trim($row['STVDIVS_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/division')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.division')
);
}
@@ -557,10 +557,10 @@ private function getDivisionTopics()
$topics = [];
while ($row = self::$getDivisionTopics_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC)) {
$topics[] = new banner_course_Topic(
- $this->getOsidIdFromString($row['STVDIVS_CODE'], 'topic/division/'),
+ $this->getOsidIdFromString($row['STVDIVS_CODE'], 'topic.division.'),
trim($row['STVDIVS_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/division')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.division')
);
}
self::$getDivisionTopics_stmts[$catalogWhere]->closeCursor();
@@ -626,29 +626,29 @@ private function getRequirementTopic(osid_id_Id $topicId)
$parameters = array_merge(
[
- ':requirement_code' => $this->getDatabaseIdString($topicId, 'topic/requirement/'),
+ ':requirement_code' => $this->getDatabaseIdString($topicId, 'topic.requirement.'),
],
$this->getCatalogParameters());
self::$getRequirementTopic_stmts[$catalogWhere]->execute($parameters);
$row = self::$getRequirementTopic_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC);
self::$getRequirementTopic_stmts[$catalogWhere]->closeCursor();
- if (!$row['STVATTR_CODE']) {
+ if (!$row || !$row['STVATTR_CODE']) {
// Try the course-only requirements
self::$getCourseRequirementTopic_stmts[$catalogWhere]->execute($parameters);
$row = self::$getCourseRequirementTopic_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC);
self::$getCourseRequirementTopic_stmts[$catalogWhere]->closeCursor();
- if (!$row['STVATTR_CODE']) {
- throw new osid_NotFoundException('Could not find a topic matching the requirement code '.$this->getDatabaseIdString($topicId, 'topic/requirement/').'.');
+ if (!$row || !$row['STVATTR_CODE']) {
+ throw new osid_NotFoundException('Could not find a topic matching the requirement code '.$this->getDatabaseIdString($topicId, 'topic.requirement.').'.');
}
}
return new banner_course_Topic(
- $this->getOsidIdFromString($row['STVATTR_CODE'], 'topic/requirement/'),
+ $this->getOsidIdFromString($row['STVATTR_CODE'], 'topic.requirement.'),
trim($row['STVATTR_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/requirement')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.requirement')
);
}
@@ -687,10 +687,10 @@ private function getRequirementTopics()
$topics = [];
while ($row = self::$getRequirementTopics_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC)) {
$topics[] = new banner_course_Topic(
- $this->getOsidIdFromString($row['STVATTR_CODE'], 'topic/requirement/'),
+ $this->getOsidIdFromString($row['STVATTR_CODE'], 'topic.requirement.'),
trim($row['STVATTR_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/requirement')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.requirement')
);
}
self::$getRequirementTopics_stmts[$catalogWhere]->closeCursor();
@@ -737,22 +737,22 @@ private function getLevelTopic(osid_id_Id $topicId)
$parameters = array_merge(
[
- ':level_code' => $this->getDatabaseIdString($topicId, 'topic/level/'),
+ ':level_code' => $this->getDatabaseIdString($topicId, 'topic.level.'),
],
$this->getCatalogParameters());
self::$getLevelTopic_stmts[$catalogWhere]->execute($parameters);
$row = self::$getLevelTopic_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC);
self::$getLevelTopic_stmts[$catalogWhere]->closeCursor();
- if (!$row['STVLEVL_CODE']) {
- throw new osid_NotFoundException('Could not find a topic matching the level code '.$this->getDatabaseIdString($topicId, 'topic/level/').'.');
+ if (!$row || !$row['STVLEVL_CODE']) {
+ throw new osid_NotFoundException('Could not find a topic matching the level code '.$this->getDatabaseIdString($topicId, 'topic.level.').'.');
}
return new banner_course_Topic(
- $this->getOsidIdFromString($row['STVLEVL_CODE'], 'topic/level/'),
+ $this->getOsidIdFromString($row['STVLEVL_CODE'], 'topic.level.'),
trim($row['STVLEVL_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/level')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.level')
);
}
@@ -798,10 +798,10 @@ private function getLevelTopics()
$topics = [];
while ($row = self::$getLevelTopics_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC)) {
$topics[] = new banner_course_Topic(
- $this->getOsidIdFromString($row['STVLEVL_CODE'], 'topic/level/'),
+ $this->getOsidIdFromString($row['STVLEVL_CODE'], 'topic.level.'),
trim($row['STVLEVL_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/level')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.level')
);
}
self::$getLevelTopics_stmts[$catalogWhere]->closeCursor();
@@ -841,22 +841,22 @@ private function getBlockTopic(osid_id_Id $topicId)
$parameters = array_merge(
[
- ':block_code' => $this->getDatabaseIdString($topicId, 'topic/block/'),
+ ':block_code' => $this->getDatabaseIdString($topicId, 'topic.block.'),
],
$this->getCatalogParameters());
self::$getBlockTopic_stmts[$catalogWhere]->execute($parameters);
$row = self::$getBlockTopic_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC);
self::$getBlockTopic_stmts[$catalogWhere]->closeCursor();
- if (!$row['STVBLCK_CODE']) {
- throw new osid_NotFoundException('Could not find a topic matching the block code '.$this->getDatabaseIdString($topicId, 'topic/block/').'.');
+ if (!$row || !$row['STVBLCK_CODE']) {
+ throw new osid_NotFoundException('Could not find a topic matching the block code '.$this->getDatabaseIdString($topicId, 'topic.block.').'.');
}
return new banner_course_Topic(
- $this->getOsidIdFromString($row['STVBLCK_CODE'], 'topic/block/'),
+ $this->getOsidIdFromString($row['STVBLCK_CODE'], 'topic.block.'),
trim($row['STVBLCK_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/block')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.block')
);
}
@@ -895,10 +895,10 @@ private function getBlockTopics()
$topics = [];
while ($row = self::$getBlockTopics_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC)) {
$topics[] = new banner_course_Topic(
- $this->getOsidIdFromString($row['STVBLCK_CODE'], 'topic/block/'),
+ $this->getOsidIdFromString($row['STVBLCK_CODE'], 'topic.block.'),
trim($row['STVBLCK_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/block')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.block')
);
}
self::$getBlockTopics_stmts[$catalogWhere]->closeCursor();
@@ -938,22 +938,22 @@ private function getInstructionMethodTopic(osid_id_Id $topicId)
$parameters = array_merge(
[
- ':insm_code' => $this->getDatabaseIdString($topicId, 'topic/instruction_method/'),
+ ':insm_code' => $this->getDatabaseIdString($topicId, 'topic.instruction_method.'),
],
$this->getCatalogParameters());
self::$getInstructionMethodTopic_stmts[$catalogWhere]->execute($parameters);
$row = self::$getInstructionMethodTopic_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC);
self::$getInstructionMethodTopic_stmts[$catalogWhere]->closeCursor();
- if (!$row['GTVINSM_CODE']) {
- throw new osid_NotFoundException('Could not find a topic matching the instruction_method code '.$this->getDatabaseIdString($topicId, 'topic/instruction_method/').'.');
+ if (!$row || !$row['GTVINSM_CODE']) {
+ throw new osid_NotFoundException('Could not find a topic matching the instruction_method code '.$this->getDatabaseIdString($topicId, 'topic.instruction_method.').'.');
}
return new banner_course_Topic(
- $this->getOsidIdFromString($row['GTVINSM_CODE'], 'topic/instruction_method/'),
+ $this->getOsidIdFromString($row['GTVINSM_CODE'], 'topic.instruction_method.'),
trim($row['GTVINSM_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/instruction_method')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.instruction_method')
);
}
@@ -992,10 +992,10 @@ private function getInstructionMethodTopics()
$topics = [];
while ($row = self::$getInstructionMethodTopics_stmts[$catalogWhere]->fetch(PDO::FETCH_ASSOC)) {
$topics[] = new banner_course_Topic(
- $this->getOsidIdFromString($row['GTVINSM_CODE'], 'topic/instruction_method/'),
+ $this->getOsidIdFromString($row['GTVINSM_CODE'], 'topic.instruction_method.'),
trim($row['GTVINSM_DESC']),
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/instruction_method')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.instruction_method')
);
}
self::$getInstructionMethodTopics_stmts[$catalogWhere]->closeCursor();
@@ -1111,19 +1111,19 @@ public function getTopicsByGenusType(osid_type_Type $topicGenusType)
return new phpkit_EmptyList('osid_course_TopicList');
}
switch ($topicGenusType->getIdentifier()) {
- case 'genera:topic/subject':
+ case 'genera:topic.subject':
return $this->getSubjectTopics();
- case 'genera:topic/department':
+ case 'genera:topic.department':
return $this->getDepartmentTopics();
- case 'genera:topic/division':
+ case 'genera:topic.division':
return $this->getDivisionTopics();
- case 'genera:topic/requirement':
+ case 'genera:topic.requirement':
return $this->getRequirementTopics();
- case 'genera:topic/level':
+ case 'genera:topic.level':
return $this->getLevelTopics();
- case 'genera:topic/block':
+ case 'genera:topic.block':
return $this->getBlockTopics();
- case 'genera:topic/instruction_method':
+ case 'genera:topic.instruction_method':
return $this->getInstructionMethodTopics();
default:
return new phpkit_EmptyList('osid_course_TopicList');
diff --git a/application/library/banner/course/Topic/Search/Query.php b/application/library/banner/course/Topic/Search/Query.php
index b17c2f77..3ccff3c3 100755
--- a/application/library/banner/course/Topic/Search/Query.php
+++ b/application/library/banner/course/Topic/Search/Query.php
@@ -39,13 +39,13 @@ public function __construct(banner_course_SessionInterface $session)
$this->termType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:record:terms');
- $this->subjectType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/subject');
- $this->departmentType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/department');
- $this->divisionType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/division');
- $this->requirementType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/requirement');
- $this->levelType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/level');
- $this->blockType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/block');
- $this->instructionMethodType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic/instruction_method');
+ $this->subjectType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.subject');
+ $this->departmentType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.department');
+ $this->divisionType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.division');
+ $this->requirementType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.requirement');
+ $this->levelType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.level');
+ $this->blockType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.block');
+ $this->instructionMethodType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:topic.instruction_method');
$this->toInclude = [];
}
diff --git a/application/library/banner/course/Topic/Search/Query/Block.php b/application/library/banner/course/Topic/Search/Query/Block.php
index 10c04d1b..0038fc65 100755
--- a/application/library/banner/course/Topic/Search/Query/Block.php
+++ b/application/library/banner/course/Topic/Search/Query/Block.php
@@ -379,6 +379,6 @@ public function getTopicQueryRecord(osid_type_Type $topicRecordType)
*/
public function matchTermId(osid_id_Id $termId, $match)
{
- $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term/')], $match);
+ $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term.')], $match);
}
}
diff --git a/application/library/banner/course/Topic/Search/Query/Department.php b/application/library/banner/course/Topic/Search/Query/Department.php
index 452c344a..e98ff86b 100755
--- a/application/library/banner/course/Topic/Search/Query/Department.php
+++ b/application/library/banner/course/Topic/Search/Query/Department.php
@@ -379,6 +379,6 @@ public function getTopicQueryRecord(osid_type_Type $topicRecordType)
*/
public function matchTermId(osid_id_Id $termId, $match)
{
- $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term/')], $match);
+ $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term.')], $match);
}
}
diff --git a/application/library/banner/course/Topic/Search/Query/Division.php b/application/library/banner/course/Topic/Search/Query/Division.php
index 390e735b..95f29e51 100755
--- a/application/library/banner/course/Topic/Search/Query/Division.php
+++ b/application/library/banner/course/Topic/Search/Query/Division.php
@@ -379,6 +379,6 @@ public function getTopicQueryRecord(osid_type_Type $topicRecordType)
*/
public function matchTermId(osid_id_Id $termId, $match)
{
- $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term/')], $match);
+ $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term.')], $match);
}
}
diff --git a/application/library/banner/course/Topic/Search/Query/InstructionMethod.php b/application/library/banner/course/Topic/Search/Query/InstructionMethod.php
index 154b90d1..6d816c30 100644
--- a/application/library/banner/course/Topic/Search/Query/InstructionMethod.php
+++ b/application/library/banner/course/Topic/Search/Query/InstructionMethod.php
@@ -375,6 +375,6 @@ public function getTopicQueryRecord(osid_type_Type $topicRecordType)
*/
public function matchTermId(osid_id_Id $termId, $match)
{
- $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term/')], $match);
+ $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term.')], $match);
}
}
diff --git a/application/library/banner/course/Topic/Search/Query/Level.php b/application/library/banner/course/Topic/Search/Query/Level.php
index 058bada9..8642814e 100755
--- a/application/library/banner/course/Topic/Search/Query/Level.php
+++ b/application/library/banner/course/Topic/Search/Query/Level.php
@@ -379,6 +379,6 @@ public function getTopicQueryRecord(osid_type_Type $topicRecordType)
*/
public function matchTermId(osid_id_Id $termId, $match)
{
- $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term/')], $match);
+ $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term.')], $match);
}
}
diff --git a/application/library/banner/course/Topic/Search/Query/Requirement.php b/application/library/banner/course/Topic/Search/Query/Requirement.php
index 2572290e..f9bf8237 100755
--- a/application/library/banner/course/Topic/Search/Query/Requirement.php
+++ b/application/library/banner/course/Topic/Search/Query/Requirement.php
@@ -379,6 +379,6 @@ public function getTopicQueryRecord(osid_type_Type $topicRecordType)
*/
public function matchTermId(osid_id_Id $termId, $match)
{
- $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term/')], $match);
+ $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term.')], $match);
}
}
diff --git a/application/library/banner/course/Topic/Search/Query/Subject.php b/application/library/banner/course/Topic/Search/Query/Subject.php
index d180982f..06f74654 100755
--- a/application/library/banner/course/Topic/Search/Query/Subject.php
+++ b/application/library/banner/course/Topic/Search/Query/Subject.php
@@ -379,6 +379,6 @@ public function getTopicQueryRecord(osid_type_Type $topicRecordType)
*/
public function matchTermId(osid_id_Id $termId, $match)
{
- $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term/')], $match);
+ $this->addClause('term', 'SSBSECT_TERM_CODE = ?', [$this->session->getDatabaseIdString($termId, 'term.')], $match);
}
}
diff --git a/application/library/banner/course/Topic/Search/Search.php b/application/library/banner/course/Topic/Search/Search.php
index c9bf90b8..17927735 100755
--- a/application/library/banner/course/Topic/Search/Search.php
+++ b/application/library/banner/course/Topic/Search/Search.php
@@ -143,6 +143,6 @@ public function orderTopicResults(osid_course_TopicSearchOrder $topicSearchOrder
*/
public function getTopicSearchRecord(osid_type_Type $topicSearchRecordType)
{
- throw new osid_UnsupportedException();
+ throw new osid_UnsupportedException('The TopicSearchRecordType passed is not supported.');
}
}
diff --git a/application/library/banner/course/Topic/Search/Session.php b/application/library/banner/course/Topic/Search/Session.php
index 4c0bc9f5..36c4fecf 100755
--- a/application/library/banner/course/Topic/Search/Session.php
+++ b/application/library/banner/course/Topic/Search/Session.php
@@ -45,7 +45,7 @@ class banner_course_Topic_Search_Session extends banner_course_AbstractSession i
*/
public function __construct(banner_course_CourseManagerInterface $manager, osid_id_Id $catalogId)
{
- parent::__construct($manager, 'section/');
+ parent::__construct($manager, 'section.');
$this->catalogId = $catalogId;
}
diff --git a/application/library/banner/resource/Bin/Lookup/Session.php b/application/library/banner/resource/Bin/Lookup/Session.php
index de76dc68..8d972c8e 100755
--- a/application/library/banner/resource/Bin/Lookup/Session.php
+++ b/application/library/banner/resource/Bin/Lookup/Session.php
@@ -40,7 +40,7 @@ class banner_resource_Bin_Lookup_Session extends banner_AbstractSession implemen
*/
public function __construct(banner_ManagerInterface $manager)
{
- parent::__construct($manager, 'catalog/');
+ parent::__construct($manager, 'catalog.');
}
/**
diff --git a/application/library/banner/resource/Resource/Building.php b/application/library/banner/resource/Resource/Building.php
index 3c467717..59d4ccd9 100644
--- a/application/library/banner/resource/Resource/Building.php
+++ b/application/library/banner/resource/Resource/Building.php
@@ -39,7 +39,7 @@ public function __construct(osid_id_Id $id, $displayName, $code)
$this->setId($id);
$this->setDisplayName($displayName);
$this->setDescription($code);
- $this->setGenusType(new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource/place/building'));
+ $this->setGenusType(new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource.place.building'));
$this->buildingDisplayName = $displayName;
$this->buildingCode = $code;
diff --git a/application/library/banner/resource/Resource/Lookup/CombinedSession.php b/application/library/banner/resource/Resource/Lookup/CombinedSession.php
index 08445eba..1cab735a 100755
--- a/application/library/banner/resource/Resource/Lookup/CombinedSession.php
+++ b/application/library/banner/resource/Resource/Lookup/CombinedSession.php
@@ -45,7 +45,7 @@ class banner_resource_Resource_Lookup_CombinedSession extends banner_AbstractSes
*/
public function __construct(banner_ManagerInterface $manager)
{
- parent::__construct($manager, 'resource/');
+ parent::__construct($manager, 'resource.');
}
/**
@@ -181,11 +181,11 @@ public function getResource(osid_id_Id $resourceId)
switch ($type) {
case 'person':
return $this->getPersonResource($resourceId);
- case 'place/room':
+ case 'place.room':
return $this->getRoomResource($resourceId);
- case 'place/building':
+ case 'place.building':
return $this->getBuildingResource($resourceId);
- case 'place/campus':
+ case 'place.campus':
return $this->getCampusResource($resourceId);
default:
throw new osid_NotFoundException('No resource found with category '.$type);
@@ -201,8 +201,8 @@ public function getResource(osid_id_Id $resourceId)
*/
public function getResourceType(osid_id_Id $resourceId)
{
- $string = $this->getDatabaseIdString($resourceId, 'resource/');
- if (!preg_match('#(person|place/room|place/building|place/campus)/(.+)#', $string, $matches)) {
+ $string = $this->getDatabaseIdString($resourceId, 'resource.');
+ if (!preg_match('#(person|place\.room|place\.building|place\.campus)\.(.+)#', $string, $matches)) {
throw new osid_NotFoundException('Could not turn "'.$string.'" into a resource type.');
}
@@ -218,8 +218,8 @@ public function getResourceType(osid_id_Id $resourceId)
*/
public function getResourceValue(osid_id_Id $resourceId)
{
- $string = $this->getDatabaseIdString($resourceId, 'resource/');
- if (!preg_match('#(person|place/room|place/building|place/campus)/(.+)#', $string, $matches)) {
+ $string = $this->getDatabaseIdString($resourceId, 'resource.');
+ if (!preg_match('#(person|place\.room|place\.building|place\.campus)\.(.+)#', $string, $matches)) {
throw new osid_NotFoundException('Could not turn "'.$string.'" into a resource type.');
}
@@ -252,18 +252,18 @@ private function getPersonResource(osid_id_Id $resourceId)
}
$parameters = [
- ':webid' => $this->getDatabaseIdString($resourceId, 'resource/person/'),
+ ':webid' => $this->getDatabaseIdString($resourceId, 'resource.person.'),
];
self::$getPersonResource_stmt->execute($parameters);
$row = self::$getPersonResource_stmt->fetch(PDO::FETCH_ASSOC);
self::$getPersonResource_stmt->closeCursor();
- if (!$row['WEB_ID']) {
- throw new osid_NotFoundException('Could not find a resource matching the person code '.$this->getDatabaseIdString($resourceId, 'resource/person/').'.');
+ if (empty($row) || !$row['WEB_ID']) {
+ throw new osid_NotFoundException('Could not find a resource matching the person code '.$this->getDatabaseIdString($resourceId, 'resource.person.').'.');
}
return new banner_resource_Resource_Person(
- $this->getOsidIdFromString($row['WEB_ID'], 'resource/person/'),
+ $this->getOsidIdFromString($row['WEB_ID'], 'resource.person.'),
$row['SYVINST_LAST_NAME'],
$row['SYVINST_FIRST_NAME']
);
@@ -298,7 +298,7 @@ private function getPersonResources()
$resources = [];
while ($row = self::$getPersonResources_stmt->fetch(PDO::FETCH_ASSOC)) {
$resources[] = new banner_resource_Resource_Person(
- $this->getOsidIdFromString($row['WEB_ID'], 'resource/person/'),
+ $this->getOsidIdFromString($row['WEB_ID'], 'resource.person.'),
$row['SYVINST_LAST_NAME'],
$row['SYVINST_FIRST_NAME']
);
@@ -333,18 +333,18 @@ private function getBuildingResource(osid_id_Id $resourceId)
}
$parameters = [
- ':code' => $this->getDatabaseIdString($resourceId, 'resource/place/building/'),
+ ':code' => $this->getDatabaseIdString($resourceId, 'resource.place.building.'),
];
self::$getBuildingResource_stmt->execute($parameters);
$row = self::$getBuildingResource_stmt->fetch(PDO::FETCH_ASSOC);
self::$getBuildingResource_stmt->closeCursor();
- if (!$row['STVBLDG_CODE']) {
- throw new osid_NotFoundException('Could not find a resource matching the building code '.$this->getDatabaseIdString($resourceId, 'resource/place/building/').'.');
+ if (!$row || !$row['STVBLDG_CODE']) {
+ throw new osid_NotFoundException('Could not find a resource matching the building code '.$this->getDatabaseIdString($resourceId, 'resource.place.building.').'.');
}
return new banner_resource_Resource_Building(
- $this->getOsidIdFromString($row['STVBLDG_CODE'], 'resource/place/building/'),
+ $this->getOsidIdFromString($row['STVBLDG_CODE'], 'resource.place.building.'),
$row['STVBLDG_DESC'],
$row['STVBLDG_CODE']
);
@@ -377,7 +377,7 @@ private function getBuildingResources()
$resources = [];
while ($row = self::$getBuildingResources_stmt->fetch(PDO::FETCH_ASSOC)) {
$resources[] = new banner_resource_Resource_Building(
- $this->getOsidIdFromString($row['STVBLDG_CODE'], 'resource/place/building/'),
+ $this->getOsidIdFromString($row['STVBLDG_CODE'], 'resource.place.building.'),
$row['STVBLDG_DESC'],
$row['STVBLDG_CODE']
);
@@ -416,8 +416,8 @@ private function getRoomResource(osid_id_Id $resourceId)
self::$getRoomResource_stmt = $this->manager->getDB()->prepare($query);
}
- $roomString = $this->getDatabaseIdString($resourceId, 'resource/place/room/');
- if (!preg_match('#^([a-z0-9_-]+)/(.+)$#i', $roomString, $matches)) {
+ $roomString = $this->getDatabaseIdString($resourceId, 'resource.place.room.');
+ if (!preg_match('#^([a-z0-9_-]+)\.(.+)$#i', $roomString, $matches)) {
throw new osid_NotFoundException("Room string '$roomString' doesn't match.");
}
@@ -429,12 +429,12 @@ private function getRoomResource(osid_id_Id $resourceId)
$row = self::$getRoomResource_stmt->fetch(PDO::FETCH_ASSOC);
self::$getRoomResource_stmt->closeCursor();
- if (!$row['STVBLDG_CODE']) {
- throw new osid_NotFoundException('Could not find a resource matching the room code '.$this->getDatabaseIdString($resourceId, 'resource/place/room/').'.');
+ if (!$row || !$row['STVBLDG_CODE']) {
+ throw new osid_NotFoundException('Could not find a resource matching the room code '.$this->getDatabaseIdString($resourceId, 'resource.place.room.').'.');
}
return new banner_resource_Resource_Room(
- $this->getOsidIdFromString($row['STVBLDG_CODE'].'/'.$row['SSRMEET_ROOM_CODE'], 'resource/place/room/'),
+ $this->getOsidIdFromString($row['STVBLDG_CODE'].'.'.$row['SSRMEET_ROOM_CODE'], 'resource.place.room.'),
$row['STVBLDG_DESC'],
$row['STVBLDG_CODE'],
$row['SSRMEET_ROOM_CODE']
@@ -474,7 +474,7 @@ private function getRoomResources()
$resources = [];
while ($row = self::$getRoomResources_stmt->fetch(PDO::FETCH_ASSOC)) {
$resources[] = new banner_resource_Resource_Room(
- $this->getOsidIdFromString($row['STVBLDG_CODE'].'/'.$row['SSRMEET_ROOM_CODE'], 'resource/place/room/'),
+ $this->getOsidIdFromString($row['STVBLDG_CODE'].'.'.$row['SSRMEET_ROOM_CODE'], 'resource.place.room.'),
$row['STVBLDG_DESC'],
$row['STVBLDG_CODE'],
$row['SSRMEET_ROOM_CODE']
@@ -510,21 +510,21 @@ private function getCampusResource(osid_id_Id $resourceId)
}
$parameters = [
- ':code' => $this->getDatabaseIdString($resourceId, 'resource/place/campus/'),
+ ':code' => $this->getDatabaseIdString($resourceId, 'resource.place.campus.'),
];
self::$getCampusResource_stmt->execute($parameters);
$row = self::$getCampusResource_stmt->fetch(PDO::FETCH_ASSOC);
self::$getCampusResource_stmt->closeCursor();
- if (!$row['STVCAMP_CODE']) {
- throw new osid_NotFoundException('Could not find a resource matching the campus code '.$this->getDatabaseIdString($resourceId, 'resource/place/campus/').'.');
+ if (!$row || !$row['STVCAMP_CODE']) {
+ throw new osid_NotFoundException('Could not find a resource matching the campus code '.$this->getDatabaseIdString($resourceId, 'resource.place.campus.').'.');
}
return new banner_resource_Resource_Place(
- $this->getOsidIdFromString($row['STVCAMP_CODE'], 'resource/place/campus/'),
+ $this->getOsidIdFromString($row['STVCAMP_CODE'], 'resource.place.campus.'),
$row['STVCAMP_DESC'],
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource/place/campus')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource.place.campus')
);
}
@@ -555,10 +555,10 @@ private function getCampusResources()
$resources = [];
while ($row = self::$getCampusResources_stmt->fetch(PDO::FETCH_ASSOC)) {
$resources[] = new banner_resource_Resource_Place(
- $this->getOsidIdFromString($row['STVCAMP_CODE'], 'resource/place/campus/'),
+ $this->getOsidIdFromString($row['STVCAMP_CODE'], 'resource.place.campus.'),
$row['STVCAMP_DESC'],
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource/place/campus')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource.place.campus')
);
}
self::$getCampusResources_stmt->closeCursor();
@@ -641,15 +641,15 @@ public function getResourcesByGenusType(osid_type_Type $resourceGenusType)
return new phpkit_EmptyList('osid_resource_ResourceList');
}
switch ($resourceGenusType->getIdentifier()) {
- case 'genera:resource/person':
+ case 'genera:resource.person':
return $this->getPersonResources();
- case 'genera:resource/place/campus':
+ case 'genera:resource.place.campus':
return $this->getCampusResources();
- case 'genera:resource/place/building':
+ case 'genera:resource.place.building':
return $this->getBuildingResources();
- case 'genera:resource/place/room':
+ case 'genera:resource.place.room':
return $this->getRoomResources();
- // case 'genera:resource/place':
+ // case 'genera:resource.place':
// return $this->getPlaceResources();
default:
return new phpkit_EmptyList('osid_resource_ResourceList');
@@ -685,7 +685,7 @@ public function getResourcesByParentGenusType(osid_type_Type $resourceGenusType)
return new phpkit_EmptyList('osid_resource_ResourceList');
}
- if ('genera:resource/place' == $resourceGenusType->getIdentifier()) {
+ if ('genera:resource.place' == $resourceGenusType->getIdentifier()) {
$resourceList = new phpkit_CombinedList('osid_resource_ResourceList');
$resourceList->addList($this->getCampusResources());
$resourceList->addList($this->getBuildingResources());
diff --git a/application/library/banner/resource/Resource/Lookup/PerCatalogSession.php b/application/library/banner/resource/Resource/Lookup/PerCatalogSession.php
index 88de7ce4..84aa0022 100755
--- a/application/library/banner/resource/Resource/Lookup/PerCatalogSession.php
+++ b/application/library/banner/resource/Resource/Lookup/PerCatalogSession.php
@@ -45,7 +45,7 @@ class banner_resource_Resource_Lookup_PerCatalogSession extends banner_AbstractS
*/
public function __construct(banner_ManagerInterface $manager, osid_id_Id $binId)
{
- parent::__construct($manager, 'resource/');
+ parent::__construct($manager, 'resource.');
$this->binId = $binId;
}
@@ -80,7 +80,7 @@ private function getCatalogParameters()
{
$params = [];
if (null !== $this->binId && !$this->binId->isEqual($this->manager->getCombinedBinId())) {
- $params[':catalog_id'] = $this->getDatabaseIdString($this->binId, 'catalog/');
+ $params[':catalog_id'] = $this->getDatabaseIdString($this->binId, 'catalog.');
}
return $params;
@@ -225,11 +225,11 @@ public function getResource(osid_id_Id $resourceId)
switch ($type) {
case 'person':
return $this->getPersonResource($resourceId);
- case 'place/room':
+ case 'place.room':
return $this->getRoomResource($resourceId);
- case 'place/building':
+ case 'place.building':
return $this->getBuildingResource($resourceId);
- case 'place/campus':
+ case 'place.campus':
return $this->getCampusResource($resourceId);
default:
throw new osid_NotFoundException('No resource found with category '.$type);
@@ -245,8 +245,8 @@ public function getResource(osid_id_Id $resourceId)
*/
public function getResourceType(osid_id_Id $resourceId)
{
- $string = $this->getDatabaseIdString($resourceId, 'resource/');
- if (!preg_match('#(person|place/room|place/building|place/campus)/(.+)#', $string, $matches)) {
+ $string = $this->getDatabaseIdString($resourceId, 'resource.');
+ if (!preg_match('#(person|place\.room|place\.building|place\.campus)\.(.+)#', $string, $matches)) {
throw new osid_NotFoundException('Could not turn "'.$string.'" into a resource type.');
}
@@ -262,8 +262,8 @@ public function getResourceType(osid_id_Id $resourceId)
*/
public function getResourceValue(osid_id_Id $resourceId)
{
- $string = $this->getDatabaseIdString($resourceId, 'resource/');
- if (!preg_match('#(person|place/room|place/building|place/campus)/(.+)#', $string, $matches)) {
+ $string = $this->getDatabaseIdString($resourceId, 'resource.');
+ if (!preg_match('#(person|place\.room|place\.building|place\.campus)\.(.+)#', $string, $matches)) {
throw new osid_NotFoundException('Could not turn "'.$string.'" into a resource type.');
}
@@ -311,19 +311,19 @@ private function getPersonResource(osid_id_Id $resourceId)
$parameters = array_merge(
[
- ':webid' => $this->getDatabaseIdString($resourceId, 'resource/person/'),
+ ':webid' => $this->getDatabaseIdString($resourceId, 'resource.person.'),
],
$this->getCatalogParameters());
self::$getPersonResource_stmt->execute($parameters);
$row = self::$getPersonResource_stmt->fetch(PDO::FETCH_ASSOC);
self::$getPersonResource_stmt->closeCursor();
- if (!$row['WEB_ID']) {
- throw new osid_NotFoundException('Could not find a resource matching the person code '.$this->getDatabaseIdString($resourceId, 'resource/person/').'.');
+ if (!$row || !$row['WEB_ID']) {
+ throw new osid_NotFoundException('Could not find a resource matching the person code '.$this->getDatabaseIdString($resourceId, 'resource.person.').'.');
}
return new banner_resource_Resource_Person(
- $this->getOsidIdFromString($row['WEB_ID'], 'resource/person/'),
+ $this->getOsidIdFromString($row['WEB_ID'], 'resource.person.'),
$row['SYVINST_LAST_NAME'],
$row['SYVINST_FIRST_NAME']
);
@@ -373,7 +373,7 @@ private function getPersonResources()
$resources = [];
while ($row = self::$getPersonResources_stmt->fetch(PDO::FETCH_ASSOC)) {
$resources[] = new banner_resource_Resource_Person(
- $this->getOsidIdFromString($row['WEB_ID'], 'resource/person/'),
+ $this->getOsidIdFromString($row['WEB_ID'], 'resource.person.'),
$row['SYVINST_LAST_NAME'],
$row['SYVINST_FIRST_NAME']
);
@@ -425,19 +425,19 @@ private function getBuildingResource(osid_id_Id $resourceId)
$parameters = array_merge(
[
- ':code' => $this->getDatabaseIdString($resourceId, 'resource/place/building/'),
+ ':code' => $this->getDatabaseIdString($resourceId, 'resource.place.building.'),
],
$this->getCatalogParameters());
self::$getBuildingResource_stmt->execute($parameters);
$row = self::$getBuildingResource_stmt->fetch(PDO::FETCH_ASSOC);
self::$getBuildingResource_stmt->closeCursor();
- if (!$row['STVBLDG_CODE']) {
- throw new osid_NotFoundException('Could not find a resource matching the building code '.$this->getDatabaseIdString($resourceId, 'resource/place/building/').'.');
+ if (!$row || !$row['STVBLDG_CODE']) {
+ throw new osid_NotFoundException('Could not find a resource matching the building code '.$this->getDatabaseIdString($resourceId, 'resource.place.building.').'.');
}
return new banner_resource_Resource_Building(
- $this->getOsidIdFromString($row['STVBLDG_CODE'], 'resource/place/building/'),
+ $this->getOsidIdFromString($row['STVBLDG_CODE'], 'resource.place.building.'),
$row['STVBLDG_DESC'],
$row['STVBLDG_CODE']
);
@@ -486,7 +486,7 @@ private function getBuildingResources()
$resources = [];
while ($row = self::$getBuildingResources_stmt->fetch(PDO::FETCH_ASSOC)) {
$resources[] = new banner_resource_Resource_Building(
- $this->getOsidIdFromString($row['STVBLDG_CODE'], 'resource/place/building/'),
+ $this->getOsidIdFromString($row['STVBLDG_CODE'], 'resource.place.building.'),
$row['STVBLDG_DESC'],
$row['STVBLDG_CODE']
);
@@ -537,8 +537,8 @@ private function getRoomResource(osid_id_Id $resourceId)
self::$getRoomResource_stmt = $this->manager->getDB()->prepare($query);
}
- $roomString = $this->getDatabaseIdString($resourceId, 'resource/place/room/');
- if (!preg_match('#^([a-z0-9_-]+)/(.+)$#i', $roomString, $matches)) {
+ $roomString = $this->getDatabaseIdString($resourceId, 'resource.place.room.');
+ if (!preg_match('#^([a-z0-9_-]+)\.(.+)$#i', $roomString, $matches)) {
throw new osid_NotFoundException("Room string '$roomString' doesn't match.");
}
@@ -552,12 +552,12 @@ private function getRoomResource(osid_id_Id $resourceId)
$row = self::$getRoomResource_stmt->fetch(PDO::FETCH_ASSOC);
self::$getRoomResource_stmt->closeCursor();
- if (!$row['STVBLDG_CODE']) {
- throw new osid_NotFoundException('Could not find a resource matching the room code '.$this->getDatabaseIdString($resourceId, 'resource/place/room/').'.');
+ if (!$row || !$row['STVBLDG_CODE']) {
+ throw new osid_NotFoundException('Could not find a resource matching the room code '.$this->getDatabaseIdString($resourceId, 'resource.place.room.').'.');
}
return new banner_resource_Resource_Room(
- $this->getOsidIdFromString($row['STVBLDG_CODE'].'/'.$row['SSRMEET_ROOM_CODE'], 'resource/place/room/'),
+ $this->getOsidIdFromString($row['STVBLDG_CODE'].'.'.$row['SSRMEET_ROOM_CODE'], 'resource.place.room.'),
$row['STVBLDG_DESC'],
$row['STVBLDG_CODE'],
$row['SSRMEET_ROOM_CODE']
@@ -610,7 +610,7 @@ private function getRoomResources()
$resources = [];
while ($row = self::$getRoomResources_stmt->fetch(PDO::FETCH_ASSOC)) {
$resources[] = new banner_resource_Resource_Room(
- $this->getOsidIdFromString($row['STVBLDG_CODE'].'/'.$row['SSRMEET_ROOM_CODE'], 'resource/place/room/'),
+ $this->getOsidIdFromString($row['STVBLDG_CODE'].'.'.$row['SSRMEET_ROOM_CODE'], 'resource.place.room.'),
$row['STVBLDG_DESC'],
$row['STVBLDG_CODE'],
$row['SSRMEET_ROOM_CODE']
@@ -649,22 +649,22 @@ private function getCampusResource(osid_id_Id $resourceId)
$parameters = array_merge(
[
- ':code' => $this->getDatabaseIdString($resourceId, 'resource/place/campus/'),
+ ':code' => $this->getDatabaseIdString($resourceId, 'resource.place.campus.'),
],
$this->getCatalogParameters());
self::$getCampusResource_stmt->execute($parameters);
$row = self::$getCampusResource_stmt->fetch(PDO::FETCH_ASSOC);
self::$getCampusResource_stmt->closeCursor();
- if (!$row['STVCAMP_CODE']) {
- throw new osid_NotFoundException('Could not find a resource matching the campus code '.$this->getDatabaseIdString($resourceId, 'resource/place/campus/').'.');
+ if (!$row || !$row['STVCAMP_CODE']) {
+ throw new osid_NotFoundException('Could not find a resource matching the campus code '.$this->getDatabaseIdString($resourceId, 'resource.place.campus.').'.');
}
return new banner_resource_Resource_Place(
- $this->getOsidIdFromString($row['STVCAMP_CODE'], 'resource/place/campus/'),
+ $this->getOsidIdFromString($row['STVCAMP_CODE'], 'resource.place.campus.'),
$row['STVCAMP_DESC'],
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource/place/campus')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource.place.campus')
);
}
@@ -697,10 +697,10 @@ private function getCampusResources()
$resources = [];
while ($row = self::$getCampusResources_stmt->fetch(PDO::FETCH_ASSOC)) {
$resources[] = new banner_resource_Resource_Place(
- $this->getOsidIdFromString($row['STVCAMP_CODE'], 'resource/place/campus/'),
+ $this->getOsidIdFromString($row['STVCAMP_CODE'], 'resource.place.campus.'),
$row['STVCAMP_DESC'],
'',
- new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource/place/campus')
+ new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource.place.campus')
);
}
self::$getCampusResources_stmt->closeCursor();
@@ -783,15 +783,15 @@ public function getResourcesByGenusType(osid_type_Type $resourceGenusType)
return new phpkit_EmptyList('osid_resource_ResourceList');
}
switch ($resourceGenusType->getIdentifier()) {
- case 'genera:resource/person':
+ case 'genera:resource.person':
return $this->getPersonResources();
- case 'genera:resource/place/campus':
+ case 'genera:resource.place.campus':
return $this->getCampusResources();
- case 'genera:resource/place/building':
+ case 'genera:resource.place.building':
return $this->getBuildingResources();
- case 'genera:resource/place/room':
+ case 'genera:resource.place.room':
return $this->getRoomResources();
- // case 'genera:resource/place':
+ // case 'genera:resource.place':
// return $this->getPlaceResources();
default:
return new phpkit_EmptyList('osid_resource_ResourceList');
@@ -827,7 +827,7 @@ public function getResourcesByParentGenusType(osid_type_Type $resourceGenusType)
return new phpkit_EmptyList('osid_resource_ResourceList');
}
- if ('genera:resource/place' == $resourceGenusType->getIdentifier()) {
+ if ('genera:resource.place' == $resourceGenusType->getIdentifier()) {
$resourceList = new phpkit_CombinedList('osid_resource_ResourceList');
$resourceList->addList($this->getCampusResources());
$resourceList->addList($this->getBuildingResources());
diff --git a/application/library/banner/resource/Resource/Person.php b/application/library/banner/resource/Resource/Person.php
index 017b5615..25770527 100755
--- a/application/library/banner/resource/Resource/Person.php
+++ b/application/library/banner/resource/Resource/Person.php
@@ -77,7 +77,7 @@ public function __construct(osid_id_Id $id, $surname, $givenName, $middleNames =
$this->addRecordType($this->namesType);
- $this->setGenusType(new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource/person'));
+ $this->setGenusType(new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource.person'));
}
/**
diff --git a/application/library/banner/resource/Resource/Room.php b/application/library/banner/resource/Resource/Room.php
index cd372449..0f7c259c 100644
--- a/application/library/banner/resource/Resource/Room.php
+++ b/application/library/banner/resource/Resource/Room.php
@@ -32,7 +32,7 @@ class banner_resource_Resource_Room extends banner_resource_Resource_Building
public function __construct(osid_id_Id $id, $buildingDisplayName, $buildingCode, $room)
{
parent::__construct($id, $buildingDisplayName, $buildingCode);
- $this->setGenusType(new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource/place/room'));
+ $this->setGenusType(new phpkit_type_URNInetType('urn:inet:middlebury.edu:genera:resource.place.room'));
$this->setDisplayName($buildingDisplayName.' '.$room);
$this->setDescription($buildingCode.' '.$room);
$this->room = $room;
diff --git a/application/library/banner/resource/ResourceManager.php b/application/library/banner/resource/ResourceManager.php
index 9ea7fa4e..3baf4f53 100755
--- a/application/library/banner/resource/ResourceManager.php
+++ b/application/library/banner/resource/ResourceManager.php
@@ -78,7 +78,7 @@ public function getIdAuthority()
*/
public function getCombinedBinId()
{
- return new phpkit_id_Id($this->getIdAuthority(), 'urn', 'resource/all');
+ return new phpkit_id_Id($this->getIdAuthority(), 'urn', 'resource.all');
}
/*********************************************************
@@ -120,17 +120,17 @@ public function initialize(osid_OsidRuntimeManager $runtime)
try {
$dsn = phpkit_configuration_ConfigUtil::getSingleValuedValue(
$runtime->getConfiguration(),
- new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course/pdo_dsn'),
+ new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course.pdo_dsn'),
new phpkit_type_Type('urn', 'middlebury.edu', 'Primitives/String'));
$username = phpkit_configuration_ConfigUtil::getSingleValuedValue(
$runtime->getConfiguration(),
- new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course/pdo_username'),
+ new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course.pdo_username'),
new phpkit_type_Type('urn', 'middlebury.edu', 'Primitives/String'));
$password = phpkit_configuration_ConfigUtil::getSingleValuedValue(
$runtime->getConfiguration(),
- new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course/pdo_password'),
+ new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course.pdo_password'),
new phpkit_type_Type('urn', 'middlebury.edu', 'Primitives/String'));
} catch (osid_NotFoundException $e) {
throw new osid_ConfigurationErrorException($e->getMessage(), $e->getCode());
@@ -139,7 +139,7 @@ public function initialize(osid_OsidRuntimeManager $runtime)
try {
$debug = phpkit_configuration_ConfigUtil::getSingleValuedValue(
$runtime->getConfiguration(),
- new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course/pdo_count_queries'),
+ new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course.pdo_count_queries'),
new phpkit_type_Type('urn', 'middlebury.edu', 'Primitives/Boolean'));
} catch (osid_ConfigurationErrorException $e) {
$debug = false;
@@ -158,10 +158,10 @@ public function initialize(osid_OsidRuntimeManager $runtime)
try {
$this->idAuthority = phpkit_configuration_ConfigUtil::getSingleValuedValue(
$runtime->getConfiguration(),
- new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course/id_authority'),
+ new phpkit_id_URNInetId('urn:inet:middlebury.edu:config:banner_course.id_authority'),
new phpkit_type_Type('urn', 'middlebury.edu', 'Primitives/String'));
if (!strlen($this->idAuthority)) {
- throw new osid_ConfigurationErrorException('urn:inet:middlebury.edu:config:banner_course/id_authority must be specified.');
+ throw new osid_ConfigurationErrorException('urn:inet:middlebury.edu:config:banner_course.id_authority must be specified.');
}
} catch (osid_NotFoundException $e) {
throw new osid_ConfigurationErrorException($e->getMessage(), $e->getCode());
diff --git a/application/resources/Auth/Action/Helper/Auth.php b/application/resources/Auth/Action/Helper/Auth.php
deleted file mode 100755
index 13655d52..00000000
--- a/application/resources/Auth/Action/Helper/Auth.php
+++ /dev/null
@@ -1,124 +0,0 @@
-config;
- if (!isset($config->authType) || !strlen(trim($config->authType))) {
- $authType = 'NullAuth';
- } else {
- $authType = $config->authType;
- }
-
- try {
- // Use a masquerade auth helper if enabled and in use.
- try {
- $masqueradeHelper = $this->getMasqueradeHelper();
- if ($masqueradeHelper->isAuthenticated()) {
- $this->authHelper = $masqueradeHelper;
- $this->initialized = true;
-
- return;
- }
- } catch (Exception $e) {
- }
-
- // Use our standard Auth helper.
- $this->authHelper = $this->getAuthHelperInstance($authType);
- $this->initialized = true;
- } catch (Zend_Controller_Action_Exception $e) {
- throw new Exception("Can not use authentication type '".$authType."'. ".$e->getMessage());
- }
- }
-
- /**
- * Answer an instance of the AuthHelper for the authType specified.
- *
- * @param string $authType
- *
- * @return Auth_Action_Helper_AuthInterface
- */
- private function getAuthHelperInstance($authType)
- {
- $authHelper = Zend_Controller_Action_HelperBroker::getStaticHelper($authType);
- if (!($authHelper instanceof Auth_Action_Helper_AuthInterface)) {
- $class = $authHelper::class;
- throw new Exception("Auth helper for auth-type '$authType' has class '$class' which does not implement Auth_Action_Helper_AuthInterface.");
- }
-
- return $authHelper;
- }
-
- /**
- * Answer the configured Authentication Helper.
- *
- * @return Zend_Controller_Action_Helper_Interface
- *
- * @since 6/14/10
- */
- public function getHelper()
- {
- if (!$this->initialized) {
- $this->init();
- }
-
- if (null === $this->authHelper) {
- throw new Exception("No authentication helper is available. Maybe one wasn't configured.", 450);
- }
-
- return $this->authHelper;
- }
-
- /**
- * Answer the configured Authentication Helper.
- *
- * @return void
- *
- * @since 6/14/10
- */
- public function direct()
- {
- return $this->getHelper();
- }
-
- /**
- * Answer the configured Masquerade helper if configured.
- *
- * Throws an exception if no masquerade helper is available.
- *
- * @return Auth_Action_Helper_MasqueradeInterface
- */
- public function getMasqueradeHelper()
- {
- $config = Zend_Registry::getInstance()->config;
- if (!empty($config->masquerade->enabled) && !empty($config->masquerade->type)) {
- return $this->getAuthHelperInstance($config->masquerade->type);
- }
- throw new Exception('No masquerade auth helper enabled.');
- }
-}
diff --git a/application/resources/Auth/Action/Helper/AuthInterface.php b/application/resources/Auth/Action/Helper/AuthInterface.php
deleted file mode 100755
index fa4d6cf7..00000000
--- a/application/resources/Auth/Action/Helper/AuthInterface.php
+++ /dev/null
@@ -1,82 +0,0 @@
-config;
-
- if ($config->cas->debug_file) {
- phpCAS::setDebug($config->cas->debug_file);
- }
-
- if (empty($config->cas->host)) {
- throw new InvalidArgumentException('cas.host must be configured.');
- }
- if (empty($config->cas->port)) {
- throw new InvalidArgumentException('cas.port must be configured.');
- }
- if (empty($config->cas->path)) {
- throw new InvalidArgumentException('cas.path must be configured.');
- }
- if (empty($config->cas->service_urls)) {
- throw new InvalidArgumentException('cas.service_urls[] must be configured.');
- }
-
- phpCAS::client(
- CAS_VERSION_2_0,
- $config->cas->host,
- (int) $config->cas->port,
- $config->cas->path,
- $config->cas->service_urls->toArray(),
- false);
-
- if ($config->cas->server_cert) {
- phpCAS::setCasServerCACert($config->cas->server_cert);
- } else {
- phpCAS::setNoCasServerValidation();
- }
-
- self::$phpcasInitialized = true;
- }
- }
-}
diff --git a/application/resources/Auth/Action/Helper/CasDirectory.php b/application/resources/Auth/Action/Helper/CasDirectory.php
deleted file mode 100755
index d8388f52..00000000
--- a/application/resources/Auth/Action/Helper/CasDirectory.php
+++ /dev/null
@@ -1,231 +0,0 @@
-isAuthenticated()) {
- throw new Exception('No user authenticated.');
- }
-
- return $_SESSION['masquerade.CasDirectory']['id'];
- }
-
- /**
- * Answer a name for the user if a user is currently authenticated or throw an Exception
- * if isAuthenticated is false.
- *
- * @return string
- */
- public function getUserDisplayName()
- {
- if (!$this->isAuthenticated()) {
- throw new Exception('No user authenticated.');
- }
-
- return $_SESSION['masquerade.CasDirectory']['name'];
- }
-
- /**
- * Answer an email address for the user if a user is currently authenticated or throw an Exception
- * if isAuthenticated is false.
- *
- * @return string
- */
- public function getUserEmail()
- {
- if (!$this->isAuthenticated()) {
- throw new Exception('No user authenticated.');
- }
-
- return $_SESSION['masquerade.CasDirectory']['email'];
- }
-
- /**
- * Answer an array of groups for the user if a user is currently authenticated or throw an Exception
- * if isAuthenticated is false.
- *
- * @return array
- */
- public function getUserGroups()
- {
- if (!$this->isAuthenticated()) {
- throw new Exception('No user authenticated.');
- }
-
- return $_SESSION['masquerade.CasDirectory']['memberof'];
- }
-
- /**
- * Change to a different user account. Clients are responsible for checking that
- * the current user is authorized before calling this method. Clients are also
- * responsible for logging.
- *
- * Throws an exception if unsupported.
- *
- * @param string $userId
- *
- * @return void
- */
- public function changeUser($userId)
- {
- $config = Zend_Registry::getInstance()->config;
- if (empty($config->masquerade->CasDirectory->url)) {
- throw new Exception('No masquerade.CasDirectory.url configured.');
- }
-
- $extraParams = [];
- if (!empty($config->masquerade->CasDirectory->extra_params)) {
- parse_str($config->masquerade->CasDirectory->extra_params, $extraParams);
- }
-
- $params = array_merge([
- 'action' => 'get_user',
- 'id' => $userId,
- ], $extraParams);
- $url = $config->masquerade->CasDirectory->url.'?'.http_build_query($params);
-
- $headers = ['User-Agent: Drupal CAS-MM-Sync'];
- if (!empty($config->masquerade->CasDirectory->headers)) {
- foreach ($config->masquerade->CasDirectory->headers as $header) {
- if (!preg_match('/.+:.+/', $header)) {
- throw new Exception('Each element of masquerade.CasDirectory.headers[] must be a "key: value" string.');
- }
- $headers[] = $header;
- }
- }
- foreach ($headers as $k => $v) {
- $headers[$k] = rtrim($v)."\r\n";
- }
- $opts = [
- 'http' => [
- 'header' => implode('', $headers),
- ],
- ];
- $context = stream_context_create($opts);
- $xmlstring = file_get_contents($url, false, $context);
- if (empty($xmlstring)) {
- throw new Exception('Could not load user information.');
- }
- $doc = new DOMDocument();
- if (!$doc->loadXML($xmlstring)) {
- throw new Exception('Could not parse user information.');
- }
-
- $xpath = new DOMXPath($doc);
- $xpath->registerNamespace('cas', 'http://www.yale.edu/tp/cas');
-
- $id = $xpath->query('/cas:results/cas:entry/cas:user')->item(0)->nodeValue;
- if ($id == $userId) {
- $_SESSION['masquerade.CasDirectory'] = [
- 'id' => $userId,
- ];
- } else {
- throw new Exception("Id found didn't match query.");
- }
-
- $name = '';
- $elements = $xpath->query('/cas:results/cas:entry/cas:attribute[@name="FirstName"]');
- if ($elements->length) {
- $name .= $elements->item(0)->getAttribute('value');
- }
- $name .= ' ';
- $elements = $xpath->query('/cas:results/cas:entry/cas:attribute[@name="LastName"]');
- if ($elements->length) {
- $name .= $elements->item(0)->getAttribute('value');
- }
- if (strlen(trim($name))) {
- $_SESSION['masquerade.CasDirectory']['name'] = $name;
- } else {
- $_SESSION['masquerade.CasDirectory']['name'] = 'name unknown';
- }
-
- $elements = $xpath->query('/cas:results/cas:entry/cas:attribute[@name="EMail"]');
- if ($elements->length) {
- $_SESSION['masquerade.CasDirectory']['email'] = $elements->item(0)->getAttribute('value');
- } else {
- $_SESSION['masquerade.CasDirectory']['email'] = '';
- }
-
- $elements = $xpath->query('/cas:results/cas:entry/cas:attribute[@name="MemberOf"]');
- $_SESSION['masquerade.CasDirectory']['memberof'] = [];
- foreach ($elements as $element) {
- $_SESSION['masquerade.CasDirectory']['memberof'][] = $element->getAttribute('value');
- }
- }
-}
diff --git a/application/resources/Auth/Action/Helper/MasqueradeInterface.php b/application/resources/Auth/Action/Helper/MasqueradeInterface.php
deleted file mode 100755
index 3c52b358..00000000
--- a/application/resources/Auth/Action/Helper/MasqueradeInterface.php
+++ /dev/null
@@ -1,31 +0,0 @@
-isAuthenticated()) {
- throw new Exception('No user authenticated.');
- }
-
- return $_SESSION['masquerade.MicrosoftGraph']['id'];
- }
-
- /**
- * Answer a name for the user if a user is currently authenticated or throw an Exception
- * if isAuthenticated is false.
- *
- * @return string
- */
- public function getUserDisplayName()
- {
- if (!$this->isAuthenticated()) {
- throw new Exception('No user authenticated.');
- }
-
- return $_SESSION['masquerade.MicrosoftGraph']['name'];
- }
-
- /**
- * Answer an email address for the user if a user is currently authenticated or throw an Exception
- * if isAuthenticated is false.
- *
- * @return string
- */
- public function getUserEmail()
- {
- if (!$this->isAuthenticated()) {
- throw new Exception('No user authenticated.');
- }
-
- return $_SESSION['masquerade.MicrosoftGraph']['email'];
- }
-
- /**
- * Answer an array of groups for the user if a user is currently authenticated or throw an Exception
- * if isAuthenticated is false.
- *
- * @return array
- */
- public function getUserGroups()
- {
- if (!$this->isAuthenticated()) {
- throw new Exception('No user authenticated.');
- }
-
- return $_SESSION['masquerade.MicrosoftGraph']['memberof'];
- }
-
- /**
- * Change to a different user account. Clients are responsible for checking that
- * the current user is authorized before calling this method. Clients are also
- * responsible for logging.
- *
- * Throws an exception if unsupported.
- *
- * @param string $userId
- *
- * @return void
- */
- public function changeUser($userId)
- {
- $user = $this->fetchUserForLogin($userId);
-
- $properties = $this->extractUserInfo($user);
- $_SESSION['masquerade.MicrosoftGraph'] = [
- 'id' => $properties['user_login'],
- ];
-
- $name = '';
- if (!empty($properties['first_name'])) {
- $name .= $properties['first_name'].' ';
- }
- if (!empty($properties['last_name'])) {
- $name .= $properties['last_name'];
- }
- if (strlen(trim($name))) {
- $_SESSION['masquerade.MicrosoftGraph']['name'] = $name;
- } else {
- $_SESSION['masquerade.MicrosoftGraph']['name'] = 'name unknown';
- }
-
- if (!empty($properties['user_email'])) {
- $_SESSION['masquerade.MicrosoftGraph']['email'] = $properties['user_email'];
- } else {
- $_SESSION['masquerade.MicrosoftGraph']['email'] = '';
- }
-
- $_SESSION['masquerade.MicrosoftGraph']['memberof'] = [];
- }
-
- /**
- * Answer our already-configured O365 API.
- *
- * @return Microsoft\Graph\Graph
- * The Graph object
- */
- protected function getGraph()
- {
- if (empty($this->graph)) {
- $this->graph = new GraphServiceClient(
- $this->getTokenRequestContext()
- );
- }
-
- return $this->graph;
- }
-
- /**
- * Get an O365 Access token context.
- */
- protected function getTokenRequestContext()
- {
- $config = Zend_Registry::getInstance()->config;
- if (empty($config->masquerade->MicrosoftGraph->tenantId)) {
- throw new Exception('No masquerade.MicrosoftGraph.tenantId configured.');
- }
- if (empty($config->masquerade->MicrosoftGraph->appId)) {
- throw new Exception('No masquerade.MicrosoftGraph.appId configured.');
- }
- if (empty($config->masquerade->MicrosoftGraph->appSecret)) {
- throw new Exception('No masquerade.MicrosoftGraph.appSecret configured.');
- }
-
- return new ClientCredentialContext(
- $config->masquerade->MicrosoftGraph->tenantId,
- $config->masquerade->MicrosoftGraph->appId,
- $config->masquerade->MicrosoftGraph->appSecret,
- );
- }
-
- /**
- * Answer an MS Graph User object matching a login string.
- *
- * @param string $login
- *
- * @return User
- */
- protected function fetchUserForLogin($login)
- {
- // First search by the primary unique ID.
- try {
- return $this->fetchUserByProperty($this->getPrimaryUniqueIdProperty(), $login);
- } catch (Exception $e) {
- // If we didn't find an account based on the primary id, try a secondary ID if configured.
- if (404 == $e->getCode() && !empty($this->getSecondaryUniqueIdProperty())) {
- return $this->fetchUserByProperty($this->getSecondaryUniqueIdProperty(), $login);
- } else {
- // If we don't support secondary ids or get another error, just throw it.
- throw $e;
- }
- }
- }
-
- /**
- * Answer an MS Graph User object matching a login string.
- *
- * @param string $property
- * The MSGraph property to match
- * @param string $value
- * The user-id value to match
- *
- * @return User
- */
- protected function fetchUserByProperty($property, $value)
- {
- $requestConfig = new UsersRequestBuilderGetRequestConfiguration(
- queryParameters: UsersRequestBuilderGetRequestConfiguration::createQueryParameters(
- filter: $property." eq '".urlencode($value)."'",
- select: $this->getUserGraphProperties(),
- orderby: ['displayName'],
- top: 10,
- count: true
- ),
- headers: ['ConsistencyLevel' => 'eventual']
- );
- $result = $this->getGraph()->users()->get($requestConfig)->wait();
- $users = [];
- foreach ($result->getValue() as $user) {
- $users[] = $user;
- }
- if (count($users) < 1) {
- throw new Exception('Could not get user. Expecting 1 entry, found '.count($users).' in AzureAD.', 404);
- } elseif (1 === count($users)) {
- return $users[0];
- } else {
- return $this->getPrimaryAccountFromUserList($users);
- }
- }
-
- protected function getUserGraphProperties()
- {
- return [
- 'id',
- 'displayName',
- 'mail',
- 'givenName',
- 'surname',
- 'userType',
- $this->getPrimaryUniqueIdProperty(),
- $this->getSecondaryUniqueIdProperty(),
- ];
- }
-
- /**
- * Filter a list of MS Graph User objects to find a single "primary" one.
- *
- * @param array $users
- * The MSGraph User list
- *
- * @return User
- * A single user if one can be determined to be "primary"
- */
- protected function getPrimaryAccountFromUserList(array $users)
- {
- // Give priority to users with the type "Member" over "Guest" or other
- // account types.
- $memberUsers = [];
- foreach ($users as $user) {
- if ('member' == strtolower($user->getUserType())) {
- $memberUsers[] = $user;
- }
- }
- // If we only have a single user with type "Member", then return that user.
- if (1 === count($memberUsers)) {
- return $memberUsers[0];
- }
-
- // Not sure what to do if we have multiple "Member" accounts with the same
- // ID or multiple "Guest" accounts with the same ID.
- // Perhaps we could do some email filtering or other logic, but hopefully
- // this case won't come up.
- ob_start();
- foreach ($users as $user) {
- $properties = $user->getProperties();
- echo "\n\t
Anti-requisites are course-equivalency entries that indicate that a course can't be taken if another already has been. This is in contrast to most usage of equivalency which indicates that courses are the same thing. Anti-requisites listed below will be filtered out of cross-list entries for courses.
-Please Note: Any changes made here will affect views for authenticated users immediately, but will not affect catalog archives or anonymous views until the next nightly sync.
- - - -Subject Code | -Course Number | -Subject Code Equivalent | -Course Number Equivalent | -Date Added | -Added By | -Comments | -Actions | -
---|---|---|---|---|---|---|---|
".$antirequisite['subj_code']." | "; - print "\n\t\t".$antirequisite['crse_numb']." | "; - print "\n\t\t".$antirequisite['subj_code_eqiv']." | "; - print "\n\t\t".$antirequisite['crse_numb_eqiv']." | "; - print "\n\t\t".$antirequisite['added_date']." | "; - print "\n\t\t".$antirequisite['added_by']." | "; - print "\n\t\t".$antirequisite['comments']." | "; - - print "\n\t\t"; - print "\n\t\t\t"; - print "\n\t\t | "; - print "\n\t
Search for a subject code and course number to find related equivalencies.
- - -searchResults)): ?> - - diff --git a/application/views/scripts/admin/export.phtml b/application/views/scripts/admin/export.phtml deleted file mode 100644 index 1c823f67..00000000 --- a/application/views/scripts/admin/export.phtml +++ /dev/null @@ -1,54 +0,0 @@ -headLink(array('rel' => 'stylesheet', 'href' => $this->baseUrl('/StyleSheets/midd/Export.css'), 'media' => 'all')); - $this->headScript()->appendFile($this->baseUrl('javascript/export.js')); - $this->headScript()->appendFile($this->baseUrl('javascript/jquery-ui-1.12.1/jquery-ui.min.js')); -?> - -- -
Current User: userName; ?> - -
Enter the id of another user to act as them.
- diff --git a/application/views/scripts/admin/terms.phtml b/application/views/scripts/admin/terms.phtml deleted file mode 100755 index e423d1a3..00000000 --- a/application/views/scripts/admin/terms.phtml +++ /dev/null @@ -1,69 +0,0 @@ -Please Note: Any changes made here will take effect during the next synchronization with Banner
- -Term Code | -Description | -Sections | -Manual Override | -Active? | -
---|---|---|---|---|
".$term['STVTERM_CODE']." | "; - print "\n\t\t".$term['STVTERM_DESC']." | "; - print "\n\t\t".$numSections." | "; - - print "\n\t\t"; - print "\n\t\t\t"; - print "\n\t\t | "; - - print "\n\t\t"; - if ($active) { - print "Yes"; - } else { - print "No: "; - if ($manuallyDisabled) - print "Manually disabled. "; - if (!$numSections) - print "Zero sections. "; - } - print "\n\t\t | "; - - print "\n\t
An error occurred; please try again later.
- - diff --git a/application/views/scripts/export/newconfig.phtml b/application/views/scripts/export/newconfig.phtml deleted file mode 100644 index 9b691150..00000000 --- a/application/views/scripts/export/newconfig.phtml +++ /dev/null @@ -1,21 +0,0 @@ -headLink(array('rel' => 'stylesheet', 'href' => $this->baseUrl('/StyleSheets/midd/Export.css'), 'media' => 'all')); - $this->headScript()->appendFile($this->baseUrl('javascript/export.js')); -?> - -Compare | Date | Author | Note | JSON | Actions | "; - foreach($this->revisions as $revision) { - print "
---|---|---|---|---|---|
"; - print " | " . $revision['last_saved'] . " | "; - print "" . $revision['user_disp_name'] . " | "; - print "" . $revision['note'] . " | "; - print "$revision['id']), 'export_viewjson') . "' target=_blank>View JSON | "; - print ""; - print " |
" . $this->revision['json_data'] . ""; - } - ?> diff --git a/application/views/scripts/index/index.phtml b/application/views/scripts/index/index.phtml deleted file mode 100644 index 3f06f315..00000000 --- a/application/views/scripts/index/index.phtml +++ /dev/null @@ -1,12 +0,0 @@ - - - - -
- escape($section->getDisplayName()); ?>
-hasRecordType($alternateType)) {
- $record = $section->getCourseOfferingRecord($alternateType);
- if ($record->hasAlternates()) {
- if ($record->isPrimary()) {
- print " * ";
- }
-
- $alternates = $record->getAlternates();
- print "\n\t\t\t\t Cross-Listed As:"; - while ($alternates->hasNext()) { - print "\n\t\t\t\t "; - $alternate = $alternates->getNextCourseOffering(); - $offeringParams['offering'] = $this->getStringFromOsidId($alternate->getId()); - print "url($offeringParams)."\">"; - print $this->escape($alternate->getDisplayName()); - print " "; - if ($alternate->hasRecordType($alternateType)) { - $alternateRecord = $alternate->getCourseOfferingRecord($alternateType); - if ($alternateRecord->isPrimary()) { - print " * "; - } - } - } - } -} - -print "\n\t
|
-
- bookmarks_CourseId = $section->getCourseId();
- $this->bookmarks_IsCourseSaved = false;
- print $this->render('schedules/bookmark_control.phtml');
- ?>
- escape($section->getTitle())); ?>
- getDescription(); ?>
-";
-
-$instructorsType = new phpkit_type_URNInetType('urn:inet:middlebury.edu:record:instructors');
-if ($section->hasRecordType($instructorsType)) {
- $instructorsRecord = $section->getCourseOfferingRecord($instructorsType);
- print "\n\t\t |
-
You have no starred courses for this term. Please url(array('controller' => 'offerings', 'action' => 'search', 'catalog' => $this->catalogIdString, 'term' => $this->termIdString), null, true)."\">search for courses and star interesting ones first.
"; -} -?> -escape($this->messageBody)); ?>
-"; - print "\n\t\t\t 'offerings', 'action' => 'view', 'offering' => $this->getStringFromOsidId($offering->getId())))."' target='_blank'>"; - print $this->escape($offering->getDisplayName()); - print "CRN: ".$this->escape($offering->getCourseReferenceNumber()); - print "\n\t\t | "; - - print "\n\t\t"; - print "\n\t\t\t 'offerings', 'action' => 'view', 'offering' => $this->getStringFromOsidId($offering->getId())))."' target='_blank'>"; - print nl2br($this->escape($offering->getTitle())); - print ""; - print "\n\t\t | "; - - print "\n\t\t".$this->formatScheduleInfo($offering->getScheduleInfo())." | "; - print "\n\t\t".nl2br($this->escape($offering->getLocationInfo()))." | "; - - print "\n\t\t\t
- - | -|
Saved Courses in render('schedules/selected_term_name.phtml'); ?> | -Schedules for render('schedules/selected_term_name.phtml'); ?> | -
---|---|
- render('schedules/bookmarks.phtml'); ?> - | -- render('schedules/schedules.phtml'); ?> - | -
What do you want to do?
"; - -// Change form -$scheduleTermIdString = $this->getStringFromOsidId($this->schedule->getTermId()); -?> - - - -url(array('action' => 'remove'))."' method='post'>"; -print "\n\t\t\t"; -print "\n\t\t\t"; -print "\n\t\t\t"; -print "\n\t\t\t"; -print "\n\t\t"; - -// Cancel -print "\n\t\t"; - -print "\n\t\t"; - -// Remove/Change Button. -print "\n\t\t"; - - - -if (!defined('REMOVE_OFFERING_DIALOG_JS_ADDED')) { - ob_start(); -?> - - $(function() { // on DOM ready - - /********************************************************* - * Remove dialog controls - *********************************************************/ - $(".remove_dialog").each(function() { - var button = $(this).siblings(".remove_button"); - var removeDialog = $(this).dialog({ - autoOpen: false, - width: 600, - modal: true, - position: 'top' - }); - - button.data("removeDialog", removeDialog); - }); - - $(".remove_button").click(function(){ - var removeDialog = $(this).data('removeDialog'); - removeDialog.dialog("open"); - }); - - $(".remove_dialog .cancel").click(function() { - $(this).parent().dialog('close'); - }); - - $(".change_section_dialog").each(function () { - var button = $(this).siblings(".change_sections_button"); - var addDialog = $(this).dialog({ - autoOpen: false, - width: 600, - modal: true, - close: function(event, ui) { - $(this).find("ul.section_sets").empty(); - } - }); - - button.data("addDialog", addDialog); - }); - - $(".change_sections_button").click(function () { - var removeDialog = $(this).parent(); - removeDialog.dialog("close"); - - var addDialog = $(this).data("addDialog"); - var scheduleId = addDialog.find("input[name=schedule_id]").val(); - - addDialog.find("ul.section_sets").empty(); - getSectionSets(addDialog, scheduleId); - addDialog.dialog("open"); - }); - - }); - - -headScript()->appendScript(ob_get_clean()); - define('REMOVE_OFFERING_DIALOG_JS_ADDED', true); -} diff --git a/application/views/scripts/schedules/schedule_calendar_dialog.phtml b/application/views/scripts/schedules/schedule_calendar_dialog.phtml deleted file mode 100755 index 6dac15bb..00000000 --- a/application/views/scripts/schedules/schedule_calendar_dialog.phtml +++ /dev/null @@ -1,68 +0,0 @@ -url(array('action' => 'eventsjson', 'schedule_id' => $this->schedule->getId()))."' title='Click to zoom'>"; -print "\n\t 'png', 'schedule_id' => $this->schedule->getId()))."' alt='Weekly Schedule Image'/>"; -print "\n\t\t"; - -print "\n\t "; - - -if (!defined('CALENDAR_DIALOG_JS_ADDED')) { - ob_start(); -?> - - $(function() { // on DOM ready - - /********************************************************* - * Calendar controls - *********************************************************/ - headLink()->appendStylesheet($this->url(array(), null, true).'javascript/jquery-week-calendar/jquery.weekcalendar.css'); - $this->headStyle()->appendStyle(' - div.wc-toolbar {display: none;} - .wc-time-slots .wc-today { background-color: #FFF; } - .wc-header .wc-today { font-weight: normal; } - '); - $this->headScript()->appendFile($this->url(array(), null, true).'javascript/jquery-week-calendar/libs/date.js'); - $this->headScript()->appendFile($this->url(array(), null, true).'javascript/jquery-week-calendar/jquery.weekcalendar.js'); - $this->headScript()->appendFile($this->url(array(), null, true).'javascript/schedule.js'); - - ?> - - $(".calendar").each(function() { - var button = $(this).siblings(".calendar_button"); - var calendar = $(this).dialog({ - autoOpen: false, - width: 900, - modal: true, - position: 'top' - }); - - button.data("calendar", calendar); - }); - $(".calendar_button").click(function(){ - var jsonUrl = $(this).attr('href'); - var calendar = $(this).data('calendar'); - calendar.dialog("open"); - - if (!calendar.data('initialized')) { - renderSchedule(calendar, jsonUrl); - calendar.data('initialized', true); - } - - return false; - }); - - }); - - -headScript()->appendScript(ob_get_clean()); - define('CALENDAR_DIALOG_JS_ADDED', true); -} diff --git a/application/views/scripts/schedules/schedules.phtml b/application/views/scripts/schedules/schedules.phtml deleted file mode 100755 index ddfbe843..00000000 --- a/application/views/scripts/schedules/schedules.phtml +++ /dev/null @@ -1,112 +0,0 @@ -schedules as $schedule) { - print "\n