diff --git a/.gitignore b/.gitignore index 9631778..9dc8805 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -.DS_Store -/admin/configuration.ini -/archive/* -/logs/* -/sushistore/* +.DS_Store +/admin/configuration.ini +/archive/* +/logs/* +/sushistore/* +*.bak diff --git a/LangCodes.php b/LangCodes.php new file mode 100644 index 0000000..13aa984 --- /dev/null +++ b/LangCodes.php @@ -0,0 +1,29 @@ +'fr_FR', + 'en_US'=>'en_US'//, + //'zh_CN'=>'zh_CN', + //'zh_TW'=>'zh_TW', + //'de_DE'=>'de_DE' + ); + return array_key_exists($code, $all_lang) ? $all_lang[$code] : "en_US"; + } + public function getNameLang($code_lang){ + $name_lang=array( + 'fr_FR'=>'Français', + 'en_US'=>'English'//, + //'zh_CN'=>'中文 (中国)', + //'zh_TW'=>'中文 (台灣)', + //'de_DE'=>'Deutsch' + ); + return array_key_exists($code_lang, $name_lang) ? $name_lang[$code_lang] : "English"; + } +} +?> \ No newline at end of file diff --git a/README b/README index 91c50d3..776a260 100755 --- a/README +++ b/README @@ -1,39 +1,38 @@ -************************** -Installation -Copy this entire directory to your web server under a directory named '/coral/usage/', then point your web browser to: -http://your_server/coral/usage/install/ -and follow instructions - -For the manual install, refer to the Technical Documentation available on http://erm.library.nd.edu - - -************************** -License / Copyright notices - -Copyright (c) 2013 University of Notre Dame -This file is part of CORAL. -CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License along with CORAL. If not, see . - - -Parts of code used in the SushiService class is reused from Sushi Starters. Here is their license: -Copyright (c) 2011, Cranfield University - All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - -More information on Sushi Starters here: -http://cclibweb-4.dmz.cranfield.ac.uk/projects/sushistarters/ - - - -************************** -To contact the CORAL Developers: -CORAL-ADMIN@LISTSERV.ND.EDU +************************** +Installation +Copy this entire directory to your web server under a directory named '/coral/usage/', then point your web browser to: +http://your_server/coral/usage/install/ +and follow instructions + +For the manual install, refer to the Technical Documentation available on http://erm.library.nd.edu + +************************** +License / Copyright notices + +Copyright (c) 2013 University of Notre Dame +This file is part of CORAL. +CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +You should have received a copy of the GNU General Public License along with CORAL. If not, see . + + +Parts of code used in the SushiService class is reused from Sushi Starters. Here is their license: +Copyright (c) 2011, Cranfield University + All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +More information on Sushi Starters here: +http://cclibweb-4.dmz.cranfield.ac.uk/projects/sushistarters/ + + + +************************** +To contact the CORAL Developers: +CORAL-ADMIN@LISTSERV.ND.EDU diff --git a/admin.php b/admin.php index f1b64e9..e6bfaaa 100755 --- a/admin.php +++ b/admin.php @@ -1,5 +1,5 @@ -Users   -
add new user +   +


-Loading... +
@@ -24,11 +24,11 @@
-Email addresses for logs   -
add new email address +   +


-Loading... +
@@ -40,10 +40,10 @@
-Outlier Parameters   +  

-Loading... +
diff --git a/admin/classes/common/Configuration.php b/admin/classes/common/Configuration.php index e650f3a..5a1420f 100755 --- a/admin/classes/common/Configuration.php +++ b/admin/classes/common/Configuration.php @@ -1,32 +1,36 @@ -. -** -************************************************************************************************************************** -*/ - - -class Configuration extends DynamicObject { - - public function init(NamedArguments $arguments) { - $arguments->setDefaultValueForArgumentName('filename', BASE_DIR . '/admin/configuration.ini'); - $config = parse_ini_file($arguments->filename, true); - foreach ($config as $section => $entries) { - $this->$section = Utility::objectFromArray($entries); - } - } - -} - +. +** +************************************************************************************************************************** +*/ + + +class Configuration extends DynamicObject { + + public function init(NamedArguments $arguments) { + $arguments->setDefaultValueForArgumentName('filename', BASE_DIR . 'admin/configuration.ini'); + if ((file_exists($arguments->filename)) and (is_readable($arguments->filename))) { + $config = parse_ini_file($arguments->filename, true); + } else { + die( BASE_DIR . 'admin/configuration.ini is missing or unreadable.'); + } + foreach ($config as $section => $entries) { + $this->$section = Utility::objectFromArray($entries); + } + } + +} + ?> \ No newline at end of file diff --git a/admin/classes/common/DBService.php b/admin/classes/common/DBService.php index 4cc44e0..000d9ab 100755 --- a/admin/classes/common/DBService.php +++ b/admin/classes/common/DBService.php @@ -36,7 +36,7 @@ protected function dealloc() { protected function checkForError() { if ($this->error = mysqli_error($this->db)) { - throw new Exception("There was a problem with the database: " . $this->error); + throw new Exception(_("There was a problem with the database: ") . $this->error); } } diff --git a/admin/classes/common/LdapPerson.php b/admin/classes/common/LdapPerson.php index 7365fd6..b1cfc79 100755 --- a/admin/classes/common/LdapPerson.php +++ b/admin/classes/common/LdapPerson.php @@ -1,64 +1,64 @@ -. -** -************************************************************************************************************************** -*/ - - -class LdapPerson extends DynamicObject { - - public function __construct($userKey) { - - $config = new Configuration; - - //try to connect to ldap if the settings are entered - if ($config->ldap->host) { - - //If you are using OpenLDAP 2.x.x you can specify a URL instead of the hostname. To use LDAP with SSL, compile OpenLDAP 2.x.x with SSL support, configure PHP with SSL, and set this parameter as ldaps://hostname/. - //note that connect happens regardless if host is valid - $ds = ldap_connect($config->ldap->host); - - //may need ldap_bind( $ds, $username, $password ) - $bd = ldap_bind($ds) or die("

Could not connect to " . $config->ldap->host . "

"); - - if ($bd){ - $filter = $config->ldap->search_key . "=" . $userKey; - - $sr = ldap_search($ds, $config->ldap->base_dn, $filter); - - if ($entries = ldap_get_entries($ds, $sr)) { - $entry = $entries[0]; - - $fieldNames = array('fname', 'lname', 'email', 'phone', 'department', 'title', 'address'); - - foreach ($fieldNames as $fieldName) { - $configName = $fieldName . '_field'; - - $this->$fieldName = $entry[$config->ldap->$configName][0]; - - } - $this->fullname = addslashes($this->fname . ' ' . $this->lname); - - } - - ldap_close($ds); - - } - } - } - -} - +. +** +************************************************************************************************************************** +*/ + + +class LdapPerson extends DynamicObject { + + public function __construct($userKey) { + + $config = new Configuration; + + //try to connect to ldap if the settings are entered + if ($config->ldap->host) { + + //If you are using OpenLDAP 2.x.x you can specify a URL instead of the hostname. To use LDAP with SSL, compile OpenLDAP 2.x.x with SSL support, configure PHP with SSL, and set this parameter as ldaps://hostname/. + //note that connect happens regardless if host is valid + $ds = ldap_connect($config->ldap->host); + + //may need ldap_bind( $ds, $username, $password ) + $bd = ldap_bind($ds) or die("

"._("Could not connect to ") . $config->ldap->host . "

"); + + if ($bd){ + $filter = $config->ldap->search_key . "=" . $userKey; + + $sr = ldap_search($ds, $config->ldap->base_dn, $filter); + + if ($entries = ldap_get_entries($ds, $sr)) { + $entry = $entries[0]; + + $fieldNames = array('fname', 'lname', 'email', 'phone', 'department', 'title', 'address'); + + foreach ($fieldNames as $fieldName) { + $configName = $fieldName . '_field'; + + $this->$fieldName = $entry[$config->ldap->$configName][0]; + + } + $this->fullname = addslashes($this->fname . ' ' . $this->lname); + + } + + ldap_close($ds); + + } + } + } + +} + ?> \ No newline at end of file diff --git a/admin/classes/common/Object.php b/admin/classes/common/Object.php index d356817..2b590de 100755 --- a/admin/classes/common/Object.php +++ b/admin/classes/common/Object.php @@ -1,89 +1,89 @@ -. -** -************************************************************************************************************************** -*/ - - -class Object { - - public function __construct(NamedArguments $arguments = NULL) { - if (method_exists($this, 'init')) { - if (!is_a($arguments, 'NamedArguments')) { - $arguments = new NamedArguments(array()); - } - $this->init($arguments); - } - } - - // An optional initializer to use instead of |__construct()|. - protected function init(NamedArguments $arguments) { - - } - - public function __destruct() { - if (method_exists($this, 'dealloc')) { - $this->dealloc(); - } - } - - // An optional method called on deconstruction instead of |__deconstruct()|. - protected function dealloc() { - - } - - // Setters are functions called |$instance->setPropertyName($value)|. - public function __set($name, $value) { - $methodName = 'set' . ucfirst($name); - $this->$methodName($value); - } - - // Getters are functions called |$instance->propertyName()|. - public function __get($name) { - return $this->$name(); - } - - // Default setter uses declared properties. - protected function setValueForKey($key, $value) { - if (property_exists($this, $key)) { - $this->$key = $value; - } else { - throw new Exception("Cannot set value for undefined key ($key)."); - } - } - - // Default getter uses declared properties. - protected function valueForKey($key) { - if (property_exists($this, $key)) { - return $this->$key; - } else { - throw new Exception("Cannot get value for undefined key ($key)."); - } - } - - // Call |valueForKey| and |setValueForKey| as default setter and getter. - public function __call($name, $arguments) { - if (preg_match('/^set[A-Z]/', $name)) { - $key = preg_replace('/^set/', '\1', $name); - $key = lcfirst($key); - $this->setValueForKey($key, $arguments[0]); - } else { - return $this->valueForKey($name); - } - } - -} - +. +** +************************************************************************************************************************** +*/ + + +class Object { + + public function __construct(NamedArguments $arguments = NULL) { + if (method_exists($this, 'init')) { + if (!is_a($arguments, 'NamedArguments')) { + $arguments = new NamedArguments(array()); + } + $this->init($arguments); + } + } + + // An optional initializer to use instead of |__construct()|. + protected function init(NamedArguments $arguments) { + + } + + public function __destruct() { + if (method_exists($this, 'dealloc')) { + $this->dealloc(); + } + } + + // An optional method called on deconstruction instead of |__deconstruct()|. + protected function dealloc() { + + } + + // Setters are functions called |$instance->setPropertyName($value)|. + public function __set($name, $value) { + $methodName = 'set' . ucfirst($name); + $this->$methodName($value); + } + + // Getters are functions called |$instance->propertyName()|. + public function __get($name) { + return $this->$name(); + } + + // Default setter uses declared properties. + protected function setValueForKey($key, $value) { + if (property_exists($this, $key)) { + $this->$key = $value; + } else { + throw new Exception(_("Cannot set value for undefined key (").$key.")."); + } + } + + // Default getter uses declared properties. + protected function valueForKey($key) { + if (property_exists($this, $key)) { + return $this->$key; + } else { + throw new Exception(_("Cannot get value for undefined key (").$key.")."); + } + } + + // Call |valueForKey| and |setValueForKey| as default setter and getter. + public function __call($name, $arguments) { + if (preg_match('/^set[A-Z]/', $name)) { + $key = preg_replace('/^set/', '\1', $name); + $key = lcfirst($key); + $this->setValueForKey($key, $arguments[0]); + } else { + return $this->valueForKey($name); + } + } + +} + ?> \ No newline at end of file diff --git a/admin/classes/common/Utility.php b/admin/classes/common/Utility.php index 9e55623..f3ada5a 100755 --- a/admin/classes/common/Utility.php +++ b/admin/classes/common/Utility.php @@ -1,136 +1,136 @@ -. -** -************************************************************************************************************************** -*/ - - -class Utility { - - static public function unixTimeFromMysqlTimestamp($timestamp) { - - // taken from Dan Green, and then modified to be correct - // http://www.weberdev.com/get_example-1427.html - - $year = substr($timestamp,0,4); - $month = substr($timestamp,5,2); - $day = substr($timestamp,8,2); - $hour = substr($timestamp,11,2); - $minute = substr($timestamp,14,2); - $second = substr($timestamp,17,2); - $newdate = mktime($hour,$minute,$second,$month,$day,$year); - - return $newdate; - - } - - static public function secondsFromDays($days) { - return $days * 24 * 60 * 60; - } - - static public function objectFromArray($array) { - $object = new DynamicObject; - foreach ($array as $key => $value) { - if (is_array($value)) { - $object->$key = Utility::objectFromArray($value); - } else { - $object->$key = $value; - } - } - return $object; - } - - //returns file path up to /coral/ - static public function getCORALPath(){ - $pagePath = $_SERVER["DOCUMENT_ROOT"]; - - $currentFile = $_SERVER["SCRIPT_NAME"]; - $parts = Explode('/', $currentFile); - for($i=0; $i. +** +************************************************************************************************************************** +*/ + + +class Utility { + + static public function unixTimeFromMysqlTimestamp($timestamp) { + + // taken from Dan Green, and then modified to be correct + // http://www.weberdev.com/get_example-1427.html + + $year = substr($timestamp,0,4); + $month = substr($timestamp,5,2); + $day = substr($timestamp,8,2); + $hour = substr($timestamp,11,2); + $minute = substr($timestamp,14,2); + $second = substr($timestamp,17,2); + $newdate = mktime($hour,$minute,$second,$month,$day,$year); + + return $newdate; + + } + + static public function secondsFromDays($days) { + return $days * 24 * 60 * 60; + } + + static public function objectFromArray($array) { + $object = new DynamicObject; + foreach ($array as $key => $value) { + if (is_array($value)) { + $object->$key = Utility::objectFromArray($value); + } else { + $object->$key = $value; + } + } + return $object; + } + + //returns file path up to /coral/ + static public function getCORALPath(){ + $pagePath = $_SERVER["DOCUMENT_ROOT"]; + + $currentFile = $_SERVER["SCRIPT_NAME"]; + $parts = Explode('/', $currentFile); + for($i=0; $i \ No newline at end of file diff --git a/admin/classes/domain/ImportLog.php b/admin/classes/domain/ImportLog.php index e5b991a..9a09000 100755 --- a/admin/classes/domain/ImportLog.php +++ b/admin/classes/domain/ImportLog.php @@ -1,187 +1,186 @@ -. -** -************************************************************************************************************************** -*/ - -class ImportLog extends DatabaseObject { - - protected function defineRelationships() {} - - protected function overridePrimaryKeyName() {} - - - static public function shortStatusFromDetails($details){ - //first, find if titles were processed - preg_match('/[0-9]+ titles processed/i', $details, $matches); - $titles = str_replace(" processed", "", $matches[0]); - - if ($titles){ - if (preg_match("/finished/i", $details)){ - $status = $titles . " (via sushi)"; - }else{ - $status = $titles; - } - - }else{ - - if (preg_match("/fail/i", $details)){ - $status = "Failed"; - }elseif (preg_match("/finished/i", $details)){ - $status = "awaiting import"; - } - - } - - return $status; - - } - - - //returns array of Platform records - public function getPlatforms(){ - - //now formulate query - $query = "SELECT platformID - FROM ImportLogPlatformLink - WHERE importLogID = '" . $this->importLogID . "'"; - - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - - $searchArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['platformID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($searchArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($searchArray, $resultArray); - } - } - - return $searchArray; - - - } - - - - //returns array of import log records - public function getImportLogRecords($limit){ - - if ($limit != ""){ - $limitStatement = " LIMIT " . $limit; - }else{ - $limitStatement = ""; - } - - - //now formulate query - $query = "SELECT importLogID, loginID, importDateTime dateTime, fileName, archiveFileURL, logFileURL, details - FROM ImportLog - ORDER BY importDateTime DESC " . $limitStatement; - - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - - $searchArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['importLogID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($searchArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($searchArray, $resultArray); - } - } - - return $searchArray; - - - } - - - - //returns array of import log records from user "sushi" - public function getSushiImports(){ - - //now formulate query - $query = "SELECT importLogID, loginID, importDateTime, fileName, archiveFileURL, logFileURL, details - FROM ImportLog - WHERE loginID = 'sushi' - AND fileName is not null - AND ucase(details) not like '%FAIL%' - ORDER BY importDateTime DESC"; - - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - - $searchArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['importLogID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($searchArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($searchArray, $resultArray); - } - } - - return $searchArray; - - - } - - - - -} - +. +** +************************************************************************************************************************** +*/ + +class ImportLog extends DatabaseObject { + + protected function defineRelationships() {} + + protected function overridePrimaryKeyName() {} + + + static public function shortStatusFromDetails($details){ + //first, find if titles were processed + preg_match('/[0-9]+ titles processed/i', $details, $matches); + if (isset($matches[0])) { + $titles = str_replace(" processed", "", $matches[0]); + } + + if (isset($titles)){ + if (preg_match("/finished/i", $details)){ + $status = $titles . _(" (via sushi)"); + }else{ + $status = $titles; + } + }else{ + if (preg_match("/fail/i", $details)){ + $status = _("Failed"); + }elseif (preg_match("/finished/i", $details)){ + $status = ""._("awaiting import").""; + } else { + $status = null; + } + } + return $status; + } + + + //returns array of Platform records + public function getPlatforms(){ + + //now formulate query + $query = "SELECT platformID + FROM ImportLogPlatformLink + WHERE importLogID = '" . $this->importLogID . "'"; + + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + + $searchArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['platformID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($searchArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($searchArray, $resultArray); + } + } + + return $searchArray; + + + } + + + + //returns array of import log records + public function getImportLogRecords($limit){ + + if ($limit != ""){ + $limitStatement = " LIMIT " . $limit; + }else{ + $limitStatement = ""; + } + + + //now formulate query + $query = "SELECT importLogID, loginID, importDateTime dateTime, fileName, archiveFileURL, logFileURL, details + FROM ImportLog + ORDER BY importDateTime DESC " . $limitStatement; + + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + + $searchArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['importLogID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($searchArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($searchArray, $resultArray); + } + } + + return $searchArray; + + + } + + + + //returns array of import log records from user "sushi" + public function getSushiImports(){ + + //now formulate query + $query = "SELECT importLogID, loginID, importDateTime, fileName, archiveFileURL, logFileURL, details + FROM ImportLog + WHERE loginID = 'sushi' + AND fileName is not null + AND ucase(details) not like '%FAIL%' + ORDER BY importDateTime DESC"; + + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + + $searchArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['importLogID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($searchArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($searchArray, $resultArray); + } + } + + return $searchArray; + + + } + + + + +} + ?> \ No newline at end of file diff --git a/admin/classes/domain/Platform.php b/admin/classes/domain/Platform.php index 25af66e..fa2bcaf 100755 --- a/admin/classes/domain/Platform.php +++ b/admin/classes/domain/Platform.php @@ -1,1052 +1,1054 @@ -. -** -************************************************************************************************************************** -*/ - -class Platform extends DatabaseObject { - - protected function defineRelationships() {} - - protected function overridePrimaryKeyName() {} - - - protected function defineAttributes() { - $this->addAttribute('platformID'); - $this->addAttribute('organizationID'); - $this->addAttribute('name'); - $this->addAttribute('reportDisplayName'); - $this->addAttribute('reportDropDownInd'); - } - - - - //override of database object all() function - //returns array of all platform objects - needed for proper ordering - public function all(){ - - $query = "SELECT * - FROM Platform - ORDER BY name;"; - - $result = $this->db->processQuery($query, 'assoc'); - - $objects = array(); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['platformID'])){ - $object = new Platform(new NamedArguments(array('primaryKey' => $result['platformID']))); - array_push($objects, $object); - }else{ - foreach ($result as $row) { - $object = new Platform(new NamedArguments(array('primaryKey' => $row['platformID']))); - array_push($objects, $object); - } - } - - return $objects; - } - - //returns array of publisher platform note objects - public function getPlatformNotes(){ - - $query = "SELECT * - FROM PlatformNote - WHERE platformID='" . $this->platformID . "';"; - - $result = $this->db->processQuery($query, 'assoc'); - - $objects = array(); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['platformNoteID'])){ - $object = new PlatformNote(new NamedArguments(array('primaryKey' => $result['platformNoteID']))); - array_push($objects, $object); - }else{ - foreach ($result as $row) { - $object = new PlatformNote(new NamedArguments(array('primaryKey' => $row['platformNoteID']))); - array_push($objects, $object); - } - } - - return $objects; - } - - //returns array of importlog objects - public function getImportLogs(){ - - $query = "SELECT * - FROM ImportLog - WHERE importLogID IN (select importLogID from ImportLogPlatformLink WHERE platformID ='" . $this->platformID . "') - Order by importDateTime desc;"; - - $result = $this->db->processQuery($query, 'assoc'); - - $objects = array(); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['importLogID'])){ - $object = new ImportLog(new NamedArguments(array('primaryKey' => $result['importLogID']))); - array_push($objects, $object); - }else{ - foreach ($result as $row) { - $object = new ImportLog(new NamedArguments(array('primaryKey' => $row['importLogID']))); - array_push($objects, $object); - } - } - - return $objects; - } - - - //returns most recent date of the last month of imports for any titles under this platform - public function getLastImportDate(){ - - $query = "SELECT max(concat(year,'-',month,'-01')) max_month - FROM MonthlyUsageSummary tsm INNER JOIN Title USING (titleID), PublisherPlatform pp - WHERE pp.publisherPlatformID = tsm.publisherPlatformID - AND pp.platformID = '" . $this->platformID . "';"; - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - if (isset($result['max_month'])){ - return $result['max_month']; - } - - } - - - - - //returns array of import log records from user "sushi" - public function removeFailedSushiImports(){ - - //now formulate query - $query = "DELETE FROM ImportLog - WHERE loginID = 'sushi' - AND importLogID IN (SELECT importLogID FROM ImportLogPlatformLink WHERE platformID = '" . $this->platformID . "') - AND ucase(details) like '%FAIL%'"; - - - return $this->db->processQuery($query); - - } - - - - - - - //returns array of platforms - used on publisherPlatformList.php - public function getPlatformArray(){ - - - //now formulate query - $query = "SELECT * FROM Platform ORDER BY name;"; - - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - - $allArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['platformID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($allArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($allArray, $resultArray); - } - } - - return $allArray; - - - } - - - //returns array of external login objects - public function getExternalLogins(){ - - $query = "SELECT * - FROM ExternalLogin - WHERE platformID='" . $this->platformID . "';"; - - $result = $this->db->processQuery($query, 'assoc'); - - $objects = array(); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['externalLoginID'])){ - $object = new ExternalLogin(new NamedArguments(array('primaryKey' => $result['externalLoginID']))); - array_push($objects, $object); - }else{ - foreach ($result as $row) { - $object = new ExternalLogin(new NamedArguments(array('primaryKey' => $row['externalLoginID']))); - array_push($objects, $object); - } - } - - return $objects; - } - - - //returns array of titles and identifiers - public function getJournalTitles(){ - - $query = "SELECT DISTINCT t.titleID titleID, t.title title, - MAX(IF(ti.identifierType='DOI', identifier, null)) doi, - MAX(IF(ti.identifierType='Proprietary Identifier', identifier, null)) pi, - MAX(IF(ti.identifierType='ISSN', concat(substr(ti.identifier,1,4), '-', substr(ti.identifier,5,4)),null)) issn, - MAX(IF(ti.identifierType='eISSN', concat(substr(ti.identifier,1,4), '-', substr(ti.identifier,5,4)),null)) eissn - FROM MonthlyUsageSummary mus, PublisherPlatform pp, Title t LEFT JOIN TitleIdentifier ti ON t.titleID = ti.titleID - WHERE pp.publisherPlatformID = mus.publisherPlatformID - AND mus.titleID = t.titleID - AND pp.platformID = '" . $this->platformID . "' - AND t.resourceType='Journal' - GROUP BY t.titleID, t.title - ORDER BY title;"; - - $result = $this->db->processQuery($query, 'assoc'); - - $allArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['titleID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($allArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($allArray, $resultArray); - } - } - - return $allArray; - } - - - - //returns array of titles and identifiers - public function getBookTitles(){ - - $query = "SELECT DISTINCT t.titleID titleID, t.title title, - MAX(IF(ti.identifierType='DOI', identifier, null)) doi, - MAX(IF(ti.identifierType='Proprietary Identifier', identifier, null)) pi, - MAX(IF(ti.identifierType='ISBN', identifier, null)) isbn, - MAX(IF(ti.identifierType='ISSN', concat(substr(ti.identifier,1,4), '-', substr(ti.identifier,5,4)),null)) issn - FROM MonthlyUsageSummary mus, PublisherPlatform pp, Title t LEFT JOIN TitleIdentifier ti ON t.titleID = ti.titleID - WHERE pp.publisherPlatformID = mus.publisherPlatformID - AND mus.titleID = t.titleID - AND pp.platformID = '" . $this->platformID . "' - AND t.resourceType='Book' - GROUP BY t.titleID, t.title - ORDER BY title;"; - - $result = $this->db->processQuery($query, 'assoc'); - - $allArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['titleID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($allArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($allArray, $resultArray); - } - } - - return $allArray; - } - - //returns array of titles and identifiers - public function getDatabaseTitles(){ - - $query = "SELECT DISTINCT t.titleID titleID, t.title title - FROM MonthlyUsageSummary mus, PublisherPlatform pp, Title t - WHERE pp.publisherPlatformID = mus.publisherPlatformID - AND mus.titleID = t.titleID - AND t.resourceType='Database' - AND pp.platformID = '" . $this->platformID . "' - GROUP BY t.titleID, t.title - ORDER BY title;"; - - $result = $this->db->processQuery($query, 'assoc'); - - $allArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['titleID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($allArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($allArray, $resultArray); - } - } - - return $allArray; - } - - - - //returns array of publisher platform objects - public function getPublisherPlatforms(){ - - $query = "SELECT publisherPlatformID - FROM PublisherPlatform pp, Publisher - WHERE pp.publisherID = Publisher.publisherID - AND platformID = '" . $this->platformID . "' - ORDER BY Publisher.name;"; - - - $result = $this->db->processQuery($query, 'assoc'); - - $objects = array(); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['publisherPlatformID'])){ - $object = new PublisherPlatform(new NamedArguments(array('primaryKey' => $result['publisherPlatformID']))); - array_push($objects, $object); - }else{ - $db = new DBService; - foreach ($result as $row) { - $object = new PublisherPlatform(new NamedArguments(array('primaryKey' => $row['publisherPlatformID'],'db'=>$db))); - array_push($objects, $object); - } - } - - return $objects; - } - - - - //returns array of monthly outlier records - public function getMonthlyOutliers($resourceType, $archiveInd, $year, $month){ - - - //now formulate query - $query = "select monthlyUsageSummaryID, Title, archiveInd, usageCount, overrideUsageCount, color - from MonthlyUsageSummary tsm, Title t, Outlier o, PublisherPlatform pp - where tsm.titleID = t.titleID - and o.outlierID = tsm.outlierID - and pp.publisherPlatformID = tsm.publisherPlatformID - and platformID='" . $this->platformID . "' - and archiveInd='" . $archiveInd . "' - and resourceType='" . $resourceType . "' - and year='" . $year . "' - and month='" . $month . "' and ignoreOutlierInd = 0 - order by 1,2,3;"; - - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - - $allArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['monthlyUsageSummaryID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($allArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($allArray, $resultArray); - } - } - - return $allArray; - - - } - - - - //returns array of yearly override records - public function getYearlyOverrides($resourceType, $archiveInd, $year){ - - //now formulate query - $query = "SELECT DISTINCT yearlyUsageSummaryID, Title, totalCount, ytdHTMLCount, ytdPDFCount, overrideTotalCount, overrideHTMLCount, overridePDFCount - FROM YearlyUsageSummary tsy, MonthlyUsageSummary tsm, Title t, PublisherPlatform pp - WHERE tsy.titleID = t.titleID - AND tsm.publisherPlatformID = tsy.publisherPlatformID - AND tsm.titleID = tsy.titleID - AND tsm.year = tsy.year - AND tsm.archiveInd = tsy.archiveInd - AND tsm.outlierID > 0 - AND pp.publisherPlatformID = tsm.publisherPlatformID - AND pp.platformID='" . $this->platformID . "' - AND tsy.archiveInd='" . $archiveInd . "' - AND tsy.year='" . $year . "' - AND t.resourceType='" . $resourceType . "' - AND ignoreOutlierInd = 0;"; - - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - - $allArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['yearlyUsageSummaryID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($allArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($allArray, $resultArray); - } - } - - return $allArray; - - - } - - - - //returns array of full statistics info for display - public function getFullStatsDetails($resourceType = null){ - - if ($resourceType){ - $addWhere = "AND t.resourceType = '" . $resourceType . "'"; - } - - //now formulate query - $query = "SELECT DISTINCT resourceType, year, GROUP_CONCAT(DISTINCT concat(month, '|', if(ignoreOutlierInd=0,ifnull(outlierID,0),0)) ORDER BY month, 1 SEPARATOR ',') months, archiveInd, MAX(month) max_month, MIN(month) min_month, MAX(IF(ignoreOutlierInd=0,outlierID,null)) outlierID - FROM PublisherPlatform pp, MonthlyUsageSummary tsm INNER JOIN Title t USING (titleID) - WHERE pp.platformID = '" . $this->platformID . "' - AND pp.publisherPlatformID = tsm.publisherPlatformID " . $addWhere . " - GROUP BY resourceType, year, archiveInd - ORDER BY resourceType desc, year desc, archiveInd, month;"; - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - - $allArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['year'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($allArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($allArray, $resultArray); - } - } - - return $allArray; - - - } - - - - - //returns array of months available for a given year - public function getAvailableMonths($resourceType, $archiveInd, $year){ - - //now formulate query - if ($year){ - $addWhere = " AND year = '" . $year . "'"; - } - if ($archiveInd){ - $addWhere .= " AND archiveInd = '" . $archiveInd . "'"; - } - if ($resourceType){ - $addWhere = " AND resourceType = '" . $resourceType . "'"; - } - - $query = "SELECT DISTINCT year, month, archiveInd - FROM MonthlyUsageSummary tsm INNER JOIN Title USING (titleID), PublisherPlatform pp - WHERE pp.publisherPlatformID = tsm.publisherPlatformID - AND pp.platformID = '" . $this->platformID . "'" . $addWhere . " - ORDER BY year, archiveInd, month;"; - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - - $allArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['month'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($allArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($allArray, $resultArray); - } - } - - return $allArray; - - - } - - - //remove an entire month for this platform - public function deleteMonth($resourceType, $archiveInd, $year, $month){ - - //now formulate query - $query = "DELETE FROM MonthlyUsageSummary - WHERE publisherPlatformID IN - (SELECT publisherPlatformID - FROM PublisherPlatform - WHERE platformID = '" . $this->platformID . "') - AND year = '" . $year . "' - AND month = '" . $month . "' - AND titleID IN (select titleID from Title where resourceType = '" . $resourceType . "') - AND archiveInd = '" . $archiveInd . "';"; - - return $this->db->processQuery($query); - - } - - - - //returns array total stats devided by month - public function getStatMonthlyTotals($resourceType, $archiveInd, $year){ - - //now formulate query - $query = "SELECT pp.platformID, - SUM(IF(month='1',usageCount,null)) january, - SUM(IF(month='2',usageCount,null)) february, - SUM(IF(month='3',usageCount,null)) march, - SUM(IF(month='4',usageCount,null)) april, - SUM(IF(month='5',usageCount,null)) may, - SUM(IF(month='6',usageCount,null)) june, - SUM(IF(month='7',usageCount,null)) july, - SUM(IF(month='8',usageCount,null)) august, - SUM(IF(month='9',usageCount,null)) september, - SUM(IF(month='10',usageCount,null)) october, - SUM(IF(month='11',usageCount,null)) november, - SUM(IF(month='12',usageCount,null)) december - FROM Title t, MonthlyUsageSummary tsm, PublisherPlatform pp, Publisher p - WHERE t.titleID = tsm.titleID - AND tsm.publisherPlatformID = pp.publisherPlatformID - AND pp.publisherID = p.publisherID - AND pp.platformID = '" . $this->platformID . "' - AND tsm.year='" . $year . "' - AND tsm.archiveInd = '" . $archiveInd . "' - AND t.resourceType = '" . $resourceType . "' - GROUP BY pp.platformID;"; - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['platformID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - } - - return $resultArray; - - - } - - - - - - - //returns array total stats devided by month - public function getStatYearlyTotals($resourceType, $archiveInd, $year){ - - //now formulate query - $query = "SELECT pp.platformID, SUM(totalCount) totalCount, SUM(ytdHTMLCount) ytdHTMLCount, SUM(ytdPDFCount) ytdPDFCount - FROM YearlyUsageSummary yus, PublisherPlatform pp, MonthlyUsageSummary mus INNER JOIN Title t ON (mus.titleID = t.titleID) - WHERE pp.publisherPlatformID = yus.publisherPlatformID - AND pp.platformID = '" . $this->platformID . "' - AND yus.archiveInd ='" . $archiveInd . "' - AND yus.year='" . $year . "' - AND yus.titleID=mus.titleID - AND mus.publisherPlatformID = yus.publisherPlatformID - AND mus.year = '" . $year . "' - AND mus.archiveInd = '" . $archiveInd . "' - AND t.resourceType = '" . $resourceType . "' - AND mus.month = '1' - GROUP BY pp.platformID;"; - - - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['platformID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - } - - return $resultArray; - - - } - - - - - //returns arrays of monthly statistics by title - public function getMonthlyStats($resourceType, $archiveInd, $year){ - - //now formulate query - $query = "SELECT pp.publisherPlatformID, t.titleID, t.Title, Publisher.name Publisher, Platform.name Platform, - MAX(IF(month='1',usageCount,null)) january, - MAX(IF(month='2',usageCount,null)) february, - MAX(IF(month='3',usageCount,null)) march, - MAX(IF(month='4',usageCount,null)) april, - MAX(IF(month='5',usageCount,null)) may, - MAX(IF(month='6',usageCount,null)) june, - MAX(IF(month='7',usageCount,null)) july, - MAX(IF(month='8',usageCount,null)) august, - MAX(IF(month='9',usageCount,null)) september, - MAX(IF(month='10',usageCount,null)) october, - MAX(IF(month='11',usageCount,null)) november, - MAX(IF(month='12',usageCount,null)) december, - MAX(IF(month='1',outlierID,0)) january_outlier, - MAX(IF(month='2',outlierID,0)) february_outlier, - MAX(IF(month='3',outlierID,0)) march_outlier, - MAX(IF(month='4',outlierID,0)) april_outlier, - MAX(IF(month='5',outlierID,0)) may_outlier, - MAX(IF(month='6',outlierID,0)) june_outlier, - MAX(IF(month='7',outlierID,0)) july_outlier, - MAX(IF(month='8',outlierID,0)) august_outlier, - MAX(IF(month='9',outlierID,0)) september_outlier, - MAX(IF(month='10',outlierID,0)) october_outlier, - MAX(IF(month='11',outlierID,0)) november_outlier, - MAX(IF(month='12',outlierID,0)) december_outlier, - MAX(mergeInd) mergeInd, activityType - FROM Title t, MonthlyUsageSummary tsm, PublisherPlatform pp, Publisher, Platform - WHERE t.titleID = tsm.titleID - AND tsm.publisherPlatformID = pp.publisherPlatformID - AND pp.publisherID = Publisher.publisherID - AND pp.platformID = Platform.platformID - AND pp.platformID = '" . $this->platformID . "' - AND tsm.year='" . $year . "' - AND tsm.archiveInd = '" . $archiveInd . "' - AND t.resourceType = '" . $resourceType . "' - GROUP BY t.titleID, t.Title, activityType - ORDER BY t.Title;"; - - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - - $allArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['publisherPlatformID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($allArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($allArray, $resultArray); - } - } - - return $allArray; - - - } - - - - - //returns platform object from name - public function getByName($platformName){ - - $query = "select platformID from Platform where upper(name) = upper('" . str_replace("'","''", $platformName) . "') LIMIT 1;"; - - $result = $this->db->processQuery($query, 'assoc'); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['platformID'])){ - $obj = new Platform(new NamedArguments(array('primaryKey' => $result['platformID']))); - return $obj; - }else{ - return false; - } - - } - - - - //returns array of month counts available for a given year - public function getTotalMonths($resourceType, $archiveInd, $year){ - - //now formulate query - $query = "SELECT COUNT(month) count_months, MIN(month) min_month, MAX(month) max_month - FROM MonthlyUsageSummary mus INNER JOIN Title t USING (titleID), PublisherPlatform pp - WHERE mus.publisherPlatformID = pp.publisherPlatformID - AND year = '" . $year . "' - AND pp.PlatformID = '" . $this->platformID . "' - AND resourceType = '" . $resourceType . "' - AND archiveInd=$archiveInd;"; - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['count_months'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - } - - return $resultArray; - - - } - - - - - - - - - //search used for the autocomplete - public function searchOrganizations($q){ - $config = new Configuration; - - $q = str_replace("+", " ",$q); - $q = str_replace("%", "&",$q); - - $orgArray = array(); - - //if the org module is installed get the org names from org database - if ($config->settings->organizationsModule == 'Y'){ - - $dbName = $config->settings->organizationsDatabaseName; - - - $query = "SELECT CONCAT(A.name, ' (', O.name, ')') name, O.organizationID - FROM " . $dbName . ".Alias A, " . $dbName . ".Organization O - WHERE A.organizationID=O.organizationID - AND upper(A.name) like upper('%" . $q . "%') - UNION - SELECT name, organizationID - FROM " . $dbName . ".Organization - WHERE upper(name) like upper('%" . $q . "%') - ORDER BY 1;"; - - $result = mysqli_query($this->db->getDatabase(), $query); - - while ($row = mysqli_fetch_assoc($result)){ - $orgArray[] = $row['organizationID'] . "|" . $row['name']; - } - - } - - - return $orgArray; - } - - - - - //search used index page drop down - public function getOrganizationList(){ - $config = new Configuration; - - $orgArray = array(); - - //if the org module is installed get the org names from org database - if ($config->settings->organizationsModule == 'Y'){ - $dbName = $config->settings->organizationsDatabaseName; - $query = "SELECT name, organizationID FROM " . $dbName . ".Organization ORDER BY 1;"; - } - - - $result = $this->db->processQuery($query, 'assoc'); - - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['organizationID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($orgArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($orgArray, $resultArray); - } - } - - return $orgArray; - - } - - - - //go to organizations and get the org name for this platform - public function getOrganizationName(){ - $config = new Configuration; - - //if the org module is installed get the org name from org database - if ($config->settings->organizationsModule == 'Y'){ - $dbName = $config->settings->organizationsDatabaseName; - - $orgArray = array(); - $query = "SELECT name FROM " . $dbName . ".Organization WHERE organizationID = " . $this->organizationID; - - if ($result = mysqli_query($this->db->getDatabase(), $query)){ - - while ($row = mysqli_fetch_assoc($result)){ - return $row['name']; - } - } - } - } - - - //returns array of external login data - public function getOrganizationExternalLogins(){ - $config = new Configuration; - - //if the org module is installed get the org info from org database - if (($config->settings->organizationsModule == 'Y') && ($this->organizationID)){ - $dbName = $config->settings->organizationsDatabaseName; - - $query = "SELECT externalLoginID, ELT.shortName externalLoginType, updateDate, loginURL, emailAddress, username, password, noteText - FROM " . $dbName . ".ExternalLogin EL, " . $dbName . ".ExternalLoginType ELT - WHERE EL.externalLoginTypeID = ELT.externalLoginTypeID - AND organizationID = '" . $this->organizationID . "' - ORDER BY ELT.shortName"; - - $result = $this->db->processQuery($query, 'assoc'); - - $allArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['externalLoginID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($allArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($allArray, $resultArray); - } - } - - return $allArray; - - } - - } - - - - - //used for A-Z on search (index) - public function getAlphabeticalList(){ - $allArray = array(); - $result = $this->db->processQuery("SELECT DISTINCT UPPER(SUBSTR(TRIM(LEADING 'The ' FROM name),1,1)) letter, COUNT(SUBSTR(TRIM(LEADING 'The ' FROM name),1,1)) letter_count - FROM Platform - GROUP BY SUBSTR(TRIM(LEADING 'The ' FROM name),1,1) - ORDER BY 1;", "assoc"); - - - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['letter'])){ - $allArray = $result; - }else{ - foreach ($result as $row) { - $allArray[$row['letter']] = $row['letter_count']; - } - } - - return $allArray; - } - - - //returns array based on search - public function search($whereAdd, $orderBy, $limit){ - - if (count($whereAdd) > 0){ - $whereStatement = " WHERE " . implode(" AND ", $whereAdd); - }else{ - $whereStatement = ""; - } - - if ($limit != ""){ - $limitStatement = " LIMIT " . $limit; - }else{ - $limitStatement = ""; - } - - - //now actually execute query - $query = "SELECT P.platformID, P.name, P.reportDisplayName, - GROUP_CONCAT(DISTINCT PP.publisherPlatformID ORDER BY PP.reportDisplayName DESC SEPARATOR ':') publishers, - date(importDateTime) last_import, - loginID, - details, - if(serviceDayOfMonth > day(now()), str_to_date(concat(EXTRACT(YEAR_MONTH FROM NOW()), lpad(serviceDayOfMonth,2,'0')), '%Y%m%d'), str_to_date(concat(EXTRACT(YEAR_MONTH FROM NOW()) + 1, lpad(serviceDayOfMonth,2,'0')), '%Y%m%d') ) next_import - FROM - Platform P - LEFT JOIN (PublisherPlatform PP - INNER JOIN Publisher USING (publisherID)) - ON P.PlatformID = PP.PlatformID - LEFT JOIN (SELECT platformID, mil.importLogID, max(importDateTime) importDateTime, loginID, details FROM ImportLog mil INNER JOIN ImportLogPlatformLink mipl USING (ImportLogID) GROUP BY platformID) mil ON P.platformID = mil.platformID - LEFT JOIN SushiService SS ON P.PlatformID = SS.PlatformID - " . $whereStatement . " - GROUP By P.platformID - ORDER BY " . $orderBy . $limitStatement; - - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - $searchArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['platformID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($searchArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($searchArray, $resultArray); - } - } - - return $searchArray; - } - - -} - - -?> +. +** +************************************************************************************************************************** +*/ + +class Platform extends DatabaseObject { + + protected function defineRelationships() {} + + protected function overridePrimaryKeyName() {} + + + protected function defineAttributes() { + $this->addAttribute('platformID'); + $this->addAttribute('organizationID'); + $this->addAttribute('name'); + $this->addAttribute('reportDisplayName'); + $this->addAttribute('reportDropDownInd'); + } + + + + //override of database object all() function + //returns array of all platform objects - needed for proper ordering + public function all(){ + + $query = "SELECT * + FROM Platform + ORDER BY name;"; + + $result = $this->db->processQuery($query, 'assoc'); + + $objects = array(); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['platformID'])){ + $object = new Platform(new NamedArguments(array('primaryKey' => $result['platformID']))); + array_push($objects, $object); + }else{ + foreach ($result as $row) { + $object = new Platform(new NamedArguments(array('primaryKey' => $row['platformID']))); + array_push($objects, $object); + } + } + + return $objects; + } + + //returns array of publisher platform note objects + public function getPlatformNotes(){ + + $query = "SELECT * + FROM PlatformNote + WHERE platformID='" . $this->platformID . "';"; + + $result = $this->db->processQuery($query, 'assoc'); + + $objects = array(); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['platformNoteID'])){ + $object = new PlatformNote(new NamedArguments(array('primaryKey' => $result['platformNoteID']))); + array_push($objects, $object); + }else{ + foreach ($result as $row) { + $object = new PlatformNote(new NamedArguments(array('primaryKey' => $row['platformNoteID']))); + array_push($objects, $object); + } + } + + return $objects; + } + + //returns array of importlog objects + public function getImportLogs(){ + + $query = "SELECT * + FROM ImportLog + WHERE importLogID IN (select importLogID from ImportLogPlatformLink WHERE platformID ='" . $this->platformID . "') + Order by importDateTime desc;"; + + $result = $this->db->processQuery($query, 'assoc'); + + $objects = array(); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['importLogID'])){ + $object = new ImportLog(new NamedArguments(array('primaryKey' => $result['importLogID']))); + array_push($objects, $object); + }else{ + foreach ($result as $row) { + $object = new ImportLog(new NamedArguments(array('primaryKey' => $row['importLogID']))); + array_push($objects, $object); + } + } + + return $objects; + } + + + //returns most recent date of the last month of imports for any titles under this platform + public function getLastImportDate(){ + + $query = "SELECT max(concat(year,'-',month,'-01')) max_month + FROM MonthlyUsageSummary tsm INNER JOIN Title USING (titleID), PublisherPlatform pp + WHERE pp.publisherPlatformID = tsm.publisherPlatformID + AND pp.platformID = '" . $this->platformID . "';"; + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + if (isset($result['max_month'])){ + return $result['max_month']; + } + + } + + + + + //returns array of import log records from user "sushi" + public function removeFailedSushiImports(){ + + //now formulate query + $query = "DELETE FROM ImportLog + WHERE loginID = 'sushi' + AND importLogID IN (SELECT importLogID FROM ImportLogPlatformLink WHERE platformID = '" . $this->platformID . "') + AND ucase(details) like '%FAIL%'"; + + + return $this->db->processQuery($query); + + } + + + + + + + //returns array of platforms - used on publisherPlatformList.php + public function getPlatformArray(){ + + + //now formulate query + $query = "SELECT * FROM Platform ORDER BY name;"; + + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + + $allArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['platformID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($allArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($allArray, $resultArray); + } + } + + return $allArray; + + + } + + + //returns array of external login objects + public function getExternalLogins(){ + + $query = "SELECT * + FROM ExternalLogin + WHERE platformID='" . $this->platformID . "';"; + + $result = $this->db->processQuery($query, 'assoc'); + + $objects = array(); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['externalLoginID'])){ + $object = new ExternalLogin(new NamedArguments(array('primaryKey' => $result['externalLoginID']))); + array_push($objects, $object); + }else{ + foreach ($result as $row) { + $object = new ExternalLogin(new NamedArguments(array('primaryKey' => $row['externalLoginID']))); + array_push($objects, $object); + } + } + + return $objects; + } + + + //returns array of titles and identifiers + public function getJournalTitles(){ + + $query = "SELECT DISTINCT t.titleID titleID, t.title title, + MAX(IF(ti.identifierType='DOI', identifier, null)) doi, + MAX(IF(ti.identifierType='Proprietary Identifier', identifier, null)) pi, + MAX(IF(ti.identifierType='ISSN', concat(substr(ti.identifier,1,4), '-', substr(ti.identifier,5,4)),null)) issn, + MAX(IF(ti.identifierType='eISSN', concat(substr(ti.identifier,1,4), '-', substr(ti.identifier,5,4)),null)) eissn + FROM MonthlyUsageSummary mus, PublisherPlatform pp, Title t LEFT JOIN TitleIdentifier ti ON t.titleID = ti.titleID + WHERE pp.publisherPlatformID = mus.publisherPlatformID + AND mus.titleID = t.titleID + AND pp.platformID = '" . $this->platformID . "' + AND t.resourceType='Journal' + GROUP BY t.titleID, t.title + ORDER BY title;"; + + $result = $this->db->processQuery($query, 'assoc'); + + $allArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['titleID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($allArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($allArray, $resultArray); + } + } + + return $allArray; + } + + + + //returns array of titles and identifiers + public function getBookTitles(){ + + $query = "SELECT DISTINCT t.titleID titleID, t.title title, + MAX(IF(ti.identifierType='DOI', identifier, null)) doi, + MAX(IF(ti.identifierType='Proprietary Identifier', identifier, null)) pi, + MAX(IF(ti.identifierType='ISBN', identifier, null)) isbn, + MAX(IF(ti.identifierType='ISSN', concat(substr(ti.identifier,1,4), '-', substr(ti.identifier,5,4)),null)) issn + FROM MonthlyUsageSummary mus, PublisherPlatform pp, Title t LEFT JOIN TitleIdentifier ti ON t.titleID = ti.titleID + WHERE pp.publisherPlatformID = mus.publisherPlatformID + AND mus.titleID = t.titleID + AND pp.platformID = '" . $this->platformID . "' + AND t.resourceType='Book' + GROUP BY t.titleID, t.title + ORDER BY title;"; + + $result = $this->db->processQuery($query, 'assoc'); + + $allArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['titleID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($allArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($allArray, $resultArray); + } + } + + return $allArray; + } + + //returns array of titles and identifiers + public function getDatabaseTitles(){ + + $query = "SELECT DISTINCT t.titleID titleID, t.title title + FROM MonthlyUsageSummary mus, PublisherPlatform pp, Title t + WHERE pp.publisherPlatformID = mus.publisherPlatformID + AND mus.titleID = t.titleID + AND t.resourceType='Database' + AND pp.platformID = '" . $this->platformID . "' + GROUP BY t.titleID, t.title + ORDER BY title;"; + + $result = $this->db->processQuery($query, 'assoc'); + + $allArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['titleID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($allArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($allArray, $resultArray); + } + } + + return $allArray; + } + + + + //returns array of publisher platform objects + public function getPublisherPlatforms(){ + + $query = "SELECT publisherPlatformID + FROM PublisherPlatform pp, Publisher + WHERE pp.publisherID = Publisher.publisherID + AND platformID = '" . $this->platformID . "' + ORDER BY Publisher.name;"; + + + $result = $this->db->processQuery($query, 'assoc'); + + $objects = array(); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['publisherPlatformID'])){ + $object = new PublisherPlatform(new NamedArguments(array('primaryKey' => $result['publisherPlatformID']))); + array_push($objects, $object); + }else{ + $db = new DBService; + foreach ($result as $row) { + $object = new PublisherPlatform(new NamedArguments(array('primaryKey' => $row['publisherPlatformID'],'db'=>$db))); + array_push($objects, $object); + } + } + + return $objects; + } + + + + //returns array of monthly outlier records + public function getMonthlyOutliers($resourceType, $archiveInd, $year, $month){ + + + //now formulate query + $query = "select monthlyUsageSummaryID, Title, archiveInd, usageCount, overrideUsageCount, color + from MonthlyUsageSummary tsm, Title t, Outlier o, PublisherPlatform pp + where tsm.titleID = t.titleID + and o.outlierID = tsm.outlierID + and pp.publisherPlatformID = tsm.publisherPlatformID + and platformID='" . $this->platformID . "' + and archiveInd='" . $archiveInd . "' + and resourceType='" . $resourceType . "' + and year='" . $year . "' + and month='" . $month . "' and ignoreOutlierInd = 0 + order by 1,2,3;"; + + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + + $allArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['monthlyUsageSummaryID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($allArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($allArray, $resultArray); + } + } + + return $allArray; + + + } + + + + //returns array of yearly override records + public function getYearlyOverrides($resourceType, $archiveInd, $year){ + + //now formulate query + $query = "SELECT DISTINCT yearlyUsageSummaryID, Title, totalCount, ytdHTMLCount, ytdPDFCount, overrideTotalCount, overrideHTMLCount, overridePDFCount + FROM YearlyUsageSummary tsy, MonthlyUsageSummary tsm, Title t, PublisherPlatform pp + WHERE tsy.titleID = t.titleID + AND tsm.publisherPlatformID = tsy.publisherPlatformID + AND tsm.titleID = tsy.titleID + AND tsm.year = tsy.year + AND tsm.archiveInd = tsy.archiveInd + AND tsm.outlierID > 0 + AND pp.publisherPlatformID = tsm.publisherPlatformID + AND pp.platformID='" . $this->platformID . "' + AND tsy.archiveInd='" . $archiveInd . "' + AND tsy.year='" . $year . "' + AND t.resourceType='" . $resourceType . "' + AND ignoreOutlierInd = 0;"; + + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + + $allArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['yearlyUsageSummaryID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($allArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($allArray, $resultArray); + } + } + + return $allArray; + + + } + + + + //returns array of full statistics info for display + public function getFullStatsDetails($resourceType = null){ + + if ($resourceType){ + $addWhere = "AND t.resourceType = '" . $resourceType . "'"; + } else { + $addWhere = ""; + } + + //now formulate query + $query = "SELECT DISTINCT resourceType, year, GROUP_CONCAT(DISTINCT concat(month, '|', if(ignoreOutlierInd=0,ifnull(outlierID,0),0)) ORDER BY month, 1 SEPARATOR ',') months, archiveInd, MAX(month) max_month, MIN(month) min_month, MAX(IF(ignoreOutlierInd=0,outlierID,null)) outlierID + FROM PublisherPlatform pp, MonthlyUsageSummary tsm INNER JOIN Title t USING (titleID) + WHERE pp.platformID = '" . $this->platformID . "' + AND pp.publisherPlatformID = tsm.publisherPlatformID " . $addWhere . " + GROUP BY resourceType, year, archiveInd + ORDER BY resourceType desc, year desc, archiveInd, month;"; + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + + $allArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['year'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($allArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($allArray, $resultArray); + } + } + + return $allArray; + + + } + + + + + //returns array of months available for a given year + public function getAvailableMonths($resourceType, $archiveInd, $year){ + + //now formulate query + if ($year){ + $addWhere = " AND year = '" . $year . "'"; + } + if ($archiveInd){ + $addWhere .= " AND archiveInd = '" . $archiveInd . "'"; + } + if ($resourceType){ + $addWhere = " AND resourceType = '" . $resourceType . "'"; + } + + $query = "SELECT DISTINCT year, month, archiveInd + FROM MonthlyUsageSummary tsm INNER JOIN Title USING (titleID), PublisherPlatform pp + WHERE pp.publisherPlatformID = tsm.publisherPlatformID + AND pp.platformID = '" . $this->platformID . "'" . $addWhere . " + ORDER BY year, archiveInd, month;"; + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + + $allArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['month'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($allArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($allArray, $resultArray); + } + } + + return $allArray; + + + } + + + //remove an entire month for this platform + public function deleteMonth($resourceType, $archiveInd, $year, $month){ + + //now formulate query + $query = "DELETE FROM MonthlyUsageSummary + WHERE publisherPlatformID IN + (SELECT publisherPlatformID + FROM PublisherPlatform + WHERE platformID = '" . $this->platformID . "') + AND year = '" . $year . "' + AND month = '" . $month . "' + AND titleID IN (select titleID from Title where resourceType = '" . $resourceType . "') + AND archiveInd = '" . $archiveInd . "';"; + + return $this->db->processQuery($query); + + } + + + + //returns array total stats devided by month + public function getStatMonthlyTotals($resourceType, $archiveInd, $year){ + + //now formulate query + $query = "SELECT pp.platformID, + SUM(IF(month='1',usageCount,null)) january, + SUM(IF(month='2',usageCount,null)) february, + SUM(IF(month='3',usageCount,null)) march, + SUM(IF(month='4',usageCount,null)) april, + SUM(IF(month='5',usageCount,null)) may, + SUM(IF(month='6',usageCount,null)) june, + SUM(IF(month='7',usageCount,null)) july, + SUM(IF(month='8',usageCount,null)) august, + SUM(IF(month='9',usageCount,null)) september, + SUM(IF(month='10',usageCount,null)) october, + SUM(IF(month='11',usageCount,null)) november, + SUM(IF(month='12',usageCount,null)) december + FROM Title t, MonthlyUsageSummary tsm, PublisherPlatform pp, Publisher p + WHERE t.titleID = tsm.titleID + AND tsm.publisherPlatformID = pp.publisherPlatformID + AND pp.publisherID = p.publisherID + AND pp.platformID = '" . $this->platformID . "' + AND tsm.year='" . $year . "' + AND tsm.archiveInd = '" . $archiveInd . "' + AND t.resourceType = '" . $resourceType . "' + GROUP BY pp.platformID;"; + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['platformID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + } + + return $resultArray; + + + } + + + + + + + //returns array total stats devided by month + public function getStatYearlyTotals($resourceType, $archiveInd, $year){ + + //now formulate query + $query = "SELECT pp.platformID, SUM(totalCount) totalCount, SUM(ytdHTMLCount) ytdHTMLCount, SUM(ytdPDFCount) ytdPDFCount + FROM YearlyUsageSummary yus, PublisherPlatform pp, MonthlyUsageSummary mus INNER JOIN Title t ON (mus.titleID = t.titleID) + WHERE pp.publisherPlatformID = yus.publisherPlatformID + AND pp.platformID = '" . $this->platformID . "' + AND yus.archiveInd ='" . $archiveInd . "' + AND yus.year='" . $year . "' + AND yus.titleID=mus.titleID + AND mus.publisherPlatformID = yus.publisherPlatformID + AND mus.year = '" . $year . "' + AND mus.archiveInd = '" . $archiveInd . "' + AND t.resourceType = '" . $resourceType . "' + AND mus.month = '1' + GROUP BY pp.platformID;"; + + + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['platformID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + } + + return $resultArray; + + + } + + + + + //returns arrays of monthly statistics by title + public function getMonthlyStats($resourceType, $archiveInd, $year){ + + //now formulate query + $query = "SELECT pp.publisherPlatformID, t.titleID, t.Title, Publisher.name Publisher, Platform.name Platform, + MAX(IF(month='1',usageCount,null)) january, + MAX(IF(month='2',usageCount,null)) february, + MAX(IF(month='3',usageCount,null)) march, + MAX(IF(month='4',usageCount,null)) april, + MAX(IF(month='5',usageCount,null)) may, + MAX(IF(month='6',usageCount,null)) june, + MAX(IF(month='7',usageCount,null)) july, + MAX(IF(month='8',usageCount,null)) august, + MAX(IF(month='9',usageCount,null)) september, + MAX(IF(month='10',usageCount,null)) october, + MAX(IF(month='11',usageCount,null)) november, + MAX(IF(month='12',usageCount,null)) december, + MAX(IF(month='1',outlierID,0)) january_outlier, + MAX(IF(month='2',outlierID,0)) february_outlier, + MAX(IF(month='3',outlierID,0)) march_outlier, + MAX(IF(month='4',outlierID,0)) april_outlier, + MAX(IF(month='5',outlierID,0)) may_outlier, + MAX(IF(month='6',outlierID,0)) june_outlier, + MAX(IF(month='7',outlierID,0)) july_outlier, + MAX(IF(month='8',outlierID,0)) august_outlier, + MAX(IF(month='9',outlierID,0)) september_outlier, + MAX(IF(month='10',outlierID,0)) october_outlier, + MAX(IF(month='11',outlierID,0)) november_outlier, + MAX(IF(month='12',outlierID,0)) december_outlier, + MAX(mergeInd) mergeInd, activityType + FROM Title t, MonthlyUsageSummary tsm, PublisherPlatform pp, Publisher, Platform + WHERE t.titleID = tsm.titleID + AND tsm.publisherPlatformID = pp.publisherPlatformID + AND pp.publisherID = Publisher.publisherID + AND pp.platformID = Platform.platformID + AND pp.platformID = '" . $this->platformID . "' + AND tsm.year='" . $year . "' + AND tsm.archiveInd = '" . $archiveInd . "' + AND t.resourceType = '" . $resourceType . "' + GROUP BY t.titleID, t.Title, activityType + ORDER BY t.Title;"; + + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + + $allArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['publisherPlatformID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($allArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($allArray, $resultArray); + } + } + + return $allArray; + + + } + + + + + //returns platform object from name + public function getByName($platformName){ + + $query = "select platformID from Platform where upper(name) = upper('" . str_replace("'","''", $platformName) . "') LIMIT 1;"; + + $result = $this->db->processQuery($query, 'assoc'); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['platformID'])){ + $obj = new Platform(new NamedArguments(array('primaryKey' => $result['platformID']))); + return $obj; + }else{ + return false; + } + + } + + + + //returns array of month counts available for a given year + public function getTotalMonths($resourceType, $archiveInd, $year){ + + //now formulate query + $query = "SELECT COUNT(month) count_months, MIN(month) min_month, MAX(month) max_month + FROM MonthlyUsageSummary mus INNER JOIN Title t USING (titleID), PublisherPlatform pp + WHERE mus.publisherPlatformID = pp.publisherPlatformID + AND year = '" . $year . "' + AND pp.PlatformID = '" . $this->platformID . "' + AND resourceType = '" . $resourceType . "' + AND archiveInd=$archiveInd;"; + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['count_months'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + } + + return $resultArray; + + + } + + + + + + + + + //search used for the autocomplete + public function searchOrganizations($q){ + $config = new Configuration; + + $q = str_replace("+", " ",$q); + $q = str_replace("%", "&",$q); + + $orgArray = array(); + + //if the org module is installed get the org names from org database + if ($config->settings->organizationsModule == 'Y'){ + + $dbName = $config->settings->organizationsDatabaseName; + + + $query = "SELECT CONCAT(A.name, ' (', O.name, ')') name, O.organizationID + FROM " . $dbName . ".Alias A, " . $dbName . ".Organization O + WHERE A.organizationID=O.organizationID + AND upper(A.name) like upper('%" . $q . "%') + UNION + SELECT name, organizationID + FROM " . $dbName . ".Organization + WHERE upper(name) like upper('%" . $q . "%') + ORDER BY 1;"; + + $result = mysqli_query($this->db->getDatabase(), $query); + + while ($row = mysqli_fetch_assoc($result)){ + $orgArray[] = $row['organizationID'] . "|" . $row['name']; + } + + } + + + return $orgArray; + } + + + + + //search used index page drop down + public function getOrganizationList(){ + $config = new Configuration; + + $orgArray = array(); + + //if the org module is installed get the org names from org database + if ($config->settings->organizationsModule == 'Y'){ + $dbName = $config->settings->organizationsDatabaseName; + $query = "SELECT name, organizationID FROM " . $dbName . ".Organization ORDER BY 1;"; + } + + + $result = $this->db->processQuery($query, 'assoc'); + + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['organizationID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($orgArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($orgArray, $resultArray); + } + } + + return $orgArray; + + } + + + + //go to organizations and get the org name for this platform + public function getOrganizationName(){ + $config = new Configuration; + + //if the org module is installed get the org name from org database + if ($config->settings->organizationsModule == 'Y'){ + $dbName = $config->settings->organizationsDatabaseName; + + $orgArray = array(); + $query = "SELECT name FROM " . $dbName . ".Organization WHERE organizationID = " . $this->organizationID; + + if ($result = mysqli_query($this->db->getDatabase(), $query)){ + + while ($row = mysqli_fetch_assoc($result)){ + return $row['name']; + } + } + } + } + + + //returns array of external login data + public function getOrganizationExternalLogins(){ + $config = new Configuration; + + //if the org module is installed get the org info from org database + if (($config->settings->organizationsModule == 'Y') && ($this->organizationID)){ + $dbName = $config->settings->organizationsDatabaseName; + + $query = "SELECT externalLoginID, ELT.shortName externalLoginType, updateDate, loginURL, emailAddress, username, password, noteText + FROM " . $dbName . ".ExternalLogin EL, " . $dbName . ".ExternalLoginType ELT + WHERE EL.externalLoginTypeID = ELT.externalLoginTypeID + AND organizationID = '" . $this->organizationID . "' + ORDER BY ELT.shortName"; + + $result = $this->db->processQuery($query, 'assoc'); + + $allArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['externalLoginID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($allArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($allArray, $resultArray); + } + } + + return $allArray; + + } + + } + + + + + //used for A-Z on search (index) + public function getAlphabeticalList(){ + $allArray = array(); + $result = $this->db->processQuery("SELECT DISTINCT UPPER(SUBSTR(TRIM(LEADING 'The ' FROM name),1,1)) letter, COUNT(SUBSTR(TRIM(LEADING 'The ' FROM name),1,1)) letter_count + FROM Platform + GROUP BY SUBSTR(TRIM(LEADING 'The ' FROM name),1,1) + ORDER BY 1;", "assoc"); + + + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['letter'])){ + $allArray = $result; + }else{ + foreach ($result as $row) { + $allArray[$row['letter']] = $row['letter_count']; + } + } + + return $allArray; + } + + + //returns array based on search + public function search($whereAdd, $orderBy, $limit){ + + if (count($whereAdd) > 0){ + $whereStatement = " WHERE " . implode(" AND ", $whereAdd); + }else{ + $whereStatement = ""; + } + + if ($limit != ""){ + $limitStatement = " LIMIT " . $limit; + }else{ + $limitStatement = ""; + } + + + //now actually execute query + $query = "SELECT P.platformID, P.name, P.reportDisplayName, + GROUP_CONCAT(DISTINCT PP.publisherPlatformID ORDER BY PP.reportDisplayName DESC SEPARATOR ':') publishers, + date(importDateTime) last_import, + loginID, + details, + if(serviceDayOfMonth > day(now()), str_to_date(concat(EXTRACT(YEAR_MONTH FROM NOW()), lpad(serviceDayOfMonth,2,'0')), '%Y%m%d'), str_to_date(concat(EXTRACT(YEAR_MONTH FROM NOW()) + 1, lpad(serviceDayOfMonth,2,'0')), '%Y%m%d') ) next_import + FROM + Platform P + LEFT JOIN (PublisherPlatform PP + INNER JOIN Publisher USING (publisherID)) + ON P.PlatformID = PP.PlatformID + LEFT JOIN (SELECT platformID, mil.importLogID, max(importDateTime) importDateTime, loginID, details FROM ImportLog mil INNER JOIN ImportLogPlatformLink mipl USING (ImportLogID) GROUP BY platformID) mil ON P.platformID = mil.platformID + LEFT JOIN SushiService SS ON P.PlatformID = SS.PlatformID + " . $whereStatement . " + GROUP By P.platformID + ORDER BY " . $orderBy . $limitStatement; + + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + $searchArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['platformID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($searchArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($searchArray, $resultArray); + } + } + + return $searchArray; + } + + +} + + +?> diff --git a/admin/classes/domain/SushiService.php b/admin/classes/domain/SushiService.php index 4bd0bca..e1e06a7 100755 --- a/admin/classes/domain/SushiService.php +++ b/admin/classes/domain/SushiService.php @@ -1,829 +1,905 @@ -. -** -************************************************************************************************************************** -*/ - -class SushiService extends DatabaseObject { - - protected function defineRelationships() {} - - protected function overridePrimaryKeyName() {} - - public $startDate; - public $endDate; - private $statusLog = array(); - private $detailLog = array(); - - public function getByPlatformID($platformID){ - if (isset($platformID)) { - $query = "SELECT * FROM `$this->tableName` WHERE `platformID` = '$platformID'"; - $result = $this->db->processQuery($query, 'assoc'); - - foreach (array_keys($result) as $attributeName) { - $this->addAttribute($attributeName); - $this->attributes[$attributeName] = $result[$attributeName]; - } - } - } - - public function getByPublisherPlatformID($publisherPlatformID){ - if (isset($publisherPlatformID)) { - $query = "SELECT * FROM `$this->tableName` WHERE `publisherPlatformID` = '$publisherPlatformID'"; - $result = $this->db->processQuery($query, 'assoc'); - - foreach (array_keys($result) as $attributeName) { - $this->addAttribute($attributeName); - $this->attributes[$attributeName] = $result[$attributeName]; - } - } - } - - //returns array of sushi service objects that need to be run on a particular day - public function getByDayOfMonth($serviceDayOfMonth){ - //now formulate query - $query = "SELECT * FROM SushiService WHERE `serviceDayOfMonth` = '$serviceDayOfMonth';"; - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - $objects = array(); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['sushiServiceID'])){ - $object = new SushiService(new NamedArguments(array('primaryKey' => $result['sushiServiceID']))); - array_push($objects, $object); - }else{ - foreach ($result as $row) { - $object = new SushiService(new NamedArguments(array('primaryKey' => $row['sushiServiceID']))); - array_push($objects, $object); - } - } - - return $objects; - } - - - - public function getPublisherOrPlatform(){ - if (($this->platformID != "") && ($this->platformID > 0)){ - return new Platform(new NamedArguments(array('primaryKey' => $this->platformID))); - }else{ - return new PublisherPlatform(new NamedArguments(array('primaryKey' => $this->publisherPlatformID))); - } - } - - - public function getServiceProvider(){ - return str_replace('"','',$this->getPublisherOrPlatform->reportDisplayName); - } - - - - - public function failedImports(){ - $query = "SELECT ipl.platformID, ss.sushiServiceID, date(il.importDateTime), details, il.importLogID - FROM ImportLog il - INNER JOIN ImportLogPlatformLink ipl USING (ImportLogID) - INNER JOIN SushiService ss ON (ss.platformID = ipl.platformID) - INNER JOIN (SELECT platformID, max(importLogID) importLogID, max(importDateTime) importDateTime FROM ImportLog mil INNER JOIN ImportLogPlatformLink mipl USING (ImportLogID) GROUP BY platformID) mil ON (mil.importLogID = il.importLogID) - WHERE ucase(details) like '%FAIL%' - ORDER BY il.importDateTime desc"; - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - $searchArray = array(); - $importArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['platformID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($importArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($importArray, $resultArray); - } - } - - return $importArray; - - } - - public function allServices(){ - $query = "SELECT ss.platformID, ss.publisherPlatformID, sushiServiceID, serviceURL, reportLayouts, releaseNumber, - if(serviceDayOfMonth > day(now()), str_to_date(concat(EXTRACT(YEAR_MONTH FROM NOW()), lpad(serviceDayOfMonth,2,'0')), '%Y%m%d'), str_to_date(concat(EXTRACT(YEAR_MONTH FROM NOW()) + 1, lpad(serviceDayOfMonth,2,'0')), '%Y%m%d') ) next_import - FROM SushiService ss - LEFT JOIN Platform p on (p.platformID = ss.platformID) - LEFT JOIN PublisherPlatform pp - INNER JOIN Publisher pub USING(publisherID) - ON (pp.publisherPlatformID = ss.publisherPlatformID) - ORDER BY p.name, pub.name"; - - $result = $this->db->processQuery(stripslashes($query), 'assoc'); - - $searchArray = array(); - $importArray = array(); - - //need to do this since it could be that there's only one result and this is how the dbservice returns result - if (isset($result['platformID'])){ - - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($importArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($importArray, $resultArray); - } - } - - return $importArray; - - } - - - //run through ajax function on publisherplatform - public function runTest(){ - $reportLayouts = $this->reportLayouts; - $rlArray = explode(";", $reportLayouts); - - //just default test import dates to just be january 1 - 31 of this year - $sDate = date_format(date_create_from_format("Ymd", date("Y")."0101"), "Y-m-d"); - $eDate = date_format(date_create_from_format("Ymd", date("Y")."0131"), "Y-m-d"); - $this->setImportDates($sDate, $eDate); - - - foreach($rlArray as $reportLayout){ - $xmlFile = $this->sushiTransfer($reportLayout); - } - - if ($reportLayouts == ""){ - echo "At least one report type must be set up!"; - }else{ - echo "Connection test successful!"; - } - - } - - //run through post or through sushi scheduler - public function runAll($overwritePlatform = TRUE){ - $reportLayouts = $this->reportLayouts; - $rlArray = explode(";", $reportLayouts); - - $detailsForOutput = array(); - - foreach($rlArray as $reportLayout){ - $this->statusLog = array(); - $this->detailLog = array(); - - $xmlFile = $this->sushiTransfer($reportLayout); - $this->parseXML($xmlFile, $reportLayout, $overwritePlatform); - - $detailsForOutput = $this->statusLog; - } - - if ($reportLayouts == ""){ - return "No report types are set up!"; - } - - return implode("\n", $detailsForOutput); - } - - - - - - public function setDefaultImportDates(){ - - // Determine the End Date - //start with first day of this month - $endDate = date_create_from_format("Ymd", date("Y") . date("m") . "01" ); - - //subtract one day - date_sub($endDate, date_interval_create_from_date_string('1 days')); - $this->endDate = date_format($endDate,"Y-m-d"); - - //Determine the Start Date - //first, get this publisher/platform's last day of import - $lastImportDate = $this->getPublisherOrPlatform->getLastImportDate(); - $lastImportDate = date_create_from_format("Y-m-d", $lastImportDate); - date_add($lastImportDate, date_interval_create_from_date_string('1 month')); - - //if that date is set and it's sooner than the first of this year, default it to that date - if (($lastImportDate) && (date_format($lastImportDate, "Y-m-d") > date_format($endDate, "Y") . "-01-01")){ - $this->startDate = date_format($lastImportDate, "Y-m-d"); - }else{ - $this->startDate = date_format($endDate, "Y") . "-01-01"; - } - - } - - - - public function setImportDates($sDate = null, $eDate = null){ - - if (!$sDate){ - $this->setDefaultImportDates(); - }else{ - //using the multiple functions in order to make sure leading zeros, and this is a date - $this->startDate = date_format(date_create_from_format("Y-m-d", $sDate), "Y-m-d"); - $this->endDate = date_format(date_create_from_format("Y-m-d", $eDate), "Y-m-d"); - } - - } - - - - - //status for storing in DB and displaying in rows - private function logStatus($logText){ - array_push($this->statusLog, $logText); - array_push($this->detailLog, $logText); - } - - //longer log for storing in log file and displaying output - private function log($logText){ - array_push($this->detailLog, $logText); - } - - //logs process to import log table and to log file - public function saveLogAndExit($reportLayout = NULL, $txtFile = NULL, $success = FALSE){ - - - //First, delete any preexisting Failured records, these shouldn't be needed/interesting after this. - $this->log("Cleaning up prior failed import logs...."); - - $this->getPublisherOrPlatform->removeFailedSushiImports; - - if (!$txtFile){ - $txtFile = strtotime("now") . '.txt'; - } - $logFileLocation = 'logs/' . $txtFile; - - $this->log("Log File Name: $logFileLocation"); - - if ($success){ - $this->logStatus("Finished processing " . $this->getServiceProvider . ": $reportLayout."); - } - - //save the actual log file - $fp = fopen(BASE_DIR . $logFileLocation, 'w'); - fwrite($fp, implode("\n", $this->detailLog)); - fclose($fp); - - - //save to import log!! - $importLog = new ImportLog(); - $importLog->loginID = "sushi"; - $importLog->layoutCode = $reportLayout; - $importLog->fileName = 'archive/' . $txtFile; - $importLog->archiveFileURL = 'archive/' . $txtFile; - $importLog->logFileURL = $logFileLocation; - $importLog->details = implode("
", $this->statusLog); - - try { - $importLog->save(); - $importLogID = $importLog->primaryKey; - } catch (Exception $e) { - echo $e->getMessage(); - } - - $importLogPlatformLink = new ImportLogPlatformLink(); - $importLogPlatformLink->importLogID = $importLogID; - $importLogPlatformLink->platformID = $this->platformID; - - - try { - $importLogPlatformLink->save(); - } catch (Exception $e) { - echo $e->getMessage(); - } - - if(!$success){ - throw new Exception(implode("\n", $this->detailLog)); - } - - - } - - - - private function soapConnection($wsdl, $parameters){ - - $parameters = array_merge($parameters, array( - "keep_alive" => true, - "connection_timeout"=>1000, - "trace" => 1, - "exceptions" => 1, - "cache_wsdl" => WSDL_CACHE_NONE, - "stream_context" => stream_context_create(array( - 'http' => array('protocol_version' => 1.0, - 'header' => 'Content-Type: application/soap+xml'))) - ) - ); - - try{ - try{ - $client = new SoapClient($wsdl, $parameters); - - //returns soapfault - }catch (Exception $e){ - $error = $e->__toString(); - - //if soap fault returned version mismatch or http headers error, try again with soap 1.2 - if ((preg_match('/Version/i', $error)) || (preg_match('/HTTP/i', $error))){ - - $this->log("Using Soap Version 1.2"); - $parameters = array_merge($parameters, array("soap_version" => SOAP_1_2)); - - //try connection again with 1.2 - $client = new SoapClient($wsdl, $parameters); - } - } - - //throws soap fault - }catch (Exception $e){ - $error = $e->getMessage(); - - $this->logStatus("Failed to establish soap connection: " . $error); - $this->saveLogAndExit(); - } - - $this->log(""); - $this->log("-- Soap Connection successfully completed --"); - $this->log(""); - - return $client; - } - - - - private function sushiTransfer($reportLayout){ - - - - $ppObj = $this->getPublisherOrPlatform(); - $serviceProvider = str_replace('"','',$ppObj->reportDisplayName); - - //if report layout is BR and Release is 3, change it to 1 - if((preg_match('/BR/i', $reportLayout)) && ($this->releaseNumber == "3")){ - $releaseNumber = '1'; - }else{ - $releaseNumber = $this->releaseNumber; - } - - if (($this->wsdlURL == '') || (strtoupper($this->wsdlURL) == 'COUNTER')){ - if ($this->releaseNumber == "4"){ - $wsdl = 'http://www.niso.org/schemas/sushi/counter_sushi4_0.wsdl'; - }else{ - $wsdl = 'http://www.niso.org/schemas/sushi/counter_sushi3_0.wsdl'; - } - }else{ - $wsdl=$this->wsdlURL; - } - - - - $createDate = date("Y-m-d\TH:i:s.0\Z"); - $id = uniqid("CORAL:", true); - - // look at $Security to ses if it uses an extension - if(preg_match('/Extension=/i', $this->security)){ - $extensions = array(); - $varlist = explode(";", $this->security); - foreach( $varlist as $params){ - list($extVar, $extVal) = explode("=", $params); - $extensions[$extVar] = $extVal; - if ($extVar == 'Extension'){ - $extension = $extVal; - } - } - } - - if (!empty($extension)){ - include BASE_DIR . 'sushiincludes/extension_'.$extension.'.inc.php'; - }else{ - if (preg_match("/http/i", $this->security)){ - $this->log("Using HTTP Basic authentication via login and password."); - - $parameters = array( - 'login' => $this->login, - 'password' => $this->password, - 'location' => $this->serviceURL, - ); - }else{ - if ((strtoupper($this->wsdlURL) != 'COUNTER') && ($this->wsdlURL != '')){ - $this->log("Using provided wsdl: $wsdl"); - $parameters = array(); - - }else{ - $this->log("Using COUNTER wsdl, connecting to $this->serviceURL"); - $parameters = array('location'=> $this->serviceURL); - } - } - - $client = $this->soapConnection($wsdl, $parameters); - } - - if (preg_match("/wsse/i", $this->security)){ - // Prepare SoapHeader parameters - $strWSSENS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; - $objSoapVarUser = new SoapVar($this->login, XSD_STRING, NULL, $strWSSENS, NULL, $strWSSENS); - $objSoapVarPass = new SoapVar($this->password, XSD_STRING, NULL, $strWSSENS, NULL, $strWSSENS); - $objWSSEAuth = new clsWSSEAuth($objSoapVarUser, $objSoapVarPass); - $objSoapVarWSSEAuth = new SoapVar($objWSSEAuth, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'UsernameToken', $strWSSENS); - $objWSSEToken = new clsWSSEToken($objSoapVarWSSEAuth); - $objSoapVarWSSEToken = new SoapVar($objWSSEToken, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'UsernameToken', $strWSSENS); - $objSoapVarHeaderVal=new SoapVar($objSoapVarWSSEToken, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'Security', $strWSSENS); - $objSoapVarWSSEHeader = new SoapHeader($strWSSENS, 'Security', $objSoapVarHeaderVal,false); - - // Prepare Soap Client - try{ - $client->__setSoapHeaders(array($objSoapVarWSSEHeader)); - }catch (Exception $e){ - $error = $e->getMessage(); - $this->logStatus("Failed to connect to $serviceProvider: " . $error); - $this->log("Tried: " . var_dump($client)); - $this->saveLogAndExit($reportLayout); - } - - } - - try{ - $reportRequest = array - ('Requestor' => array - ('ID' => $this->requestorID, - 'Name' => 'CORAL Processing', - 'Email' => $this->requestorID - ), - 'CustomerReference' => array - ('ID' => $this->customerID, - 'Name' => 'CORAL Processing' - ), - 'ReportDefinition' => array - ('Filters' => array - ('UsageDateRange' => array - ('Begin' => $this->startDate, - 'End' => $this->endDate - ) - ), - 'Name' => $reportLayout, - 'Release' => $releaseNumber - ), - 'Created' => $createDate, - 'ID' => $id, - 'connection_timeout' => 1000 - ); - - $result = $client->GetReport($reportRequest); - }catch(Exception $e){ - $error = $e->getMessage(); - - $this->logStatus("Exception performing GetReport with connection to $serviceProvider: $error"); - - //exceptions seem to happen that don't matter, continue processing and if no data or error is found then it will quit. - //$this->saveLogAndExit($reportLayout); - } - - $xml = $client->__getLastResponse(); - - $fname = $serviceProvider.'_'.$reportLayout.'_'.$this->startDate.'_'.$this->endDate.'.xml'; - $replace="_"; - $pattern="/([[:alnum:]_\.-]*)/"; - $fname = 'sushistore/' . str_replace(str_split(preg_replace($pattern,$replace,$fname)),$replace,$fname); - - $xmlFileName = BASE_DIR . $fname; - file_put_contents($xmlFileName, $xml); - - //open file to look for errors - $reader = new XMLReader(); - if (!$reader->open($xmlFileName)) { - $this->logStatus("Failed trying to open XML File: " . $xmlFileName . ". This could be due to not having write access to the /sushistore/ directory."); - $this->saveLogAndExit($reportLayout); - } - - while ($reader->read()) { - if ($reader->nodeType == XMLReader::ELEMENT){ - if ($reader->localName == 'Severity') { - $reader->read(); - $severity = trim($reader->value); - } - if ($reader->localName == 'Message') { - $reader->read(); - $message = trim($reader->value); - } - - } - } - - $reader->close(); - - if ($message !=""){ - if (($severity == "Error") || (stripos($message, "Error") !== FALSE)){ - $this->logStatus("Failed to request report from $serviceProvider: " . $message); - - $this->log("Please fix the settings for this provider and try again."); - $this->saveLogAndExit($reportLayout); - }else{ - $this->logStatus("$serviceProvider says: $severity: $message"); - } - } - - $this->log("$reportLayout successfully retrieved from $serviceProvider for start date: $this->startDate, end date: $this->endDate"); - - $this->log(""); - $this->log("-- Sushi Transfer completed --"); - - return $fname; - - - } - - - - private function parseXML($fName, $reportLayout, $overwritePlatform){ - - - ////////////////////////////////////// - //PARSE XML!! - ////////////////////////////////////// - - $serviceProvider = $this->getServiceProvider(); - $xmlFileName = BASE_DIR . $fName; - - //read layouts ini file to get the available layouts - $layoutsArray = parse_ini_file(BASE_DIR . "layouts.ini", true); - $layoutColumns = array(); - - $reader = new XMLReader(); - if (!$reader->open($xmlFileName, 'UTF-8')) { - $this->logStatus("Failed trying to open XML File: " . $xmlFileName . ". This could be due to not having write access to the /sushistore/ directory."); - $this->saveLogAndExit($reportLayout); - } - - - $layoutCode = ""; - $countArray = array(); - - while ($reader->read()) { - //First - get report information - if (($reader->nodeType == XMLReader::ELEMENT) && ($reader->localName == 'Report') && (count($layoutColumns) == '0')) { - $name = $reader->getAttribute("Name"); - $version = $reader->getAttribute("Version"); - - $layoutCode = $name; - - if (($version == "3") || ($version =="4")){ - $version = "R" . $version; - } - if ($version != ''){ - $layoutCode .= "_" . $version; - }else{ - $layoutCode .= "_R" . $this->releaseNumber; - } - - //At this point, determine the format of the report to port to csv from the layouts.ini file - $layoutKey = $layoutsArray[ReportTypes][$layoutCode]; - $layoutColumns = $layoutsArray[$layoutKey]['columns']; - - - //if this way of determining layout was unsuccessful, just use the layout sent in - if (count($layoutColumns) == "0"){ - $layoutCode = $reportLayout . "_R" . $this->releaseNumber; - - $layoutKey = $layoutsArray[ReportTypes][$layoutCode]; - $layoutColumns = $layoutsArray[$layoutKey]['columns']; - } - - $this->log("Layout validated successfully against layouts.ini : " . $layoutCode); - - - } - - if (($reader->nodeType == XMLReader::ELEMENT) && ($reader->localName == 'ReportItems')) { - if ((count($layoutColumns) == '0') || ($layoutCode == '')){ - $this->logStatus("Failed determining layout: Reached report items before establishing layout. Please make sure this layout is set up in layouts.ini"); - $this->saveLogAndExit($reportLayout); - } - - //reset variables - $identifierArray=array(); - $reportArray = array(); - - //loop through each element under "Item" - while ($reader->read()) { - - //get the element name - if ($reader->nodeType == XMLReader::ELEMENT){ - $elementName = trim($reader->localName); - - //move to next to get the text - if (($elementName != "Instance") && ($elementName != "ItemIdentifier") && ($elementName != "Period")){ - $reader->read(); - } - - - - if ($reader->nodeType == XMLReader::TEXT - || $reader->nodeType == XMLReader::CDATA - || $reader->nodeType == XMLReader::WHITESPACE - || $reader->nodeType == XMLReader::SIGNIFICANT_WHITESPACE) { - $elementValue = trim($reader->value); - - switch ($elementName) { - case 'ItemPlatform': - if ($overwritePlatform){ - $reportArray['platform'] = $serviceProvider; - }else{ - $reportArray['platform'] = $elementValue; - } - - break; - case 'ItemPublisher': - $reportArray['publisher'] = $elementValue; - break; - case 'ItemName': - $reportArray['title'] = $elementValue; - break; - case 'ActivityType': - $reportArray['activityType'] = strtoupper($reader->value); - break; - case 'Type': - $idType = strtoupper($reader->value); - break; - case 'Value': - $identifierArray[$idType] = $reader->value; - break; - case 'Begin': - $date = new DateTime($reader->value); - - if (strtolower($date->format('M')) != $m){ - $totalCountsArray[$m] = $countArray; - - $m = strtolower($date->format('M')); - $y = strtolower($date->format('Y')); - - $countArray = array(); - } - - break; - case 'MetricType': - $metricType = strtoupper($reader->value); - - //make sure metric types have conformity - if (!(strpos($metricType,'HTML') === false)){ - $metricType ='html'; - }else if (!(strpos($metricType,'PDF') === false)){ - $metricType ='pdf'; - }else{ - $metricType ='ytd'; - } - - break; - case 'Count': - $countArray[$metricType] = $reader->value; - break; - } - - - } - - //Finished parsing the Title!!! - }else if ($reader->nodeType == XMLReader::END_ELEMENT - && $reader->localName == "ReportItems") { - - foreach($identifierArray as $key => $value){ - if (!(strrpos($key,'PRINT') === false) && !(strrpos($key,'ISSN') === false)){ - $reportArray['issn'] = $value; - }else if (!(strrpos($key,'ONLINE') === false) && !(strrpos($key,'ISSN') === false)){ - $reportArray['eissn'] = $value; - }else if (!(strpos($key,'PRINT') === false) && !(strpos($key,'ISBN') === false)){ - $reportArray['isbn'] = $value; - }else if (!(strpos($key,'ONLINE') === false) && !(strpos($key,'ISBN') === false)){ - $reportArray['eisbn'] = $value; - }else if (!(strpos($key,'DOI') === false)){ - $reportArray['doi'] = $value; - }else if (!(strpos($key,'PROPRIETARY') === false)){ - $reportArray['pi']=$value; - } - - } - - //get the last array into the totals array - $totalCountsArray[$m] = $countArray; - - //now figure out the months and the ytd, etc totals - foreach ($totalCountsArray as $key => $countArray){ - - if ($key != ''){ - - if (intval($countArray['ytd']) == "0"){ - $reportArray[$key] = intval($countArray['pdf']) + intval($countArray['html']); - }else{ - $reportArray[$key] = intval($countArray['ytd']); - } - - $reportArray['ytd'] += intval($countArray['ytd']); - $reportArray['ytdPDF'] += intval($countArray['pdf']); - $reportArray['ytdHTML'] += intval($countArray['html']); - } - - } - - - //Now look at the report's layoutcode's columns to order them properly - $finalArray=array(); - foreach($layoutColumns as $colName){ - $finalArray[] = $reportArray[$colName]; - } - - $txtOut .= implode($finalArray,"\t") . "\n"; - - $totalCountsArray=array(); - break; - } - } - } - - } - - $reader->close(); - - if (($layoutKey == "") || (count($layoutColumns) == '0') || ($txtOut == "")){ - if (file_exists($xmlFileName)) { - $this->logStatus("Failed XML parsing or no data was found."); - - $xml = simplexml_load_file($xmlFileName); - $this->log("The following is the XML response:"); - - $this->log(htmlentities(file_get_contents($xmlFileName))); - - }else{ - $this->log("Failed loading XML file. Please verify you have write permissions on /sushistore/ directory."); - } - - $this->saveLogAndExit($layoutCode); - } - - #Save final text delimited "file" and log output on server - $txtFile = strtotime("now") . '.txt'; - $fp = fopen(BASE_DIR . 'archive/' . $txtFile, 'w'); - fwrite($fp, $txtOut); - fclose($fp); - - - $this->log(""); - $this->log("-- Sushi XML parsing completed --"); - - $this->log("Archive/Text File Name: " . $utility->getPageURL . 'archive/' . $txtFile); - - $this->saveLogAndExit($layoutCode, $txtFile, true); - } - -} - - -//for soap headers -class clsWSSEAuth{ - private $username; - private $password; - function __construct($username, $password){ - $this->username=$username; - $this->password=$password; - } -} -class clsWSSEToken{ - private $usernameToken; - function __construct ($innerVal){ - $this->usernameToken = $innerVal; - } -} - - - -?> +. +** +************************************************************************************************************************** +*/ + +class SushiService extends DatabaseObject { + + protected function defineRelationships() {} + + protected function overridePrimaryKeyName() {} + + public $startDate; + public $endDate; + private $statusLog = array(); + private $detailLog = array(); + + public function getByPlatformID($platformID){ + if (isset($platformID)) { + $query = "SELECT * FROM `$this->tableName` WHERE `platformID` = '$platformID'"; + $result = $this->db->processQuery($query, 'assoc'); + + foreach (array_keys($result) as $attributeName) { + $this->addAttribute($attributeName); + $this->attributes[$attributeName] = $result[$attributeName]; + } + } + } + + public function getByPublisherPlatformID($publisherPlatformID){ + if (isset($publisherPlatformID)) { + $query = "SELECT * FROM `$this->tableName` WHERE `publisherPlatformID` = '$publisherPlatformID'"; + $result = $this->db->processQuery($query, 'assoc'); + + foreach (array_keys($result) as $attributeName) { + $this->addAttribute($attributeName); + $this->attributes[$attributeName] = $result[$attributeName]; + } + } + } + + //returns array of sushi service objects that need to be run on a particular day + public function getByDayOfMonth($serviceDayOfMonth){ + //now formulate query + $query = "SELECT * FROM SushiService WHERE `serviceDayOfMonth` = '$serviceDayOfMonth';"; + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + $objects = array(); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['sushiServiceID'])){ + $object = new SushiService(new NamedArguments(array('primaryKey' => $result['sushiServiceID']))); + array_push($objects, $object); + }else{ + foreach ($result as $row) { + $object = new SushiService(new NamedArguments(array('primaryKey' => $row['sushiServiceID']))); + array_push($objects, $object); + } + } + + return $objects; + } + + + + public function getPublisherOrPlatform(){ + if (($this->platformID != "") && ($this->platformID > 0)){ + return new Platform(new NamedArguments(array('primaryKey' => $this->platformID))); + }else{ + return new PublisherPlatform(new NamedArguments(array('primaryKey' => $this->publisherPlatformID))); + } + } + + + public function getServiceProvider(){ + return str_replace('"','',$this->getPublisherOrPlatform->reportDisplayName); + } + + + + + public function failedImports(){ + $query = "SELECT ipl.platformID, ss.sushiServiceID, date(il.importDateTime), details, il.importLogID + FROM ImportLog il + INNER JOIN ImportLogPlatformLink ipl USING (ImportLogID) + INNER JOIN SushiService ss ON (ss.platformID = ipl.platformID) + INNER JOIN (SELECT platformID, max(importLogID) importLogID, max(importDateTime) importDateTime FROM ImportLog mil INNER JOIN ImportLogPlatformLink mipl USING (ImportLogID) GROUP BY platformID) mil ON (mil.importLogID = il.importLogID) + WHERE ucase(details) like '%FAIL%' + ORDER BY il.importDateTime desc"; + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + $resultArray = array(); + $importArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['platformID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($importArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($importArray, $resultArray); + } + } + + return $importArray; + + } + + public function allServices(){ + $query = "SELECT ss.platformID, ss.publisherPlatformID, sushiServiceID, serviceURL, reportLayouts, releaseNumber, + if(serviceDayOfMonth > day(now()), str_to_date(concat(EXTRACT(YEAR_MONTH FROM NOW()), lpad(serviceDayOfMonth,2,'0')), '%Y%m%d'), str_to_date(concat(EXTRACT(YEAR_MONTH FROM NOW()) + 1, lpad(serviceDayOfMonth,2,'0')), '%Y%m%d') ) next_import + FROM SushiService ss + LEFT JOIN Platform p on (p.platformID = ss.platformID) + LEFT JOIN PublisherPlatform pp + INNER JOIN Publisher pub USING(publisherID) + ON (pp.publisherPlatformID = ss.publisherPlatformID) + ORDER BY p.name, pub.name"; + + $result = $this->db->processQuery(stripslashes($query), 'assoc'); + + $resultArray = array(); + $importArray = array(); + + //need to do this since it could be that there's only one result and this is how the dbservice returns result + if (isset($result['platformID'])){ + + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($importArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($importArray, $resultArray); + } + } + + return $importArray; + + } + + + //run through ajax function on publisherplatform + public function runTest(){ + $reportLayouts = $this->reportLayouts; + $rlArray = explode(";", $reportLayouts); + + //just default test import dates to just be january 1 - 31 of this year + $sDate = date_format(date_create_from_format("Ymd", date("Y")."0101"), "Y-m-d"); + $eDate = date_format(date_create_from_format("Ymd", date("Y")."0131"), "Y-m-d"); + $this->setImportDates($sDate, $eDate); + + + foreach($rlArray as $reportLayout){ + $xmlFile = $this->sushiTransfer($reportLayout); + } + + if ($reportLayouts == ""){ + echo _("At least one report type must be set up!"); + }else{ + echo _("Connection test successful!"); + } + + } + + //run through post or through sushi scheduler + public function runAll($overwritePlatform = TRUE){ + $reportLayouts = $this->reportLayouts; + $rlArray = explode(";", $reportLayouts); + + $detailsForOutput = array(); + + foreach($rlArray as $reportLayout){ + $this->statusLog = array(); + $this->detailLog = array(); + + $xmlFile = $this->sushiTransfer($reportLayout); + $this->parseXML($xmlFile, $reportLayout, $overwritePlatform); + + $detailsForOutput = $this->statusLog; + } + + if ($reportLayouts == ""){ + return _("No report types are set up!"); + } + + return implode("\n", $detailsForOutput); + } + + + + + + public function setDefaultImportDates(){ + + // Determine the End Date + //start with first day of this month + $endDate = date_create_from_format("Ymd", date("Y") . date("m") . "01" ); + + //subtract one day + date_sub($endDate, date_interval_create_from_date_string('1 days')); + $this->endDate = date_format($endDate,"Y-m-d"); + + //Determine the Start Date + //first, get this publisher/platform's last day of import + $lastImportDate = $this->getPublisherOrPlatform->getLastImportDate(); + $lastImportDate = date_create_from_format("Y-m-d", $lastImportDate); + date_add($lastImportDate, date_interval_create_from_date_string('1 month')); + + //if that date is set and it's sooner than the first of this year, default it to that date + if (($lastImportDate) && (date_format($lastImportDate, "Y-m-d") > date_format($endDate, "Y") . "-01-01")){ + $this->startDate = date_format($lastImportDate, "Y-m-d"); + }else{ + $this->startDate = date_format($endDate, "Y") . "-01-01"; + } + + } + + + + public function setImportDates($sDate = null, $eDate = null){ + + if (!$sDate){ + $this->setDefaultImportDates(); + }else{ + //using the multiple functions in order to make sure leading zeros, and this is a date + $this->startDate = date_format(date_create_from_format("Y-m-d", $sDate), "Y-m-d"); + $this->endDate = date_format(date_create_from_format("Y-m-d", $eDate), "Y-m-d"); + } + + } + + + + + //status for storing in DB and displaying in rows + private function logStatus($logText){ + array_push($this->statusLog, $logText); + array_push($this->detailLog, $logText); + } + + //longer log for storing in log file and displaying output + private function log($logText){ + array_push($this->detailLog, $logText); + } + + //logs process to import log table and to log file + public function saveLogAndExit($reportLayout = NULL, $txtFile = NULL, $success = FALSE){ + + + //First, delete any preexisting Failured records, these shouldn't be needed/interesting after this. + $this->log("Cleaning up prior failed import logs...."); + + $this->getPublisherOrPlatform->removeFailedSushiImports; + + if (!$txtFile){ + $txtFile = strtotime("now") . '.txt'; + } + $logFileLocation = 'logs/' . $txtFile; + + $this->log("Log File Name: $logFileLocation"); + + if ($success){ + $this->logStatus("Finished processing " . $this->getServiceProvider . ": $reportLayout."); + } + + //save the actual log file + $fp = fopen(BASE_DIR . $logFileLocation, 'w'); + fwrite($fp, implode("\n", $this->detailLog)); + fclose($fp); + + + //save to import log!! + $importLog = new ImportLog(); + $importLog->loginID = "sushi"; + $importLog->layoutCode = $reportLayout; + $importLog->fileName = 'archive/' . $txtFile; + $importLog->archiveFileURL = 'archive/' . $txtFile; + $importLog->logFileURL = $logFileLocation; + $importLog->details = implode("
", $this->statusLog); + + try { + $importLog->save(); + $importLogID = $importLog->primaryKey; + } catch (Exception $e) { + echo $e->getMessage(); + } + + $importLogPlatformLink = new ImportLogPlatformLink(); + $importLogPlatformLink->importLogID = $importLogID; + $importLogPlatformLink->platformID = $this->platformID; + + + try { + $importLogPlatformLink->save(); + } catch (Exception $e) { + echo $e->getMessage(); + } + + if(!$success){ + throw new Exception(implode("\n", $this->detailLog)); + } + + + } + + + + private function soapConnection($wsdl, $parameters){ + + $parameters = array_merge($parameters, array( + "keep_alive" => true, + "connection_timeout"=>1000, + "trace" => 1, + "exceptions" => 1, + "cache_wsdl" => WSDL_CACHE_NONE, + "stream_context" => stream_context_create(array( + 'http' => array('protocol_version' => 1.0, + 'header' => 'Content-Type: application/soap+xml'))) + ) + ); + + try{ + try{ + $client = new SoapClient($wsdl, $parameters); + + //returns soapfault + }catch (Exception $e){ + $error = $e->__toString(); + + //if soap fault returned version mismatch or http headers error, try again with soap 1.2 + if ((preg_match('/Version/i', $error)) || (preg_match('/HTTP/i', $error))){ + + $this->log("Using Soap Version 1.2"); + $parameters = array_merge($parameters, array("soap_version" => SOAP_1_2)); + + //try connection again with 1.2 + $client = new SoapClient($wsdl, $parameters); + } + } + + //throws soap fault + }catch (Exception $e){ + $error = $e->getMessage(); + + $this->logStatus("Failed to establish soap connection: " . $error); + $this->saveLogAndExit(); + } + + $this->log(""); + $this->log("-- Soap Connection successfully completed --"); + $this->log(""); + + return $client; + } + + + + private function sushiTransfer($reportLayout){ + + + + $ppObj = $this->getPublisherOrPlatform(); + $serviceProvider = str_replace('"','',$ppObj->reportDisplayName); + + //if report layout is BR and Release is 3, change it to 1 + if((preg_match('/BR/i', $reportLayout)) && ($this->releaseNumber == "3")){ + $releaseNumber = '1'; + }else{ + $releaseNumber = $this->releaseNumber; + } + + if (($this->wsdlURL == '') || (strtoupper($this->wsdlURL) == 'COUNTER')){ + if ($this->releaseNumber == "4"){ + $wsdl = 'http://www.niso.org/schemas/sushi/counter_sushi4_0.wsdl'; + }else{ + $wsdl = 'http://www.niso.org/schemas/sushi/counter_sushi3_0.wsdl'; + } + }else{ + $wsdl=$this->wsdlURL; + } + + + + $createDate = date("Y-m-d\TH:i:s.0\Z"); + $id = uniqid("CORAL:", true); + + // look at $Security to ses if it uses an extension + if(preg_match('/Extension=/i', $this->security)){ + $extensions = array(); + $varlist = explode(";", $this->security); + foreach( $varlist as $params){ + list($extVar, $extVal) = explode("=", $params); + $extensions[$extVar] = $extVal; + if ($extVar == 'Extension'){ + $extension = $extVal; + } + } + } + + if (!empty($extension)){ + include BASE_DIR . 'sushiincludes/extension_'.$extension.'.inc.php'; + }else{ + if (preg_match("/http/i", $this->security)){ + $this->log("Using HTTP Basic authentication via login and password."); + + $parameters = array( + 'login' => $this->login, + 'password' => $this->password, + 'location' => $this->serviceURL, + ); + }else{ + if ((strtoupper($this->wsdlURL) != 'COUNTER') && ($this->wsdlURL != '')){ + $this->log("Using provided wsdl: $wsdl"); + $parameters = array(); + + }else{ + $this->log("Using COUNTER wsdl, connecting to $this->serviceURL"); + $parameters = array('location'=> $this->serviceURL); + } + } + + $client = $this->soapConnection($wsdl, $parameters); + } + + if (preg_match("/wsse/i", $this->security)){ + // Prepare SoapHeader parameters + $strWSSENS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; + $objSoapVarUser = new SoapVar($this->login, XSD_STRING, NULL, $strWSSENS, NULL, $strWSSENS); + $objSoapVarPass = new SoapVar($this->password, XSD_STRING, NULL, $strWSSENS, NULL, $strWSSENS); + $objWSSEAuth = new clsWSSEAuth($objSoapVarUser, $objSoapVarPass); + $objSoapVarWSSEAuth = new SoapVar($objWSSEAuth, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'UsernameToken', $strWSSENS); + $objWSSEToken = new clsWSSEToken($objSoapVarWSSEAuth); + $objSoapVarWSSEToken = new SoapVar($objWSSEToken, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'UsernameToken', $strWSSENS); + $objSoapVarHeaderVal=new SoapVar($objSoapVarWSSEToken, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'Security', $strWSSENS); + $objSoapVarWSSEHeader = new SoapHeader($strWSSENS, 'Security', $objSoapVarHeaderVal,false); + + // Prepare Soap Client + try{ + $client->__setSoapHeaders(array($objSoapVarWSSEHeader)); + }catch (Exception $e){ + $error = $e->getMessage(); + $this->logStatus("Failed to connect to $serviceProvider: " . $error); + $this->log("Tried: " . var_dump($client)); + $this->saveLogAndExit($reportLayout); + } + + } + $uStartArray = explode("-",$this->startDate); + $usd = $uStartArray[2];//the start day used to find the unix timestamp for the start date + $usm = $uStartArray[1];//the start month used to find the unix timestamp for the start date + $usy = $uStartArray[0];//the start year used to find the unix timestamp for the start date + $uStartDate = mktime(0,0,0,$usm,$usd,$usy);//finds the unix timestamp for the start date + //Do exactly the same thing for the end date + $uEndDate = explode("-", $this->endDate); + $ued = $uEndDate[2]; + $uem = $uEndDate[1]; + $uey = $uEndDate[0]; + $uEndDate = mktime(0,0,0,$uem,$ued,$uey); + if (($uEndDate-$uStartDate)<31536000){ + try{ + $reportRequest = array + ('Requestor' => array + ('ID' => $this->requestorID, + 'Name' => 'CORAL Processing', + 'Email' => $this->requestorID + ), + 'CustomerReference' => array + ('ID' => $this->customerID, + 'Name' => 'CORAL Processing' + ), + 'ReportDefinition' => array + ('Filters' => array + ('UsageDateRange' => array + ('Begin' => $this->startDate, + 'End' => $this->endDate + ) + ), + 'Name' => $reportLayout, + 'Release' => $releaseNumber + ), + 'Created' => $createDate, + 'ID' => $id, + 'connection_timeout' => 1000 + ); + $dateError=FALSE; + + $result = $client->GetReport($reportRequest); + }catch(Exception $e){ + $error = $e->getMessage(); + + $this->logStatus("Exception performing GetReport with connection to $serviceProvider: $error"); + + //exceptions seem to happen that don't matter, continue processing and if no data or error is found then it will quit. + //$this->saveLogAndExit($reportLayout); + } + } + else { + $dateError = TRUE; + $this->logStatus("Invalid Dates entered. Must enter a start and end date less than or equal to one year apart."); + } + + $xml = $client->__getLastResponse(); + + $fname = $serviceProvider.'_'.$reportLayout.'_'.$this->startDate.'_'.$this->endDate.'.xml'; + $replace="_"; + $pattern="/([[:alnum:]_\.-]*)/"; + $fname = 'sushistore/' . str_replace(str_split(preg_replace($pattern,$replace,$fname)),$replace,$fname); + + $xmlFileName = BASE_DIR . $fname; + file_put_contents($xmlFileName, $xml); + + //open file to look for errors + $reader = new XMLReader(); + if (!$reader->open($xmlFileName)) { + $this->logStatus("Failed trying to open XML File: " . $xmlFileName . ". This could be due to not having write access to the /sushistore/ directory."); + $this->saveLogAndExit($reportLayout); + } + + $message = ""; + while ($reader->read()) { + if ($reader->nodeType == XMLReader::ELEMENT){ + if ($reader->localName == 'Severity') { + $reader->read(); + $severity = trim($reader->value); + } + if ($reader->localName == 'Message') { + $reader->read(); + $message = trim($reader->value); + } + + } + } + + $reader->close(); + + if ($message !=""){ + if (($severity == "Error") || (stripos($message, "Error") !== FALSE)){ + $this->logStatus("Failed to request report from $serviceProvider: " . $message); + + $this->log("Please fix the settings for this provider and try again."); + $this->saveLogAndExit($reportLayout); + }else{ + $this->logStatus("$serviceProvider says: $severity: $message"); + } + } + if (!$dateError) + $this->log("$reportLayout successfully retrieved from $serviceProvider for start date: $this->startDate, end date: $this->endDate"); + + $this->log(""); + $this->log("-- Sushi Transfer completed --"); + + return $fname; + + + } + + + + private function parseXML($fName, $reportLayout, $overwritePlatform){ + + + ////////////////////////////////////// + //PARSE XML!! + ////////////////////////////////////// + + $serviceProvider = $this->getServiceProvider(); + $xmlFileName = BASE_DIR . $fName; + + //read layouts ini file to get the available layouts + $layoutsArray = parse_ini_file(BASE_DIR . "layouts.ini", true); + $layoutColumns = array(); + + $reader = new XMLReader(); + if (!$reader->open($xmlFileName, 'UTF-8')) { + $this->logStatus("Failed trying to open XML File: " . $xmlFileName . ". This could be due to not having write access to the /sushistore/ directory."); + $this->saveLogAndExit($reportLayout); + } + + + $layoutCode = ""; + $countArray = array('ytd'=>null,'pdf'=>null,'html'=>null); + $txtOut = ""; + $startDateArr = explode("-", $this -> startDate); + $endDateArr = explode("-", $this -> endDate); + $startYear = $startDateArr[0]; + $startMonth = $startDateArr[1]; + $endYear = $endDateArr[0]; + $endMonth = $endDateArr[1]; + $numMonths = 0; + if ($startMonth > $endMonth) + $numMonths = (13 - ($startMonth - $endMonth)); + else if ($endMonth > $startMonth) + $numMonths = ($endMonth - $startMonth); + else + $numMonths = 1; + $m = null; //month + + while ($reader->read()) { + //First - get report information + if (($reader->nodeType == XMLReader::ELEMENT) && ($reader->localName == 'Report') && (count($layoutColumns) == '0')) { + $name = $reader->getAttribute("Name"); + $version = $reader->getAttribute("Version"); + + $layoutCode = $name; + + if (($version == "3") || ($version =="4")){ + $version = "R" . $version; + } + if ($version != ''){ + $layoutCode .= "_" . $version; + }else{ + $layoutCode .= "_R" . $this->releaseNumber; + } + + //At this point, determine the format of the report to port to csv from the layouts.ini file + $layoutKey = $layoutsArray['ReportTypes'][$layoutCode]; + $layoutColumns = $layoutsArray[$layoutKey]['columns']; + + + //if this way of determining layout was unsuccessful, just use the layout sent in + if (count($layoutColumns) == "0"){ + $layoutCode = $reportLayout . "_R" . $this->releaseNumber; + + $layoutKey = $layoutsArray['ReportTypes'][$layoutCode]; + $layoutColumns = $layoutsArray[$layoutKey]['columns']; + + /////////////////////////////////////////////////////// + // Create header for SUSHI file + /////////////////////////////////////////////////////// + $header = $layoutColumns; + $startMonthArray = array('jan' => 1, 'feb' => 2, 'mar' => 3, 'apr' => 4, 'may' => 5, 'jun' => 6, 'jul' => 7, 'aug' => 8, 'sep' => 9, 'oct' => 10, 'nov' => 11, 'dec' => 12); + for ($i = 0; $i < sizeof($header); $i++) { + foreach ($startMonthArray as $monthName => $monthNumber) { + if($header[$i] == $monthName && $monthNumber >= $startMonth) { + $header[$i] .= "-$startYear"; + break; + } + else if ($header[$i] == $monthName && $monthNumber < $startMonth){ + $header[$i] .= "-$endYear"; + break; + } + } + } + for ($i = 12; $i > 0; $i--) { + if ($startMonth > $endMonth && $i < $startMonth && $i > $endMonth) + $header[(count($header) - 13)+$i] .= "-x"; + else if ($endMonth > $startMonth && ($i < $startMonth || $i > $endMonth)) + $header[(count($header) - 13)+$i] .= "-x"; + else if ($endMonth == $startMonth && $i < $startMonth && $i > $endMonth) + $header[(count($header) - 13)+$i] .= "-x"; + } + $txtOut .= implode($header, "\t") . "\n"; + } + + $this->log("Layout validated successfully against layouts.ini : " . $layoutCode); + + + } + + if (($reader->nodeType == XMLReader::ELEMENT) && ($reader->localName == 'ReportItems')) { + if ((count($layoutColumns) == '0') || ($layoutCode == '')){ + $this->logStatus("Failed determining layout: Reached report items before establishing layout. Please make sure this layout is set up in layouts.ini"); + $this->saveLogAndExit($reportLayout); + } + + //reset variables + $identifierArray=array(); + $reportArray = array('ytd'=>null,'ytdHTML'=>null,'ytdPDF'=>null); + + //loop through each element under "Item" + while ($reader->read()) { + + //get the element name + if ($reader->nodeType == XMLReader::ELEMENT){ + $elementName = trim($reader->localName); + + //move to next to get the text + if (($elementName != "Instance") && ($elementName != "ItemIdentifier") && ($elementName != "Period")){ + $reader->read(); + } + + + + if ($reader->nodeType == XMLReader::TEXT + || $reader->nodeType == XMLReader::CDATA + || $reader->nodeType == XMLReader::WHITESPACE + || $reader->nodeType == XMLReader::SIGNIFICANT_WHITESPACE) { + $elementValue = trim($reader->value); + + switch ($elementName) { + case 'ItemPlatform': + if ($overwritePlatform){ + $reportArray['platform'] = $serviceProvider; + }else{ + $reportArray['platform'] = $elementValue; + } + + break; + case 'ItemPublisher': + $reportArray['publisher'] = $elementValue; + break; + case 'ItemName': + $reportArray['title'] = $elementValue; + break; + case 'ActivityType': + $reportArray['activityType'] = strtoupper($reader->value); + break; + case 'Type': + $idType = strtoupper($reader->value); + break; + case 'Value': + $identifierArray[$idType] = $reader->value; + break; + case 'Begin': + $date = new DateTime($reader->value); + if ($m === null) { + $m = strtolower($date->format('M')); + $countArray = array('ytd'=>null,'pdf'=>null,'html'=>null); + } else if (strtolower($date->format('M')) !== $m){ + $totalCountsArray[$m] = $countArray; + + $m = strtolower($date->format('M')); + //$y = strtolower($date->format('Y')); + + $countArray = array('ytd'=>null,'pdf'=>null,'html'=>null); + } + + break; + case 'MetricType': + $metricType = strtoupper($reader->value); + + //make sure metric types have conformity + if (!(strpos($metricType,'HTML') === false)){ + $metricType ='html'; + }else if (!(strpos($metricType,'PDF') === false)){ + $metricType ='pdf'; + }else{ + $metricType ='ytd'; + } + + break; + case 'Count': + $countArray[$metricType] = $reader->value; + break; + } + + + } + + //Finished parsing the Title!!! + }else if ($reader->nodeType == XMLReader::END_ELEMENT + && $reader->localName == "ReportItems") { + + foreach($identifierArray as $key => $value){ + if (!(strrpos($key,'PRINT') === false) && !(strrpos($key,'ISSN') === false)){ + $reportArray['issn'] = $value; + }else if (!(strrpos($key,'ONLINE') === false) && !(strrpos($key,'ISSN') === false)){ + $reportArray['eissn'] = $value; + }else if (!(strpos($key,'PRINT') === false) && !(strpos($key,'ISBN') === false)){ + $reportArray['isbn'] = $value; + }else if (!(strpos($key,'ONLINE') === false) && !(strpos($key,'ISBN') === false)){ + $reportArray['eisbn'] = $value; + }else if (!(strpos($key,'DOI') === false)){ + $reportArray['doi'] = $value; + }else if (!(strpos($key,'PROPRIETARY') === false)){ + $reportArray['pi']=$value; + } + + } + + //get the last array into the totals array + $totalCountsArray[$m] = $countArray; + + //now figure out the months and the ytd, etc totals + foreach ($totalCountsArray as $key => $countArray){ + + if ($key != ''){ + + if (intval($countArray['ytd']) == "0"){ + $reportArray[$key] = intval($countArray['pdf']) + intval($countArray['html']); + }else{ + $reportArray[$key] = intval($countArray['ytd']); + } + + if ($reportArray['ytd']===null) + $reportArray['ytd'] = intval($countArray['ytd']); + else + $reportArray['ytd'] += intval($countArray['ytd']); + + if ($reportArray['ytdPDF']===null) + $reportArray['ytdPDF'] = intval($countArray['pdf']); + else + $reportArray['ytdPDF'] += intval($countArray['pdf']); + + if ($reportArray['ytdHTML']===null) + $reportArray['ytdHTML'] = intval($countArray['html']); + else + $reportArray['ytdHTML'] += intval($countArray['html']); + } + + } + + + //Now look at the report's layoutcode's columns to order them properly + $finalArray=array(); + foreach($layoutColumns as $colName){ + if (isset($reportArray[$colName])) + $finalArray[] = $reportArray[$colName]; + else + $finalArray[] = null; + } + + $txtOut .= implode($finalArray,"\t") . "\n"; + + $totalCountsArray=array(); + break; + } + } + } + + } + + $reader->close(); + + if (($layoutKey == "") || (count($layoutColumns) == '0') || ($txtOut == "")){ + if (file_exists($xmlFileName)) { + $this->logStatus("Failed XML parsing or no data was found."); + + $xml = simplexml_load_file($xmlFileName); + $this->log("The following is the XML response:"); + + $this->log(htmlentities(file_get_contents($xmlFileName))); + + }else{ + $this->log("Failed loading XML file. Please verify you have write permissions on /sushistore/ directory."); + } + + $this->saveLogAndExit($layoutCode); + } + + #Save final text delimited "file" and log output on server + $txtFile = strtotime("now") . '.txt'; + $fp = fopen(BASE_DIR . 'archive/' . $txtFile, 'w'); + fwrite($fp, $txtOut); + fclose($fp); + + + $this->log(""); + $this->log("-- Sushi XML parsing completed --"); + + $this->log("Archive/Text File Name: " . Utility::getPageURL() . 'archive/' . $txtFile); + + $this->saveLogAndExit($layoutCode, $txtFile, true); + } + +} + + +//for soap headers +class clsWSSEAuth{ + private $username; + private $password; + function __construct($username, $password){ + $this->username=$username; + $this->password=$password; + } +} +class clsWSSEToken{ + private $usernameToken; + function __construct ($innerVal){ + $this->usernameToken = $innerVal; + } +} + + + +?> diff --git a/admin/classes/domain/Title.php b/admin/classes/domain/Title.php index e5fa519..fb612bc 100755 --- a/admin/classes/domain/Title.php +++ b/admin/classes/domain/Title.php @@ -1,358 +1,360 @@ -. -** -************************************************************************************************************************** -*/ - -class Title extends DatabaseObject { - - protected function defineRelationships() {} - - protected function overridePrimaryKeyName() {} - - protected function defineAttributes() { - $this->addAttribute('titleID'); - $this->addAttribute('title'); - $this->addAttribute('resourceType'); - } - - //returns identifier (issn, isbn, etc) only of the first print identifier found for this title - public function getIdentifier($idType){ - $query = "SELECT * FROM TitleIdentifier ti - WHERE ti.titleID = '" . $this->titleID . "' - AND identifierType='" . $idType . "' - ORDER BY 1 - LIMIT 1;"; - - $result = $this->db->processQuery($query, 'assoc'); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['titleIdentifierID'])){ - $identifier = $result['identifier']; - return substr($identifier, 0, 4) . "-" . substr($identifier, 4, 4); - }else{ - return; - } - - - } - - - - //find out if there is an existing identifier for a title - public function getExistingIdentifier($identifier){ - - $query = "SELECT distinct identifier - FROM TitleIdentifier ti - WHERE ti.titleID = '" . $this->titleID . "' - AND identifier = '" . $identifier . "' - ORDER BY identifierType DESC - LIMIT 1;"; - - $result = $this->db->processQuery($query, 'assoc'); - - //only one identifier will be returned - if (isset($result['identifier'])){ - return true; - }else{ - return false; - } - - - } - - - //returns array of identifier objects - public function getIdentifiers($idType = null){ - - if($idType){ - $addWhere = " AND identifierType='" . $idType . "'"; - } - - $query = "SELECT * - FROM TitleIdentifier ti - WHERE ti.titleID = '" . $this->titleID . "' " . $addWhere . " - ORDER BY identifierType DESC;"; - - $result = $this->db->processQuery($query, 'assoc'); - - $objects = array(); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['titleIdentifierID'])){ - $object = new TitleIdentifier(new NamedArguments(array('primaryKey' => $result['titleIdentifierID']))); - array_push($objects, $object); - }else{ - foreach ($result as $row) { - $object = new TitleIdentifier(new NamedArguments(array('primaryKey' => $row['titleIdentifierID']))); - array_push($objects, $object); - } - } - - return $objects; - } - - - //returns array of title objects - public function getRelatedTitles(){ - - $query = "SELECT DISTINCT t.titleID - FROM TitleIdentifier ti, Title t, TitleIdentifier ti2 - WHERE ti.titleID = t.titleID - AND ti.identifier = ti2.identifier - AND ti.identifierType = ti2.identifierType - AND ti2.titleID = '" . $this->titleID . "';"; - - $result = $this->db->processQuery($query, 'assoc'); - - $objects = array(); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['titleID'])){ - $object = new Title(new NamedArguments(array('primaryKey' => $result['titleID']))); - array_push($objects, $object); - }else{ - foreach ($result as $row) { - $object = new Title(new NamedArguments(array('primaryKey' => $row['titleID']))); - array_push($objects, $object); - } - } - - return $objects; - } - - - - - //returns array of yearly stats for this title - public function getYearlyStats($archiveInd, $year, $publisherPlatformID, $activityType){ - - $addWhere = ''; - if ($activityType){ - $addWhere=" AND activityType='" . $activityType . "'"; - } - $query = "SELECT titleID, totalCount, ytdHTMLCount, ytdPDFCount - FROM YearlyUsageSummary - WHERE titleID = '" . $this->titleID . "' - AND archiveInd ='" . $archiveInd . "' - AND year='" . $year . "'" . $addWhere . " - AND publisherPlatformID = '" . $publisherPlatformID . "';"; - - $result = $this->db->processQuery($query, 'assoc'); - - $allArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['titleID'])){ - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($allArray, $resultArray); - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - array_push($allArray, $resultArray); - } - } - - return $allArray; - } - - - //returns array of the first listed identifier objects - public function getByTitle($resourceType, $resourceTitle, $pISSN, $eISSN, $pISBN, $eISBN, $publisherPlatformID){ - - //default search to print ISBN only - we're confident that's the same title - if ($pISBN) { - $query = "SELECT DISTINCT ti.titleID as titleID FROM TitleIdentifier ti INNER JOIN Title t USING (titleID) WHERE identifierType = 'ISBN' AND identifier = '" . $pISBN . "' AND t.resourceType = '" . $resourceType . "' LIMIT 1;"; - - //Otherwise try ISSN if it's a journal or there's no p-isbn - } else if (($pISSN) && (($resourceType == "Journal") || (!$pISBN))) { - $query = "SELECT DISTINCT ti.titleID as titleID FROM TitleIdentifier ti INNER JOIN Title t USING (titleID) WHERE identifierType = 'ISSN' AND identifier = '" . $pISSN . "' AND t.resourceType = '" . $resourceType . "' LIMIT 1;"; - - //not so confident about online identifier so we also search on common platform / publisher - }else if ((!$pISBN) && ($eISBN)){ - $query = "SELECT DISTINCT t.titleID as titleID FROM TitleIdentifier ti INNER JOIN Title t ON (ti.titleID = t.titleID) INNER JOIN MonthlyUsageSummary mus ON (mus.titleID = t.titleID) WHERE identifierType = 'eISBN' AND identifier = '" . $eISBN . "' AND publisherPlatformID = '" . $publisherPlatformID . "' AND ucase(title) = ucase('" . $resourceTitle . "') AND t.resourceType = '" . $resourceType . "' LIMIT 1;"; - - - //not so confident about online identifier so we also search on common platform / publisher - }else if ((!$pISSN) && ($eISSN) && ($resourceType == "Journal")){ - $query = "SELECT DISTINCT t.titleID as titleID FROM TitleIdentifier ti INNER JOIN Title t ON (ti.titleID = t.titleID) INNER JOIN MonthlyUsageSummary mus ON (mus.titleID = t.titleID) WHERE identifierType = 'eISSN' AND identifier = '" . $eISSN . "' AND publisherPlatformID = '" . $publisherPlatformID . "' AND ucase(title) = ucase('" . $resourceTitle . "') AND t.resourceType = '" . $resourceType . "' LIMIT 1;"; - - //this is a title search so we're also searching on common platform / publisher (used for Databases probably primarily) - }else if ((!$pISSN) && (!$eISSN) && (!$pISBN) && (!$eISBN)){ - $query = "SELECT DISTINCT t.titleID as titleID FROM Title t INNER JOIN MonthlyUsageSummary mus ON (mus.titleID = t.titleID) WHERE publisherPlatformID = '" . $publisherPlatformID . "' AND ucase(title) = ucase('" . $resourceTitle . "') AND t.resourceType = '" . $resourceType . "' LIMIT 1;"; - } - - $result = $this->db->processQuery($query, 'assoc'); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['titleID'])){ - return $result['titleID']; - }else{ - return false; - } - - } - - - - - //remove an entire month for this title/publisher - public function deleteMonth($archiveInd, $year, $month, $publisherPlatformID){ - - //now formulate query - $query = "DELETE FROM MonthlyUsageSummary - WHERE archiveInd = '" . $archiveInd . "' - AND titleID = '" . $this->titleID . "' - AND publisherPlatformID = '" . $publisherPlatformID . "' - AND year = '" . $year . "' - AND month = '" . $month . "';"; - - return $this->db->processQuery($query); - - } - - - //remove an entire month for this title/publisher - public function deleteYearlyStats($archiveInd, $year, $publisherPlatformID, $activityType){ - - if ($activityType){ - $addWhere = " AND activityType='" . $activityType . "'"; - } - - //now formulate query - $query = "DELETE FROM YearlyUsageSummary - WHERE archiveInd = '" . $archiveInd . "' - AND titleID = '" . $this->titleID . "' - AND publisherPlatformID = '" . $publisherPlatformID . "' " . $addWhere . " - AND year = '" . $year . "';"; - - return $this->db->processQuery($query); - - } - - - //returns usage count only - public function getUsageCountByMonth($archiveInd, $year, $month, $publisherPlatformID){ - - $query = "SELECT usageCount FROM MonthlyUsageSummary - WHERE archiveInd = '" . $archiveInd . "' - AND titleID = '" . $this->titleID . "' - AND publisherPlatformID = '" . $publisherPlatformID . "' - AND year = '" . $year . "' - AND month = '" . $month . "';"; - - - - $result = $this->db->processQuery($query, 'assoc'); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['usageCount'])){ - return $result['usageCount']; - }else{ - return false; - } - - } - - - - - - //returns array of the first listed identifier objects - public function getTotalCountByYear($archiveInd, $year, $publisherPlatformID){ - - $query = "SELECT totalCount usageCount, ytdHTMLCount, ytdPDFCount FROM YearlyUsageSummary - WHERE archiveInd = '" . $archiveInd . "' - AND titleID = '" . $this->titleID . "' - AND publisherPlatformID = '" . $publisherPlatformID . "' - AND year = '" . $year . "';"; - - - - $result = $this->db->processQuery($query, 'assoc'); - - $resultArray = array(); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['usageCount'])){ - $resultArray['usageCount'] = $result['usageCount']; - $resultArray['ytdHTMLCount'] = $result['ytdHTMLCount']; - $resultArray['ytdPDFCount'] = $result['ytdPDFCount']; - - return $resultArray; - }else{ - return false; - } - - } - - - - //returns array of yearly stats for this title - public function get12MonthUsageCount($archiveInd, $publisherPlatformID, $yearAddWhere){ - - $query = "SELECT usageCount FROM MonthlyUsageSummary - WHERE archiveInd = '" . $archiveInd . "' - AND titleID = '" . $this->titleID . "' - AND publisherPlatformID = '" . $publisherPlatformID . "' - AND " . $yearAddWhere . ";"; - - $result = $this->db->processQuery($query, 'assoc'); - - $allArray = array(); - $resultArray = array(); - - //need to do this since it could be that there's only one request and this is how the dbservice returns result - if (isset($result['usageCount'])){ - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - - array_push($allArray, $resultArray); - }else{ - if ($result){ - foreach ($result as $row) { - $resultArray = array(); - if ($resultArray){ - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; - } - } - array_push($allArray, $resultArray); - } - } - } - - return $allArray; - } - - - - - - - - -} - -?> +. +** +************************************************************************************************************************** +*/ + +class Title extends DatabaseObject { + + protected function defineRelationships() {} + + protected function overridePrimaryKeyName() {} + + protected function defineAttributes() { + $this->addAttribute('titleID'); + $this->addAttribute('title'); + $this->addAttribute('resourceType'); + } + + //returns identifier (issn, isbn, etc) only of the first print identifier found for this title + public function getIdentifier($idType){ + $query = "SELECT * FROM TitleIdentifier ti + WHERE ti.titleID = '" . $this->titleID . "' + AND identifierType='" . $idType . "' + ORDER BY 1 + LIMIT 1;"; + + $result = $this->db->processQuery($query, 'assoc'); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['titleIdentifierID'])){ + $identifier = $result['identifier']; + return substr($identifier, 0, 4) . "-" . substr($identifier, 4, 4); + }else{ + return; + } + + + } + + + + //find out if there is an existing identifier for a title + public function getExistingIdentifier($identifier){ + + $query = "SELECT distinct identifier + FROM TitleIdentifier ti + WHERE ti.titleID = '" . $this->titleID . "' + AND identifier = '" . $identifier . "' + ORDER BY identifierType DESC + LIMIT 1;"; + + $result = $this->db->processQuery($query, 'assoc'); + + //only one identifier will be returned + if (isset($result['identifier'])){ + return true; + }else{ + return false; + } + + + } + + + //returns array of identifier objects + public function getIdentifiers($idType = null){ + + if($idType){ + $addWhere = " AND identifierType='" . $idType . "'"; + } + + $query = "SELECT * + FROM TitleIdentifier ti + WHERE ti.titleID = '" . $this->titleID . "' " . $addWhere . " + ORDER BY identifierType DESC;"; + + $result = $this->db->processQuery($query, 'assoc'); + + $objects = array(); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['titleIdentifierID'])){ + $object = new TitleIdentifier(new NamedArguments(array('primaryKey' => $result['titleIdentifierID']))); + array_push($objects, $object); + }else{ + foreach ($result as $row) { + $object = new TitleIdentifier(new NamedArguments(array('primaryKey' => $row['titleIdentifierID']))); + array_push($objects, $object); + } + } + + return $objects; + } + + + //returns array of title objects + public function getRelatedTitles(){ + + $query = "SELECT DISTINCT t.titleID + FROM TitleIdentifier ti, Title t, TitleIdentifier ti2 + WHERE ti.titleID = t.titleID + AND ti.identifier = ti2.identifier + AND ti.identifierType = ti2.identifierType + AND ti2.titleID = '" . $this->titleID . "';"; + + $result = $this->db->processQuery($query, 'assoc'); + + $objects = array(); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['titleID'])){ + $object = new Title(new NamedArguments(array('primaryKey' => $result['titleID']))); + array_push($objects, $object); + }else{ + foreach ($result as $row) { + $object = new Title(new NamedArguments(array('primaryKey' => $row['titleID']))); + array_push($objects, $object); + } + } + + return $objects; + } + + + + + //returns array of yearly stats for this title + public function getYearlyStats($archiveInd, $year, $publisherPlatformID, $activityType){ + + $addWhere = ''; + if ($activityType){ + $addWhere=" AND activityType='" . $activityType . "'"; + } + $query = "SELECT titleID, totalCount, ytdHTMLCount, ytdPDFCount + FROM YearlyUsageSummary + WHERE titleID = '" . $this->titleID . "' + AND archiveInd ='" . $archiveInd . "' + AND year='" . $year . "'" . $addWhere . " + AND publisherPlatformID = '" . $publisherPlatformID . "';"; + + $result = $this->db->processQuery($query, 'assoc'); + + $allArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['titleID'])){ + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($allArray, $resultArray); + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + array_push($allArray, $resultArray); + } + } + + return $allArray; + } + + + //returns array of the first listed identifier objects + public function getByTitle($resourceType, $resourceTitle, $pISSN, $eISSN, $pISBN, $eISBN, $publisherPlatformID){ + + //default search to print ISBN only - we're confident that's the same title + if ($pISBN) { + $query = "SELECT DISTINCT ti.titleID as titleID FROM TitleIdentifier ti INNER JOIN Title t USING (titleID) WHERE identifierType = 'ISBN' AND identifier = '" . $pISBN . "' AND t.resourceType = '" . $resourceType . "' LIMIT 1;"; + + //Otherwise try ISSN if it's a journal or there's no p-isbn + } else if (($pISSN) && (($resourceType == "Journal") || (!$pISBN))) { + $query = "SELECT DISTINCT ti.titleID as titleID FROM TitleIdentifier ti INNER JOIN Title t USING (titleID) WHERE identifierType = 'ISSN' AND identifier = '" . $pISSN . "' AND t.resourceType = '" . $resourceType . "' LIMIT 1;"; + + //not so confident about online identifier so we also search on common platform / publisher + }else if ((!$pISBN) && ($eISBN)){ + $query = "SELECT DISTINCT t.titleID as titleID FROM TitleIdentifier ti INNER JOIN Title t ON (ti.titleID = t.titleID) INNER JOIN MonthlyUsageSummary mus ON (mus.titleID = t.titleID) WHERE identifierType = 'eISBN' AND identifier = '" . $eISBN . "' AND publisherPlatformID = '" . $publisherPlatformID . "' AND ucase(title) = ucase('" . $resourceTitle . "') AND t.resourceType = '" . $resourceType . "' LIMIT 1;"; + + + //not so confident about online identifier so we also search on common platform / publisher + }else if ((!$pISSN) && ($eISSN) && ($resourceType == "Journal")){ + $query = "SELECT DISTINCT t.titleID as titleID FROM TitleIdentifier ti INNER JOIN Title t ON (ti.titleID = t.titleID) INNER JOIN MonthlyUsageSummary mus ON (mus.titleID = t.titleID) WHERE identifierType = 'eISSN' AND identifier = '" . $eISSN . "' AND publisherPlatformID = '" . $publisherPlatformID . "' AND ucase(title) = ucase('" . $resourceTitle . "') AND t.resourceType = '" . $resourceType . "' LIMIT 1;"; + + //this is a title search so we're also searching on common platform / publisher (used for Databases probably primarily) + }else if ((!$pISSN) && (!$eISSN) && (!$pISBN) && (!$eISBN)){ + $query = "SELECT DISTINCT t.titleID as titleID FROM Title t INNER JOIN MonthlyUsageSummary mus ON (mus.titleID = t.titleID) WHERE publisherPlatformID = '" . $publisherPlatformID . "' AND ucase(title) = ucase('" . $resourceTitle . "') AND t.resourceType = '" . $resourceType . "' LIMIT 1;"; + } + + $result = $this->db->processQuery($query, 'assoc'); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['titleID'])){ + return $result['titleID']; + }else{ + return false; + } + + } + + + + + //remove an entire month for this title/publisher + public function deleteMonth($archiveInd, $year, $month, $publisherPlatformID){ + + //now formulate query + $query = "DELETE FROM MonthlyUsageSummary + WHERE archiveInd = '" . $archiveInd . "' + AND titleID = '" . $this->titleID . "' + AND publisherPlatformID = '" . $publisherPlatformID . "' + AND year = '" . $year . "' + AND month = '" . $month . "';"; + + return $this->db->processQuery($query); + + } + + + //remove an entire month for this title/publisher + public function deleteYearlyStats($archiveInd, $year, $publisherPlatformID, $activityType){ + + if ($activityType){ + $addWhere = " AND activityType='" . $activityType . "'"; + } else { + $addWhere = null; + } + + //now formulate query + $query = "DELETE FROM YearlyUsageSummary + WHERE archiveInd = '" . $archiveInd . "' + AND titleID = '" . $this->titleID . "' + AND publisherPlatformID = '" . $publisherPlatformID . "' " . $addWhere . " + AND year = '" . $year . "';"; + + return $this->db->processQuery($query); + + } + + + //returns usage count only + public function getUsageCountByMonth($archiveInd, $year, $month, $publisherPlatformID){ + + $query = "SELECT usageCount FROM MonthlyUsageSummary + WHERE archiveInd = '" . $archiveInd . "' + AND titleID = '" . $this->titleID . "' + AND publisherPlatformID = '" . $publisherPlatformID . "' + AND year = '" . $year . "' + AND month = '" . $month . "';"; + + + + $result = $this->db->processQuery($query, 'assoc'); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['usageCount'])){ + return $result['usageCount']; + }else{ + return false; + } + + } + + + + + + //returns array of the first listed identifier objects + public function getTotalCountByYear($archiveInd, $year, $publisherPlatformID){ + + $query = "SELECT totalCount usageCount, ytdHTMLCount, ytdPDFCount FROM YearlyUsageSummary + WHERE archiveInd = '" . $archiveInd . "' + AND titleID = '" . $this->titleID . "' + AND publisherPlatformID = '" . $publisherPlatformID . "' + AND year = '" . $year . "';"; + + + + $result = $this->db->processQuery($query, 'assoc'); + + $resultArray = array(); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['usageCount'])){ + $resultArray['usageCount'] = $result['usageCount']; + $resultArray['ytdHTMLCount'] = $result['ytdHTMLCount']; + $resultArray['ytdPDFCount'] = $result['ytdPDFCount']; + + return $resultArray; + }else{ + return false; + } + + } + + + + //returns array of yearly stats for this title + public function get12MonthUsageCount($archiveInd, $publisherPlatformID, $yearAddWhere){ + + $query = "SELECT usageCount FROM MonthlyUsageSummary + WHERE archiveInd = '" . $archiveInd . "' + AND titleID = '" . $this->titleID . "' + AND publisherPlatformID = '" . $publisherPlatformID . "' + AND " . $yearAddWhere . ";"; + + $result = $this->db->processQuery($query, 'assoc'); + + $allArray = array(); + $resultArray = array(); + + //need to do this since it could be that there's only one request and this is how the dbservice returns result + if (isset($result['usageCount'])){ + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; + } + + array_push($allArray, $resultArray); + }else{ + if ($result){ + foreach ($result as $row) { + $resultArray = array(); + if ($resultArray){ + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + } + array_push($allArray, $resultArray); + } + } + } + + return $allArray; + } + + + + + + + + +} + +?> diff --git a/admin/configuration_sample.ini b/admin/configuration_sample.ini index 3c8c450..2ffad93 100755 --- a/admin/configuration_sample.ini +++ b/admin/configuration_sample.ini @@ -3,6 +3,7 @@ organizationsModule= organizationsDatabaseName= licensingModule= resourcesModule= +managementModule= reportingModule= authModule= authDatabaseName= diff --git a/ajax_forms.php b/ajax_forms.php index 6334de4..c1a1e57 100755 --- a/ajax_forms.php +++ b/ajax_forms.php @@ -36,11 +36,11 @@ if (isset($_GET['logEmailAddressID']) && ($_GET['logEmailAddressID'] != '')){ $logEmailAddressID = $_GET['logEmailAddressID']; - $addUpdate = 'Update'; + $addUpdate = _('Update'); $logEmailAddress = new LogEmailAddress(new NamedArguments(array('primaryKey' => $_GET['logEmailAddressID']))); }else{ $logEmailAddressID = ''; - $addUpdate = 'Add'; + $addUpdate = _('Add'); $logEmailAddress = new LogEmailAddress(); } @@ -52,18 +52,16 @@ - + - - - +

Email Address


emailAddress; ?>' style='width:190px;'/> - +

close

@@ -75,9 +73,9 @@ if(e.keyCode == 13) { doSubmitLogEmailAddress(); } - }); + }); - + '> - + - + - - + + @@ -126,8 +124,8 @@ @@ -140,7 +138,7 @@
SUSHI Service for getServiceProvider; ?>
Optional Parameters

getServiceProvider; ?>


(yyyy-mm-dd)
(yyyy-mm-dd)
-  Ensure platform name stays CORAL's Platform Name: "getServiceProvider; ?>" +  getServiceProvider;?>"
- - + +
- - - + + + - - + +
Update Outlier - Level outlierLevel; ?>

- outlierLevel; ?>

            
@@ -190,7 +188,7 @@ } }); - + '> - + - - - + +

Update Report Display Name

reportDisplayName . "' style='width:190px;'/>update"; + echo "" . _("update") . ""; ?>

close

@@ -241,9 +238,9 @@ if(e.keyCode == 13) { updateReportDisplayName(); } - }); + }); - + $platformNoteID))); @@ -295,27 +292,27 @@ - + - + - + - + - + @@ -324,8 +321,8 @@ @@ -350,10 +347,10 @@ case 'getPublisherNoteForm': if (isset($_GET['publisherPlatformNoteID'])) $publisherPlatformNoteID = $_GET['publisherPlatformNoteID']; else $publisherPlatformNoteID = ''; - if (isset($_GET['publisherPlatformID'])) $publisherPlatformID = $_GET['publisherPlatformID']; + if (isset($_GET['publisherPlatformID'])) $publisherPlatformID = $_GET['publisherPlatformID']; if ($publisherPlatformNoteID){ - $addUpdate = 'Update'; + $addUpdate = _('Update'); $publisherPlatformNote = new PublisherPlatformNote(new NamedArguments(array('primaryKey' => $publisherPlatformNoteID))); @@ -362,7 +359,7 @@ if (($publisherPlatformNote->endYear == '0') || ($publisherPlatformNote->endYear =='')) $endYear = ''; else $endYear = $publisherPlatformNote->endYear; }else{ - $addUpdate = 'Add'; + $addUpdate = _('Add'); $publisherPlatformNote = new PublisherPlatformNote(); } @@ -373,18 +370,18 @@
Interface Notes



- /> Yes   - /> No + />    + /> 
- - + +
- + - + - + - + @@ -393,8 +390,8 @@ @@ -416,17 +413,17 @@ case 'getLoginForm': if (isset($_GET['externalLoginID'])) $externalLoginID = $_GET['externalLoginID']; else $externalLoginID = ''; - if (isset($_GET['platformID'])) $platformID = $_GET['platformID']; else $platformID = ''; - if (isset($_GET['publisherPlatformID'])) $publisherPlatformID = $_GET['publisherPlatformID']; else $publisherPlatformID = ''; + if (isset($_GET['platformID'])) $platformID = $_GET['platformID']; else $platformID = ''; + if (isset($_GET['publisherPlatformID'])) $publisherPlatformID = $_GET['publisherPlatformID']; else $publisherPlatformID = ''; if ($externalLoginID){ - $addUpdate = 'Update'; + $addUpdate = _('Update'); $externalLogin = new ExternalLogin(new NamedArguments(array('primaryKey' => $externalLoginID))); $publisherPlatformID = $externalLogin->publisherPlatformID; $platformID = $externalLogin->platformID; }else{ - $addUpdate = 'Add'; + $addUpdate = _('Add'); $externalLogin = new ExternalLogin(); } @@ -437,21 +434,21 @@
Publisher Notes



- - + +
- + - + - + - + - + @@ -460,8 +457,8 @@ @@ -481,15 +478,15 @@ //sushi service information case 'getSushiForm': $sushiServiceID = $_GET['sushiServiceID']; - $platformID = $_GET['platformID']; - + $platformID = $_GET['platformID']; + if ($sushiServiceID){ - $addUpdate = 'Update'; + $addUpdate = _('Update'); $sushiService = new SushiService(new NamedArguments(array('primaryKey' => $sushiServiceID))); }else{ - $addUpdate = 'Add'; + $addUpdate = _('Add'); $sushiService = new SushiService(); } @@ -499,68 +496,71 @@
Login



- - + +
- + - + - + +
- - + - + - + - + - + - + - + - + + - " . _("only needed for HTTP or WSSE Authentication");?> + + - + + - " . _("only needed for HTTP or WSSE Authentication");?> + + - + + - " . _("number indicating the day of month the service should run") . "
" . _("(e.g. 27 will run 27th of every month)");?>
+ - + @@ -569,8 +569,8 @@ @@ -608,11 +608,11 @@
SUSHI Connection



-
- if using COUNTER's WSDL +
-
-
- if not using COUNTER's WSDL
-
separate report types with semi-colon, e.g. JR1;BR1 +
- (optional)
can be: HTTP Basic, WSSE Authentication
+
- (optional)
- only needed for HTTP or WSSE Authentication
-
- (optional)
- only needed for HTTP or WSSE Authentication
-
- (optional)
- number indicating the day of month the service should run
(e.g. 27 will run 27th of every month)
- - + +
- + - - - + +
Link Associated Organization




+

@@ -623,8 +623,8 @@
@@ -683,14 +683,14 @@ None currently"; + echo "" . _("None currently") . ""; }else{ foreach($statsArray as $monthlyStat){ echo ""; echo "" . $monthlyStat['Title']. ""; echo "" . $monthlyStat['usageCount'] . ""; echo ""; - echo "update override
ignore outlier"; + echo "" . _("update override") . "
" . _("ignore outlier") . ""; echo ""; } } @@ -699,7 +699,7 @@ -

Close +

@@ -750,7 +750,7 @@
- + @@ -759,30 +759,30 @@ "; + echo ""; }else{ foreach($statsArray as $yearlyStat){ ?> - + - + - + - + - + - +

(showing only titles for which there were outliers during the year)

None currently
" . _("None currently") . "
Total update
PDF update
  HTML update


Close


@@ -818,17 +818,17 @@ ?>
- - + + - + @@ -853,27 +853,27 @@ //Add Identifiers case 'getAddIdentifierForm': if (isset($_GET['platformID'])) $platformID = $_GET['platformID']; else $platformID = ''; - if (isset($_GET['publisherPlatformID'])) $publisherPlatformID = $_GET['publisherPlatformID']; - if (isset($_GET['titleID'])) $titleID = $_GET['titleID']; + if (isset($_GET['publisherPlatformID'])) $publisherPlatformID = $_GET['publisherPlatformID']; + if (isset($_GET['titleID'])) $titleID = $_GET['titleID']; ?>
Add New Platform for SUSHI Connection



   - - + +
- - + + - + @@ -881,8 +881,8 @@ @@ -915,7 +915,7 @@ ?>
Add Identifier



- - + +
- + - @@ -975,25 +975,25 @@ if (isset($_GET['loginID'])) $loginID = $_GET['loginID']; else $loginID = ''; if ($loginID != ''){ - $update='Update'; + $update=_('Update'); $updateUser = new User(new NamedArguments(array('primaryKey' => $loginID))); }else{ - $update='Add New'; + $update=_('Add New'); } ?>
Associated Titles and Identifiers

@@ -950,7 +950,7 @@


Close +


- - - - - + + + + + @@ -1019,8 +1019,8 @@ - - + +
User



- +
            
@@ -1039,7 +1039,7 @@ default: - echo "Function " . $_REQUEST['function'] . " not set up!"; + echo _("Function ") . $_REQUEST['function'] . _(" not set up!"); break; diff --git a/ajax_htmldata.php b/ajax_htmldata.php index 1041995..0ebb58b 100755 --- a/ajax_htmldata.php +++ b/ajax_htmldata.php @@ -27,6 +27,7 @@ include "common.php"; $action = $_REQUEST['action']; +$classAdd = ""; switch ($action) { @@ -43,7 +44,7 @@ ?> -

Import History for name; ?>

+

name; ?>

@@ -58,9 +59,9 @@ echo ""; echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -72,13 +73,13 @@ echo ""; echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } echo "
Import DateImported ByImport Summary" . _("Import Date") . "" . _("Imported By") . "" . _("Import Summary") . "  
" . format_date($importLog->importDateTime) . "" . $importLog->loginID . "" . nl2br($importLog->details) . "view logview archive" . _("view log") . "" . _("view archive") . "
"; }else{ - echo "(no imports found)"; + echo _("(no imports found)"); } @@ -92,7 +93,7 @@ ?> -

Publisher Logins

+

@@ -109,10 +110,10 @@ - - - - + + + + @@ -124,7 +125,7 @@ echo ""; echo ""; echo ""; - echo ""; + echo ""; echo ""; } @@ -134,7 +135,7 @@ @@ -142,7 +143,7 @@
- add new login + -

Interface Logins

+

@@ -170,10 +171,10 @@
Interface LoginPasswordURLLogin Notes  
" . $externalLogin->password . "" . $externalLogin->loginURL . "" . $externalLogin->noteText . "edit
remove
" . _("edit") . "
" . _("remove") . "
- - - - + + + + @@ -185,7 +186,7 @@ echo ""; echo ""; echo ""; - echo ""; + echo ""; echo ""; } @@ -195,7 +196,7 @@ @@ -203,7 +204,7 @@
- add new login + settings->organizationsModule == 'Y'){ - echo "


Organization Accounts

"; + echo "

" . _("Organization Accounts") . "

"; if (isset($_GET['publisherPlatformID']) && ($_GET['publisherPlatformID'] != '')){ $publisherPlatformID = $_GET['publisherPlatformID']; @@ -233,14 +234,14 @@ if (count($externalLoginArray) > 0){ ?> - For getOrganizationName() . "  view organization"; ?> + getOrganizationName() . "  " . _("view organization") . "";?>
Interface LoginPasswordURLLogin Notes  
" . $externalLogin->password . "" . $externalLogin->loginURL . "" . $externalLogin->noteText . "edit
remove
" . _("edit") . "
" . _("remove") . "
- - - - - + + + + + "; }else{ - echo "No login information stored for " . $obj->getOrganizationName . "  view organization"; + echo "" . _("No login information stored for ") . $obj->getOrganizationName . "  " . _("view organization") . ""; } ?>
- change associated organization +

- link to associated organization + 0){ echo "
"; - echo "Login Credentials are also available for the following publishers:
"; + echo _("Login Credentials are also available for the following publishers:") . "
"; foreach ($pubArray as $pubID => $pubName){ echo "" . $pubName . "
"; @@ -317,7 +318,7 @@ ?> -

Publisher Notes

+

@@ -332,22 +333,22 @@
Login TypeUsernamePasswordURLNotes
- - - + + + endYear == '0') || ($publisherPlatformNote->endYear =='')) $endYear = 'Present'; else $endYear = $publisherPlatformNote->endYear; + if (($publisherPlatformNote->endYear == '0') || ($publisherPlatformNote->endYear =='')) $endYear = _('Present'); else $endYear = $publisherPlatformNote->endYear; echo ""; echo ""; echo ""; echo ""; - echo ""; + echo ""; echo ""; } @@ -355,12 +356,12 @@ ?>
Start YearEnd YearNotes  
" . $publisherPlatformNote->startYear . "" . $endYear . "" . $publisherPlatformNote->noteText . "edit
remove
" . _("edit") . "
" . _("remove") . "
- +

- add new publisher notes +
@@ -373,7 +374,7 @@ ?> -

Interface Notes

+

@@ -391,10 +392,10 @@ - - - - + + + + @@ -416,7 +417,7 @@ echo ""; echo ""; echo ""; - echo ""; + echo ""; echo ""; } @@ -424,12 +425,12 @@ ?>
Start YearEnd YearCounter
Compliant?
Interface Notes' . _("Compliant?");?>  
" . $endYear . "" . $counterCompliantInd . "" . $platformNote->noteText . "edit
remove
" . _("edit") . "
" . _("remove") . "
- +

- add new interface note +

@@ -455,32 +456,32 @@ $sushiService->getByPublisherPlatformID($pubishlerPlatformID); } - echo "

SUSHI Connection

"; + echo "

" . _("SUSHI Connection") . "

"; if (($sushiService->platformID != '') || ($sushiService->publisherPlatformID != '')){ echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; echo "
Service URL" . $sushiService->serviceURL . "
WSDL URL" . $sushiService->wsdlURL . "
COUNTER Release" . $sushiService->releaseNumber . "
Report Layouts" . $sushiService->reportLayouts . "
Requestor ID" . $sushiService->requestorID . "
Customer ID" . $sushiService->customerID . "
Security" . $sushiService->security . "
Login" . $sushiService->login . "
Password" . $sushiService->password . "
Service Day" . $sushiService->serviceDayOfMonth . " (day of month)
Notes" . $sushiService->noteText . "
" . _("Service URL") . "" . $sushiService->serviceURL . "
" . _("WSDL URL") . "" . $sushiService->wsdlURL . "
" . _("COUNTER Release") . "" . $sushiService->releaseNumber . "
" . _("Report Layouts") . "" . $sushiService->reportLayouts . "
" . _("Requestor ID") . "" . $sushiService->requestorID . "
" . _("Customer ID") . "" . $sushiService->customerID . "
" . _("Security") . "" . $sushiService->security . "
" . _("Login") . "" . $sushiService->login . "
" . _("Password") . "" . $sushiService->password . "
" . _("Service Day") . "" . $sushiService->serviceDayOfMonth . _(" (day of month)") . "
" . _("Notes") . "" . $sushiService->noteText . "
"; - echo "

Edit SUSHI Connection Info
"; - echo "

"; + echo "

" . _("Edit SUSHI Connection Info") . "
"; + echo "

"; }else{ - echo "\n(none found)

Add SUSHI Connection
"; + echo "\n" . _("(none found)") . "

" . _("Add SUSHI Connection") . "
"; } echo "

  "; - echo "Visit the SUSHI Server Registry for information about adding your provider."; + echo _("Visit the ") . "" . _("SUSHI Server Registry") . "" . _(" for information about adding your provider."); break; @@ -507,7 +508,7 @@ if ($month['archiveInd'] == "1") {$archive = ' (archive)';}else{$archive='';} echo ""; - echo ""; + echo ""; //monthly ouliers if ($publisherPlatformID){ @@ -518,7 +519,7 @@ if ($outlierCount != 0) { - echo ""; + echo ""; }else{ echo ""; } @@ -553,9 +554,9 @@ if (count($statsArray) > 0){ - echo "

Statistics Management

"; - + echo "

" . _("Statistics Management") . "

"; + $holdYear = ""; foreach($statsArray as $statArray){ $year=$statArray['year']; if ($year != $holdYear){ @@ -564,7 +565,7 @@ $holdYear = $year; } - if ($statArray['archiveInd'] == "1") {$archive = ' (archive)';}else{$archive='';} + if ($statArray['archiveInd'] == "1") {$archive = " " . _("(archive)");}else{$archive='';} echo "
"; echo "  " . $statArray['resourceType'] . "s" . $archive; @@ -574,7 +575,7 @@ echo ""; echo ""; - echo ""; //loop through each month @@ -598,11 +599,11 @@ echo "
View Spreadsheet"; + echo "" . _("View Spreadsheet") . ""; echo "
"; echo ""; echo ""; - echo ""; @@ -619,9 +620,9 @@ if ($statArray['outlierID'] > 0){ - echo "    update overrides for this year"; + echo "    " . _("update overrides for this year") . ""; }else{ - echo "    (no outliers found for this year)"; + echo "    " . _("(no outliers found for this year)"); } echo ""; @@ -634,7 +635,7 @@ } }else{ - echo "

Statistics Management

(none found)"; + echo "

" . _("Statistics Management") . "

" . _("(none found)"); } @@ -657,19 +658,19 @@ $bookTitleArray = $obj->getBookTitles; - echo "

Titles

"; + echo "

" . _("Titles") . "

"; echo "
"; if ((count($journalTitleArray) == '0') && (count($bookTitleArray) == '0') && (count($databaseTitleArray) == '0')){ - echo "(none found)"; + echo _("(none found)"); }else{ if (count($journalTitleArray) > 0){ - echo "View Journal Spreadsheet
"; + echo "" . _("View Journal Spreadsheet") . "
"; } if (count($bookTitleArray) > 0){ - echo "View Books Spreadsheet
"; + echo "" . _("View Books Spreadsheet") . "
"; } } @@ -695,7 +696,7 @@ $databaseTitleArray = $obj->getDatabaseTitles; if ((count($journalTitleArray) == '0') && (count($bookTitleArray) == '0') && (count($databaseTitleArray) == '0')){ - echo "

Titles

(none found)"; + echo "

" . _("Titles") . "

" . _("(none found)"); } @@ -710,14 +711,14 @@ if (count($titleArray) >0 ){ ?> -

Journals - Associated Titles and ISSNs

+

" . numberToMonth($month) . " " . $statArray['year'] . "delete entire month"; + echo "" . _("delete entire month") . ""; //print out prompt for outliers if outlierID is > 0 if ($outlier > 0){ - echo "  view outliers for this month"; + echo "  " . _("view outliers for this month") . ""; } echo "
- - - - + + + + @@ -757,8 +758,7 @@ } $resolverURL .= $urlAdd; - echo "\n"; - + echo "\n"; }else{ echo "\n"; } @@ -786,14 +786,14 @@ if (count($titleArray) >0 ){ ?> -

Books - Associated Titles and ISBNs

+

TitleDOIISSNeISSN  
view related titles
view in link resolver
" . _("view related titles") . "
" . _("view in link resolver") . "
 
- - - - + + + + @@ -835,7 +835,7 @@ $resolverURL .= $urlAdd; - echo "\n"; + echo "\n"; }else{ echo "\n"; } @@ -860,11 +860,11 @@ if (count($titleArray) > 0){ ?> -

Database Titles

+

TitleDOIISBNISSN  
view related titles
view in link resolver
" . _("view related titles") . "
" . _("view in link resolver") . "
 
- + Current Email Addresses"; + echo "" . _("Current Email Addresses") . ""; echo "
Title
"; foreach($logEmailAddresses->allAsArray as $logEmailAddress) { echo ""; - echo ""; - echo ""; + echo ""; + echo ""; } echo "
" . $logEmailAddress['emailAddress'] . "editdelete
" . _("edit") . "" . _("delete") . "
"; @@ -918,15 +918,15 @@ $outlier = array(); $outliers = new Outlier(); - echo "Current Outlier Parameters
"; + echo "" . _("Current Outlier Parameters") . "
"; foreach($outliers->allAsArray as $outlier) { - echo "Level " . $outlier['outlierLevel'] . ": " . $outlier['overageCount'] . " over plus " . $outlier['overagePercent'] . "% over - displayed " . $outlier['color']; - echo "  edit"; + echo _("Level ") . $outlier['outlierLevel'] . ": " . $outlier['overageCount'] . _(" over plus ") . $outlier['overagePercent'] . _("% over - displayed ") . $outlier['color']; + echo "  " . _("edit") . ""; echo "
"; } }else{ - echo "Outliers are currently disabled in the configuration file. Contact your technical support to enable them."; + echo _("Outliers are currently disabled in the configuration file. Contact your technical support to enable them."); } @@ -958,15 +958,15 @@ echo ""; if ($totalRows == 0){ - echo ""; + echo ""; }else{ foreach($statsArray as $monthlyStat){ echo ""; echo ""; echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } } @@ -1007,24 +1007,24 @@ ?> - - + - - + - + " . $platform->name . ""; if ($platform->reportDisplayName) echo "  (" . $platform->reportDisplayName . ")"; - echo "  edit report display name
"; + echo "  " . _("edit report display name") . "
"; @@ -1077,7 +1077,7 @@ echo "
None currently
" . _("None currently") . "
" . $monthlyStat['Title']. "" . $monthlyStat['usageCount'] . "update overrideignore outlier" . _("update override") . "" . _("ignore outlier") . "
Total + update
 PDF + update
  HTML update
" . $publisher->name; if ($publisherPlatform->reportDisplayName) echo "  (" . $publisherPlatform->reportDisplayName . ")"; - echo "  edit report display name
"; + echo "  " . _("edit report display name") . ""; break; @@ -1103,13 +1103,13 @@ $recordCount = count($importLogArray); if ($totalRecords == 0){ - echo "No imports found."; + echo "" . _("No imports found.") . ""; }else{ $thisPageNum = $recordCount + $pageStart - 1; - echo "Displaying " . $pageStart . " to " . $thisPageNum . " of " . $totalRecords . " Records
"; + echo "" . _("Displaying ") . $pageStart . _(" to ") . $thisPageNum . _(" of ") . $totalRecords . _(" Records") . "
"; //print out page selectors if ($totalRecords > $numberOfRecords){ @@ -1133,9 +1133,9 @@ } if ($pageStart == $nextPageStarts){ - echo ">> "; + echo " "; }else{ - echo ">> "; + echo " "; } }else{ echo "
"; @@ -1144,9 +1144,9 @@ //making table larger so it fills the page more echo ""; echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1165,8 +1165,8 @@ echo ""; echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } @@ -1177,13 +1177,13 @@ $numberOfRecords){ - if ($pageStart == "1"){ - echo "<< "; - }else{ - echo "<< "; - } + //print out page selectors + if ($totalRecords > $numberOfRecords){ + if ($pageStart == "1"){ + echo " "; + }else{ + echo " "; + } for ($i=1; $i<($totalRecords/$numberOfRecords)+1; $i++){ @@ -1198,15 +1198,15 @@ } } - if ($pageStart == $nextPageStarts){ - echo ">> "; - }else{ - echo ">> "; - } - }else{ - echo "
"; - } - } + if ($pageStart == $nextPageStarts){ + echo " "; + }else{ + echo " "; + } + }else{ + echo "
"; + } + } break; @@ -1225,9 +1225,9 @@ if (count($sushiArray) > 0){ echo "
Import DateImported ByImport Summary" . _("Import Date") . "" . _("Imported By") . "" . _("Import Summary") . "  
" . format_date($importLog['dateTime'], "%m/%e/%y %I:%i %p") . "" . $importLog['loginID'] . "" . nl2br($importLog['details']) . "view logview archive" . _("view log") . "" . _("view archive") . "
"; echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1251,15 +1251,15 @@ echo ""; echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } echo "
Platform/PublisherImport Run DateDetails" . _("Platform/Publisher") . "" . _("Import Run Date") . "" . _("Details") . "  
" . $obj->name . "" . format_date($sushi['importDateTime']) . "" . nl2br($sushi['details']) . "view to processdelete import" . _("view to process") . "" . _("delete import") . "
"; }else{ - echo "(no outstanding imports found)"; + echo _("(no outstanding imports found)"); - } + } break; @@ -1277,9 +1277,9 @@ if (count($sushiArray) > 0){ echo ""; echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1305,16 +1305,16 @@ echo ""; echo ""; echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; echo ""; } echo "
Platform/PublisherLatest RunLatest Status" . _("Platform/Publisher") . "" . _("Latest Run") . "" . _("Latest Status") . "  
" . $obj->name . "" . $lastImportDate . "" . $lastImportDetails . "
view full log
run nowchange/test connection" . $lastImportDetails . "
" . _("view full log") . "
" . _("run now") . "" . _("change/test connection") . "
"; }else{ - echo "(no failed imports found)"; + echo _("(no failed imports found)"); } @@ -1334,11 +1334,11 @@ if (count($sushiArray) > 0){ echo ""; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1353,7 +1353,7 @@ $obj = new PublisherPlatform(new NamedArguments(array('primaryKey' => $sushi['publisherPlatformID']))); } - if ($obj->getImportLogs[0]){ + if (isset($obj->getImportLogs[0])){ $lastImportObj = $obj->getImportLogs[0]; $lastImportDate = format_date($lastImportObj->importDateTime); $lastImportDetails = nl2br($lastImportObj->details); @@ -1369,15 +1369,15 @@ echo ""; echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } echo "
Platform/PublisherReport(s)Next RunLatest RunLatest Status" . _("Platform/Publisher") . "" . _("Report(s)") . "" . _("Next Run") . "" ._("Latest Run") . "" . _("Latest Status") . "  
" . format_date($sushi['next_import']) . "" . format_date($lastImportDate) . "" . $lastImportDetails . "run nowchange/test connection" . _("run now") . "" . _("change/test connection") . "
"; }else{ - echo "(no sushi services set up)"; + echo _("(no sushi services set up)"); } @@ -1399,10 +1399,10 @@ ?> - - - - + + + + " . $instance['firstName'] . ""; echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } @@ -1425,7 +1425,7 @@ search($whereAdd, $orderBy, $limit); if (count($platformArray) == 0){ - echo "

Sorry, no platforms or publishers fit your query"; + echo "

" . _("Sorry, no platforms or publishers fit your query") . ""; $i=0; }else{ $thisPageNum = count($platformArray) + $pageStart - 1; - echo "Displaying " . $pageStart . " to " . $thisPageNum . " of " . $totalRecords . " Platform Records
"; + echo "" . _("Displaying ") . $pageStart . _(" to ") . $thisPageNum . _(" of ") . $totalRecords . _(" Platform Records") . "
"; - //print out page selectors - if ($totalRecords > $numberOfRecords){ - if ($pageStart == "1"){ - echo "<< "; - }else{ - echo "<< "; - } + //print out page selectors + if ($totalRecords > $numberOfRecords){ + if ($pageStart == "1"){ + echo " "; + }else{ + echo " "; + } //don't want to print out too many page selectors!! $maxDisplay=41; @@ -1498,25 +1498,25 @@ } } - if ($pageStart == $nextPageStarts){ - echo ">> "; - }else{ - echo ">> "; - } - }else{ - echo "
"; - } + if ($pageStart == $nextPageStarts){ + echo " "; + }else{ + echo " "; + } + }else{ + echo "
"; + } ?>
Login IDFirst NameLast NamePrivilege     " . $instance['lastName'] . "" . $privilege->shortName . "updateremove" . _("update") . "" . _("remove") . "
- - - - - - + + + + + + " . $platform['name'] . ""; echo "
Platform Name 
Publishers 
Next Run 
Latest Run 
Latest Status 
By 
 
 
 
 
 
 
"; if (strlen($platform['publishers']) == "0"){ - echo "(none found)"; + echo _("(none found)"); }else{ $publisherPlatformArray = explode(":", $platform['publishers']); if (count($publisherPlatformArray) > 5){ - echo "show publisher list show publisher list
"; + echo "" . _("show publisher list") . " " . _("show publisher list") . "
"; echo "
@@ -1636,7 +1636,7 @@ default: - echo "Function " . $_REQUEST['function'] . " not set up!"; + echo _("Function ") . $_REQUEST['function'] . _(" not set up!"); break; diff --git a/ajax_processing.php b/ajax_processing.php index d669109..968a7e9 100755 --- a/ajax_processing.php +++ b/ajax_processing.php @@ -392,7 +392,7 @@ try { $yearlyUsageSummary->save(); - echo "Override has been updated"; + echo _("Override has been updated"); } catch (Exception $e) { echo $e->getMessage(); } @@ -439,7 +439,7 @@ try { $platform->save(); - echo "Platform Reporting Display Name has been updated"; + echo _("Platform Reporting Display Name has been updated"); } catch (Exception $e) { echo $e->getMessage(); } @@ -455,7 +455,7 @@ try { $platform->save(); - echo "Default display list has been updated"; + echo _("Default display list has been updated"); } catch (Exception $e) { echo $e->getMessage(); } @@ -471,7 +471,7 @@ try { $publisherPlatform->save(); - echo "Publisher Reporting Display Name has been updated"; + echo _("Publisher Reporting Display Name has been updated"); } catch (Exception $e) { echo $e->getMessage(); } @@ -487,7 +487,7 @@ try { $publisherPlatform->save(); - echo "Default display list has been updated"; + echo _("Default display list has been updated"); } catch (Exception $e) { echo $e->getMessage(); } @@ -595,7 +595,7 @@ default: - echo "Function " . $_REQUEST['function'] . " not set up!"; + echo _("Function ") . $_REQUEST['function'] . _(" not set up!"); break; diff --git a/css/style.css b/css/style.css index 1ddc996..b884de6 100755 --- a/css/style.css +++ b/css/style.css @@ -1,96 +1,52 @@ html { - height: 100%; - margin: 0; - padding: 0; + height: 100%; + margin: 0; + padding: 0; + -webkit-font-smoothing: antialiased; } body { - height: 100%; - text-decoration: none; - color: #2c3c42; - font-family: "arial"; - font-size: 10pt; - font-weight: heavy; - background: #FFFFFF; - margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */ - padding: 0; - text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */ - + height: 100%; + text-decoration: none; + color: #666; + font-family: Arial, sans-serif; + font-size: 14px; + font-weight: 30; + background: #E7E8E8; + margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */ + padding: 0; + text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */ + background: #E7E8E8 url(../images/bg-gray-texture.jpg) repeat top left; + -webkit-font-smoothing: antialiased; } .wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -2em; + margin: 0 auto -2em; + height; 120px; + background-image: url("../images/back-header.jpg"); + background-repeat: repeat-x; + padding-bottom: 40px; +} + +table { + border-collapse: collapse; + border-spacing: 0; + /*-*/margin: 0 auto; } .push { - height: 2em; + height: 2em; } .footer { -height: 2em; -font-size:80%; -color:#526972; -text-align:center; -width:100%; -} - - -/* Menu */ -.menubtn { - background: #fefefe; - background-image: -webkit-linear-gradient(top, #fefefe, #dee8f1); - background-image: -moz-linear-gradient(top, #fefefe, #dee8f1); - background-image: -ms-linear-gradient(top, #fefefe, #dee8f1); - background-image: -o-linear-gradient(top, #fefefe, #dee8f1); - background-image: linear-gradient(to bottom, #fefefe, #dee8f1); - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0px; - border: none; - display: inline-block; - font-family: Arial; - font-weight: 500; - color: #2c3c42; - font-size: 13px; - padding: 3px 13px; - text-decoration: none; - vertical-align:top; -} - -.menubtn:hover { - background: #526972; - background-image: -webkit-linear-gradient(top, #526972, #96a5aa) !important; - background-image: -moz-linear-gradient(top, #526972, #96a5aa) !important; - background-image: -ms-linear-gradient(top, #526972, #96a5aa) !important; - background-image: -o-linear-gradient(top, #526972, #96a5aa) !important; - background-image: linear-gradient(to bottom, #526972, #96a5aa) !important; - text-decoration: none; - color: #ccd7db; -} - -#firstmenubtn { - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; -} - -#lastmenubtn { - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; -} - -.menubtn.active { - background: #c7d3de; - background-image: -webkit-linear-gradient(top, #c7d3de, #e7eef5); - background-image: -moz-linear-gradient(top, #c7d3de, #e7eef5); - background-image: -ms-linear-gradient(top, #c7d3de, #e7eef5); - background-image: -o-linear-gradient(top, #c7d3de, #e7eef5); - background-image: linear-gradient(to bottom, #c7d3de, #e7eef5); + height: 3em; + font-size: 80%; + text-align: center; + /*-*/width: 100%; + font-style: italic; + text-align: center; } - a {color:#3D545D;} a:active {color:#94a9be;} a:focus {color:#94a9be; outline: none; -moz-outline-style: none;} @@ -101,17 +57,22 @@ a.helpfulLink {color:#526972;} .smallText{color:#3D545D;font-size:92%;} .smallerText{color:#3D545D;font-size:85%;} -.redText{color:red} +.redText{color:red;} .smallRedText{font-size:85%;color:red;} .darkRedText{color:#7a0026;} .bigDarkRedText{font-size:125%; color:#7a0026;} .smallDarkRedText{font-size:85%;color:#7a0026;} -.normalText{color:#3D545D} -.smallBlueText{font-size:85%;font-weight:normal; color:#526972} -.smallGreyText{font-size:85%;font-weight:normal; color:gray} +.normalText{color:#3D545D;} +.smallBlueText{font-size:85%;font-weight:normal; color:#526972;} +.smallGreyText{font-size:85%;font-weight:normal; color:gray;} .boldBlueText{font-weight:bold; color:#526972;} .boldText{font-weight:bold;} -.bigBlueText{font-size:125%; color:#526972;} + +.bigBlueText { + font-size: 125%; + color: #1B77AA; +} + .headerText {font-size:125%;font-weight:bold; } @@ -123,9 +84,7 @@ fieldset {border:0;} select option { color: #3D545D; font-family: "arial"; font-size: 95%; margin:1px; } .optionStyle { color: #3D545D; font-family: "arial"; font-size: 8pt; font-weight: medium; } - -input, select, multiple, textarea{color: #3D545D; font-family: "arial"; font-size: 95%; font-weight: medium;} - +input, select, multiple, textarea {color: #3D545D; font-family: "arial"; font-size: 8pt; font-weight: medium;} /* following is for the right panel (helpful links) in the resource page *************************/ @@ -148,7 +107,7 @@ div.queueMenuLink a:hover {color:#526972;text-decoration:underline;} div.queueMenuLink a:focus {color:#3D545D; outline: none; font-weight:bold;} -table.queueMenuTable { +table.queueMenuTable { border-width: 0 0 1px 1px; border-style: solid; border-color: #e6e5e9; @@ -160,7 +119,7 @@ table.queueMenuTable { table.queueMenuTable td { margin: 0; - padding: 3px 3px 3px 3px; + padding: 3px; background-color: #f6f8fa; border-top: 1px solid #e6e5e9; vertical-align:top; @@ -170,7 +129,7 @@ table.queueMenuTable td { table.queueMenuTable td.selected { margin: 0; - padding: 3px 3px 3px 3px; + padding: 3px; border-top: 1px solid #e6e5e9; background-color: #f2f5f7; background-image:url('../images/tab.gif'); @@ -187,13 +146,13 @@ table.queueMenuTable td.selected a:focus {color:#526972;outline: none;} -table.queueMenuTable tr { +table.queueMenuTable tr { vertical-align:top; } td.queueRightPanel { - border-width: 1px 1px 1px 1px; + border-width: 1px; border-style: solid; border-color: #e6e5e9; border-collapse: collapse; @@ -205,7 +164,7 @@ td.queueRightPanel { -table.queueDataTable { +table.queueDataTable { border-width: 0 1px 1px 1px; border-style: solid; border-color: #e6e5e9; @@ -217,7 +176,7 @@ table.queueDataTable { table.queueDataTable td { margin: 0; - padding: 3px 3px 3px 3px; + padding: 3px; border-width: 1px 0 0 0; border-style: solid; border-color: #e6e5e9; @@ -235,7 +194,7 @@ table.queueDataTable th { -moz-border-radius: 0px; } -table.queueDataTable tr { +table.queueDataTable tr { vertical-align:top; } @@ -257,7 +216,7 @@ div.adminMenuLink a:hover {color:#526972;text-decoration:underline;} div.adminMenuLink a:focus {color:#3D545D; outline: none; font-weight:bold;} -table.adminMenuTable { +table.adminMenuTable { border-width: 0 0 1px 1px; border-style: solid; border-color: #e6e5e9; @@ -269,7 +228,7 @@ table.adminMenuTable { table.adminMenuTable td { margin: 0; - padding: 3px 3px 3px 3px; + padding: 3px; background-color: #f6f8fa; border-top: 1px solid #e6e5e9; vertical-align:top; @@ -279,7 +238,7 @@ table.adminMenuTable td { table.adminMenuTable td.selected { margin: 0; - padding: 3px 3px 3px 3px; + padding: 3px; border-top: 1px solid #e6e5e9; background-color: #f2f5f7; background-image:url('../images/tab.gif'); @@ -296,13 +255,13 @@ table.adminMenuTable td.selected a:focus {color:#526972;outline: none;} -table.adminMenuTable tr { +table.adminMenuTable tr { vertical-align:top; } td.adminRightPanel { - border-width: 1px 1px 1px 1px; + border-width: 1px; border-style: solid; border-color: #e6e5e9; border-collapse: collapse; @@ -314,7 +273,7 @@ td.adminRightPanel { -table.linedDataTable { +table.linedDataTable { border-width: 0 1px 1px 1px; border-style: solid; border-color: #e6e5e9; @@ -349,7 +308,7 @@ table.linedDataTable th { -moz-border-radius: 0px; } -table.linedDataTable tr { +table.linedDataTable tr { vertical-align:top; } @@ -384,25 +343,24 @@ div.f3 { clear: both; } -table#title {padding:0px; background-image:url('../images/organizationstitle.gif');background-repeat:no-repeat;height:84px;width:900px;} -table.headerTable {padding:1px;width:900px;min-height:40px;background-image:url('../images/header.gif');background-repeat:no-repeat;} +table#title {padding:0px; background-image:url('../images/organizationstitle.jpg');background-repeat:no-repeat;height:120px;width:900px;} +table.headerTable { + padding: 1px; + width: 1024px; + min-height:40px; + background: none !important; + border-collapse: collapse; +} hr { - border:0; - border-bottom: 1px solid #e0dfe3; - height: 0; - background: #e0dfe3; + border:0; + border-bottom: 1px solid #e0dfe3; + height: 0; + background: #e0dfe3; } - - -span.searchLetter{margin:0px;padding-left:1.5px;padding-right:1.5px;background-color:white;} -span.searchLetterSelected{margin:0px;padding-left:1.5px;padding-right:1.5px;background-color: #e0dfe3;} -span.searchLetterSelected a:focus{color:#3D545D;} -span.searchLetterSelected a:active{color:#3D545D;} - #search_box { width: 170px; height: 19px; @@ -441,7 +399,7 @@ ul.tabs li{ display: table-cell; float: left; position: relative; - width:130px; + width: 166px; height: 19px; } @@ -451,260 +409,33 @@ ul.tabs a{ text-decoration: none; } -/* Coral Change Module Menu - coraldropdowns -*************************/ - -ul.coraldropdown{ - margin: 0; - padding: 0; - display: block; - position: absolute; - z-index: 999; - top: 100%; - width: 130px; - display: none; - left: 0; - border: 1px solid #b8cee4; - -moz-border-radius: 1px; - -webkit-border-radius: 1px; -} - -ul.coraldropdown ul.coraldropdown{ - top: 0; - left: 95%; -} - -ul.coraldropdown li{ - margin: 0; - padding: 0; - float: left; - position: relative; - list-style: none; - display: block; - height: 23px; - border-top: 1px solid #e2ebf4; -} - -ul.coraldropdown li a{ - display: block; - line-height:23px; - background-color:#f6f9fb; - background-repeat:no-repeat; -} - - -ul.coraldropdown li a:hover{ -background-color:white; -} - - - -/* More Custom classes... -*************************/ - - -div.grayBorder { - border-width: 1px; - border-style: solid; - border-color: #e0dfe3; -} - -table.dataTable { - border-width: 0 0 1px 1px; - border-style: solid; - border-color: #e0dfe3; - border-collapse: collapse; - border-spacing: 0; - max-width:895px; - width:895px; - font-size:90%; -} - - -table.dataTable td { - margin: 0; - padding: 2px 3px 2px 2px; - border-width: 1px 1px 0 0; - border-style: solid; - border-color: #e0dfe3; - background-color: white; - -moz-border-radius: 0px; -} - - - -table.dataTable td.alt { - margin: 0; - padding: 2px 3px 2px 2px; - border-width: 1px 1px 0 0; - border-style: solid; - border-color: #e0dfe3; - background-color: #f5f8fa; - -moz-border-radius: 0px; -} - - -table.dataTable th { - margin: 0; - padding: 2px 3px 2px 2px; - border-width: 1px 1px 0 0; - border-style: solid; - border-color: #e0dfe3; - background-color: white; - -moz-border-radius: 0px; -} - -table.dataTable tr {vertical-align: top;} - - - - - -table.sample { - padding:0px; - margin:0px; - border-width: 0px; - border-spacing: 0px; - border-style: inset inset inset inset; - border-color: white; - border-collapse: collapse; - background-color: white; -} - -table.sample td.main { - border-width: 1px 1px 1px 1px; - padding: 3px 3px 3px 3px; - border-style: solid solid solid solid; - border-color: gray gray gray white; - -moz-border-radius: 0px 0px 0px 0px; -} - -table.sample td.selected { - width:110px; - height:15px; - border-width: 1px 0px 1px 1px; - padding: 8px 3px 8px 3px; - border-style: solid solid solid solid; - border-color: gray white gray gray; - -moz-border-radius: 0px 0px 0px 0px; - -} - -table.sample td.unselected { - width:110px; - height:15px; - border-width: 1px 1px 1px 1px; - padding: 8px 3px 8px 3px; - border-style: solid solid solid solid; - border-color: gray gray gray gray; - background-color: #adc6de; - -moz-border-radius: 0px 0px 0px 0px; - -} - - -table.sample td.bottom { - width:90px; - height:auto; - border-width: 1px 1px 1px 1px; - padding: 3px 3px 3px 3px; - border-style: solid solid solid solid; - border-color: white gray white white; - -moz-border-radius: 0px 0px 0px 0px; - -} - - -.sidemenu{ - background-color: white; - border-right: 1px solid #d2d2d5; - border-top: 1px solid #d2d2d5; - width: 108px; - vertical-align: top; - text-align: left; -} - -.sidemenu a:link{text-decoration: none;} -.sidemenu a:hover {text-decoration: underline;} -.sidemenu img{vertical-align: top;} - -.sidemenu span.icon{ - float:left; - vertical-align: top; - text-align:center; - height:16px; - width:20px; -} - -.sidemenu div{ - padding: 6px 0px 6px 3px; - border-bottom: 1px solid #d2d2d5; - font-weight:normal; -} -.sidemenuselected{ - padding: 6px 0px 6px 6px; - border-bottom: 1px solid #d2d2d5; - border-left: 1px solid #d2d2d5; - background-color: white; -} -.sidemenuunselected{ - padding: 6px 0px 6px 6px; - border-bottom: 1px solid #d2d2d5; - border-left: 1px solid #d2d2d5; - background-color: #f2f5f7; - background-image:url('../images/tab.gif'); - background-repeat:no-repeat; - min-height:16px; -} - -.sidemenuunselected span.link{ - float:left; - clear:right; -} - -.mainContent{ - padding: 8px 14px 14px 14px; - background-color: white; - text-align:left; - border-top: 1px solid #d2d2d5; - border-right: 1px solid #d2d2d5; - border-bottom: 1px solid #d2d2d5; - background-color: white; - vertical-align: top; - -} - - - .printContent{ - padding: 24px 24px 24px 24px; - background-color: white; - text-align:left; - background-color: white; - vertical-align: top; - + padding: 24px 24px 24px 24px; + background-color: white; + text-align:left; + background-color: white; + vertical-align: top; + } - - -table.formTable td { +table.formTable td { margin:4px; padding:4px; } -table.formTable tr { +table.formTable tr { vertical-align:top; } -table.formTable td.alt { +table.formTable td.alt { margin:4px; padding:4px; background-color:#f0f2f4; } -table.verticalFormTable { +table.verticalFormTable { border-width: 0 0 1px 1px; border-style: solid; border-color: #e0dfe3; @@ -715,7 +446,7 @@ table.verticalFormTable { table.verticalFormTable td { margin: 0; - padding: 3px 3px 3px 3px; + padding: 3px; border-width: 1px 1px 0 0; border-style: solid; border-color: #e0dfe3; @@ -734,23 +465,23 @@ table.verticalFormTable th { } -table.verticalFormTable tr { +table.verticalFormTable tr { vertical-align:top; } -table.verticalFormTable td.complete { +table.verticalFormTable td.complete { background-color:#f2f5f7; } -table.verticalFormTable td.outstanding { +table.verticalFormTable td.outstanding { background-color:#fdf2e7; } -table.linedFormTable { +table.linedFormTable { border-width: 0 1px 1px 1px; border-style: solid; border-color: #e6e5e9; @@ -761,7 +492,7 @@ table.linedFormTable { table.linedFormTable td { margin: 0; - padding: 3px 3px 3px 3px; + padding: 3px; border-width: 1px 0 0 0; border-style: solid; border-color: #e6e5e9; @@ -772,7 +503,7 @@ table.linedFormTable td { table.linedFormTable td.bottom { margin: 0; - padding: 3px 3px 3px 3px; + padding: 3px; border-width: 1px 0 0 0; border-style: solid; border-color: #e6e5e9; @@ -791,16 +522,16 @@ table.linedFormTable th { } -table.linedFormTable tr { +table.linedFormTable tr { vertical-align:top; } -table.linedFormTable tr.lightGrayBackground td { +table.linedFormTable tr.lightGrayBackground td { background-color:#ebebeb; } -table.linedFormTable td.outstanding { +table.linedFormTable td.outstanding { background-color:#fdf2e7; } @@ -817,15 +548,15 @@ div.formTitle { span.surroundBoxTitle { - background-color:white; - position:relative; - top:8px; + background-color:white; + position:relative; + top:8px; left:5px; font-size:110%; } -table.surroundBox { +table.surroundBox { border-width: 1px; border-style: solid; border-color: #e6e5e9; @@ -841,242 +572,2067 @@ table.surroundBox td { -moz-border-radius: 0px; } -table.surroundBox tr { +table.surroundBox tr { vertical-align:top; } +table.noBorder td { border:0; } +table.smallPadding td{ padding:1px; } +table.noMargin { border:0px;margin:0px; padding:0px;text-align:center; } +table.noMargin tr { border:0px;margin:0px; padding:0px; vertical-align:middle; } +table.noMargin td { border:0px;margin:0px; padding:0px; } -table.surroundForm { - border-width: 1px 1px 0px 1px; - border-style: solid; - border-color: #e6e5e9; - border-collapse: collapse; - border-spacing: 0; - font-size:100%; -} -table.surroundForm td { - border-width: 0px 0px 1px 0px; - border-style: solid; - border-color: #e6e5e9; - border-collapse: collapse; - border-spacing: 0; - margin: 0; - padding: 5px; - background-color: white; - -moz-border-radius: 0px; +.formText {font-weight:bold;} + + +div.thickboxDiv{display:none;} + +table.thickboxTable{ + padding:6px; + text-decoration: none; + color: #2c3c42; + font-family: "arial"; + font-size: 8pt; + font-weight: heavy; } -table.surroundForm tr { - vertical-align:top; +table.thickboxTable td{ + padding:1px; } +.infoText{font-size:small;font-weight:normal; color:gray;} +.span_CancellationNumber{font-size:small;font-weight:normal; color:gray;} +.span_CurrentQueue{font-size:small;font-weight:normal; color:gray;} + +table.noBorderTable {padding:0px; width:100%; border-style:none;} +table.noBorderTable td {padding:0px; border-style:none; vertical-align:middle;} +table.noBorderTable td.alt {padding:0px; border-style:none; vertical-align:middle;background-color: #f5f8fa;} +ul li { margin-left: 1.5em;} +ul li { margin-bottom: .7em;} +a.dp-choose-date { + float: left; + width: 16px; + height: 16px; + padding: 0; + margin: 0px 3px 0; + display: block; + text-indent: -2000px; + overflow: hidden; + background: url('../images/calendar.gif') no-repeat; +} +a.dp-choose-date.dp-disabled { + background-position: 0 -20px; + cursor: default; +} +/* makes the input field shorter once the date picker code + * has run (to allow space for the calendar icon + */ +input.dp-applied { + width: 140px; + float: left; +} +.adminAddInput{margin-top:5px;} +.licenseAddInput{margin-top:5px;margin-bottom:5px;} -table.borderedFormTable { - border-width: 0 0 1px 1px; - border-style: solid; - border-color: #e0dfe3; - border-collapse: collapse; - border-spacing: 0; - font-size:90%; +.changeInput{ + padding:1px; + outline:none; } -table.borderedFormTable td { - margin:3px; - padding:3px; - border-width: 1px 1px 0 0; - border-style: solid; - border-color: #e0dfe3; - background-color: white; - -moz-border-radius: 0px; +select.changeSelect{ + padding:0px; } -table.borderedFormTable td.alt { - margin:3px; - padding:3px; - border-width: 1px 1px 0 0; - border-style: solid; - border-color: #e0dfe3; - background-color: #f4f8fc; - -moz-border-radius: 0px; +select option.changeSelect{ + padding:0px; } +.changeDefault{ + padding:2px; + outline:none; + background:#f5f8fa; + border: solid 1px #a5acb2; + color: #526972; +} -table.borderedFormTable td.searchRow { - margin:3px; - padding:3px; +.focusField{ + border:solid 1px #526972; + background:#f5f8fa; + color:#2c3c42; +} +.idleField{ + background:#fbfbfb; + color: #526972; + border: solid 1px #a5acb2; +} + +.changeAutocomplete{ + padding:2px; + outline:none; + background:#f5f8fa; + border: solid 1px #a5acb2; + color: #526972; +} + + +.changeDefaultWhite{ + border: solid 1px #a5acb2; + color: #526972; +} + +/*-------------------------------------------------------------------*/ + +.footer { + height: 2em; + font-size:80%; + color: #4d4d4d; + text-align:center; + width:100%; + position: absolute; +} + +a { + color:#4d4d4d; +} + +a.smallLink { + font-size: 12px; + text-decoration: none; + color: #1B76A9; +} + +table.queueMenuTable { + margin-right: 10px; +} + +table.queueMenuTable td { + padding: 10px; + background-color: #1b77aa; + border-bottom: 1px solid #5295ba; + width: 150px !important; +} + +table.queueMenuTable td.selected { + background-color: #DAE6EA; + width: 150px; + vertical-align: top; + text-align: left; + color: #fff; +} + +table.queueMenuTable td.selected:last-child { + border-bottom: 1px solid #DAE6EA; +} + +table.queueMenuTable td.selected a { + color: #1b77aa !important; + text-decoration: none; +} + +table.headerTable { + padding: 1px; + width: 900px; + min-height:40px; + background: none !important; + border-collapse: collapse; +} + +hr { + border:0; + border-bottom: 1px solid #e0dfe3; + height: 0; + width: auto !important; + background: #e0dfe3; +} + +span.searchLetter { + margin: 0px; + padding-left: 1px; + padding-right: 1px; + color: #fff; + font-family: Courier, monospace; +} + +span.searchLetter a { + color: #fff; +} + +span.searchLetterSelected { + margin: 0px; + padding-left: 1px; + padding-right: 1px; + background-color: #A9D0E0; + color: #fff; +} + +span.searchLetter a:hover { + text-decoration: none; + background-color: #4d4d4d; + margin: 0px; +} + + +/* Coral Change Module Menu - tabs +*************************/ + +ul.tabs{ + display: table; + margin: 0; + padding: 0; + list-style: none; + position: relative; +} + +ul.tabs li{ + margin: 0; + padding: 0; + list-style: none; + display: table-cell; + float: left; + position: relative; + width: 166px; + height: 40px; +} + +ul.tabs a{ + position: relative; + display: block; + text-decoration: none; +} + +/* Coral Change Module Menu - coraldropdowns +*************************/ + +ul.coraldropdown{ + margin: 0; + padding: 0; + display: block; + position: absolute; + z-index: 999; + top: 100%; + width: 154px; + display: none; + left: 0; +} + +ul.coraldropdown ul.coraldropdown{ + top: 0; + left: 95%; +} + +ul.coraldropdown li { + margin: 0; + padding: 0; + float: left; + position: relative; + list-style: none; + display: block; + height: 40px; + width: 154px; + border-top: solid 1px #5a5a5a; +} + +ul.coraldropdown li:first-child { + border-top: solid 1px #6195B2; +} + +ul.coraldropdown li a { + display: block; + line-height: 23px; + background-color: #4d4d4d; + background-repeat: no-repeat; + padding-left: 0px; +} + + +ul.coraldropdown li a:hover{ + background-color: #1b76a9; + cursor: pointer; +} + +/* More Custom classes... +*************************/ + + +table.dataTable { + border-width: 0 0 1px 1px; + border-style: solid; + border-color: #e0dfe3; + border-collapse: collapse; + border-spacing: 0; + max-width:895px; + width:895px; + font-size:90%; + margin-top: 11px; + margin-bottom: 10px; + /*-*/margin-left: 0; +} + +table.dataTable td { + margin: 0; + padding: 6px; + border-width: 1px 1px 0 0; + border-style: solid; + border-color: #e0dfe3; + -moz-border-radius: 0px; + vertical-align: middle; + background-color: #f3f3f3; +} + +table.dataTable td.alt { + margin: 0; + padding: 6px; + border-width: 1px 1px 0 0; + border-style: solid; + border-color: #e0dfe3; + background-color: #fff; + -moz-border-radius: 0px; + vertical-align: middle; +} + +table.dataTable th { + margin: 0; + padding: 6px; + border-width: 1px 1px 0 0; + border-style: solid; + border-color: #C9C9C9; + background-color: #CAD7E1; + -moz-border-radius: 0px; + vertical-align: middle; + font-weight: 300; + color: #000; + background: rgba(200, 200, 200, 0.5) url(../images/bg-diagonal-stripes.png) repeat top left !important; + border-bottom: 1px solid #C9C9C9 !important; +} + +table.dataTable tr {vertical-align: top;} + +.sidemenu { + background-color: #1b77aa; + width: 120px; + vertical-align: top; + text-align: left; + font-size: 12px; + color: #fff; +} + +.sidemenu a:link { + text-decoration: none; + color: #fff; +} + +.sidemenu a:hover { + text-decoration: none; + color: #ccc; +} + +.sidemenu span.icon{ + display: none; +} + +.sidemenuselected { + padding: 10px; + border-bottom: 1px solid #1b77aa; + background-color: #DAE6EA; + width: 150px !important; +} + +.sidemenuselected:last-child { + border-bottom: 1px solid #DAE6EA ; +} + +.sidemenuunselected { + padding: 10px; + border-bottom: 1px solid #5295ba; + width: 150px !important; +} + +.sidemenuselected a { + color: #1b77aa !important; +} + +.mainContent{ + background-color: #f9fafb; + text-align:left; + vertical-align: top; + border: solid 1px #e0dfe3; +} + +.printContent{ + padding: 24px 24px 24px 24px; + background-color: white; + text-align:left; + background-color: white; + vertical-align: top; +} + + + +table.formTable td { + margin:4px; + padding:4px; +} + +table.formTable tr { + vertical-align:top; +} + + +table.formTable td.alt { + margin:4px; + padding:4px; + background-color:#f0f2f4; +} + + +table.verticalFormTable { + border-width: 0 0 1px 1px; + border-style: solid; + border-color: #e0dfe3; + border-collapse: collapse; + border-spacing: 0; + font-size:90%; +} + +table.verticalFormTable td { + margin: 0; + padding: 3px 3px 3px 3px; border-width: 1px 1px 0 0; border-style: solid; border-color: #e0dfe3; - background-image:url('../images/search.gif'); - background-repeat:no-repeat; background-color: white; -moz-border-radius: 0px; } +table.verticalFormTable th { + margin: 0; + padding: 2px 3px 2px 2px; + border-width: 1px 1px 0 0; + border-style: solid; + border-color: #e0dfe3; + background-color: #e5ebef; + -moz-border-radius: 0px; +} + +table.verticalFormTable tr { + vertical-align:top; +} + + +table.verticalFormTable td.complete { + background-color:#f2f5f7; +} + +table.verticalFormTable td.outstanding { + background-color:#fdf2e7; +} + +table.linedFormTable { + border-width: 0 1px 1px 1px; + border-style: solid; + border-color: #e6e5e9; + border-collapse: collapse; + border-spacing: 0; + font-size:90%; +} + +table.linedFormTable td { + margin: 0; + padding: 6px; + border: solid 1px #e6e5e9; + background-color: white; + -moz-border-radius: 0px; +} + + +table.linedFormTable td.bottom { + margin: 0; + padding: 6px; + border: solid 1px #e6e5e9; + background-color: white; + -moz-border-radius: 0px; +} + +table.linedFormTable th { + margin: 0; + padding: 6px; + border: solid 1px #e6e5e9; + background-color: #e9edf0; + -moz-border-radius: 0px; + background: rgba(200, 200, 200, 0.5) url(../images/bg-diagonal-stripes.png) repeat top left !important; +} + +table.linedFormTable tr { + vertical-align:top; +} + +table.linedFormTable tr.lightGrayBackground td { + background-color:#ebebeb; +} + +table.linedFormTable td.outstanding { + background-color:#fdf2e7; +} + +div.formTitle { + width: auto !important; + margin: 0; + padding: 6px; + border-width: 1px 0 0 0; + border-style: solid; + border-color: #e6e5e9; + background-color: #cad7e1; + -moz-border-radius: 0px; + background: rgba(200, 200, 200, 0.5) url(../images/bg-diagonal-stripes.png) repeat top left !important; +} + +span.surroundBoxTitle { + background-color:white; + position:relative; + top:8px; + left:5px; + font-size:110%; +} + +table.surroundBox { + border-width: 1px; + border-style: solid; + border-color: #e6e5e9; + border-collapse: collapse; + border-spacing: 0; + font-size:100%; +} + +table.surroundBox td { + margin: 0; + padding: 3px; + background-color: white; + -moz-border-radius: 0px; +} + +table.surroundBox tr { + vertical-align:top; +} + +table.surroundForm { + border-width: 1px 1px 0px 1px; + border-style: solid; + border-color: #e6e5e9; + border-collapse: collapse; + border-spacing: 0; + font-size:100%; +} + +table.surroundForm td { + border-width: 0px 0px 1px 0px; + border-style: solid; + border-color: #e6e5e9; + border-collapse: collapse; + border-spacing: 0; + margin: 0; + padding: 5px; + background-color: white; + -moz-border-radius: 0px; +} + +table.surroundForm tr { + vertical-align:top; +} + +table.borderedFormTable { + border-width: 0; + border-style: solid; + border-color: #5295ba; + border-collapse: collapse; + border-spacing: 0; + font-size:90%; +} + +table.borderedFormTable td { + margin:3px; + padding:3px; + border-width: 1px 1px 0 0; + border-style: solid; + border-color: #6195B2; + background-color: #1B77AA; + -moz-border-radius: 0px; +} + +table.borderedFormTable td.alt { + margin:3px; + padding:3px; + border: solid 1px #e0dfe3; + background-color: #f4f8fc; + -moz-border-radius: 0px; +} + +table.borderedFormTable td.searchRow { + margin: 3px; + padding: 10px; + background-color: #1B77AA; + -moz-border-radius: 0px; +} + +table.borderedFormTable td.searchRow label b { + color: #fff; + font-weight: 100; + font-size: 11px; +} + +table.borderedFormTable th { + margin:3px; + padding:3px; + border-width: 1px 1px 0 0; + border-style: solid; + border-color: #e0dfe3; + background-color: white; + -moz-border-radius: 0px; +} + +table.borderedFormTable tr {vertical-align: top;} + +table.borderedHeadTable { + width:947px; + border-width: 0 0 1px 1px; + border-style: solid; + border-color: #e0dfe3; + border-collapse: collapse; + border-spacing: 0; + font-size:110%; + text-align:center; + color:white; +} + +table.borderedHeadTable td { + margin:3px; + padding:3px; + border-width: 0 1px 0 1px; + border-style: solid; + border-color: #b0932c; + background-color: #adc6de; + -moz-border-radius: 0px; +} + +table.borderedHeadTable tr { + vertical-align:middle; +} + +table.noBorder td { border:0; } + +table.smallPadding td { + padding:1px; +} + +table.noMargin { border:0px;margin:0px; padding:0px;text-align:center; } +table.noMargin tr { border:0px;margin:0px; padding:0px; vertical-align:center; } +table.noMargin td { border:0px;margin:0px; padding:0px; } + + +.formText {font-weight:bold;} + + +div.thickboxDiv{display:none;} + +table.thickboxTable{ + padding:6px; + text-decoration: none; + color: #2c3c42; + font-family: "arial"; + font-size: 8pt; + font-weight: heavy; +} + +table.thickboxTable td{ + padding:1px; +} + +.smallText{font-size:small;} + +.infoText{font-size:small;font-weight:normal; color:gray} +.span_CancellationNumber{font-size:small;font-weight:normal; color:gray} +.span_CurrentQueue{font-size:small;font-weight:normal; color:gray} + +table.noBorderTable {padding:0px; width:100%; border-style:none;} +table.noBorderTable td {padding:0px; border-style:none; vertical-align:middle;} +table.noBorderTable td.alt {padding:0px; border-style:none; vertical-align:middle;background-color: #f5f8fa;} + +ul li { margin-left: 1.5em;} + +a.dp-choose-date { + float: left; + width: 16px; + height: 16px; + padding: 0; + margin: 0px 3px 0; + display: block; + text-indent: -2000px; + overflow: hidden; + background: url('../images/calendar.gif') no-repeat; +} +a.dp-choose-date.dp-disabled { + background-position: 0 -20px; + cursor: default; +} +/* makes the input field shorter once the date picker code + * has run (to allow space for the calendar icon + */ +input.dp-applied { + width: 140px; + float: left; +} + +.adminAddInput{margin-top:5px;} +.licenseAddInput{margin-top:5px;margin-bottom;5px;} + + + +.changeInput{ + padding:1px; + outline:none; +} + +select.changeSelect{ + padding:0px; +} + +select option.changeSelect{ + padding:0px; +} + +.changeDefault{ + padding:2px; + outline:none; + background:#f5f8fa; + border: solid 1px #a5acb2; + color: #526972; +} + +.focusField{ + border:solid 1px #526972; + background:#f5f8fa; + color:#2c3c42; +} +.idleField{ + background:#fbfbfb; + color: #526972; + border: solid 1px #a5acb2; +} + +.changeAutocomplete{ + padding:2px; + outline:none; + background:#f5f8fa; + border: solid 1px #a5acb2; + color: #526972; +} + + +.changeDefaultWhite{ + border: solid 1px #a5acb2; + color: #526972; +} + +/*--- Additional Custom CSS ---*/ + +.titleTable { + height: 120px; + margin-bottom: 25px; +} + +.titleTable td { + height: 40px !important; + padding-top: 13px !important; +} + +.titleTable td a { + padding-left: 0px; +} + +.titleTable ul.tabs { + padding-right: 15px; +} + +.titleTable tr:first-child td div { + padding-right: 20px; +} + +.titleTable tr:first-child td div a:hover { + color: #ccc; +} + +#menu-end { + display: none; +} + +.noBorder > tbody > tr > td:nth-child(1) { + width: 100px !important; + padding-bottom: 20px; + padding-left: 20px; +} + +a.newSearch:hover { + color: #ccc; +} + +a#showMoreOptions:hover { + color: #ccc; +} + +#hideShowOptions { + padding: 10px; +} + +#div_searchName { + margin-left: 0 !important; + margin-top: 6px; +} + +#div_searchISBNOrISSN { + margin-left: 0 !important; + margin-top: 6px; +} + +#div_searchFund { + margin-left: 0 !important; + margin-top: 6px; +} + +#div_searchID { + margin-left: 0 !important; + margin-top: 6px; +} + +#div_searchResourceNote { + margin-left: 0 !important; + margin-top: 6px; +} + +.searchButton { + text-transform: uppercase; +} + +#searchResourceIDButton { + text-transform: uppercase; +} + +#searchCreateDateEnd { + margin-left: 7px; + margin-bottom: 10px; +} + +img[src*="menu-bar.gif"] { + display: none; +} + +img[src*="arrowup.png"] { + padding-left: 6px; +} + +.noBorderTable td { + vertical-align: middle !important; +} + +/*--- Table Column Widths ---*/ + +table.dataTable th:nth-of-type(1) { + min-width: 36px; +} + +table.dataTable th:nth-of-type(2) { + min-width: 250px; +} + +table.dataTable th:nth-of-type(3) { + min-width: 68px; +} + +table.dataTable th:nth-of-type(4) { + min-width: 100px; +} + +table.dataTable th:nth-of-type(5) { + min-width: 120px; +} + +table.dataTable th:nth-of-type(6) { + min-width: 68px; +} + +/*-----*/ + +#div_searchResults { + padding: 20px; + padding: 20px; +} + +#div_searchResults > span:nth-child(2) { + padding-right: 20px; +} + +a.setPage:hover { + text-decoration: none; + color: #ccc; +} + +.noBorderTable tr td { + background: none; +} + +/*--- Links with Icons ---*/ + +a.newSearch:before { + font-family: FontAwesome; + content: "\f00e"; + font-size: 11px; + margin-right: 3px; +} + +a.newSearch { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a.newSearch:hover { + color: #ccc; +} + +a#logout:before { + font-family: FontAwesome; + content: "\f007"; + font-size: 11px; + margin-right: 3px; +} + +a#logout { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; + position: relative; + top: 4px; + left: -4px; +} + +a#logout:hover { + color: #ccc; +} + +a#showMoreOptions:before { + font-family: FontAwesome; + content: "\f055"; + font-size: 11px; + margin-right: 3px; +} + +a#showMoreOptions { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a#showMoreOptions:hover { + color: #ccc; +} + +#print-view a:before { + font-family: FontAwesome; + content: "\f02f"; + font-size: 11px; + margin-right: 3px; +} + +#print-view a { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +#print-view a:hover { + color: #ccc; +} + +/*--- Resources Side Menu Icons ---*/ + +a.showProduct:before { + font-family: FontAwesome; + content: "\f02d"; + font-size: 11px; + margin-right: 5px; +} + +a.showProduct { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a.showProduct:hover { + color: #ccc; +} + +a.showAcquisitions:before { + font-family: FontAwesome; + content: "\f12e"; + font-size: 11px; + margin-right: 5px; +} + +a.showAcquisitions { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a.showAcquisitions:hover { + color: #ccc; +} + +a.showAccess:before { + font-family: FontAwesome; + content: "\f13e"; + font-size: 11px; + margin-right: 5px; +} + +a.showAccess { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a.showAccess:hover { + color: #ccc; +} + +a.showCataloging:before { + font-family: FontAwesome; + content: "\f00b"; + font-size: 11px; + margin-right: 5px; +} + +a.showCataloging { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a.showCataloging:hover { + color: #ccc; +} + +a.showContacts:before { + font-family: FontAwesome; + content: "\f234"; + font-size: 11px; + margin-right: 5px; +} + +a.showContacts { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a.showContacts:hover { + color: #ccc; +} + +a.showAttachments:before { + font-family: FontAwesome; + content: "\f0c6"; + font-size: 11px; + margin-right: 5px; +} + +a.showAttachments { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a.showAttachments:hover { + color: #ccc; +} + +a.showRouting:before { + font-family: FontAwesome; + content: "\f064"; + font-size: 11px; + margin-right: 5px; +} + +a.showRouting { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a.showRouting:hover { + color: #ccc; +} + + +/*-- Add New Platform SUSHI ---*/ + +a#uploadDocument:before { + font-family: FontAwesome; + content: "\f0fe"; + font-size: 12px; + margin-right: 5px; +} + +a#uploadDocument { + text-decoration: none; + text-transform: capitalize; + font-size: 13px; + color: #1b77aa; +} + +a#uploadDocument:hover { + color: #ccc; +} + +/*---------------*/ + +td.searchRow > b { + color: #fff; + font-weight: normal; + position: relative; + top: 6px; +} + +td.searchRow input, +td.searchRow select, +td.searchRow multiple, +td.searchRow textarea { + margin-top: 5px; +} + +#div_additionalSearch > table > tbody > tr:nth-child(3) > td a.dp-choose-date { + margin-top: 5px; +} + +#span_resourceName { + padding: 25px 20px; + padding-top: 0; +} + +.span_AttachmentNumber { + color: #FFF654; + margin-left: 0px !important; +} + +.sidemenuselected .span_AttachmentNumber { + color: #666672; +} + +.resource_tab_content { + width: 630px !important; +} + +.sidemenu { + width: 170px; + float: left; + margin-right: 20px; +} + +.mainContent { + width: 100%; + padding: 20px; +} + +.linedFormTable { + width: 430px !important; +} + +.rightPanel { + text-align: left; +} + +div.rightPanelLink { + margin: 0; + font-size: 12px; +} + +div.rightPanelHeader { + color: #1B76A9; + margin-bottom: 5px; +} + +#title-search { + padding: 20px; + padding-top: 0; +} + +input[type="button"]:hover { + cursor: pointer; +} + +table.surroundBox table.noBorder { + margin: 15px !important; +} + +#resourcePromptForm table.noBorderTable input { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; +} + +/*--- My Queue Page Side Menu ---*/ + +a#OutstandingTasks:before { + font-family: FontAwesome; + content: "\f192"; + font-size: 11px; + margin-right: 5px; +} + +a#OutstandingTasks { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a#OutstandingTasks:hover { + color: #ccc; +} + +a#SavedRequests:before { + font-family: FontAwesome; + content: "\f0fe"; + font-size: 11px; + margin-right: 5px; +} + +a#SavedRequests { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a#SavedRequests:hover { + color: #ccc; +} + +a#SubmittedRequests:before { + font-family: FontAwesome; + content: "\f045"; + font-size: 11px; + margin-right: 5px; +} + +a#SubmittedRequests { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a#SubmittedRequests:hover { + color: #ccc; +} + +.span_OutstandingTasksNumber { + color: #FFF654; + font-size: 85%; + margin-left: 15px !important; +} + +.span_SubmittedRequestsNumber { + color: #FFF654; + font-size: 85%; + margin-left: 15px !important; +} + +.span_SavedRequestsNumber { + color: #FFF654; + font-size: 85%; + margin-left: 15px !important; +} + +.selected .span_OutstandingTasksNumber { + color: #666672; + font-size: 85%; + margin-left: 15px !important; +} + +.selected .span_SubmittedRequestsNumber { + color: #666672; + font-size: 85%; + margin-left: 15px !important; +} + +.selected .span_SavedRequestsNumber { + color: #666672; + font-size: 85%; + margin-left: 15px !important; +} + +#print-view a.helpfulLink { + text-decoration: underline !important; +} + +a.helpfulLink { + text-decoration: underline !important; +} + +.headerTable #form1 b { + float: left; + margin-bottom: 5px; + width: 100%; +} + +.headerTable .bigBlueText { + margin-bottom: 10px; + width: 100%; +} + +.headerTable input#submitFile { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + cursor: pointer; +} + +.headerTable input#submitFile:hover { + cursor: pointer; + background: #999; +} + +#import-file { + width: 450px; +} + +input#submitPlatformForm { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + cursor: pointer; +} + +input#submitPlatformForm:hover { + cursor: pointer; + background: #999; +} + +/*.noBorderTable input#cancel-button { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + cursor: pointer; + float: left; + position: relative; + left: -17px; +} + +.noBorderTable input#cancel-button:hover { + cursor: pointer; + background: #999; +}*/ -table.borderedFormTable th { - margin:3px; - padding:3px; - border-width: 1px 1px 0 0; - border-style: solid; - border-color: #e0dfe3; - background-color: white; - -moz-border-radius: 0px; +#TB_ajaxContent { + height: auto !important; } -table.borderedFormTable tr {vertical-align: top;} +#div_addPlatformForm .thickboxTable { + width: 100% !important; +} +a#usage-reports { + position: relative; + top: 9px; +} +/*--- Align Text When No Documents Fit the Query ---*/ +div#div_searchResults > i { + font-size: 18px; + position: relative; + top: 0; + left: 0; +} +/*--- Capitalize Add/Edit Links ---*/ -table.borderedHeadTable { - width:947px; - border-width: 0 0 1px 1px; - border-style: solid; - border-color: #e0dfe3; - border-collapse: collapse; - border-spacing: 0; - font-size:110%; - text-align:center; - color:white; +.mainContent a { + text-transform: capitalize; +} +.headerTable a { + text-transform: capitalize; } -table.borderedHeadTable td { - margin:3px; - padding:3px; - border-width: 0 1px 0 1px; +/*--- Form Modal Windows ---*/ + +table.thickboxTable .headerText { + width: auto !important; + margin: 0; + padding: 6px; + border-width: 1px 0 0 0; border-style: solid; - border-color: #b0932c; - background-color: #adc6de; + border-color: #e6e5e9; + background-color: #cad7e1; -moz-border-radius: 0px; + background: rgba(200, 200, 200, 0.5) url(../images/bg-diagonal-stripes.png) repeat top left !important; + display: block; } -table.borderedHeadTable tr { - vertical-align:middle; +#div_updateForm table.thickboxTable .headerText { + height: 16px; + margin-bottom: 10px; } +/*--- Adjust Add Login Form Modal Window ---*/ -table.noBorder td { border:0; } -table.smallPadding td{ padding:1px; } +/*#div_updateForm input#submitExternalLoginForm { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 5px; +} -table.noMargin { border:0px;margin:0px; padding:0px;text-align:center; } -table.noMargin tr { border:0px;margin:0px; padding:0px; vertical-align:center; } -table.noMargin td { border:0px;margin:0px; padding:0px; } +#div_updateForm input#submitExternalLoginForm:hover { + cursor: pointer; +} +#div_updateForm input[value=cancel] { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 5px; + position: relative; + left: -31px; +} -.formText {font-weight:bold;} +#div_updateForm input[value=cancel]:hover { + cursor: pointer; +}*/ +/*--- Adjust Update Sushi Connection Form Modal Window ---*/ -div.thickboxDiv{display:none;} +/*#div_updateForm input#submitSushiForm { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 5px; +} -table.thickboxTable{ - padding:6px; - text-decoration: none; - color: #2c3c42; - font-family: "arial"; - font-size: 8pt; - font-weight: heavy; +#div_updateForm input#submitSushiForm:hover { + cursor: pointer; } -table.thickboxTable td{ - padding:1px; +#div_updateForm input#update-sushi-cancel { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 5px; + position: relative; + left: -176px; } -.infoText{font-size:small;font-weight:normal; color:gray} -.span_CancellationNumber{font-size:small;font-weight:normal; color:gray} -.span_CurrentQueue{font-size:small;font-weight:normal; color:gray} +#div_updateForm input#update-sushi-cancel:hover { + cursor: pointer; +}*/ -table.noBorderTable {padding:0px; width:100%; border-style:none;} -table.noBorderTable td {padding:0px; border-style:none; vertical-align:middle;} -table.noBorderTable td.alt {padding:0px; border-style:none; vertical-align:middle;background-color: #f5f8fa;} +/*--- Adjust Link Associated Organization Form Modal Window ---*/ -ul li { margin-left: 1.5em;} -ul li { margin-bottom: .7em;} +/*#div_organizationsForm input#submitOrganization { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 5px; +} + +#div_organizationsForm input#submitOrganization:hover { + cursor: pointer; +} + +#div_organizationsForm input[value=cancel] { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 5px; + position: relative; + left: -130px; +} +#div_organizationsForm input[value=cancel]:hover { + cursor: pointer; +}*/ +/*--- Adjust Update Sushi Connection Form Modal Window ---*/ -a.dp-choose-date { +/*#div_updateForm input#submitPlatformNoteForm { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 5px; +} + +#div_updateForm input#submitPlatformNoteForm:hover { + cursor: pointer; +} + +#div_updateForm input#interface-cancel { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 5px; + position: relative; + left: -132px; +} + +#div_updateForm input#interface-cancel:hover { + cursor: pointer; +}*/ + +/*--- Adjust Update User Form Modal Window ---*/ + +/*#div_updateForm input[value=Update] { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 5px; float: left; - width: 16px; - height: 16px; - padding: 0; - margin: 0px 3px 0; - display: block; - text-indent: -2000px; - overflow: hidden; - background: url('../images/calendar.gif') no-repeat; } -a.dp-choose-date.dp-disabled { - background-position: 0 -20px; - cursor: default; + +#div_updateForm input[value=Update]:hover { + cursor: pointer; } -/* makes the input field shorter once the date picker code - * has run (to allow space for the calendar icon - */ -input.dp-applied { - width: 140px; + +#div_updateForm input#update-user-cancel { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 5px; + position: relative; + left: 2px; + top: -16px; +} + +#div_updateForm input#update-user-cancel:hover { + cursor: pointer; +}*/ + +/*--- Adjust Add New User Form Modal Window ---*/ + +/*#div_updateForm input[value=Add\ New] { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 5px; float: left; } -.adminAddInput{margin-top:5px;} -.licenseAddInput{margin-top:5px;margin-bottom;5px;} +#div_updateForm input[value=Add\ New]:hover { + cursor: pointer; +}*/ +/*--- More Spacing for Headers ---*/ +.div_mainContent h3 { + margin-top: 15px; +} -.changeInput{ - padding:1px; - outline:none; -} +.div_mainContent h3:nth-child(1) { + margin-top: 0; +} -select.changeSelect{ - padding:0px; -} +/*--- Adjust Update Outlier Form Modal Window ---*/ -select option.changeSelect{ - padding:0px; +/*#div_updateForm input#outlier-cancel { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 5px; + position: relative; + left: -30px; } -.changeDefault{ - padding:2px; - outline:none; - background:#f5f8fa; - border: solid 1px #a5acb2; - color: #526972; -} +#div_updateForm input#outlier-cancel:hover { + cursor: pointer; +}*/ -.focusField{ - border:solid 1px #526972; - background:#f5f8fa; - color:#2c3c42; -} -.idleField{ - background:#fbfbfb; - color: #526972; - border: solid 1px #a5acb2; -} +/*--- Side Menu Icons ---*/ -.changeAutocomplete{ - padding:2px; - outline:none; - background:#f5f8fa; - border: solid 1px #a5acb2; - color: #526972; -} - - -.changeDefaultWhite{ - border: solid 1px #a5acb2; - color: #526972; -} +a.showImports:before { + font-family: FontAwesome; + content: "\f019"; + font-size: 11px; + margin-right: 5px; +} + +a.showImports { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a.showTitles:before { + font-family: FontAwesome; + content: "\f0c9"; + font-size: 11px; + margin-right: 5px; +} + +a.showTitles { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a.showStatistics:before { + font-family: FontAwesome; + content: "\f080"; + font-size: 11px; + margin-right: 5px; +} + +a.showStatistics { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +a.showLogins:before { + font-family: FontAwesome; + content: "\f007"; + font-size: 11px; + margin-right: 5px; +} + +a.showLogins { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + + +a.showSushi:before { + font-family: FontAwesome; + content: "\f192"; + font-size: 11px; + margin-right: 5px; +} + +a.showSushi { + text-decoration: none; + text-transform: capitalize; + font-size: 12px; +} + +/*--- Get Recent Imports Table to View Properly ---*/ + +div#div_recentImports { + width: 700px; +} + +.dataTable th:nth-child(2) { + max-width: 80px !important; +} + +.dataTable td:nth-child(3) { + max-width: 380px; + word-wrap: break-all; +} + +.dataTable th:nth-child(4) { + max-width: 75px !important; +} + +.dataTable th:nth-child(5) { + max-width: 75px !important; +} + +#importForm fieldset:nth-of-type(1) label { + padding-left: 70px; +} + +/*--- IE 11 Fix for Sidemenu Link Color ---*/ + +.sidemenu span.link a { + color: #fff; +} + +.sidemenu span.link a:hover { + color: #ccc; +} + +/*--- Add New Email Address Modal ---*/ + +/*#div_updateForm a#addButton { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + text-decoration: none; +} + +#div_updateForm a#addButton:hover { + cursor: pointer; +} + +#div_updateForm a#closeButton { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + text-decoration: none; +} + +#div_updateForm a#closeButton:hover { + cursor: pointer; +}*/ + +/*--- Left Align Table Header Text ---*/ + +table.dataTable th { + text-align: left; +} + +/*--- IE10 and IE11 Only ---*/ +@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { + #div_updateForm input#update-user-cancel { + left: 39px; + top: -23px; + } +} + +/*--- Help Menu Link ---*// + +span#divider { + font-size: 12px; + position: relative; + top: 4px; +} + +a#help { + text-decoration: none; + font-size: 12px; + position: relative; + top: 4px; + margin-left: 5px; +} + +a#help:hover { + color: #ccc; +} + +a#help:before { + font-family: FontAwesome; + content: "\f059"; + font-size: 11px; + margin-right: 3px; +} + +td#setLanguage { + vertical-align:middle; +} + +/*--- Adjustments for Language Dropdown ---*/ + +select#lang { + border: none; + margin-left: 6px; + background-color: #fff; + position: relative; + top: 3px; + font-size: 12px; +} + +/*--- Consistentcy for Form Buttons ---*/ + +.submit-button, +.cancel-button, +.save-button + { + color: #FFFFFF; + font-family: "Arial", sans-serif; + font-size: 11px; + font-weight: normal; + background: #1b76a9; + border: none; + padding: 5px 10px; + text-transform: capitalize; + margin-left: 8px; + min-width: 60px; + margin-top: 5px; +} + +.submit-button:hover, +.cancel-button:hover, +.save-button { + cursor: pointer; +} + +.submit-button { + margin-left: 0; +} + +a.submit-button, +a.cancel-button, +a.save-button + { + color: #FFFFFF !important; + text-decoration: none !important; +} + +/*--- Adjustments to Up/Down Arrows ---*/ + +table.noBorderTable td.arrow { + text-align: right; +} + +span#divider { + position: relative; + top: 3px; +} + +#main-menu-titles img { + float: left; +} + +#usage-reports img { + float: none; +} + +/*--- Newly Designed Main Menu ---*/ + +.main-menu-link { + float: left; + padding: 13px 10px 12px; + border-left: solid 1px #5295BA; +} + +#main-menu-titles a:first-child .main-menu-link { + border: none; +} + +.main-menu-link:hover { + background: #4d4d4d; +} + +.main-menu-link.active { + background: #3999c2; +} + +.main-menu-link span { + color: #fff; + text-decoration: none; + font-size: 13px; + font-weight: 600; +} + +.main-menu-link img { + margin-right: 6px; +} + +/*--- Change Module Menu ---*/ + +#change-mod-menu { + padding: 13px 0 12px; + color: #fff; + height: initial; + text-align: center; +} + +#change-mod-menu img { + position: absolute; + left: 10px; + top: 10px; +} + +#change-mod-menu .fa-chevron-down { + font-size: 10px; + position: relative; + top: -2px; + margin-left: 8px; +} + +li.change-mod-item { + background: #4d4d4d; + height: initial !important; + text-align: left; +} + +li.change-mod-item a { + display: block; + color: #fff; + font-size: 14px; + padding: 10px !important; + margin: 0; + line-height: 18px !important; + position: relative !important; + padding-left: 35px !important; +} + +.change-mod-item a span { + position: relative; + top: 1px; +} + +#change-mod-menu span { + font-size: 13px; + font-weight: 600; +} + +li.change-mod-item:hover { + background-color: none !important; +} + +/*--- New Top Bar Titles ---*/ + +#main-title { + font-size: 36px; + color: #6098A7; + font-family: "Open Sans"; + font-weight: 100; + float: left; +} + +#main-title span { + float: left; +} + +#menu-login { + float: right; + text-align: right; +} + +#main-title-text { + margin-left: 15px; +} + +#powered-by-text img { + vertical-align: text-bottom; + margin-left: 7px; + float: none; +} + +#powered-by-text { + color: #687FA1; + margin-top: 20px; + font-size: 14px; + margin-left: 10px; +} + +#main-title > img { + margin-left: 15px; + float: left !important; +} + +table.titleTable { + border-collapse: collapse; +} + +/*--- Main Table ---*/ + +#main-table { + margin: 0 30px; +} + +#TB_window { + max-height: 75vh !important; + max-width: 100vw !important; + overflow-y: auto !important; + top: 5vh !important; + margin-top: 0px !important; +} diff --git a/css/thickbox.css b/css/thickbox.css index a491b9e..8a79568 100755 --- a/css/thickbox.css +++ b/css/thickbox.css @@ -57,6 +57,7 @@ text-align:left; top:50%; left:50%; + width: auto !important; } * html #TB_window { /* ie6 hack */ @@ -109,10 +110,11 @@ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = d overflow:auto; text-align:left; line-height:1.4em; -} + height: auto !important; + width: auto !important;} #TB_ajaxContent.TB_modal{ - padding:15px; + padding: 10px; } #TB_ajaxContent p{ diff --git a/directory.php b/directory.php index 57464c5..2817c5f 100755 --- a/directory.php +++ b/directory.php @@ -23,8 +23,8 @@ // Useful directory constants, ending with |/|. -define('ADMIN_DIR', dirname(__FILE__) . '/admin/'); define('BASE_DIR', dirname(__FILE__) . '/'); +define('ADMIN_DIR', BASE_DIR . 'admin/'); define('CLASSES_DIR', ADMIN_DIR . 'classes/'); // Automatically load undefined classes from subdirectories of |CLASSES_DIR|. @@ -138,6 +138,23 @@ function debug($value) { echo '
'.print_r($value, true).'
'; } - +// Include file of language codes +include_once 'LangCodes.php'; +$lang_name = new LangCodes(); + +// Verify the language of the browser +global $http_lang; +if(isset($_COOKIE["lang"])){ + $http_lang = $_COOKIE["lang"]; +}else{ + $codeL = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,5); + $http_lang = $lang_name->getLanguage($codeL); + if($http_lang == "") + $http_lang = "en_US"; +} +putenv("LC_ALL=$http_lang"); +setlocale(LC_ALL, $http_lang.".utf8"); +bindtextdomain("messages", dirname(__FILE__) . "/locale"); +textdomain("messages"); ?> \ No newline at end of file diff --git a/images/add.gif b/images/add.gif new file mode 100644 index 0000000..1eacfbd Binary files /dev/null and b/images/add.gif differ diff --git a/images/arrowdown.png b/images/arrowdown.png new file mode 100644 index 0000000..6b3a006 Binary files /dev/null and b/images/arrowdown.png differ diff --git a/images/arrowup.png b/images/arrowup.png new file mode 100644 index 0000000..2106ace Binary files /dev/null and b/images/arrowup.png differ diff --git a/images/authpage.gif b/images/authpage.gif new file mode 100644 index 0000000..4bb475b Binary files /dev/null and b/images/authpage.gif differ diff --git a/images/back-header.jpg b/images/back-header.jpg new file mode 100644 index 0000000..4ca4142 Binary files /dev/null and b/images/back-header.jpg differ diff --git a/images/bg-diagonal-stripes.png b/images/bg-diagonal-stripes.png new file mode 100644 index 0000000..e94c385 Binary files /dev/null and b/images/bg-diagonal-stripes.png differ diff --git a/images/bg-gray-texture.jpg b/images/bg-gray-texture.jpg new file mode 100644 index 0000000..ef0afea Binary files /dev/null and b/images/bg-gray-texture.jpg differ diff --git a/images/change/coral-cancellation.gif b/images/change/coral-cancellation.gif deleted file mode 100755 index 54e3e44..0000000 Binary files a/images/change/coral-cancellation.gif and /dev/null differ diff --git a/images/change/coral-cancellation.png b/images/change/coral-cancellation.png new file mode 100644 index 0000000..4ac5e63 Binary files /dev/null and b/images/change/coral-cancellation.png differ diff --git a/images/change/coral-change.gif b/images/change/coral-change.gif index 6953e6f..67ba1b9 100755 Binary files a/images/change/coral-change.gif and b/images/change/coral-change.gif differ diff --git a/images/change/coral-licensing.gif b/images/change/coral-licensing.gif index 8503045..6c2f483 100755 Binary files a/images/change/coral-licensing.gif and b/images/change/coral-licensing.gif differ diff --git a/images/change/coral-licensing.png b/images/change/coral-licensing.png new file mode 100644 index 0000000..378f529 Binary files /dev/null and b/images/change/coral-licensing.png differ diff --git a/images/change/coral-main.gif b/images/change/coral-main.gif index 793a3c8..ef8376e 100755 Binary files a/images/change/coral-main.gif and b/images/change/coral-main.gif differ diff --git a/images/change/coral-main.png b/images/change/coral-main.png new file mode 100644 index 0000000..5b4548e Binary files /dev/null and b/images/change/coral-main.png differ diff --git a/images/change/coral-management.png b/images/change/coral-management.png new file mode 100644 index 0000000..94a36f5 Binary files /dev/null and b/images/change/coral-management.png differ diff --git a/images/change/coral-organizations.gif b/images/change/coral-organizations.gif index 1388015..34c370d 100755 Binary files a/images/change/coral-organizations.gif and b/images/change/coral-organizations.gif differ diff --git a/images/change/coral-organizations.png b/images/change/coral-organizations.png new file mode 100644 index 0000000..2e3c830 Binary files /dev/null and b/images/change/coral-organizations.png differ diff --git a/images/change/coral-resources.gif b/images/change/coral-resources.gif index e69c256..ba7b5fb 100755 Binary files a/images/change/coral-resources.gif and b/images/change/coral-resources.gif differ diff --git a/images/change/coral-resources.png b/images/change/coral-resources.png new file mode 100644 index 0000000..efa3421 Binary files /dev/null and b/images/change/coral-resources.png differ diff --git a/images/change/coral-usage.gif b/images/change/coral-usage.gif index 628a897..cf5c4d4 100755 Binary files a/images/change/coral-usage.gif and b/images/change/coral-usage.gif differ diff --git a/images/change/coral-usage.png b/images/change/coral-usage.png new file mode 100644 index 0000000..a17c093 Binary files /dev/null and b/images/change/coral-usage.png differ diff --git a/images/change/icon-mod-cancellation.png b/images/change/icon-mod-cancellation.png new file mode 100644 index 0000000..bcab23a Binary files /dev/null and b/images/change/icon-mod-cancellation.png differ diff --git a/images/change/icon-mod-licensing.png b/images/change/icon-mod-licensing.png new file mode 100644 index 0000000..00792ca Binary files /dev/null and b/images/change/icon-mod-licensing.png differ diff --git a/images/change/icon-mod-main.png b/images/change/icon-mod-main.png new file mode 100644 index 0000000..3f8eae1 Binary files /dev/null and b/images/change/icon-mod-main.png differ diff --git a/images/change/icon-mod-management.png b/images/change/icon-mod-management.png new file mode 100644 index 0000000..73b95c1 Binary files /dev/null and b/images/change/icon-mod-management.png differ diff --git a/images/change/icon-mod-organizations.png b/images/change/icon-mod-organizations.png new file mode 100644 index 0000000..6dc54bc Binary files /dev/null and b/images/change/icon-mod-organizations.png differ diff --git a/images/change/icon-mod-resources.png b/images/change/icon-mod-resources.png new file mode 100644 index 0000000..a01eb84 Binary files /dev/null and b/images/change/icon-mod-resources.png differ diff --git a/images/change/icon-mod-usage.png b/images/change/icon-mod-usage.png new file mode 100644 index 0000000..dbb3eae Binary files /dev/null and b/images/change/icon-mod-usage.png differ diff --git a/images/favicon.ico b/images/favicon.ico new file mode 100644 index 0000000..609cd4a Binary files /dev/null and b/images/favicon.ico differ diff --git a/images/login.gif b/images/login.gif new file mode 100644 index 0000000..7f55239 Binary files /dev/null and b/images/login.gif differ diff --git a/images/logo-coral.jpg b/images/logo-coral.jpg new file mode 100644 index 0000000..26dc1dd Binary files /dev/null and b/images/logo-coral.jpg differ diff --git a/images/menu/icon-admin.png b/images/menu/icon-admin.png new file mode 100644 index 0000000..4c64de7 Binary files /dev/null and b/images/menu/icon-admin.png differ diff --git a/images/menu/icon-home.png b/images/menu/icon-home.png new file mode 100644 index 0000000..813cb0c Binary files /dev/null and b/images/menu/icon-home.png differ diff --git a/images/menu/icon-import.png b/images/menu/icon-import.png new file mode 100644 index 0000000..9eb1cd9 Binary files /dev/null and b/images/menu/icon-import.png differ diff --git a/images/menu/icon-report-options.png b/images/menu/icon-report-options.png new file mode 100644 index 0000000..b70848f Binary files /dev/null and b/images/menu/icon-report-options.png differ diff --git a/images/menu/icon-sushi.png b/images/menu/icon-sushi.png new file mode 100644 index 0000000..e52769b Binary files /dev/null and b/images/menu/icon-sushi.png differ diff --git a/images/menu/icon-usage.png b/images/menu/icon-usage.png new file mode 100644 index 0000000..1fdb38c Binary files /dev/null and b/images/menu/icon-usage.png differ diff --git a/images/menu/menu-admin-on.gif b/images/menu/menu-admin-on.gif deleted file mode 100755 index 79c0a94..0000000 Binary files a/images/menu/menu-admin-on.gif and /dev/null differ diff --git a/images/menu/menu-admin-over.gif b/images/menu/menu-admin-over.gif deleted file mode 100755 index b423145..0000000 Binary files a/images/menu/menu-admin-over.gif and /dev/null differ diff --git a/images/menu/menu-admin.gif b/images/menu/menu-admin.gif deleted file mode 100755 index 45727dc..0000000 Binary files a/images/menu/menu-admin.gif and /dev/null differ diff --git a/images/menu/menu-fileimport-on.gif b/images/menu/menu-fileimport-on.gif deleted file mode 100755 index d6a98de..0000000 Binary files a/images/menu/menu-fileimport-on.gif and /dev/null differ diff --git a/images/menu/menu-fileimport-over.gif b/images/menu/menu-fileimport-over.gif deleted file mode 100755 index 96513c4..0000000 Binary files a/images/menu/menu-fileimport-over.gif and /dev/null differ diff --git a/images/menu/menu-fileimport.gif b/images/menu/menu-fileimport.gif deleted file mode 100755 index 4119066..0000000 Binary files a/images/menu/menu-fileimport.gif and /dev/null differ diff --git a/images/menu/menu-home-on.gif b/images/menu/menu-home-on.gif deleted file mode 100755 index fbfafdc..0000000 Binary files a/images/menu/menu-home-on.gif and /dev/null differ diff --git a/images/menu/menu-home-over.gif b/images/menu/menu-home-over.gif deleted file mode 100755 index 8b1f133..0000000 Binary files a/images/menu/menu-home-over.gif and /dev/null differ diff --git a/images/menu/menu-home.gif b/images/menu/menu-home.gif deleted file mode 100755 index 2478b84..0000000 Binary files a/images/menu/menu-home.gif and /dev/null differ diff --git a/images/menu/menu-reportingoptions-on.gif b/images/menu/menu-reportingoptions-on.gif deleted file mode 100755 index 0c2bf7a..0000000 Binary files a/images/menu/menu-reportingoptions-on.gif and /dev/null differ diff --git a/images/menu/menu-reportingoptions-over.gif b/images/menu/menu-reportingoptions-over.gif deleted file mode 100755 index 7fa8751..0000000 Binary files a/images/menu/menu-reportingoptions-over.gif and /dev/null differ diff --git a/images/menu/menu-reportingoptions.gif b/images/menu/menu-reportingoptions.gif deleted file mode 100755 index ded934c..0000000 Binary files a/images/menu/menu-reportingoptions.gif and /dev/null differ diff --git a/images/menu/menu-sushi-on.gif b/images/menu/menu-sushi-on.gif deleted file mode 100755 index 91e3667..0000000 Binary files a/images/menu/menu-sushi-on.gif and /dev/null differ diff --git a/images/menu/menu-sushi-over.gif b/images/menu/menu-sushi-over.gif deleted file mode 100755 index b8353d0..0000000 Binary files a/images/menu/menu-sushi-over.gif and /dev/null differ diff --git a/images/menu/menu-sushi.gif b/images/menu/menu-sushi.gif deleted file mode 100755 index 508a554..0000000 Binary files a/images/menu/menu-sushi.gif and /dev/null differ diff --git a/images/seahorsefavicon.ico b/images/seahorsefavicon.ico deleted file mode 100755 index d4e813c..0000000 Binary files a/images/seahorsefavicon.ico and /dev/null differ diff --git a/images/seahorseicon.jpg b/images/seahorseicon.jpg deleted file mode 100755 index 7e345ba..0000000 Binary files a/images/seahorseicon.jpg and /dev/null differ diff --git a/images/seahorseicon.png b/images/seahorseicon.png deleted file mode 100755 index 8804a7e..0000000 Binary files a/images/seahorseicon.png and /dev/null differ diff --git a/images/seahorseicon_bw.png b/images/seahorseicon_bw.png deleted file mode 100755 index 2a5fb9d..0000000 Binary files a/images/seahorseicon_bw.png and /dev/null differ diff --git a/images/title-icon-usage.png b/images/title-icon-usage.png new file mode 100644 index 0000000..17c3dbe Binary files /dev/null and b/images/title-icon-usage.png differ diff --git a/images/usage-reports-button.gif b/images/usage-reports-button.gif deleted file mode 100755 index c773144..0000000 Binary files a/images/usage-reports-button.gif and /dev/null differ diff --git a/images/usagetitle.gif b/images/usagetitle.gif index 1548a8a..f87038c 100755 Binary files a/images/usagetitle.gif and b/images/usagetitle.gif differ diff --git a/images/usagetitle.jpg b/images/usagetitle.jpg new file mode 100644 index 0000000..635e0d5 Binary files /dev/null and b/images/usagetitle.jpg differ diff --git a/images/xls.gif b/images/xls.gif index cf58968..21f7d2c 100755 Binary files a/images/xls.gif and b/images/xls.gif differ diff --git a/import.php b/import.php index 8b5ea9f..30e10c1 100755 --- a/import.php +++ b/import.php @@ -1,6 +1,6 @@ - + -
Usage Statistics Import
+
Incorrect File format, must be .txt!

"; + echo "" . _("Incorrect File format, must be .txt!") . "

"; break; case 2: - echo "There was an error uploading the file. Please verify the size is not over 5MB and try again!

"; + echo "" . _("There was an error uploading the file. Please verify the size is not over 5MB and try again!") . "

"; break; case 3: - echo "File has an incorrectly formatted name - try filename.txt!

"; + echo "" . _("File has an incorrectly formatted name - try filename.txt!") . "

"; break; } } @@ -40,12 +40,12 @@
- File:


+


Layout:
"; foreach($layout->getLayouts as $lo) { echo "\n"; } @@ -54,8 +54,8 @@

-  Override previous month verification

- +  

+ @@ -65,12 +65,12 @@



-
Instructions:
+


@@ -79,7 +79,7 @@ -
Recent Imports   
+
   
diff --git a/index.php b/index.php index 100d761..5516166 100755 --- a/index.php +++ b/index.php @@ -1,126 +1,126 @@ - -. -** -************************************************************************************************************************** -*/ - - -session_start(); - -include_once 'directory.php'; - -//print header -$pageTitle='Home'; -include 'templates/header.php'; - -//used for creating a "sticky form" for back buttons -//except we don't want it to retain if they press the 'index' button -//check what referring script is - -if ($_SESSION['ref_script'] != "publisherPlatform.php"){ - $reset = "Y"; -} - -$_SESSION['ref_script']=$currentPage; - - -?> - -
- - - - -
- - - - -
- Search
- new search -
 
-
- - - - - - - - - - - - -
-
-
-
margin-left:118px;margin-top:5px'>
-
-
-
- getAlphabeticalList; - - foreach ($alphArray as $letter){ - if ((isset($pAlphArray[$letter])) && ($pAlphArray[$letter] > 0)){ - echo "" . $letter . ""; - if ($letter == "N") echo "
"; - }else{ - echo "" . $letter . ""; - if ($letter == "N") echo "
"; - } - } - ?> -
-
- -
-
-
-
-
- -"; - - //print footer - include 'templates/footer.php'; +. +** +************************************************************************************************************************** +*/ + + +session_start(); + +include_once 'directory.php'; + +//print header +$pageTitle=_('Home'); +include 'templates/header.php'; + +//used for creating a "sticky form" for back buttons +//except we don't want it to retain if they press the 'index' button +//check what referring script is + +if ((isset($_SESSION['ref_script'])) and ($_SESSION['ref_script'] != "publisherPlatform.php")){ + $reset = "Y"; +} + +$_SESSION['ref_script']=$currentPage; + + +?> + +
+ + + + +
+ + + + +
+
+ +
 
+
+ + + + + + + + + + + + +
+
+
+
margin-left:118px;margin-top:5px'>
+
+
+
+ getAlphabeticalList; + + foreach ($alphArray as $letter){ + if ((isset($pAlphArray[$letter])) && ($pAlphArray[$letter] > 0)){ + echo "" . $letter . ""; + if ($letter == "N") echo "
"; + }else{ + echo "" . $letter . ""; + if ($letter == "N") echo "
"; + } + } + ?> +
+
+ +
+
+
+
+
+ +"; + + //print footer + include 'templates/footer.php'; +?> \ No newline at end of file diff --git a/install/CORALInstaller.php b/install/CORALInstaller.php index 0791cde..d79c9f8 100755 --- a/install/CORALInstaller.php +++ b/install/CORALInstaller.php @@ -15,6 +15,18 @@ class CORALInstaller { protected $statusNotes; protected $config; protected $updates = array( + "1.2" => array( + "privileges" => array("ALTER","CREATE"), + "installedTablesCheck" => array("Version"), + "description" => "

The 1.2 update includes the following

+
    +
  • Misc. bug fixes
  • +
  • Migrated from deprecated mysql to mysqli functions
  • +
  • Added form validation
  • +
  • SUSHI improvements
  • +
+

The database change will increae the number of the allowed characters in the TitleIdentifer table.

" + ), "1.1" => array( "privileges" => array("ALTER","CREATE","DROP"), "installedTablesCheck" => array("Layout"), @@ -51,17 +63,10 @@ public function connect($username = null, $password = null) { if ($password === null) { $password = $this->config->database->password; } - $this->db = @mysql_connect($host, $username, $password); + $this->db = @mysqli_connect($host, $username, $password, $this->config->database->name); if (!$this->db) { - $this->error = mysql_error(); - if (!$this->error) { - $this->error = "Access denied for user '$username'"; - } - } else { - $databaseName = $this->config->database->name; - mysql_select_db($databaseName, $this->db); - $this->error = mysql_error($this->db); + $this->error = mysqli_error($this->db); } if ($this->error) { @@ -73,30 +78,36 @@ public function connect($username = null, $password = null) { } public function query($sql) { - $result = mysql_query($sql, $this->db); + $result = mysqli_query($this->db, $sql); $this->checkForError(); $data = array(); - if (is_resource($result)) { - while ($row = mysql_fetch_array($result)) { - array_push($data, $row); - } - } else if ($result) { - $data = mysql_insert_id($this->db); - } + if ($result instanceof mysqli_result) { - return $data; - } + while ($row = mysqli_fetch_array($result)) { + if (mysqli_affected_rows($this->db) > 1) { + array_push($data, $row); + } else { + $data = $row; + } + } + mysqli_free_result($result); + } else if ($result) { + $data = mysqli_insert_id($this->db); + } - protected function checkForError() { - if ($this->error = mysql_error($this->db)) { - throw new Exception("There was a problem with the database: " . $this->error); - } - } + return $data; + } + + protected function checkForError() { + if ($this->error = mysqli_error($this->db)) { + throw new Exception("There was a problem with the database: " . $this->error); + } + } - public function getDatabaseName() { - return $this->config->database->name; + public function getDatabase() { + return $this->db; } public function addErrorMessage($error) { @@ -241,6 +252,24 @@ public function isUpdateInstalled($version) { $this->statusNotes["version_".$version] = "Version $version already installed. Found tables: ".implode(", ", $installedTablesCheck); return true; } + else + { + $query = "SELECT version FROM ".$this->config->database->name.".Version WHERE version = '".$version."'"; + try{ + $databaseVersion = $this->query($query); + } + catch (Exception $e){ + //$this->statusNotes["version_".$version."_db_error"] = $e; + }; + + if($version == $databaseVersion[0]){ + $this->statusNotes["version_".$version] = "Version $version already installed."; + return true; + }else{ + $this->statusNotes["version_".$version] = "Version $version not installed. Could not find the version in the Version table"; + return false; + } + } } return false; } diff --git a/install/SECURITY-Enforce-redirect-to-login-page.patch b/install/SECURITY-Enforce-redirect-to-login-page.patch new file mode 100644 index 0000000..98f04a4 --- /dev/null +++ b/install/SECURITY-Enforce-redirect-to-login-page.patch @@ -0,0 +1,21 @@ +diff --git a/user.php b/user.php +index ef68901..1fe9e83 100755 +--- a/user.php ++++ b/user.php +@@ -57,6 +57,8 @@ if ($config->settings->authModule == 'Y'){ + $authURL = $util->getCORALURL() . "auth/" . $addURL . htmlentities($_SERVER['REQUEST_URI']); + header('Location: ' . $authURL, true); + ++ exit; //PREVENT SECURITY HOLE ++ + } + + +@@ -110,6 +112,7 @@ if ($loginID){ + //if the user doesn't exist in database we need to redirect them to a page to give instructions on how to be added + if ($user->privilegeID == ""){ + header('Location: not_avail.php'); ++ exit; //PREVENT SECURITY HOLE + } + } + diff --git a/install/install.php b/install/install.php index 9e89103..b84ee49 100755 --- a/install/install.php +++ b/install/install.php @@ -33,13 +33,13 @@ }else{ //first check connecting to host - $link = @mysqli_connect("$database_host", "$database_username", "$database_password"); + $link = mysqli_connect($database_host, $database_username, $database_password); if (!$link) { $errorMessage[] = "Could not connect to the server '" . $database_host . "'
MySQL Error: " . mysqli_error($link); }else{ //next check that the database exists - $dbcheck = @mysqli_select_db($link, "$database_name"); + $dbcheck = mysqli_select_db($link, $database_name); if (!$dbcheck) { $errorMessage[] = "Unable to access the database '" . $database_name . "'. Please verify it has been created.
MySQL Error: " . mysqli_error($link); }else{ @@ -142,7 +142,7 @@ }else{ //next check that the database exists - $dbcheck = @mysqli_select_db("$database_name"); + $dbcheck = @mysqli_select_db($link, $database_name); if (!$dbcheck) { $errorMessage[] = "Unable to access the database '" . $database_name . "'. Please verify it has been created.
MySQL Error: " . mysqli_error($link); }else{ @@ -323,7 +323,7 @@ } if (count($errorMessage) > 0){ - $step="5"; + $step="4"; } diff --git a/install/manual_upgrade_charset_utf8.txt b/install/manual_upgrade_charset_utf8.txt new file mode 100644 index 0000000..9ac141f --- /dev/null +++ b/install/manual_upgrade_charset_utf8.txt @@ -0,0 +1,6 @@ +How to change the charset in the database to utf8 + + -Open SQL file in /coral/usage/install/protected/update_latin1-to-utf8.sql and replace _DATABASE_NAME_ with your database schema name + -Run SQL file + +This script will change the charset in the database and convert all tables to utf8. \ No newline at end of file diff --git a/install/protected/install.sql b/install/protected/install.sql index e853420..8e9b84b 100755 --- a/install/protected/install.sql +++ b/install/protected/install.sql @@ -8,7 +8,7 @@ CREATE TABLE `ExternalLogin` ( `loginURL` varchar(245) default NULL, `noteText` text, PRIMARY KEY USING BTREE (`externalLoginID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `ImportLog`; @@ -22,14 +22,14 @@ CREATE TABLE `ImportLog` ( `logFileURL` varchar(145) DEFAULT NULL, `details` varchar(245) DEFAULT NULL, PRIMARY KEY (`importLogID`) USING BTREE -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `LogEmailAddress`; CREATE TABLE `LogEmailAddress` ( `logEmailAddressID` int(11) NOT NULL auto_increment, `emailAddress` varchar(50) default NULL, PRIMARY KEY (`logEmailAddressID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `MonthlyUsageSummary`; CREATE TABLE `MonthlyUsageSummary` ( @@ -49,7 +49,7 @@ CREATE TABLE `MonthlyUsageSummary` ( KEY `Index_publisherPlatformID` (`publisherPlatformID`), KEY `Index_year` (`year`), KEY `Index_TPPYMA` (`titleID`,`publisherPlatformID`,`year`,`month`,`archiveInd`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `Outlier`; CREATE TABLE `Outlier` ( @@ -59,7 +59,7 @@ CREATE TABLE `Outlier` ( `overagePercent` int(3) default NULL, `color` varchar(45) NOT NULL, PRIMARY KEY (`outlierID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `Platform`; CREATE TABLE `Platform` ( @@ -69,7 +69,7 @@ CREATE TABLE `Platform` ( `reportDisplayName` varchar(150) default NULL, `reportDropDownInd` tinyint(1) unsigned default '0', PRIMARY KEY (`platformID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `PlatformNote`; CREATE TABLE `PlatformNote` ( @@ -80,21 +80,21 @@ CREATE TABLE `PlatformNote` ( `counterCompliantInd` tinyint(1) unsigned default NULL, `noteText` text, PRIMARY KEY USING BTREE (`platformNoteID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `Privilege`; CREATE TABLE `Privilege` ( `privilegeID` int(10) unsigned NOT NULL auto_increment, `shortName` varchar(50) default NULL, PRIMARY KEY USING BTREE (`privilegeID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `Publisher`; CREATE TABLE `Publisher` ( `publisherID` int(11) NOT NULL auto_increment, `name` varchar(150) NOT NULL, PRIMARY KEY (`publisherID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `PublisherPlatform`; CREATE TABLE `PublisherPlatform` ( @@ -105,7 +105,7 @@ CREATE TABLE `PublisherPlatform` ( `reportDisplayName` varchar(150) NOT NULL, `reportDropDownInd` tinyint(1) unsigned NOT NULL, PRIMARY KEY (`publisherPlatformID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `PublisherPlatformNote`; CREATE TABLE `PublisherPlatformNote` ( @@ -115,7 +115,7 @@ CREATE TABLE `PublisherPlatformNote` ( `endYear` int(4) unsigned default NULL, `noteText` text, PRIMARY KEY USING BTREE (`publisherPlatformNoteID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `Title`; CREATE TABLE `Title` ( @@ -124,19 +124,19 @@ CREATE TABLE `Title` ( `resourceType` varchar(45) DEFAULT NULL, PRIMARY KEY (`titleID`), KEY `Index_title` (`title`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `TitleIdentifier`; CREATE TABLE `TitleIdentifier` ( `titleIdentifierID` int(11) NOT NULL AUTO_INCREMENT, `titleID` int(11) DEFAULT NULL, `identifier` varchar(25) DEFAULT NULL, - `identifierType` varchar(25) DEFAULT NULL, + `identifierType` varchar(30) DEFAULT NULL, PRIMARY KEY (`titleIdentifierID`), KEY `Index_titleID` (`titleID`), KEY `Index_issn` (`identifier`) USING BTREE, KEY `Index_ISSNType` (`identifierType`) USING BTREE -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `User`; CREATE TABLE `User` ( @@ -144,7 +144,7 @@ CREATE TABLE `User` ( `lastName` varchar(45) default NULL, `firstName` varchar(45) default NULL, `privilegeID` int(10) unsigned NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `YearlyUsageSummary`; CREATE TABLE `YearlyUsageSummary` ( @@ -165,7 +165,7 @@ CREATE TABLE `YearlyUsageSummary` ( KEY `Index_publisherPlatformID` (`publisherPlatformID`), KEY `Index_year` (`year`), KEY `Index_TPPYA` (`titleID`,`publisherPlatformID`,`year`,`archiveInd`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; ALTER TABLE `MonthlyUsageSummary` ADD COLUMN `activityType` VARCHAR(45) NULL AFTER `mergeInd` ; ALTER TABLE `MonthlyUsageSummary` ADD COLUMN `sectionType` VARCHAR(45) NULL AFTER `activityType` ; @@ -179,7 +179,7 @@ CREATE TABLE `Layout` ( `name` varchar(45) DEFAULT NULL, `resourceType` varchar(45) DEFAULT NULL, PRIMARY KEY (`layoutID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `SushiService`; CREATE TABLE `SushiService` ( @@ -200,7 +200,7 @@ CREATE TABLE `SushiService` ( PRIMARY KEY (`sushiServiceID`), KEY `Index_publisherPlatformID` (`publisherPlatformID`), KEY `Index_platformID` (`platformID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `ImportLogPlatformLink`; CREATE TABLE `ImportLogPlatformLink` ( @@ -209,7 +209,13 @@ CREATE TABLE `ImportLogPlatformLink` ( `importLogID` int(11) DEFAULT NULL, PRIMARY KEY (`importLogPlatformLinkID`), KEY `Index_platformID` (`platformID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `Version`; +CREATE TABLE `Version` ( + `version` varchar(10) NOT NULL +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; +INSERT INTO Version (version) values('1.2'); INSERT INTO Layout (layoutCode, name, resourceType) values('JR1_R3', 'Journals (JR1) R3', 'Journal'); INSERT INTO Layout (layoutCode, name, resourceType) values('JR1a_R3', 'Journals (JR1) R3 archive', 'Journal'); diff --git a/install/protected/update_1.1.sql b/install/protected/update_1.1.sql index 96c3015..87f67f4 100755 --- a/install/protected/update_1.1.sql +++ b/install/protected/update_1.1.sql @@ -1,72 +1,72 @@ -CREATE TABLE `Layout` ( - `layoutID` int(11) NOT NULL AUTO_INCREMENT, - `layoutCode` varchar(45) NOT NULL, - `name` varchar(45) DEFAULT NULL, - `resourceType` varchar(45) DEFAULT NULL, - PRIMARY KEY (`layoutID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; - -INSERT INTO Layout (layoutCode, name, resourceType) values('JR1_R3', 'Journals (JR1) R3', 'Journal'); -INSERT INTO Layout (layoutCode, name, resourceType) values('JR1a_R3', 'Journals (JR1) R3 archive', 'Journal'); -INSERT INTO Layout (layoutCode, name, resourceType) values('JR1_R4', 'Journals (JR1) R4', 'Journal'); -INSERT INTO Layout (layoutCode, name, resourceType) values('JR1a_R4', 'Journals (JR1) R4 archive', 'Journal'); -INSERT INTO Layout (layoutCode, name, resourceType) values('BR1_R3', 'Books (BR1) R3', 'Book'); -INSERT INTO Layout (layoutCode, name, resourceType) values('BR1_R4', 'Books (BR1) R4', 'Book'); -INSERT INTO Layout (layoutCode, name, resourceType) values('BR2_R3', 'Book Sections (BR2) R3', 'Book'); -INSERT INTO Layout (layoutCode, name, resourceType) values('BR2_R4', 'Book Sections (BR2) R4', 'Book'); -INSERT INTO Layout (layoutCode, name, resourceType) values('DB1_R3', 'Database (DB1) R3', 'Database'); -INSERT INTO Layout (layoutCode, name, resourceType) values('DB1_R4', 'Database (DB1) R4', 'Database'); - -ALTER TABLE `ImportLog` ADD COLUMN `layoutCode` VARCHAR(45) NULL AFTER `importDateTime` ; -ALTER TABLE `ImportLog` ADD COLUMN `sushiServiceID` INT NULL AFTER `loginID` ; -ALTER TABLE `ImportLog` CHANGE COLUMN `fileName` `fileName` VARCHAR(145) NULL ; -ALTER TABLE `ImportLog` CHANGE COLUMN `archiveFileURL` `archiveFileURL` VARCHAR(145) NULL ; -ALTER TABLE `ImportLog` CHANGE COLUMN `logFileURL` `logFileURL` VARCHAR(145) NULL ; -ALTER TABLE `ImportLog` CHANGE COLUMN `details` `details` VARCHAR(245) NULL ; - -ALTER TABLE `Title` -ADD COLUMN `resourceType` VARCHAR(45) NULL AFTER `title` ; - -UPDATE Title SET resourceType="Journal"; - -ALTER TABLE `TitleISSN` -CHANGE COLUMN `titleISSNID` `titleIdentifierID` INT(11) NOT NULL AUTO_INCREMENT , -CHANGE COLUMN `issn` `identifier` VARCHAR(20) NULL DEFAULT NULL , -CHANGE COLUMN `issnType` `identifierType` VARCHAR(20) NULL DEFAULT NULL , -RENAME TO `TitleIdentifier` ; - -UPDATE TitleIdentifier SET identifierType="ISSN" where identifierType="print"; -UPDATE TitleIdentifier SET identifierType="eISSN" where identifierType="online"; - -ALTER TABLE `MonthlyUsageSummary` ADD COLUMN `activityType` VARCHAR(45) NULL AFTER `mergeInd` ; -ALTER TABLE `MonthlyUsageSummary` ADD COLUMN `sectionType` VARCHAR(45) NULL AFTER `activityType` ; -ALTER TABLE `YearlyUsageSummary` ADD COLUMN `activityType` VARCHAR(45) NULL AFTER `mergeInd` ; -ALTER TABLE `YearlyUsageSummary` ADD COLUMN `sectionType` VARCHAR(45) NULL AFTER `activityType` ; - -CREATE TABLE `SushiService` ( - `sushiServiceID` int(11) NOT NULL AUTO_INCREMENT, - `platformID` int(11) DEFAULT NULL, - `publisherPlatformID` int(11) DEFAULT NULL, - `serviceURL` varchar(300) DEFAULT NULL, - `wsdlURL` varchar(300) DEFAULT NULL, - `requestorID` varchar(300) DEFAULT NULL, - `customerID` varchar(300) DEFAULT NULL, - `login` varchar(300) DEFAULT NULL, - `password` varchar(300) DEFAULT NULL, - `security` varchar(300) DEFAULT NULL, - `serviceDayOfMonth` varchar(300) DEFAULT NULL, - `noteText` varchar(300) DEFAULT NULL, - `releaseNumber` varchar(45) DEFAULT NULL, - `reportLayouts` varchar(45) DEFAULT NULL, - PRIMARY KEY (`sushiServiceID`), - KEY `Index_publisherPlatformID` (`publisherPlatformID`), - KEY `Index_platformID` (`platformID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; - -CREATE TABLE `ImportLogPlatformLink` ( - `importLogPlatformLinkID` int(11) NOT NULL AUTO_INCREMENT, - `platformID` int(11) DEFAULT NULL, - `importLogID` int(11) DEFAULT NULL, - PRIMARY KEY (`importLogPlatformLinkID`), - KEY `Index_platformID` (`platformID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +CREATE TABLE `Layout` ( + `layoutID` int(11) NOT NULL AUTO_INCREMENT, + `layoutCode` varchar(45) NOT NULL, + `name` varchar(45) DEFAULT NULL, + `resourceType` varchar(45) DEFAULT NULL, + PRIMARY KEY (`layoutID`) +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; + +INSERT INTO Layout (layoutCode, name, resourceType) values('JR1_R3', 'Journals (JR1) R3', 'Journal'); +INSERT INTO Layout (layoutCode, name, resourceType) values('JR1a_R3', 'Journals (JR1) R3 archive', 'Journal'); +INSERT INTO Layout (layoutCode, name, resourceType) values('JR1_R4', 'Journals (JR1) R4', 'Journal'); +INSERT INTO Layout (layoutCode, name, resourceType) values('JR1a_R4', 'Journals (JR1) R4 archive', 'Journal'); +INSERT INTO Layout (layoutCode, name, resourceType) values('BR1_R3', 'Books (BR1) R3', 'Book'); +INSERT INTO Layout (layoutCode, name, resourceType) values('BR1_R4', 'Books (BR1) R4', 'Book'); +INSERT INTO Layout (layoutCode, name, resourceType) values('BR2_R3', 'Book Sections (BR2) R3', 'Book'); +INSERT INTO Layout (layoutCode, name, resourceType) values('BR2_R4', 'Book Sections (BR2) R4', 'Book'); +INSERT INTO Layout (layoutCode, name, resourceType) values('DB1_R3', 'Database (DB1) R3', 'Database'); +INSERT INTO Layout (layoutCode, name, resourceType) values('DB1_R4', 'Database (DB1) R4', 'Database'); + +ALTER TABLE `ImportLog` ADD COLUMN `layoutCode` VARCHAR(45) NULL AFTER `importDateTime` ; +ALTER TABLE `ImportLog` ADD COLUMN `sushiServiceID` INT NULL AFTER `loginID` ; +ALTER TABLE `ImportLog` CHANGE COLUMN `fileName` `fileName` VARCHAR(145) NULL ; +ALTER TABLE `ImportLog` CHANGE COLUMN `archiveFileURL` `archiveFileURL` VARCHAR(145) NULL ; +ALTER TABLE `ImportLog` CHANGE COLUMN `logFileURL` `logFileURL` VARCHAR(145) NULL ; +ALTER TABLE `ImportLog` CHANGE COLUMN `details` `details` VARCHAR(245) NULL ; + +ALTER TABLE `Title` +ADD COLUMN `resourceType` VARCHAR(45) NULL AFTER `title` ; + +UPDATE Title SET resourceType="Journal"; + +ALTER TABLE `TitleISSN` +CHANGE COLUMN `titleISSNID` `titleIdentifierID` INT(11) NOT NULL AUTO_INCREMENT , +CHANGE COLUMN `issn` `identifier` VARCHAR(20) NULL DEFAULT NULL , +CHANGE COLUMN `issnType` `identifierType` VARCHAR(30) NULL DEFAULT NULL , +RENAME TO `TitleIdentifier` ; + +UPDATE TitleIdentifier SET identifierType="ISSN" where identifierType="print"; +UPDATE TitleIdentifier SET identifierType="eISSN" where identifierType="online"; + +ALTER TABLE `MonthlyUsageSummary` ADD COLUMN `activityType` VARCHAR(45) NULL AFTER `mergeInd` ; +ALTER TABLE `MonthlyUsageSummary` ADD COLUMN `sectionType` VARCHAR(45) NULL AFTER `activityType` ; +ALTER TABLE `YearlyUsageSummary` ADD COLUMN `activityType` VARCHAR(45) NULL AFTER `mergeInd` ; +ALTER TABLE `YearlyUsageSummary` ADD COLUMN `sectionType` VARCHAR(45) NULL AFTER `activityType` ; + +CREATE TABLE `SushiService` ( + `sushiServiceID` int(11) NOT NULL AUTO_INCREMENT, + `platformID` int(11) DEFAULT NULL, + `publisherPlatformID` int(11) DEFAULT NULL, + `serviceURL` varchar(300) DEFAULT NULL, + `wsdlURL` varchar(300) DEFAULT NULL, + `requestorID` varchar(300) DEFAULT NULL, + `customerID` varchar(300) DEFAULT NULL, + `login` varchar(300) DEFAULT NULL, + `password` varchar(300) DEFAULT NULL, + `security` varchar(300) DEFAULT NULL, + `serviceDayOfMonth` varchar(300) DEFAULT NULL, + `noteText` varchar(300) DEFAULT NULL, + `releaseNumber` varchar(45) DEFAULT NULL, + `reportLayouts` varchar(45) DEFAULT NULL, + PRIMARY KEY (`sushiServiceID`), + KEY `Index_publisherPlatformID` (`publisherPlatformID`), + KEY `Index_platformID` (`platformID`) +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; + +CREATE TABLE `ImportLogPlatformLink` ( + `importLogPlatformLinkID` int(11) NOT NULL AUTO_INCREMENT, + `platformID` int(11) DEFAULT NULL, + `importLogID` int(11) DEFAULT NULL, + PRIMARY KEY (`importLogPlatformLinkID`), + KEY `Index_platformID` (`platformID`) +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; diff --git a/install/protected/update_1.2.sql b/install/protected/update_1.2.sql new file mode 100644 index 0000000..126cbc9 --- /dev/null +++ b/install/protected/update_1.2.sql @@ -0,0 +1,8 @@ +ALTER TABLE `TitleIdentifier` +CHANGE COLUMN `identifierType` `identifierType` VARCHAR(30) NULL DEFAULT NULL; + +CREATE TABLE `Version` ( + `version` varchar(10) NOT NULL +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; + +INSERT INTO Version (version) values('1.2'); diff --git a/install/protected/update_latin1-to-utf8.sql b/install/protected/update_latin1-to-utf8.sql new file mode 100644 index 0000000..a75d744 --- /dev/null +++ b/install/protected/update_latin1-to-utf8.sql @@ -0,0 +1,19 @@ +ALTER DATABASE `_DATABASE_NAME_` CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`ExternalLogin` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`ImportLog` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`LogEmailAddress` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`MonthlyUsageSummary` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`Outlier` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`Platform` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`PlatformNote` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`Privilege` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`Publisher` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`PublisherPlatform` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`PublisherPlatformNote` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`Title` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`TitleIdentifier` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`User` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`YearlyUsageSummary` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`Layout` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`SushiService` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`ImportLogPlatformLink` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; \ No newline at end of file diff --git a/js/admin.js b/js/admin.js index 6a1621e..d0b31fe 100755 --- a/js/admin.js +++ b/js/admin.js @@ -59,9 +59,9 @@ function deleteUser(loginID){ - if (confirm("Do you really want to delete this user?") == true) { + if (confirm(_("Do you really want to delete this user?")) == true) { - $('#span_User_response').html('  Processing...'); + $('#span_User_response').html("  " + _("Processing...")); $.ajax({ type: "GET", url: "ajax_processing.php", @@ -118,11 +118,11 @@ function doSubmitLogEmailAddress(){ // Validate Log Email Address function validateLogEmail(){ if($("#emailAddress").val() == ''){ - $("#span_errors").html('Error - Please enter a value.'); + $("#span_errors").html(_('Error - Please enter a value.')); $("#emailAddress").focus(); return false; }else if(!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9]+$/.test( $("#emailAddress").val() )){ - $("#span_errors").html('Error - Please enter a valid email address.'); + $("#span_errors").html(_('Error - Please enter a valid email address.')); $("#emailAddress").focus(); return false; }else{ @@ -132,7 +132,7 @@ function validateLogEmail(){ function deleteLogEmailAddress(addressID){ - if (confirm("Do you really want to delete this email address?") == true) { + if (confirm(_("Do you really want to delete this email address?")) == true) { $.ajax({ type: "GET", url: "ajax_processing.php", @@ -196,8 +196,8 @@ function validateLogEmail(){ //validates fields for outlier form function validateForm (){ myReturn=0; - if (!validateNumber('overageCount','Count over must be a number.')) myReturn="1"; - if (!validateNumber('overagePercent','% over must be a number.')) myReturn="1"; + if (!validateNumber('overageCount', _("Count over must be a number."))) myReturn="1"; + if (!validateNumber('overagePercent', _("% over must be a number."))) myReturn="1"; if (myReturn == "1"){ return false; diff --git a/js/common.js b/js/common.js index 5506d94..9af3410 100755 --- a/js/common.js +++ b/js/common.js @@ -1,174 +1,214 @@ - - - +/* +************************************************************************************************************************** +** CORAL Usage Statistics Module v. 1.0 +** +** Copyright (c) 2010 University of Notre Dame +** +** This file is part of CORAL. +** +** CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +** +** CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License along with CORAL. If not, see . +** +************************************************************************************************************************** +*/ //image preloader -(function($) { - var cache = []; - // Arguments are image paths relative to the current page. - $.preLoadImages = function() { - var args_len = arguments.length; - for (var i = args_len; i--;) { - var cacheImage = document.createElement('img'); - cacheImage.src = arguments[i]; - cache.push(cacheImage); - } - } +(function($) +{ + var cache = []; + // Arguments are image paths relative to the current page. + $.preLoadImages = function() + { + var args_len = arguments.length; + for (var i = args_len; i--;) + { + var cacheImage = document.createElement('img'); + cacheImage.src = arguments[i]; + cache.push(cacheImage); + } + } })(jQuery) +$(function() +{ - - - -$(function(){ - - //for the Change Module drop down - $('.coraldropdown').each(function () { - $(this).parent().eq(0).hover(function () { - $('.coraldropdown:eq(0)', this).slideDown(100); - }, function () { - $('.coraldropdown:eq(0)', this).slideUp(100); - }); - }); + //for the Change Module drop down + $('.coraldropdown').each(function() + { + $(this).parent().eq(0).hover(function() + { + $('.coraldropdown:eq(0)', this).slideDown(100); + }, function() + { + $('.coraldropdown:eq(0)', this).slideUp(100); + }); + }); }); - - - var displayInds = []; // 1 visible, 0 hidden -function toggleDivState(divID, intDisplay) { - if(document.layers){ - document.layers[divID].display = intDisplay ? "block" : "none"; - } - else if(document.getElementById){ - var obj = document.getElementById(divID); - obj.style.display = intDisplay ? "block" : "none"; - } - else if(document.all){ - document.all[divID].style.display = intDisplay ? "block" : "none"; - } +function toggleDivState(divID, intDisplay) +{ + if (document.layers) + { + document.layers[divID].display = intDisplay ? "block" : "none"; + } + else if (document.getElementById) + { + var obj = document.getElementById(divID); + obj.style.display = intDisplay ? "block" : "none"; + } + else if (document.all) + { + document.all[divID].style.display = intDisplay ? "block" : "none"; + } } +// 1 visible, 0 hidden +function toggleDivs(platformID) +{ + imageName = "document.image_" + platformID; + imageName.src = "images/arrowdown.gif"; -// 1 visible, 0 hidden -function toggleDivs(platformID) { - - imageName = "document.image_" + platformID; - imageName.src="images/arrowdown.gif"; - - divID = 'div_' + platformID; - - - if (typeof displayInds[divID] == "undefined") displayInds[divID] = 1; - - toggleDivState(divID, displayInds[divID]); - - if (displayInds[divID] == 0) displayInds[divID]=1; else displayInds[divID]=0 - - + divID = 'div_' + platformID; + + if (typeof displayInds[divID] == "undefined") + { + displayInds[divID] = 1; + } + + toggleDivState(divID, displayInds[divID]); + + if (displayInds[divID] == 0) + { + displayInds[divID] = 1; + } + else + { + displayInds[divID] = 0; + } } -function replaceSpecial(myString){ +function replaceSpecial(myString) +{ + var re = new RegExp(/.?&/); - var re = new RegExp(/.?&/); - - myString=myString.replace(/\//gi, "\\/"); - - return myString.replace(/\./gi, "\\."); + myString = myString.replace(/\//gi, "\\/"); + return myString.replace(/\./gi, "\\."); } -function getCheckboxValue(field){ - if ($('#' + field + ':checked').attr('checked')) { - return 1; - }else{ - return 0; - } +function getCheckboxValue(field) +{ + if ($('#' + field + ':checked').attr('checked')) + { + return 1; + } + else + { + return 0; + } } -function validateRequired(field,alerttxt){ - fieldValue=$("#" + field).val(); - - if (fieldValue==null || fieldValue=="") { - $("#span_error_" + field).html(alerttxt); - $("#" + field).focus(); - return false; - } else { - $("#span_error_" + field).html(''); - return true; - } +function validateRequired(field, alerttxt) +{ + fieldValue = $("#" + field).val(); + + if (fieldValue == null || fieldValue == "") + { + $("#span_error_" + field).html(alerttxt); + $("#" + field).focus(); + return false; + } + else + { + $("#span_error_" + field).html(''); + return true; + } } -function validateNumber(field,alerttxt){ - fieldValue=$("#" + field).val(); +function validateNumber(field, alerttxt) +{ + fieldValue = $("#" + field).val(); - if (isNaN(fieldValue)) { - $("#span_error_" + field).html(alerttxt); - $("#" + field).focus(); - return false; - } else { - $("#span_error_" + field).html(''); - return true; - } + if (isNaN(fieldValue)) + { + $("#span_error_" + field).html(alerttxt); + $("#" + field).focus(); + return false; + } + else + { + $("#span_error_" + field).html(''); + return true; + } } -function validateDate(field,alerttxt) { - $("#span_error_" + field).html(''); - sDate =$("#" + field).val(); - - if (sDate){ - - var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/ - if (re.test(sDate)) { - var dArr = sDate.split("/"); - var d = new Date(sDate); - - if (!(d.getMonth() + 1 == dArr[0] && d.getDate() == dArr[1] && d.getFullYear() == dArr[2])) { - $("#span_error_" + field).html(alerttxt); - $("#" + field).focus(); - return false; - }else{ - return true; - } - - } else { - $("#span_error_" + field).html(alerttxt); - $("#" + field).focus(); - return false; - } - } - - return true; -} - +function validateDate(field, alerttxt) +{ + $("#span_error_" + field).html(''); + sDate = $("#" + field).val(); + if (sDate) + { + var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/ + if (re.test(sDate)) + { + var dArr = sDate.split("/"); + var d = new Date(sDate); + + if (!(d.getMonth() + 1 == dArr[0] && d.getDate() == dArr[1] && d.getFullYear() == dArr[2])) + { + $("#span_error_" + field).html(alerttxt); + $("#" + field).focus(); + return false; + } + else + { + return true; + } + + } + else + { + $("#span_error_" + field).html(alerttxt); + $("#" + field).focus(); + return false; + } + } + return true; +} -function postwith (to,p) { - var myForm = document.createElement("form"); - myForm.method="post" ; - myForm.action = to ; - for (var k in p) { - var myInput = document.createElement("input") ; - myInput.setAttribute("name", k) ; - myInput.setAttribute("value", p[k]); - myForm.appendChild(myInput) ; - } - document.body.appendChild(myForm) ; - myForm.submit() ; - document.body.removeChild(myForm) ; +function postwith(to, p) +{ + var myForm = document.createElement("form"); + myForm.method = "post"; + myForm.action = to; + for (var k in p) + { + var myInput = document.createElement("input"); + myInput.setAttribute("name", k); + myInput.setAttribute("value", p[k]); + myForm.appendChild(myInput); + } + document.body.appendChild(myForm); + myForm.submit(); + document.body.removeChild(myForm); } @@ -179,72 +219,78 @@ function postwith (to,p) { if (!Array.prototype.indexOf) { - Array.prototype.indexOf = function(elt /*, from*/) - { - var len = this.length; - - var from = Number(arguments[1]) || 0; - from = (from < 0) - ? Math.ceil(from) - : Math.floor(from); - if (from < 0) - from += len; - - for (; from < len; from++) + Array.prototype.indexOf = function(elt /*, from*/ ) { - if (from in this && - this[from] === elt) - return from; - } - return -1; - }; + var len = this.length; + + var from = Number(arguments[1]) || 0; + from = (from < 0) ? Math.ceil(from) : Math.floor(from); + if (from < 0) + from += len; + + for (; from < len; from++) + { + if (from in this && + this[from] === elt) + return from; + } + return -1; + }; } - - -function isEmpty(value) { +function isEmpty(value) +{ var error = ""; - - if (value.length == 0) { + + if (value.length == 0) + { return true; - }else{ - return false; + } + else + { + return false; } } -function isISSN (value) { - - value = value.replace('-', ''); - - if (value.length == 8) { - var objRegExp = /^[a-zA-Z0-9]*$/; - - return (objRegExp.test(value)); - }else{ - return false; - } +function isISSN(value) +{ + value = value.replace('-', ''); + + if (value.length == 8) + { + var objRegExp = /^[a-zA-Z0-9]*$/; + + return (objRegExp.test(value)); + } + else + { + return false; + } } +function isYear(value) +{ + if (value.length == 4) + { + var objRegExp = /^19|20[0-9][0-9]$/; -function isYear (value) { - - if (value.length == 4) { - var objRegExp = /^19|20[0-9][0-9]$/; - - return (objRegExp.test(value)); - }else{ - return false; - } + return (objRegExp.test(value)); + } + else + { + return false; + } } -function isNumber (value) { +function isNumber(value) +{ + + var objRegExp = /^[0-9]*$/; + return (objRegExp.test(value)); - var objRegExp = /^[0-9]*$/; - return (objRegExp.test(value)); - } \ No newline at end of file diff --git a/js/forms/externalLoginSubmitForm.js b/js/forms/externalLoginSubmitForm.js index b427b62..3ea04a8 100755 --- a/js/forms/externalLoginSubmitForm.js +++ b/js/forms/externalLoginSubmitForm.js @@ -51,11 +51,11 @@ function validateExternalLogin() { if($("#username").val() == ''){ - $("#span_errors").html('
Please enter an username to continue'); + $("#span_errors").html('
' + _('Please enter a username to continue'); $("#username").focus(); return false; }else if($("#password").val() == ''){ - $("#span_errors").html('
For security, please enter a password'); + $("#span_errors").html('
' + _('For security, please enter a password'); $("#password").focus(); return false; }else{ diff --git a/js/forms/identifierSubmitForm.js b/js/forms/identifierSubmitForm.js index c693d7d..62c6088 100755 --- a/js/forms/identifierSubmitForm.js +++ b/js/forms/identifierSubmitForm.js @@ -68,7 +68,7 @@ function submitIdentifier(){ function validateForm (){ myReturn=0; if (!isIdentifier($("#identifier").val())){ - $('#span_error_Identifier').html('
Identifier must be valid format.'); + $('#span_error_Identifier').html("
" + _("Identifier must be valid format.")); myReturn=1; } diff --git a/js/forms/organizationForm.js b/js/forms/organizationForm.js index bef3cf1..4683c96 100755 --- a/js/forms/organizationForm.js +++ b/js/forms/organizationForm.js @@ -31,7 +31,7 @@ $(function(){ success: function(exists) { if ((exists == 0) && ($("#organizationName").val() != '')){ $("#organizationID").val(""); - $("#span_error_organizationNameResult").html("
This organization doesn't exist in the CORAL Organizations module."); + $("#span_error_organizationNameResult").html("
" + _("This organization doesn't exist in the CORAL Organizations module.")); $('#submitOrganization').attr("disabled", "disabled"); }else{ @@ -94,7 +94,7 @@ $(function(){ success: function(exists) { if ((exists == 0) && ($("#organizationName").val() != '')){ $("#organizationID").val(""); - $("#span_error_organizationNameResult").html("
This organization doesn't exist in the CORAL Organizations Module."); + $("#span_error_organizationNameResult").html("
" + _("This organization doesn't exist in the CORAL Organizations Module.")); $('#submitOrganization').attr("disabled", "disabled"); }else{ diff --git a/js/forms/outlierSubmitForm.js b/js/forms/outlierSubmitForm.js index fad0ff3..685100c 100755 --- a/js/forms/outlierSubmitForm.js +++ b/js/forms/outlierSubmitForm.js @@ -91,7 +91,7 @@ function ignoreOutlier(monthlyUsageSummaryIDValue){ //validates fields function validateForm (monthlyUsageSummaryIDValue){ myReturn=0; - if (!validateRequired('overrideUsageCount_' + monthlyUsageSummaryIDValue, '
Count is required. If you wish to remove the count the outlier should be ignored.')) myReturn="1"; + if (!validateRequired('overrideUsageCount_' + monthlyUsageSummaryIDValue, "
" + _("Count is required. If you wish to remove the count the outlier should be ignored."))) myReturn="1"; if (myReturn == "1"){ return false; }else{ diff --git a/js/forms/overrideSubmitForm.js b/js/forms/overrideSubmitForm.js index 1d44d75..1300c96 100755 --- a/js/forms/overrideSubmitForm.js +++ b/js/forms/overrideSubmitForm.js @@ -55,7 +55,7 @@ function updateYTDOverride(yearlyUsageSummaryIDValue, overrideColumn){ //validates fields function validateForm (columnName){ myReturn=0; - if (!validateRequired(columnName, 'Count is required.')) myReturn="1"; + if (!validateRequired(columnName, _('Count is required.'))) myReturn="1"; if (myReturn == "1"){ return false; }else{ diff --git a/js/forms/platformNoteSubmitForm.js b/js/forms/platformNoteSubmitForm.js index f4b094c..5361b9c 100755 --- a/js/forms/platformNoteSubmitForm.js +++ b/js/forms/platformNoteSubmitForm.js @@ -51,9 +51,9 @@ function submitPlatformNotes(){ errorMessage=''; - if (isYear($("#startYear").val()) == false) { errorMessage = "
Start Year must be 4 numbers and start with 19 or 20.\n"; } - if ((isYear($("#endYear").val()) == false) && ($("#endYear").val() != '')){ errorMessage += "
End Year must be 4 numbers and start with 19 or 20.\n"; } - if (!($('#counterCompliantInd:checked').length > 0)) { errorMessage += "
Please choose Yes or No for Counter Compliant.\n"; } + if (isYear($("#startYear").val()) == false) { errorMessage = "
" + _("Start Year must be 4 numbers and start with 19 or 20.") + "\n"; } + if ((isYear($("#endYear").val()) == false) && ($("#endYear").val() != '')){ errorMessage += "
" + _("End Year must be 4 numbers and start with 19 or 20.") + "\n"; } + if (!($('#counterCompliantInd:checked').length > 0)) { errorMessage += "
" + _("Please choose Yes or No for Counter Compliant.") + "\n"; } $('#span_errors').html(errorMessage); diff --git a/js/forms/platformSubmitForm.js b/js/forms/platformSubmitForm.js index 8ee3b5d..9ff405a 100755 --- a/js/forms/platformSubmitForm.js +++ b/js/forms/platformSubmitForm.js @@ -1,81 +1,81 @@ -/* -************************************************************************************************************************** -** CORAL Usage Statistics Module -** -** Copyright (c) 2010 University of Notre Dame -** -** This file is part of CORAL. -** -** CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -** -** CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License along with CORAL. If not, see . -** -************************************************************************************************************************** -*/ - - $(function(){ - - - $("#submitPlatformForm").click(function () { - submitPlatform(); - }); - - - //do submit if enter is hit - $('#platformName').keyup(function(e) { - if(e.keyCode == 13) { - submitPlatform(); - } - }); - - - }); - - - - - - -function submitPlatform(){ - - - if (validateForm() === true) { - $('#span_error_Platform').html(''); - - $.ajax({ - type: "POST", - url: "ajax_processing.php?action=addPlatform", - cache: false, - data: { platformName: $("#platformName").val() }, - success: function(platformID) { - window.parent.tb_remove(); - window.location = 'publisherPlatform.php?platformID=' + platformID + '&showTab=sushi'; - return false; - } - - - }); - - } - -} - - - -//validates fields -function validateForm (){ - myReturn=0; - if ($("#platformName").val() == ""){ - $('#span_error_Platform').html('
Platform must be entered.'); - myReturn=1; - } - - - if (myReturn == "1"){ - return false; - }else{ - return true; - } -} +/* +************************************************************************************************************************** +** CORAL Usage Statistics Module +** +** Copyright (c) 2010 University of Notre Dame +** +** This file is part of CORAL. +** +** CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +** +** CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License along with CORAL. If not, see . +** +************************************************************************************************************************** +*/ + + $(function(){ + + + $("#submitPlatformForm").click(function () { + submitPlatform(); + }); + + + //do submit if enter is hit + $('#platformName').keyup(function(e) { + if(e.keyCode == 13) { + submitPlatform(); + } + }); + + + }); + + + + + + +function submitPlatform(){ + + + if (validateForm() === true) { + $('#span_error_Platform').html(''); + + $.ajax({ + type: "POST", + url: "ajax_processing.php?action=addPlatform", + cache: false, + data: { platformName: $("#platformName").val() }, + success: function(platformID) { + window.parent.tb_remove(); + window.location = 'publisherPlatform.php?platformID=' + platformID + '&showTab=sushi'; + return false; + } + + + }); + + } + +} + + + +//validates fields +function validateForm (){ + myReturn=0; + if ($("#platformName").val() == ""){ + $('#span_error_Platform').html("
" + _("Platform must be entered.")); + myReturn=1; + } + + + if (myReturn == "1"){ + return false; + }else{ + return true; + } +} diff --git a/js/forms/publisherNoteSubmitForm.js b/js/forms/publisherNoteSubmitForm.js index 7ddf276..2a3f3a3 100755 --- a/js/forms/publisherNoteSubmitForm.js +++ b/js/forms/publisherNoteSubmitForm.js @@ -52,8 +52,8 @@ function submitPublisherNote(){ errorMessage=''; - if (isYear($("#startYear").val()) == false) { errorMessage = "
Start Year must be 4 numbers and start with 19 or 20.\n"; } - if ((isYear($("#endYear").val()) == false) && ($("#endYear").val() != '')) { errorMessage += "
End Year must be 4 numbers and start with 19 or 20.\n"; } + if (isYear($("#startYear").val()) == false) { errorMessage = "
" + _("Start Year must be 4 numbers and start with 19 or 20.") + "\n"; } + if ((isYear($("#endYear").val()) == false) && ($("#endYear").val() != '')) { errorMessage += "
" + _("End Year must be 4 numbers and start with 19 or 20.") + "\n"; } $('#span_errors').html(errorMessage); diff --git a/js/import.js b/js/import.js index 30d0eb2..3606648 100755 --- a/js/import.js +++ b/js/import.js @@ -1,73 +1,73 @@ -/* -************************************************************************************************************************** -** CORAL Usage Statistics Module -** -** Copyright (c) 2010 University of Notre Dame -** -** This file is part of CORAL. -** -** CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -** -** CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License along with CORAL. If not, see . -** -************************************************************************************************************************** -*/ - - - $(document).ready(function(){ - - updateImportTable(); - - - //do submit if enter is hit - $('#submitFile').keyup(function(e) { - if(e.keyCode == 13) { - submitForm(); - } - }); - - }); - - - - var pageStart = '1'; - - function updateImportTable(){ - $('#span_feedback').html('  Loading...'); - $.ajax({ - type: "GET", - url: "ajax_htmldata.php", - cache: false, - data: "action=getImportTable&pageStart=" + pageStart, - success: function(html) { - $('#span_feedback').html(''); - $('#div_recentImports').html(html); - tb_reinit(); - } - }); - - } - - - -function setPageStart(pageStartNumber){ - pageStart=pageStartNumber; - updateImportTable(); -} - - - -function validateForm(){ - - if ($("#usageFile").val() == '') { - $('#span_error').html(' Please select a file.'); - return false; - }else{ - $('#span_error').html(''); - return true; - } - -} - +/* +************************************************************************************************************************** +** CORAL Usage Statistics Module +** +** Copyright (c) 2010 University of Notre Dame +** +** This file is part of CORAL. +** +** CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +** +** CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License along with CORAL. If not, see . +** +************************************************************************************************************************** +*/ + + + $(document).ready(function(){ + + updateImportTable(); + + + //do submit if enter is hit + $('#submitFile').keyup(function(e) { + if(e.keyCode == 13) { + submitForm(); + } + }); + + }); + + + + var pageStart = '1'; + + function updateImportTable(){ + $('#span_feedback').html("  " + _("Loading...")); + $.ajax({ + type: "GET", + url: "ajax_htmldata.php", + cache: false, + data: "action=getImportTable&pageStart=" + pageStart, + success: function(html) { + $('#span_feedback').html(''); + $('#div_recentImports').html(html); + tb_reinit(); + } + }); + + } + + + +function setPageStart(pageStartNumber){ + pageStart=pageStartNumber; + updateImportTable(); +} + + + +function validateForm(){ + + if ($("#usageFile").val() == '') { + $('#span_error').html(' ' + _("Please select a file.")); + return false; + }else{ + $('#span_error').html(''); + return true; + } + +} + diff --git a/js/index.js b/js/index.js index 0a686ad..77236a0 100755 --- a/js/index.js +++ b/js/index.js @@ -1,138 +1,144 @@ /* -************************************************************************************************************************** -** CORAL Usage Statistics Module -** -** Copyright (c) 2010 University of Notre Dame -** -** This file is part of CORAL. -** -** CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -** -** CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License along with CORAL. If not, see . -** -************************************************************************************************************************** -*/ - - - $(document).ready(function(){ - - updateSearch(); - - //perform search if enter is hit - $('#searchName').keyup(function(e) { - if(e.keyCode == 13) { - updateSearch(); + ************************************************************************************************************************** + ** CORAL Usage Statistics Module + ** + ** Copyright (c) 2010 University of Notre Dame + ** + ** This file is part of CORAL. + ** + ** CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + ** + ** CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License along with CORAL. If not, see . + ** + ************************************************************************************************************************** + */ + + +$(document).ready(function() +{ + updateSearch(); + + //perform search if enter is hit + $('#searchName').keyup(function(e) + { + if (e.keyCode == 13) + { + updateSearch(); } - }); - - - }); - - + }); +}); + + var orderBy = "TRIM(LEADING 'THE ' FROM UPPER(P.name)) asc"; var pageStart = '1'; var numberOfRecords = 25; var startWith = ''; -function updateSearch(){ - $("#div_feedback").html(" Processing..."); - - - $.ajax({ - type: "GET", - url: "ajax_htmldata.php", - cache: false, - data: "action=getSearch&searchName=" + $("#searchName").val() + "&orderBy=" + orderBy + "&pageStart=" + pageStart + "&numberOfRecords=" + numberOfRecords + "&startWith=" + startWith, - success: function(html) { - $("#div_feedback").html(" "); - $('#div_searchResults').html(html); - } - - - }); - +function updateSearch() +{ + $("#div_feedback").html(" " + _("Processing...") + ""); + $.ajax( + { + type: "GET", + url: "ajax_htmldata.php", + cache: false, + data: "action=getSearch&searchName=" + $("#searchName").val() + "&orderBy=" + orderBy + "&pageStart=" + pageStart + "&numberOfRecords=" + numberOfRecords + "&startWith=" + startWith, + success: function(html) + { + $("#div_feedback").html(" "); + $('#div_searchResults').html(html); + } + }); +} + +function setOrder(column, direction) +{ + orderBy = column + " " + direction; + updateSearch(); +} + +function setPageStart(pageStartNumber) +{ + pageStart = pageStartNumber; + updateSearch(); +} + +function setNumberOfRecords(numberOfRecordsNumber) +{ + pageStart = '1'; + numberOfRecords = $("#numberOfRecords").val(); + updateSearch(); } - - - function setOrder(column, direction){ - orderBy = column + " " + direction; - updateSearch(); - } - - - function setPageStart(pageStartNumber){ - pageStart=pageStartNumber; - updateSearch(); - } - - - function setNumberOfRecords(numberOfRecordsNumber){ - pageStart = '1'; - numberOfRecords=$("#numberOfRecords").val(); - updateSearch(); - } - - - - - function setStartWith(startWithLetter){ + +function setStartWith(startWithLetter) +{ //first, set the previous selected letter (if any) to the regular class - if (startWith != ''){ - $("#span_letter_" + startWith).removeClass('searchLetterSelected').addClass('searchLetter'); + if (startWith != '') + { + $("#span_letter_" + startWith).removeClass('searchLetterSelected').addClass('searchLetter'); } - + //next, set the new start with letter to show selected $("#span_letter_" + startWithLetter).removeClass('searchLetter').addClass('searchLetterSelected'); pageStart = '1'; - startWith=startWithLetter; + startWith = startWithLetter; updateSearch(); - } - - - $(".searchButton").click(function () { - pageStart = '1'; - updateSearch(); - }); - - $(".newSearch").click(function () { +} + + +$(".searchButton").click(function() +{ + pageStart = '1'; + updateSearch(); +}); + +$(".newSearch").click(function() +{ //reset fields $("#searchName").val(""); - + //reset startwith background color $("#span_letter_" + startWith).removeClass('searchLetterSelected').addClass('searchLetter'); - startWith=''; - - orderBy = "TRIM(LEADING 'THE ' FROM UPPER(P.name)) asc"; - pageStart = '1'; + startWith = ''; + + orderBy = "TRIM(LEADING 'THE ' FROM UPPER(P.name)) asc"; + pageStart = '1'; updateSearch(); - }); - - - $("#searchName").focus(function () { - $("#div_searchName").css({'display':'block'}); - }); - - -function showPublisherList(platformID){ - divID = 'div_' + platformID; - - if (typeof displayInds[divID] == "undefined") displayInds[divID] = 1; - - toggleDivState(divID, displayInds[divID]); - - if (displayInds[divID] == 0) { - $('#image_' + platformID).attr('src', "images/arrowright.gif"); - $('#link_' + platformID).text('show publisher list'); - displayInds[divID]=1; - } else { - $('#image_' + platformID).attr('src', "images/arrowdown.gif"); - $('#link_' + platformID).text('hide publisher list'); - displayInds[divID]=0; - } - - -} +}); + + +$("#searchName").focus(function() +{ + $("#div_searchName").css( + { + 'display': 'block' + }); +}); + + +function showPublisherList(platformID) +{ + divID = 'div_' + platformID; + + if (typeof displayInds[divID] == "undefined") displayInds[divID] = 1; + + toggleDivState(divID, displayInds[divID]); + + if (displayInds[divID] == 0) + { + $('#image_' + platformID).attr('src', "images/arrowright.gif"); + $('#link_' + platformID).text(_('show publisher list')); + displayInds[divID] = 1; + } + else + { + $('#image_' + platformID).attr('src', "images/arrowdown.gif"); + $('#link_' + platformID).text(_('hide publisher list')); + displayInds[divID] = 0; + } + +} \ No newline at end of file diff --git a/js/plugins/Gettext.js b/js/plugins/Gettext.js new file mode 100644 index 0000000..8a905e6 --- /dev/null +++ b/js/plugins/Gettext.js @@ -0,0 +1,1265 @@ +/* +Pure Javascript implementation of Uniforum message translation. +Copyright (C) 2008 Joshua I. Miller , all rights reserved + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +USA. + +=head1 NAME + +Javascript Gettext - Javascript implemenation of GNU Gettext API. + +=head1 SYNOPSIS + + // ////////////////////////////////////////////////////////// + // Optimum caching way + + + + var gt = new Gettext({ "domain" : "myDomain" }); + // rest is the same + + + // ////////////////////////////////////////////////////////// + // The reson the shortcuts aren't exported by default is because they'd be + // glued to the single domain you created. So, if you're adding i18n support + // to some js library, you should use it as so: + + if (typeof(MyNamespace) == 'undefined') MyNamespace = {}; + MyNamespace.MyClass = function () { + var gtParms = { "domain" : 'MyNamespace_MyClass' }; + this.gt = new Gettext(gtParams); + return this; + }; + MyNamespace.MyClass.prototype._ = function (msgid) { + return this.gt.gettext(msgid); + }; + MyNamespace.MyClass.prototype.something = function () { + var myString = this._("this will get translated"); + }; + + // ////////////////////////////////////////////////////////// + // Adding the shortcuts to a global scope is easier. If that's + // ok in your app, this is certainly easier. + var myGettext = new Gettext({ 'domain' : 'myDomain' }); + function _ (msgid) { + return myGettext.gettext(msgid); + } + alert( _("text") ); + + // ////////////////////////////////////////////////////////// + // Data structure of the json data + // NOTE: if you're loading via the + + // in domain.json + json_locale_data = { + "mydomain" : { + // po header fields + "" : { + "plural-forms" : "...", + "lang" : "en", + }, + // all the msgid strings and translations + "msgid" : [ "msgid_plural", "translation", "plural_translation" ], + }, + }; + // please see the included bin/po2json script for the details on this format + +This method also allows you to use unsupported file formats, so long as you can parse them into the above format. + +=item 2. Use AJAX to load language file. + +Use XMLHttpRequest (actually, SJAX - syncronous) to load an external resource. + +Supported external formats are: + +=over + +=item * Javascript Object Notation (.json) + +(see bin/po2json) + + type=application/json + +=item * Uniforum Portable Object (.po) + +(see GNU Gettext's xgettext) + + type=application/x-po + +=item * Machine Object (compiled .po) (.mo) + +NOTE: .mo format isn't actually supported just yet, but support is planned. + +(see GNU Gettext's msgfmt) + + type=application/x-mo + +=back + +=back + +=head1 METHODS + +The following methods are implemented: + + new Gettext(args) + textdomain (domain) + gettext (msgid) + dgettext (domainname, msgid) + dcgettext (domainname, msgid, LC_MESSAGES) + ngettext (msgid, msgid_plural, count) + dngettext (domainname, msgid, msgid_plural, count) + dcngettext (domainname, msgid, msgid_plural, count, LC_MESSAGES) + pgettext (msgctxt, msgid) + dpgettext (domainname, msgctxt, msgid) + dcpgettext (domainname, msgctxt, msgid, LC_MESSAGES) + npgettext (msgctxt, msgid, msgid_plural, count) + dnpgettext (domainname, msgctxt, msgid, msgid_plural, count) + dcnpgettext (domainname, msgctxt, msgid, msgid_plural, count, LC_MESSAGES) + strargs (string, args_array) + + +=head2 new Gettext (args) + +Several methods of loading locale data are included. You may specify a plugin or alternative method of loading data by passing the data in as the "locale_data" option. For example: + + var get_locale_data = function () { + // plugin does whatever to populate locale_data + return locale_data; + }; + var gt = new Gettext( 'domain' : 'messages', + 'locale_data' : get_locale_data() ); + +The above can also be used if locale data is specified in a statically included + + @@ -661,7 +661,7 @@ //Related Titles (this form is display only) case 'getRelatedTitlesForm': - if (isset($_GET['titleID'])) $titleID = $_GET['titleID']; + if (isset($_GET['titleID'])) $titleID = $_GET['titleID']; ?>
@@ -735,12 +735,12 @@ default: - echo "Function " . $_REQUEST['function'] . " not set up!"; - break; + echo "Function " . $_REQUEST['function'] . " not set up!"; + break; } -?> \ No newline at end of file +?> diff --git a/old/includes/header.php b/old/includes/header.php index f324327..035ee2d 100755 --- a/old/includes/header.php +++ b/old/includes/header.php @@ -36,7 +36,7 @@ CORAL Usage Statistics - <?php echo $pageTitle; ?> - + diff --git a/publisherPlatform.php b/publisherPlatform.php index 623c66b..95ae040 100755 --- a/publisherPlatform.php +++ b/publisherPlatform.php @@ -17,7 +17,7 @@ } -$pageTitle = 'View or Edit Publisher / Platform'; +$pageTitle = _('View or Edit Publisher / Platform'); include 'templates/header.php'; @@ -49,9 +49,9 @@
-
+
- +
@@ -65,7 +65,7 @@ -