diff --git a/LangCodes.php b/LangCodes.php new file mode 100644 index 0000000..2d58bc7 --- /dev/null +++ b/LangCodes.php @@ -0,0 +1,23 @@ +'fr_FR', + 'en'=>'en_US' + ); + return $all_lang[$code]; + } + public function getNameLang($code_lang){ + $name_lang=array( + 'fr'=>_('French'), + 'en'=>_('English') + ); + return $name_lang[$code_lang]; + } +} +?> \ No newline at end of file diff --git a/admin.php b/admin.php index 04538f6..84c5e39 100644 --- a/admin.php +++ b/admin.php @@ -19,7 +19,7 @@ include_once 'directory.php'; -$pageTitle='Administration'; +$pageTitle=_('Administration'); include 'templates/header.php'; //set referring page @@ -37,7 +37,7 @@ @@ -48,51 +48,52 @@
- Administration +
- - - - - - + + + + + + settings->enableAlerts == 'Y'){ ?> - + - - - - - - - + + + + + + + settings->enhancedCostHistory == 'Y'){ ?> - + - - - - + + + + + settings->organizationsModule == 'N'){ ?> - - + + - - - - - - + + + + + +
- Loading... +
@@ -115,7 +116,7 @@ //end else for admin }else{ - echo "You do not have permissions to access this screen."; + echo _("You do not have permissions to access this screen."); } include 'templates/footer.php'; diff --git a/admin/classes/common/DBService.php b/admin/classes/common/DBService.php index fa37650..17dbcef 100644 --- 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 = $this->db->error) { - 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 7d933fe..c4c928d 100644 --- a/admin/classes/common/LdapPerson.php +++ b/admin/classes/common/LdapPerson.php @@ -31,7 +31,7 @@ public function __construct($userKey) { $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 . "

"); + $bd = ldap_bind($ds) or die("

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

"); if ($bd){ $filter = $config->ldap->search_key . "=" . $userKey; diff --git a/admin/classes/common/Object.php b/admin/classes/common/Object.php index 5f30ba9..4a9e208 100644 --- a/admin/classes/common/Object.php +++ b/admin/classes/common/Object.php @@ -60,7 +60,7 @@ protected function setValueForKey($key, $value) { if (property_exists($this, $key)) { $this->$key = $value; } else { - throw new Exception("Cannot set value for undefined key ($key)."); + throw new Exception(_("Cannot set value for undefined key (").$key.")."); } } @@ -69,7 +69,7 @@ protected function valueForKey($key) { if (property_exists($this, $key)) { return $this->$key; } else { - throw new Exception("Cannot get value for undefined key ($key)."); + throw new Exception(_("Cannot set value for undefined key (").$key.")."); } } diff --git a/admin/classes/common/Utility.php b/admin/classes/common/Utility.php index 87e7c28..8aeed4a 100644 --- a/admin/classes/common/Utility.php +++ b/admin/classes/common/Utility.php @@ -118,7 +118,7 @@ public function createMessageFromTemplate($messageType, $resourceID, $resourceTi $defaultMessage .= $buffer; } if (!feof($fh)) { - return "Error: unexpected fgets() fail\n"; + return _("Error: unexpected fgets() fail")."\n"; } fclose($fh); @@ -130,7 +130,7 @@ public function createMessageFromTemplate($messageType, $resourceID, $resourceTi $resourceTitleInURL = str_replace('+', '%20', $resourceTitleInURL); $completionLink = str_replace('', $resourceTitleInURL, $config->settings->completionLink); - $defaultMessage .= "Edit DDW facet/term selections at: " . $completionLink; + $defaultMessage .= _("Edit DDW facet/term selections at: ") . $completionLink; } @@ -145,7 +145,7 @@ public function createMessageFromTemplate($messageType, $resourceID, $resourceTi return $defaultMessage; }else{ - return 'Email template file not found: ' . $templateFile; + return _('Email template file not found: ') . $templateFile; } diff --git a/admin/classes/domain/Downtime.php b/admin/classes/domain/Downtime.php new file mode 100644 index 0000000..5309bea --- /dev/null +++ b/admin/classes/domain/Downtime.php @@ -0,0 +1,67 @@ +primaryKey)) { + $query = "SELECT d.*, dt.shortName, i.subjectText + FROM Downtime d + LEFT JOIN DowntimeType dt ON dt.downtimeTypeID=d.downtimeTypeID + LEFT JOIN Issue i ON i.issueID=d.issueID + WHERE d.downtimeID={$this->primaryKey}"; + + $result = $this->db->processQuery($query, 'assoc'); + + foreach (array_keys($result) as $attributeName) { + $this->addAttribute($attributeName); + $this->attributes[$attributeName] = $result[$attributeName]; + } + + }else{ + // Figure out attributes from existing database + $query = "SELECT COLUMN_NAME FROM information_schema.`COLUMNS` WHERE table_schema = '"; + $query .= $this->db->config->database->name . "' AND table_name = '$this->tableName'";// MySQL-specific + foreach ($this->db->processQuery($query) as $result) { + $attributeName = $result[0]; + $this->addAttribute($attributeName); + } + } + } + + public function save() { + + //We have added the name attribute after the fact, and here, we are cleaning it up + unset($this->attributes["shortName"]); + unset($this->attributesNames["shortName"]); + + unset($this->attributes["subjectText"]); + unset($this->attributesNames["subjectText"]); + + parent::save(); + } + + public function getDowntimeTypesArray() { + $query = "SELECT dt.* + FROM DowntimeType dt"; + + $result = $this->db->processQuery($query, "assoc"); + $names = array(); + + foreach ($result as $name) { + array_push($names, $name); + } + + return $names; + } + +} + +?> \ No newline at end of file diff --git a/admin/classes/domain/DowntimeType.php b/admin/classes/domain/DowntimeType.php new file mode 100644 index 0000000..80370da --- /dev/null +++ b/admin/classes/domain/DowntimeType.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/admin/classes/domain/Issue.php b/admin/classes/domain/Issue.php new file mode 100644 index 0000000..31cfdfb --- /dev/null +++ b/admin/classes/domain/Issue.php @@ -0,0 +1,100 @@ +db->config->settings->organizationsModule == 'Y' && $this->db->config->settings->organizationsDatabaseName) { + $contactsDB = $this->db->config->settings->organizationsDatabaseName; + } else { + $contactsDB = $this->db->config->database->name; + } + $query = "SELECT ic.contactID,c.name,c.emailAddress + FROM IssueContact ic + LEFT JOIN `{$contactsDB}`.Contact c ON c.contactID=ic.contactID + WHERE ic.issueID=".$this->issueID; + $result = $this->db->processQuery($query, 'assoc'); + $objects = array(); + + if (isset($result['contactID'])){ + return array($result); + } else { + return $result; + } + } + + public function getAssociatedOrganization() { + $orgDB = $this->db->config->settings->organizationsDatabaseName; + $query = "SELECT o.organizationID + FROM IssueRelationship ir + LEFT JOIN `{$orgDB}`.Organization o ON (o.organizationID=ir.entityID AND ir.entityTypeID=1) + WHERE ir.issueID={$this->issueID}"; + $result = $this->db->processQuery($query, 'assoc'); + $objects = array(); + + if (isset($result['organizationID'])){ + $object = new Organization(new NamedArguments(array('primaryKey' => $result['organizationID']))); + array_push($objects, $object); + } + return $objects; + } + + + public function getAssociatedResources() { + $query = "SELECT r.resourceID + FROM IssueRelationship ir + LEFT JOIN Resource r ON (r.resourceID=ir.entityID AND ir.entityTypeID=2) + WHERE ir.issueID={$this->issueID}"; + $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['resourceID'])){ + $object = new Resource(new NamedArguments(array('primaryKey' => $result['resourceID']))); + array_push($objects, $object); + } else{ + foreach ($result as $row) { + $object = new Resource(new NamedArguments(array('primaryKey' => $row['resourceID']))); + array_push($objects, $object); + } + } + return $objects; + } + + public function getAllAlertable() { + $orgDB = $this->db->config->settings->organizationsDatabaseName; + + $query = "SELECT i.*,(SELECT GROUP_CONCAT(CONCAT(sc.name,' - ',sc.emailAddress) SEPARATOR ', ') + FROM IssueContact sic + LEFT JOIN `{$orgDB}`.Contact sc ON sc.contactID=sic.contactID + WHERE sic.issueID=i.issueID) AS `contacts`, + (SELECT GROUP_CONCAT(se.titleText SEPARATOR ', ') + FROM IssueRelationship sir + LEFT JOIN Resource se ON (se.resourceID=sir.entityID AND sir.entityTypeID=2) + WHERE sir.issueID=i.issueID) AS `appliesto`, + (SELECT GROUP_CONCAT(sie.email SEPARATOR ', ') + FROM IssueEmail sie + WHERE sie.issueID=i.issueID) AS `CCs` + FROM Issue i + WHERE TIMESTAMPDIFF(DAY,i.dateCreated,CURDATE())%i.reminderInterval=0 + AND i.dateClosed IS NULL"; + + $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['issueID'])){ + return array($result); + }else{ + return $result; + } + + return $objects; + } + +} + +?> \ No newline at end of file diff --git a/admin/classes/domain/IssueContact.php b/admin/classes/domain/IssueContact.php new file mode 100644 index 0000000..042f3af --- /dev/null +++ b/admin/classes/domain/IssueContact.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/admin/classes/domain/IssueEmail.php b/admin/classes/domain/IssueEmail.php new file mode 100644 index 0000000..a568497 --- /dev/null +++ b/admin/classes/domain/IssueEmail.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/admin/classes/domain/IssueRelationship.php b/admin/classes/domain/IssueRelationship.php new file mode 100644 index 0000000..553b24b --- /dev/null +++ b/admin/classes/domain/IssueRelationship.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/admin/classes/domain/Organization.php b/admin/classes/domain/Organization.php index 2fdabb5..18d78ee 100644 --- a/admin/classes/domain/Organization.php +++ b/admin/classes/domain/Organization.php @@ -37,21 +37,137 @@ public function getNumberOfChildren(){ } - public function alreadyExists($shortName) { + public function alreadyExists($shortName) { $query = "SELECT count(*) orgcount FROM Organization WHERE UPPER(shortName) = '" . str_replace("'", "''", strtoupper($shortName)) . "';"; $result = $this->db->processQuery($query, 'assoc'); return $result['orgcount']; - } + } - public function getOrganizationIDByName($shortName) { - $query = "SELECT organizationID FROM Organization WHERE UPPER(shortName) = '" . str_replace("'", "''", strtoupper($shortName)) . "';"; + public function getOrganizationIDByName($shortName) { + $query = "SELECT organizationID FROM Organization WHERE UPPER(shortName) = '" . str_replace("'", "''", strtoupper($shortName)) . "';"; $result = $this->db->processQuery($query, 'assoc'); return $result['organizationID']; - } + } + + public function getIssues($archivedOnly=false) { + $query = "SELECT i.* + FROM Issue i + LEFT JOIN IssueRelationship ir ON (ir.issueID=i.issueID AND ir.entityTypeID=1) + WHERE ir.entityID={$this->primaryKey}"; + if ($archivedOnly) { + $query .= " AND i.dateClosed IS NOT NULL"; + } else { + $query .= " AND i.dateClosed IS NULL"; + } + $query .= " ORDER BY i.dateCreated 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['issueID'])) { + $object = new Issue(new NamedArguments(array('primaryKey' => $result['issueID']))); + array_push($objects, $object); + } else { + foreach ($result as $row) { + $object = new Issue(new NamedArguments(array('primaryKey' => $row['issueID']))); + array_push($objects, $object); + } + } + return $objects; + } + + public function getDowntime($archivedOnly=false) { + $query = "SELECT d.* + FROM Downtime d + WHERE d.entityID={$this->primaryKey} + AND d.entityTypeID=1"; + if ($archivedOnly) { + $query .= " AND d.endDate < CURDATE()"; + } else { + $query .= " AND d.endDate >= CURDATE()"; + } + $query .= " ORDER BY d.dateCreated 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['downtimeID'])) { + $object = new Downtime(new NamedArguments(array('primaryKey' => $result['downtimeID']))); + array_push($objects, $object); + } else { + foreach ($result as $row) { + $object = new Downtime(new NamedArguments(array('primaryKey' => $row['downtimeID']))); + array_push($objects, $object); + } + } + return $objects; + } + public function getExportableIssues($archivedOnly=false) { + if ($this->db->config->settings->organizationsModule == 'Y' && $this->db->config->settings->organizationsDatabaseName) { + $orgDB = $this->db->config->settings->organizationsDatabaseName; + $orgField = 'name'; + } else { + $orgDB = $this->db->config->database->name; + $orgField = 'shortName'; + } + + $query = "SELECT i.*,(SELECT GROUP_CONCAT(CONCAT(sc.name,' - ',sc.emailAddress) SEPARATOR ', ') + FROM IssueContact sic + LEFT JOIN `{$orgDB}`.Contact sc ON sc.contactID=sic.contactID + WHERE sic.issueID=i.issueID) AS `contacts`, + (SELECT GROUP_CONCAT(se.{$orgField} SEPARATOR ', ') + FROM IssueRelationship sir + LEFT JOIN `{$orgDB}`.Organization se ON (se.organizationID=sir.entityID AND sir.entityTypeID=1) + WHERE sir.issueID=i.issueID) AS `appliesto`, + (SELECT GROUP_CONCAT(sie.email SEPARATOR ', ') + FROM IssueEmail sie + WHERE sie.issueID=i.issueID) AS `CCs` + FROM Issue i + LEFT JOIN IssueRelationship ir ON (ir.issueID=i.issueID AND ir.entityTypeID=1) + WHERE ir.entityID={$this->primaryKey}"; + if ($archivedOnly) { + $query .= " AND i.dateClosed IS NOT NULL"; + } else { + $query .= " AND i.dateClosed IS NULL"; + } + $query .= " ORDER BY i.dateCreated 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['issueID'])) { + return array($result); + } else { + return $result; + } + } + + public function getExportableDowntimes($archivedOnly=false){ + + $query = "SELECT d.* + FROM Downtime d + WHERE d.entityID={$this->primaryKey} AND d.entityTypeID=1"; + if ($archivedOnly) { + $query .= " AND d.endDate < CURDATE()"; + } else { + $query .= " AND d.endDate >= CURDATE()"; + } + $query .= " ORDER BY d.dateCreated 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['downtimeID'])){ + return array($result); + }else{ + return $result; + } + } } ?> diff --git a/admin/classes/domain/Resource.php b/admin/classes/domain/Resource.php index 083d380..26cccc1 100644 --- a/admin/classes/domain/Resource.php +++ b/admin/classes/domain/Resource.php @@ -397,49 +397,49 @@ public function getAliases(){ //returns array of contact objects - public function getUnarchivedContacts(){ - - + public function getUnarchivedContacts($moduleFilter=false){ $config = new Configuration; + $resultArray = array(); $contactsArray = array(); - //get resource specific contacts first - $query = "SELECT C.*, GROUP_CONCAT(CR.shortName SEPARATOR '
') contactRoles - FROM Contact C, ContactRole CR, ContactRoleProfile CRP - WHERE (archiveDate = '0000-00-00' OR archiveDate is null) - AND C.contactID = CRP.contactID - AND CRP.contactRoleID = CR.contactRoleID - AND resourceID = '" . $this->resourceID . "' - GROUP BY C.contactID - ORDER BY C.name"; - - $result = $this->db->processQuery($query, 'assoc'); - + if (!$moduleFilter || $moduleFilter == 'resources') { + //get resource specific contacts first + $query = "SELECT C.*, GROUP_CONCAT(CR.shortName SEPARATOR '
') contactRoles + FROM Contact C, ContactRole CR, ContactRoleProfile CRP + WHERE (archiveDate = '0000-00-00' OR archiveDate is null) + AND C.contactID = CRP.contactID + AND CRP.contactRoleID = CR.contactRoleID + AND resourceID = '" . $this->resourceID . "' + GROUP BY C.contactID + ORDER BY C.name"; - //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['contactID'])){ + $result = $this->db->processQuery($query, 'assoc'); - foreach (array_keys($result) as $attributeName) { - $resultArray[$attributeName] = $result[$attributeName]; - } - array_push($contactsArray, $resultArray); + //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['contactID'])){ - }else{ - foreach ($result as $row) { - $resultArray = array(); - foreach (array_keys($row) as $attributeName) { - $resultArray[$attributeName] = $row[$attributeName]; + foreach (array_keys($result) as $attributeName) { + $resultArray[$attributeName] = $result[$attributeName]; } array_push($contactsArray, $resultArray); + + }else{ + foreach ($result as $row) { + $resultArray = array(); + foreach (array_keys($row) as $attributeName) { + $resultArray[$attributeName] = $row[$attributeName]; + } + + array_push($contactsArray, $resultArray); + } } } - //if the org module is installed also get the org contacts from org database - if ($config->settings->organizationsModule == 'Y'){ + if ($config->settings->organizationsModule == 'Y' && (!$moduleFilter || $moduleFilter == 'organizations')) { $dbName = $config->settings->organizationsDatabaseName; $query = "SELECT distinct OC.*, O.name organizationName, GROUP_CONCAT(DISTINCT CR.shortName SEPARATOR '
') contactRoles @@ -748,11 +748,6 @@ public function getNotes($tabName = NULL){ return $objects; } - - - - - //returns array of the initial note object public function getInitialNote(){ $noteType = new NoteType(); @@ -776,11 +771,126 @@ public function getInitialNote(){ } + public function getIssues($archivedOnly=false){ + $query = "SELECT i.* + FROM Issue i + LEFT JOIN IssueRelationship ir ON ir.issueID=i.issueID + WHERE ir.entityID={$this->resourceID} AND ir.entityTypeID=2"; + if ($archivedOnly) { + $query .= " AND i.dateClosed IS NOT NULL"; + } else { + $query .= " AND i.dateClosed IS NULL"; + } + $query .= " ORDER BY i.dateCreated 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['issueID'])){ + $object = new Issue(new NamedArguments(array('primaryKey' => $result['issueID']))); + array_push($objects, $object); + }else{ + foreach ($result as $row) { + $object = new Issue(new NamedArguments(array('primaryKey' => $row['issueID']))); + array_push($objects, $object); + } + } + return $objects; + } + + public function getDowntime($archivedOnly=false){ + $query = "SELECT d.* + FROM Downtime d + WHERE d.entityID={$this->resourceID} AND d.entityTypeID=2"; + if ($archivedOnly) { + $query .= " AND d.endDate < CURDATE()"; + } else { + $query .= " AND d.endDate >= CURDATE()"; + } + $query .= " ORDER BY d.dateCreated 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['downtimeID'])){ + $object = new Downtime(new NamedArguments(array('primaryKey' => $result['downtimeID']))); + array_push($objects, $object); + }else{ + foreach ($result as $row) { + $object = new Downtime(new NamedArguments(array('primaryKey' => $row['downtimeID']))); + array_push($objects, $object); + } + } + return $objects; + } + + public function getExportableIssues($archivedOnly=false){ + if ($this->db->config->settings->organizationsModule == 'Y' && $this->db->config->settings->organizationsDatabaseName) { + $contactsDB = $this->db->config->settings->organizationsDatabaseName; + } else { + $contactsDB = $this->db->config->database->name; + } + + $query = "SELECT i.*,(SELECT GROUP_CONCAT(CONCAT(sc.name,' - ',sc.emailAddress) SEPARATOR ', ') + FROM IssueContact sic + LEFT JOIN `{$contactsDB}`.Contact sc ON sc.contactID=sic.contactID + WHERE sic.issueID=i.issueID) AS `contacts`, + (SELECT GROUP_CONCAT(se.titleText SEPARATOR ', ') + FROM IssueRelationship sir + LEFT JOIN Resource se ON (se.resourceID=sir.entityID AND sir.entityTypeID=2) + WHERE sir.issueID=i.issueID) AS `appliesto`, + (SELECT GROUP_CONCAT(sie.email SEPARATOR ', ') + FROM IssueEmail sie + WHERE sie.issueID=i.issueID) AS `CCs` + FROM Issue i + LEFT JOIN IssueRelationship ir ON ir.issueID=i.issueID + WHERE ir.entityID={$this->resourceID} AND ir.entityTypeID=2"; + if ($archivedOnly) { + $query .= " AND i.dateClosed IS NOT NULL"; + } else { + $query .= " AND i.dateClosed IS NULL"; + } + $query .= " ORDER BY i.dateCreated 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['issueID'])){ + return array($result); + }else{ + return $result; + } + } + + public function getExportableDowntimes($archivedOnly=false){ + + $query = "SELECT d.* + FROM Downtime d + WHERE d.entityID={$this->resourceID} AND d.entityTypeID=2"; + if ($archivedOnly) { + $query .= " AND d.endDate < CURDATE()"; + } else { + $query .= " AND d.endDate >= CURDATE()"; + } + $query .= " ORDER BY d.dateCreated 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['downtimeID'])){ + return array($result); + }else{ + return $result; + } + } //returns array of attachments objects public function getAttachments(){ @@ -1599,19 +1709,27 @@ public function getOrganizationArray(){ } - - - - } return $resourceOrgArray; } + public function getSiblingResourcesArray($organizationID) { + $query = "SELECT DISTINCT r.resourceID, r.titleText FROM ResourceOrganizationLink rol + LEFT JOIN Resource r ON r.resourceID=rol.resourceID + WHERE rol.organizationID=".$organizationID." AND r.archiveDate IS NULL + ORDER BY r.titleText"; + $result = $this->db->processQuery($query, 'assoc'); + if($result["resourceID"]) { + return array($result); + } + + return $result; + } //gets an array of distinct organizations set up for this resource (organizationID, organization) public function getDistinctOrganizationArray(){ diff --git a/admin/classes/domain/ResourceStep.php b/admin/classes/domain/ResourceStep.php index 5022f2c..3d78fa8 100644 --- a/admin/classes/domain/ResourceStep.php +++ b/admin/classes/domain/ResourceStep.php @@ -33,47 +33,55 @@ public function completeStep(){ //mark this step complete $this->stepEndDate = date( 'Y-m-d' ); $this->endLoginID = $_SESSION['loginID']; - $this->save; + $this->save(); - //if there are next steps, start them - $nextStepArray = $this->getNextSteps(); + $this->startNextStepsOrComplete(); - if (count($nextStepArray) > 0){ - foreach ($nextStepArray as $nextResourceStep){ - - $nextResourceStep->startStep(); - - } + } + public function startNextStepsOrComplete(){ + //if there are next steps, start them + $nextStepArray = $this->getNextSteps(); - }else{ + if (count($nextStepArray) > 0){ + foreach ($nextStepArray as $nextResourceStep){ - //check if it just means that this branch is complete and there are still other steps open - if ($this->getNumberOfOpenSteps() == 0){ + $nextResourceStep->startStep(); - //otherwise if there are no more steps then we can mark the resource complete - $resource = new Resource(new NamedArguments(array('primaryKey' => $this->resourceID))); - $resource->completeWorkflow(); + } + } - } - } + //check if this branch is complete or if there are still other steps open + if ($this->getNumberOfOpenSteps() == 0){ + //if there are no more steps then we can mark the resource complete + $resource = new Resource(new NamedArguments(array('primaryKey' => $this->resourceID))); + $resource->completeWorkflow(); - } + } + } public function startStep(){ //start this step $this->stepStartDate = date( 'Y-m-d' ); - $this->save; + $this->save(); //send notifications $this->sendApprovalNotification(); - } + public function restartReassignedStep(){ + //restart step if it's active + if (!is_null($this->stepStartDate)){ + $this->stepStartDate = date( 'Y-m-d' ); + + $this->sendReassignedStepNotification(); + } + $this->save(); + } //returns array of resource step objects public function getNextSteps(){ @@ -101,9 +109,6 @@ public function getNextSteps(){ return $objects; } - - - //returns prior resource step object (resource step can only have one prior step) public function getPriorStep(){ @@ -144,6 +149,33 @@ public function getNumberOfOpenSteps(){ + //returns an array of later open step objects + public function getLaterOpenSteps(){ + $query = "SELECT * FROM ResourceStep + WHERE resourceID = '" . $this->resourceID . "' + AND displayOrderSequence > " . $this->displayOrderSequence . " + AND (stepEndDate IS NULL OR stepEndDate = '0000-00-00') + ORDER BY resourceStepID"; + + $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['resourceStepID'])){ + $object = new ResourceStep(new NamedArguments(array('primaryKey' => $result['resourceStepID']))); + array_push($objects, $object); + }else{ + foreach ($result as $row) { + $object = new ResourceStep(new NamedArguments(array('primaryKey' => $row['resourceStepID']))); + array_push($objects, $object); + } + } + + return $objects; + } + + //sends email to the approval user group for this step public function sendApprovalNotification(){ @@ -158,7 +190,13 @@ public function sendApprovalNotification(){ if (($this->priorStepID) && ($this->priorStepID != '0')){ $priorResourceStep = $this->getPriorStep(); $priorStepName = $priorResourceStep->stepName; - $messageType='ResourceQueue'; + if ($priorResourceStep){ + $priorStepName = $priorResourceStep->stepName; + $messageType='ResourceQueue'; + }else{ + $messageType='DeletedPriorStep'; + } + }else{ $messageType='NewResource'; $priorStepName = ''; @@ -178,6 +216,29 @@ public function sendApprovalNotification(){ } + //sends email to the reassigned user group + public function sendReassignedStepNotification(){ + + $util = new Utility(); + + $userGroup = new UserGroup(new NamedArguments(array('primaryKey' => $this->userGroupID))); + $resource = new Resource(new NamedArguments(array('primaryKey' => $this->resourceID))); + + //only send if there is an email address set up for this group + if ($userGroup->emailAddress){ + + //formulate emil to be sent + $email = new Email(); + $email->message = $util->createMessageFromTemplate('ReassignedStep', $this->resourceID, $resource->titleText, $this->stepName, '',''); + $email->to = $userGroup->emailAddress; + $email->subject = "CORAL Alert: " . $resource->titleText; + + $email->send(); + } + + + } + } ?> \ No newline at end of file diff --git a/admin/configuration_sample.ini b/admin/configuration_sample.ini index 1378425..a7fc310 100644 --- a/admin/configuration_sample.ini +++ b/admin/configuration_sample.ini @@ -1,20 +1,20 @@ [settings] -licensingModule= +licensingModule=N licensingDatabaseName= -organizationsModule= +organizationsModule=N organizationsDatabaseName= -usageModule= +usageModule=N enhancedCostHistory=N -authModule= +authModule=N authDatabaseName= remoteAuthVariableName="_SERVER['REMOTE_USER']" defaultCurrency="USD" -enableAlerts="" -catalogURL="" -feedbackEmailAddress="" +enableAlerts= +catalogURL= +feedbackEmailAddress= testMode=N -testModeEmailAddress="" -defaultsort="" +testModeEmailAddress= +defaultsort= importISBNDedupingColumns="ISSN,ISBN" [database] diff --git a/admin/emails/DeletedPriorStep.txt b/admin/emails/DeletedPriorStep.txt new file mode 100644 index 0000000..fc0a27c --- /dev/null +++ b/admin/emails/DeletedPriorStep.txt @@ -0,0 +1,5 @@ +For resource: + +The prior step has been deleted and now the resource is in your queue. + +Visit the record at \ No newline at end of file diff --git a/admin/emails/ReassignedStep.txt b/admin/emails/ReassignedStep.txt new file mode 100644 index 0000000..beea9e4 --- /dev/null +++ b/admin/emails/ReassignedStep.txt @@ -0,0 +1,5 @@ +For resource: + +The step '' has been reassigned to you. It is now in your queue. + +Visit the record at \ No newline at end of file diff --git a/ajax_forms.php b/ajax_forms.php index 58aa67c..0385d03 100644 --- a/ajax_forms.php +++ b/ajax_forms.php @@ -22,7 +22,7 @@ $action = $_GET['action']; if (!preg_match('/^[A-Za-z]+$/', $action) || !(include "ajax_forms/$action.php")){ - echo "Form action " . $action . " not set up!"; + echo _("Form action ") . $action . _(" not set up!"); } ?> diff --git a/ajax_forms/getAccessForm.php b/ajax_forms/getAccessForm.php index b5fed50..12401c6 100644 --- a/ajax_forms/getAccessForm.php +++ b/ajax_forms/getAccessForm.php @@ -56,7 +56,7 @@
-
Edit Access
+
@@ -65,14 +65,14 @@
-      +      "; } ?> @@ -41,8 +41,8 @@
- + - + - + - + - + - + - + @@ -160,7 +160,7 @@ -      +     
@@ -205,7 +205,7 @@ -      +     
@@ -248,8 +248,8 @@
- - + +
diff --git a/ajax_forms/getAccountForm.php b/ajax_forms/getAccountForm.php index 0dda8fe..2f790c5 100644 --- a/ajax_forms/getAccountForm.php +++ b/ajax_forms/getAccountForm.php @@ -14,7 +14,7 @@ -
+
@@ -24,7 +24,7 @@ - + - + - + - + - + - + @@ -83,8 +83,8 @@
- - + +
diff --git a/ajax_forms/getAdminAlertDaysForm.php b/ajax_forms/getAdminAlertDaysForm.php index 3127a32..32ecd23 100644 --- a/ajax_forms/getAdminAlertDaysForm.php +++ b/ajax_forms/getAdminAlertDaysForm.php @@ -11,7 +11,7 @@ -
+
@@ -31,8 +31,8 @@
 
- - + +
diff --git a/ajax_forms/getAdminAlertEmailForm.php b/ajax_forms/getAdminAlertEmailForm.php index f98570e..e7b7a30 100644 --- a/ajax_forms/getAdminAlertEmailForm.php +++ b/ajax_forms/getAdminAlertEmailForm.php @@ -11,7 +11,7 @@ -
+
@@ -31,8 +31,8 @@
 
- - + +
diff --git a/ajax_forms/getAdminCurrencyUpdateForm.php b/ajax_forms/getAdminCurrencyUpdateForm.php index 8e02eae..0845659 100644 --- a/ajax_forms/getAdminCurrencyUpdateForm.php +++ b/ajax_forms/getAdminCurrencyUpdateForm.php @@ -11,7 +11,7 @@ -
+
@@ -21,10 +21,10 @@ - + - +
Code
Name
@@ -35,8 +35,8 @@
- - + +
diff --git a/ajax_forms/getAdminUpdateForm.php b/ajax_forms/getAdminUpdateForm.php index a07c734..cb9c31b 100644 --- a/ajax_forms/getAdminUpdateForm.php +++ b/ajax_forms/getAdminUpdateForm.php @@ -13,7 +13,7 @@ -
+
@@ -28,7 +28,7 @@ settings->usageModule == 'Y')){ if($instance->includeStats == 1){$stats = 'checked';}else{$stats='';} - echo "
"; + echo "
"; echo "
- - + +
diff --git a/ajax_forms/getAdminUserGroupForm.php b/ajax_forms/getAdminUserGroupForm.php index d2658bd..64be023 100644 --- a/ajax_forms/getAdminUserGroupForm.php +++ b/ajax_forms/getAdminUserGroupForm.php @@ -14,7 +14,7 @@ -
+
@@ -23,7 +23,7 @@
-      +      @@ -31,14 +31,14 @@
- + - + @@ -55,7 +55,7 @@ - - + +
-      +      @@ -79,7 +79,7 @@
- add user + <?php echo _(" title="">
@@ -118,7 +118,7 @@
- remove user from group + <?php echo _(" title="" class='remove' />
diff --git a/ajax_forms/getAdminUserUpdateForm.php b/ajax_forms/getAdminUserUpdateForm.php index b1b80db..9d51092 100644 --- a/ajax_forms/getAdminUserUpdateForm.php +++ b/ajax_forms/getAdminUserUpdateForm.php @@ -18,7 +18,7 @@ -
+
@@ -29,11 +29,11 @@ - - - - - + + + + - +
/>
/>
@@ -63,8 +63,8 @@
- - + +
diff --git a/ajax_forms/getAdminWorkflowForm.php b/ajax_forms/getAdminWorkflowForm.php index 86397e3..c27501a 100644 --- a/ajax_forms/getAdminWorkflowForm.php +++ b/ajax_forms/getAdminWorkflowForm.php @@ -39,7 +39,7 @@ -
Edit Workflow
+
@@ -48,14 +48,14 @@
-      +     
- + + - +
@@ -120,9 +120,9 @@
- - - + + + @@ -152,7 +152,7 @@ @@ -235,7 +235,7 @@ @@ -263,8 +263,8 @@
 Name:Approval/Notification Group:Parent Step  
- add step + <?php echo _(" title="">
- remove this step + <?php echo _(" title="" class='removeStep' />
- - + +
diff --git a/ajax_forms/getAttachmentForm.php b/ajax_forms/getAttachmentForm.php index 70df694..1116aaa 100644 --- a/ajax_forms/getAttachmentForm.php +++ b/ajax_forms/getAttachmentForm.php @@ -13,7 +13,7 @@ -
+
@@ -24,7 +24,7 @@ - + @@ -32,7 +32,7 @@ - + - + - + @@ -86,8 +86,8 @@
" . $attachment->attachmentURL . "
replace with new file"; + echo "
" . $attachment->attachmentURL . "
"._("replace with new file").""; echo "
"; //if adding @@ -73,7 +73,7 @@
- - + +
diff --git a/ajax_forms/getCloseIssueForm.php b/ajax_forms/getCloseIssueForm.php new file mode 100644 index 0000000..e5a4d92 --- /dev/null +++ b/ajax_forms/getCloseIssueForm.php @@ -0,0 +1,30 @@ + +
+ + + + + + + + + +
+ Issue Resolution
+
+ + +
+ + + + + +
+ + +
+ diff --git a/ajax_forms/getContactForm.php b/ajax_forms/getContactForm.php index 8941891..b68fdb0 100644 --- a/ajax_forms/getContactForm.php +++ b/ajax_forms/getContactForm.php @@ -27,7 +27,7 @@ -
+
@@ -40,56 +40,56 @@ - + - + - + - + - + - + - + - + @@ -99,7 +99,7 @@
/> - +
@@ -135,7 +135,7 @@ - + @@ -158,8 +158,8 @@
- - + +
diff --git a/ajax_forms/getCostForm.php b/ajax_forms/getCostForm.php index 8f5bd3f..d87a752 100644 --- a/ajax_forms/getCostForm.php +++ b/ajax_forms/getCostForm.php @@ -45,33 +45,33 @@
-
Edit Cost Information
+
-      +      @@ -125,7 +125,7 @@ -    +   
- - - + + + - - - + + + - + - + - + @@ -135,7 +135,7 @@ @@ -219,7 +219,7 @@ @@ -249,8 +249,8 @@
YearSub StartSub End FundPaymentType Cost Details Note Invoice  
- add this payment + <?php echo _(" title="">
- remove this payment + <?php echo _("remove this payment");?>
- - + +
diff --git a/ajax_forms/getDetailSubjectUpdateForm.php b/ajax_forms/getDetailSubjectUpdateForm.php index 0b8788f..b3256f1 100644 --- a/ajax_forms/getDetailSubjectUpdateForm.php +++ b/ajax_forms/getDetailSubjectUpdateForm.php @@ -13,7 +13,7 @@ -
+
@@ -35,8 +35,8 @@ - - + +
diff --git a/ajax_forms/getGeneralDetailSubjectForm.php b/ajax_forms/getGeneralDetailSubjectForm.php index ebb326a..d95e44f 100644 --- a/ajax_forms/getGeneralDetailSubjectForm.php +++ b/ajax_forms/getGeneralDetailSubjectForm.php @@ -15,7 +15,7 @@ -
+
@@ -24,7 +24,7 @@
-      +      @@ -50,7 +50,7 @@ @@ -125,8 +125,8 @@
-      +      @@ -72,7 +72,7 @@
- add detail subject + <?php echo _(" title="">
@@ -102,9 +102,9 @@ // Check to see if detail subject is in use. If not allow removal. $subjectObj = new DetailedSubject(); if ($subjectObj->inUse($dsSubject->detailedSubjectID, $generalSubject->generalSubjectID) == 0) { ?> - remove detailed subject + <?php echo _(" title="" class='remove' /> - subject in use + <?php echo _(" title="" />
- - + +
diff --git a/ajax_forms/getGeneralSubjectUpdateForm.php b/ajax_forms/getGeneralSubjectUpdateForm.php index 25d46fa..efc5d32 100644 --- a/ajax_forms/getGeneralSubjectUpdateForm.php +++ b/ajax_forms/getGeneralSubjectUpdateForm.php @@ -13,7 +13,7 @@ -
+
@@ -35,8 +35,8 @@ - - + +
diff --git a/ajax_forms/getLicenseForm.php b/ajax_forms/getLicenseForm.php index 79e6f1b..d33f7ac 100644 --- a/ajax_forms/getLicenseForm.php +++ b/ajax_forms/getLicenseForm.php @@ -47,7 +47,7 @@ -
Edit Licenses
+
@@ -57,7 +57,7 @@ settings->licensingModule == 'Y'){ ?> -      +      @@ -73,7 +73,7 @@
- add license + <?php echo _(" title="">
@@ -100,7 +100,7 @@
- remove license link license' class='remove' /> + <?php echo _("remove license link");?>' class='remove' />
@@ -133,7 +133,7 @@
- +
Status: - +
History: 0){ foreach ($resourceLicenseStatusArray as $licenseStatus){ - echo $licenseStatus['licenseStatus'] . " - " . format_date($licenseStatus['licenseStatusChangeDate']) . " by " . $licenseStatus['changeName'] . "
"; + echo $licenseStatus['licenseStatus'] . " - " . format_date($licenseStatus['licenseStatusChangeDate']) . _(" by ") . $licenseStatus['changeName'] . "
"; } }else{ - echo "No license status information available."; + echo ""._("No license status information available.").""; } ?> @@ -188,8 +188,8 @@ - - + +
diff --git a/ajax_forms/getNewDowntimeForm.php b/ajax_forms/getNewDowntimeForm.php new file mode 100644 index 0000000..246eb2d --- /dev/null +++ b/ajax_forms/getNewDowntimeForm.php @@ -0,0 +1,132 @@ + $resourceID))); + +$isOrgDowntime = false; +if ($organizationID) { + $organization = new Organization(new NamedArguments(array('primaryKey' => $organizationID))); + $issues = $organization->getIssues(); + $isOrgDowntime = true; +} else { + $issues = $resource->getIssues(); + + $organizationArray = $resource->getOrganizationArray(); + $organizationData = $organizationArray[0]; + + if ($organizationData['organizationID']) { + $organizationID = $organizationData['organizationID']; + + $organization = new Organization(new NamedArguments(array('primaryKey' => $organizationID))); + + $orgIssues = $organization->getIssues(); + + foreach ($orgIssues as $issue) { + array_push($issues, $issue); + } + $organizationResourcesArray = $resource->getSiblingResourcesArray($organizationID); + } +} + +//our $organizationID could have come from the $_GET or through the resource +if ($organizationID) { + $downtimeObj = new Downtime(); + $downtimeTypeNames = $downtimeObj->getDowntimeTypesArray(); + + $defaultStart = date("Y-m-d\TH:i"); + $defaultEnd = date("Y-m-d\TH:i", strtotime("+1 day")); + +?> + + +'; +} else { + echo ''; +} +?> + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Resource Downtime Report

+
+ + +
+ + +
+ +
+ +
+ +
+ + + + + + +
+ + + + + Creating downtime requires an organization or a resource to be associated with an organization. +

+ '; +} +?> + + diff --git a/ajax_forms/getNewIssueForm.php b/ajax_forms/getNewIssueForm.php new file mode 100644 index 0000000..7402b37 --- /dev/null +++ b/ajax_forms/getNewIssueForm.php @@ -0,0 +1,149 @@ + $resourceID))); + +$organizationArray = $resource->getOrganizationArray(); +$organizationData = $organizationArray[0]; + +//the issues feature currently support org or resource contacts, but not both +$moduleFilter = ($config->settings->organizationsModule == 'Y') ? 'organizations':'resources'; +$contactsArray = $resource->getUnarchivedContacts($moduleFilter); +if ($organizationData['organizationID']) { + $organizationResourcesArray = $resource->getSiblingResourcesArray($organizationData['organizationID']); +?> + +
+ + + + + + + + + + + + + + +settings->organizationsModule == 'Y') { +?> + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -128,7 +128,7 @@ -    *   +    *  
+

Report New Problem

+ * required fields +
+

+ +
+ + +
+ + add contact +
+
+ + +
+ + +

+ Current CCs: +

+ + +
+ + +
+
@@ -173,7 +173,7 @@
-   Acquisition Type *   +    *   @@ -220,7 +220,7 @@
-      +      @@ -266,7 +266,7 @@ -      +     
@@ -275,7 +275,7 @@
-
Include any additional information
+

@@ -291,9 +291,9 @@ - - - + + +
diff --git a/ajax_forms/getNoteForm.php b/ajax_forms/getNoteForm.php index f7a8109..8bb4741 100644 --- a/ajax_forms/getNoteForm.php +++ b/ajax_forms/getNoteForm.php @@ -15,7 +15,7 @@ -
+
@@ -25,7 +25,7 @@ - + - + @@ -58,8 +58,8 @@
- - + +
diff --git a/ajax_forms/getOrderForm.php b/ajax_forms/getOrderForm.php index c886d1b..5b0b7b1 100644 --- a/ajax_forms/getOrderForm.php +++ b/ajax_forms/getOrderForm.php @@ -30,20 +30,20 @@ -
Edit Acquisitions Information
+
-      +      - - - + + + - - + + - + - + - + - + @@ -222,35 +222,35 @@ ?> - - - + + + - - + + - + - + - + - + "; + echo ""; } ?>
- + - + - + - + - + @@ -86,7 +86,7 @@ @@ -108,7 +108,7 @@ -      +     
 
- +
@@ -157,8 +157,8 @@
- - + +
diff --git a/ajax_forms/getResourceStepForm.php b/ajax_forms/getResourceStepForm.php new file mode 100644 index 0000000..374b562 --- /dev/null +++ b/ajax_forms/getResourceStepForm.php @@ -0,0 +1,75 @@ +

You must supply a valid resource step ID.

"; +}else{ + $resourceStepID = $_GET['resourceStepID']; + $resourceStep = new ResourceStep(new NamedArguments(array('primaryKey' => $resourceStepID))); + //get step name & group + $stepName = $resourceStep->attributes['stepName']; + $stepGroupID = $resourceStep->attributes['userGroupID']; + $orderNum = $resourceStep->attributes['displayOrderSequence']; + $remainingSteps = $resourceStep->getNumberOfOpenSteps(); + //echo "the step name is ".$stepName.", and the group id is ". $stepGroup.".
\n"; + //get possible groups + $userGroupArray = array(); + $userGroupObj = new UserGroup(); + $userGroupArray = $userGroupObj->allAsArray(); + + //make form + ?> +
+ + + + +
Edit Resource Step
+ + + + + + + +
+      + + + + +
+ + + + + + + +
Step name: + + + Apply to all later steps?
+
+
+ + + + + + +
+ + + +
+ + allAsArray(); ?>
-
Add General / Detail Subject Link
+
0){ ?> - - + + @@ -24,14 +24,14 @@ echo ""; echo ""; echo ""; - echo ""; + echo ""; foreach ($generalSubject->getDetailedSubjects() as $detailedSubjects){ echo ""; echo ""; echo ""; - echo ""; + echo ""; echo ""; } echo ""; @@ -42,11 +42,11 @@ "; + echo _("(none found)")."
"; } ?> - + diff --git a/ajax_forms/getUpdateProductForm.php b/ajax_forms/getUpdateProductForm.php index 3f7d112..6d11300 100644 --- a/ajax_forms/getUpdateProductForm.php +++ b/ajax_forms/getUpdateProductForm.php @@ -69,7 +69,7 @@ -
Edit Resource
+
@@ -78,7 +78,7 @@ - + - + - + - + - + - + - + No accounts available

"; + echo ""._("No accounts available")."

"; } if ($user->canEdit() && ($orgELFlag == 0)){ ?> - add new account +


px;padding:0x;margin:0px;height:100%;'> @@ -105,26 +105,26 @@ acquisitionTypeID) { ?> - + orderNumber) { ?> - + systemNumber) { ?> - + @@ -133,14 +133,14 @@ 0) { ?> - + currentStartDate) && ($resource->currentStartDate != '0000-00-00')) { ?> - + @@ -149,14 +149,14 @@
General Subject NameDetail Subject Name    
" . $generalSubject->shortName . "add"._("add")."
"; echo $detailedSubjects->shortName . "add"._("add")."
-      +      @@ -88,22 +88,22 @@ @@ -319,7 +319,7 @@ @@ -420,8 +420,8 @@
- + - + - + - + @@ -115,13 +115,13 @@ - + - + - + - + @@ -234,8 +234,8 @@
- add Parent resource
+ <?php echo _("add Parent resource");?>

@@ -134,7 +134,7 @@
- remove parent + <?php echo _("remove parent");?>
- add Isbn
+ <?php echo _("add Isbn");?>


@@ -167,7 +167,7 @@
/>
- - + + @@ -257,7 +257,7 @@
Role:Organization:  
- add organization + <?php echo _("add organization");?>
@@ -297,7 +297,7 @@
- remove organization organization' class='remove' /> + <?php echo _(" title='' class='remove' />
-      +      @@ -327,8 +327,8 @@
- - + + @@ -350,7 +350,7 @@
Type:Alias:  
- add this alias + <?php echo _("add this alias");?>
@@ -391,7 +391,7 @@
- remove this alias + <?php echo _("remove this alias");?>
- - + +
diff --git a/ajax_htmldata.php b/ajax_htmldata.php index 95b79aa..6b8c661 100644 --- a/ajax_htmldata.php +++ b/ajax_htmldata.php @@ -24,7 +24,7 @@ $action = $_GET['action']; if (!preg_match('/^[A-Za-z]+$/', $action) || !(include "ajax_htmldata/$action.php")){ - echo "Data action " . $action . " not set up!"; + echo _("Data action ") . $action . _(" not set up!"); } ?> diff --git a/ajax_htmldata/getAccessDetails.php b/ajax_htmldata/getAccessDetails.php index 06654f2..f0363fb 100644 --- a/ajax_htmldata/getAccessDetails.php +++ b/ajax_htmldata/getAccessDetails.php @@ -28,11 +28,11 @@ @@ -40,21 +40,21 @@ 0) { ?> - + 0) { ?> - + shortName) { ?> - + @@ -62,14 +62,14 @@ authenticationUserName) || ($resource->authenticationPassword)) { ?> - + shortName) { ?> - + @@ -77,7 +77,7 @@ registeredIPAddressException){ ?> - + @@ -85,35 +85,35 @@ shortName) { ?> - + coverageText) { ?> - + shortName) { ?> - + shortName) && (!$resource->coverageText) && (!$resource->authenticationUserName) && (!$resource->authenticationPassword) && (!$userLimit->shortName) && (!$resource->registeredIPAddressException) && (!$storageLocation->shortName) && (!$accessMethod->shortName)){ - echo ""; + echo ""; } ?>
- Access Information + canEdit()){ ?> - edit + <?php echo _("edit");?>
Administering Sites:
Authorized Sites:
Authentication Type: shortName; ?>
Username / Password: authenticationUserName . " / " . $resource->authenticationPassword; ?>
Simultaneous User Limit: shortName; ?>
Registered IP Address: registeredIPAddressException; ?>
Storage Location: shortName; ?>
Coverage: coverageText; ?>
Access Method: shortName; ?>
No access information available.
"._("No access information available").".
canEdit()){ ?> - edit access information +


@@ -156,10 +156,10 @@ ?> - + @@ -167,10 +167,10 @@ - +
Additional Notes canEdit()){?> - add new note +

canEdit()){?> - &modal=true' class='thickbox'>edit ' tab='Access'>remove note + &modal=true' class='thickbox'><?php echo _("edit");?> ' tab='Access'><?php echo _("remove note");?>


@@ -178,7 +178,7 @@ }else{ if ($user->canEdit()){ ?> - add new note + Resource Specific:"; + echo "
"._("Resource Specific:")."
"; $resELFlag = 1; }else if (($orgELFlag == 0) && ($externalLogin['organizationName'] != '')){ if ($resELFlag == 0){ - echo "No Resource Specific Accounts

"; + echo ""._("No Resource Specific Accounts")."

"; } if ($user->canEdit()){ ?> - add new account +


Inherited:"; + echo "
"._("Inherited:")."
"; $orgELFlag = 1; }else{ echo "
"; @@ -41,7 +41,7 @@ canEdit()) && ($externalLogin['organizationName'] == '')){ ?> - ' class='thickbox'>edit '>remove account + ' class='thickbox'><?php echo _("edit");?> '><?php echo _("remove account");?>
Organization:getCORALURL() . "organizations/orgDetail.php?showTab=accounts&organizationID=" . $externalLogin['organizationID'] . "' target='_blank'>Visit Account in Organizations Module"; ?>getCORALURL() . "organizations/orgDetail.php?showTab=accounts&organizationID=" . $externalLogin['organizationID'] . "' target='_blank'>"._("Visit Account in Organizations Module").""; ?>
Login URL:  ' target='_blank'>Visit Login URL  ' target='_blank'><?php echo _("Visit Login URL");?>
User Name:
Password:
Last Updated:
Registered Email:
Notes:
- Order + canEdit()){ ?> - edit + <?php echo _("edit");?>
Acquisition Type: shortName; ?>
Order Number: orderNumber; ?>
System Number: systemNumber; if ($config->settings->catalogURL != ''){ - echo "  catalog view"; + echo "  "._("catalog view").""; } ?>
Purchasing Sites:
Sub Start: currentStartDate); ?>
Current Sub End: currentEndDate); ?>   - subscriptionAlertEnabledInd == "1") { echo "Expiration Alert Enabled"; } ?> + subscriptionAlertEnabledInd == "1") { echo ""._("Expiration Alert Enabled").""; } ?>
canEdit()){ ?> - edit order information +

@@ -166,31 +166,31 @@
- Cost History + canEdit()){ ?> - edit + <?php echo _("edit");?>
YearSub StartSub End FundPayment % Type Details Notes Invoice
>>> > > > >> > > style='text-align: right'> > > > > > > > >
No payment information available.
"._("No payment information available").".
canEdit()){ ?> - edit cost history +

@@ -259,24 +259,24 @@ - + - +
- License + canEdit()){ ?> - edit + <?php echo _("edit");?>
Status: 0){ foreach ($licenseStatusArray as $licenseStatus){ - echo $licenseStatus['licenseStatus'] . " on " . format_date($licenseStatus['licenseStatusChangeDate']) . " by " . $licenseStatus['changeName'] . "
"; + echo $licenseStatus['licenseStatus'] . _(" on ")."" . format_date($licenseStatus['licenseStatusChangeDate']) . _(" by ") . $licenseStatus['changeName'] . "
"; } }else{ - echo "No license status information available."; + echo ""._("No license status information available.").""; } ?> @@ -286,16 +286,16 @@ settings->licensingModule == "Y"){ ?>
Licenses: 0){ foreach ($licenseArray as $license){ - echo $license['license'] . "  View License
"; + echo $license['license'] . "  "._("View License")."
"; } }else{ - echo "No associated licenses available."; + echo ""._("No associated licenses available.").""; } ?> @@ -309,9 +309,9 @@
canEdit()){ ?> settings->licensingModule == "Y"){ ?> - edit license and status + - edit license status +



@@ -353,10 +353,10 @@ ?> - + @@ -364,10 +364,10 @@ - +
Additional Notes canEdit()){?> - add new note +

canEdit()){?> - &modal=true' class='thickbox'>edit ' tab='Acquisitions'>remove note + &modal=true' class='thickbox'><?php echo _("edit");?> ' tab='Acquisitions'><?php echo _("remove note");?>


@@ -375,7 +375,7 @@ }else{ if ($user->canEdit()){ ?> - add new note + allAsArray(); $daysInAdvanceArray = $alertDaysInAdvance->allAsArray(); - echo "
Alert Settings
"; + echo "
"._("Alert Settings")."
"; if (count($emailAddressArray) > 0){ ?> - + @@ -22,8 +22,8 @@ foreach($emailAddressArray as $emailAddress) { echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } @@ -32,10 +32,10 @@ "; + echo _("(none found)")."
"; } - echo "add email address"; + echo ""._("add email address").""; echo "


"; @@ -43,7 +43,7 @@ ?>
Email Address    
" . $emailAddress['emailAddress'] . "editremove"._("edit").""._("remove")."
- + @@ -52,8 +52,8 @@ foreach($daysInAdvanceArray as $daysInAdvance) { echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } @@ -62,13 +62,13 @@ "; + echo _("(none found)")."
"; } - echo "add days"; + echo ""._("add days").""; ?> diff --git a/ajax_htmldata/getAdminCurrencyDisplay.php b/ajax_htmldata/getAdminCurrencyDisplay.php index ce70223..0b7a3c2 100644 --- a/ajax_htmldata/getAdminCurrencyDisplay.php +++ b/ajax_htmldata/getAdminCurrencyDisplay.php @@ -5,14 +5,14 @@ $instanceArray = $obj->allAsArray(); - echo "
Currency
"; + echo "
"._("Currency")."
"; if (count($instanceArray) > 0){ ?>
Days in advance of expiration    
" . $daysInAdvance['daysInAdvanceNumber'] . "editremove"._("edit").""._("remove")."
- - + + @@ -22,8 +22,8 @@ echo ""; echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } @@ -35,7 +35,7 @@ echo "(none found)
"; } - echo "add new currency"; + echo ""._("add new currency").""; ?> diff --git a/ajax_htmldata/getAdminDisplay.php b/ajax_htmldata/getAdminDisplay.php index 78e4743..a7d5b85 100644 --- a/ajax_htmldata/getAdminDisplay.php +++ b/ajax_htmldata/getAdminDisplay.php @@ -13,7 +13,7 @@ ?>
CodeName    
" . $instance['currencyCode'] . "" . $instance['shortName'] . "editremove"._("edit").""._("remove")."
- + @@ -22,8 +22,8 @@ foreach($instanceArray as $instance) { echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } @@ -32,10 +32,10 @@ "; + echo _("(none found)")."
"; } - echo "add new " . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst($className))) . ""; + echo ""._("add new ") . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst($className))) . ""; ?> diff --git a/ajax_htmldata/getAdminSubjectDisplay.php b/ajax_htmldata/getAdminSubjectDisplay.php index fb66fc0..e2391ae 100644 --- a/ajax_htmldata/getAdminSubjectDisplay.php +++ b/ajax_htmldata/getAdminSubjectDisplay.php @@ -25,9 +25,9 @@ $generalSubject = new GeneralSubject(); if ($generalSubject->inUse($instance[lcfirst("GeneralSubject") . 'ID']) == 0) { - echo ""; + echo ""; } else { - echo ""; + echo ""; } echo ""; @@ -38,23 +38,23 @@ "; + echo _("(none found)")."
"; } - echo "add new " . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst("GeneralSubject"))) . ""; + echo ""._("add new ") . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst("GeneralSubject"))) . ""; ?>

Detailed Subject"; + echo "
"._("Detailed Subject")."
"; if (count($detailedSubjectArray) > 0){ ?>
Value    
" . $instance['shortName'] . "editremove"._("edit").""._("remove")."
remove"._("remove")."subject in use"._("subject in use")."
- + @@ -63,12 +63,12 @@ foreach($detailedSubjectArray as $instance) { echo ""; echo ""; - echo ""; + echo ""; $detailedSubject = new DetailedSubject(); if ($detailedSubject->inUse($instance[lcfirst("DetailedSubject") . 'ID'], -1) == 0) { - echo ""; + echo ""; } else { - echo ""; + echo ""; } echo ""; } @@ -78,10 +78,10 @@ "; + echo _("(none found)")."
"; } - echo "add new " . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst("DetailedSubject"))) . ""; + echo ""._("add new ") . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst("DetailedSubject"))) . ""; ?> @@ -89,14 +89,14 @@ Subject Relationships"; + echo "
"._("Subject Relationships")."
"; if (count($generalSubjectArray) > 0){ ?>
Value    
" . $instance['shortName'] . "edit"._("edit")."remove"._("remove")."subject in use"._("subject in use")."
- - + + @@ -112,7 +112,7 @@ echo $detailedSubjects->shortName . "
"; } echo ""; - echo ""; + echo ""; echo ""; } @@ -121,7 +121,7 @@ "; + echo _("(none found)")."
"; } ?> diff --git a/ajax_htmldata/getAdminUserDisplay.php b/ajax_htmldata/getAdminUserDisplay.php index 4d870a0..73abdce 100644 --- a/ajax_htmldata/getAdminUserDisplay.php +++ b/ajax_htmldata/getAdminUserDisplay.php @@ -16,15 +16,15 @@ if (count($instanceArray) > 0){ ?> -
Users
+
General SubjectDetailed Subject    
edit"._("edit")."
- @@ -44,18 +44,18 @@ echo ""; echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } ?>
Login ID - First Name - Last Name - Privilege - View Accounts - Email Address + + + + + +    
" . $instance['priv'] . "" . $accountTab . "" . $instance['emailAddress'] . "editremove"._("edit").""._("remove")."
- add new user + add new user"; + echo _("(none found)")."
"._("add new user").""; } ?> diff --git a/ajax_htmldata/getAdminWorkflowDisplay.php b/ajax_htmldata/getAdminWorkflowDisplay.php index cd28c44..a8a197e 100644 --- a/ajax_htmldata/getAdminWorkflowDisplay.php +++ b/ajax_htmldata/getAdminWorkflowDisplay.php @@ -7,15 +7,15 @@ $userGroupArray = $userGroup->allAsArray(); - echo "
Workflow Setup
"; + echo "
"._("Workflow Setup")."
"; if (count($workflowArray) > 0){ ?> - - - + + + @@ -36,8 +36,8 @@ echo ""; echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } @@ -46,14 +46,14 @@ "; + echo _("(none found)")."
"; } //user groups are required to set workflows up so display this message if there arent any if (count($userGroupArray) >0){ - echo "add workflow"; + echo ""._("add workflow").""; }else{ - echo "You must set up at least one user group before you can add workflows"; + echo ""._("You must set up at least one user group before you can add workflows").""; } ?> @@ -63,15 +63,15 @@ User Group Setup"; + echo "
"._("User Group Setup")."
"; if (count($userGroupArray) > 0){ ?>
Acquisition TypeResource FormatResource Type    
" . $acquisitionType->shortName . "" . $resourceFormat->shortName . "" . $rtName . "editremove"._("edit").""._("remove")."
- - - + + + @@ -87,8 +87,8 @@ echo $groupUser->getDisplayName . "
"; } echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } @@ -97,11 +97,11 @@ "; + echo _("(none found)")."
"; } - echo "add user group"; + echo ""._("add user group").""; ?> diff --git a/ajax_htmldata/getAttachmentDetails.php b/ajax_htmldata/getAttachmentDetails.php index 1328c07..1109d81 100644 --- a/ajax_htmldata/getAttachmentDetails.php +++ b/ajax_htmldata/getAttachmentDetails.php @@ -27,12 +27,12 @@ - + - + No attachments available

"; + echo ""._("No attachments available")."

"; } if ($user->canEdit()){ ?> - add new attachment

+

diff --git a/ajax_htmldata/getContactDetails.php b/ajax_htmldata/getContactDetails.php index 6c8ba7b..59dda44 100644 --- a/ajax_htmldata/getContactDetails.php +++ b/ajax_htmldata/getContactDetails.php @@ -20,7 +20,7 @@ //if we want archives to be displayed if ($showArchivesInd == "1"){ if (count($resource->getArchivedContacts()) > 0){ - echo "The following are archived contacts:"; + echo ""._("The following are archived contacts:").""; } $contactArray = $resource->getArchivedContacts(); } @@ -32,20 +32,20 @@ if (count($contactArray) > 0){ foreach ($contactArray as $contact){ if (($resContactFlag == 0) && (!isset($contact['organizationName']))){ - echo "
Resource Specific:
"; + echo "
"._("Resource Specific:")."
"; $resContactFlag = 1; }else if (($orgContactFlag == 0) && (isset($contact['organizationName']))){ if ($resContactFlag == 0){ - echo "No Resource Specific Contacts

"; + echo ""._("No Resource Specific Contacts")."

"; } if ($user->canEdit() && ($archiveInd != 1) && ($showArchivesInd != 1)){ ?> - add contact +


Inherited:"; + echo "
"._("Inherited:")."
"; $orgContactFlag = 1; }else{ echo "
"; @@ -65,8 +65,8 @@ canEdit()) && (!isset($contact['organizationName']))){ - echo "edit"; - echo "  remove note"; + echo ""._("edit").""; + echo "  "._("remove note").""; }else{ echo " "; } @@ -80,8 +80,8 @@ if (isset($contact['organizationName'])){ ?> - - + + - + - + - + - + - + - + - + - + - + - + canEdit() && ($orgContactFlag == 0) && ($showArchivesInd != 1)){ ?> - add contact +


No contacts available

"; + echo ""._("No contacts available")."

"; if (($user->canEdit())){ ?> - add contact +


getArchivedContacts()) > 0)){ - echo "" . count($resource->getArchivedContacts()) . " archived contact(s) available. show archived contacts
"; + echo "" . count($resource->getArchivedContacts()) . _(" archived contact(s) available.")." "._("show archived contacts")."
"; } if (($showArchivesInd == "1") && ($archiveInd == "1") && (count($resource->getArchivedContacts()) > 0)){ - echo "hide archived contacts
"; + echo ""._("hide archived contacts")."
"; } echo "

"; diff --git a/ajax_htmldata/getDowntimeList.php b/ajax_htmldata/getDowntimeList.php new file mode 100644 index 0000000..e58aeb9 --- /dev/null +++ b/ajax_htmldata/getDowntimeList.php @@ -0,0 +1,88 @@ + $resourceID))); +$util = new Utility(); + + +//shared html template for organization and resource downtimes +function generateDowntimeHTML($downtime,$associatedEntities=null) { + + $html = " +
"; + + $html .= " +
+
Type:
+
{$downtime->shortName}
+ +
Downtime Start:
+
{$downtime->startDate}
+ +
Downtime Resolved:
+
{$downtime->endDate}
"; + + if($downtime->subjectText) { + $html .= " +
Linked issue:
+
{$downtime->subjectText}
"; + } + + if ($downtime->note) { + $html .= " +
Note:
+
{$downtime->note}
"; + } + + $html .= " +
+
"; + + return $html; +} + +//display any organization level downtimes for the resource +$organizationArray = $resource->getOrganizationArray(); + +if (count($organizationArray) > 0) { + echo '

Organizational

'; + + $downtimedOrgs = array(); + foreach ($organizationArray as $orgData) { + if (!in_array($orgData['organizationID'],$downtimedOrgs)) { + $organization = new Organization(new NamedArguments(array('primaryKey' => $orgData['organizationID']))); + + $orgDowntimes = $organization->getDowntime($archivedFlag); + + if(count($orgDowntimes) > 0) { + foreach ($orgDowntimes as $downtime) { + echo generateDowntimeHTML($downtime,array(array("name"=>$orgData['organization'],"id"=>$organization->organizationID,"entityType"=>1))); + } + } else { + echo "

There are no organization level downtimes.


"; + } + + $orgDowntimes = null; + $downtimedOrgs[] = $orgData['organizationID']; + } + } +} + +//display any resource level downtimes for the resource (shows any other resources associated with the downtime, too) +$resourceDowntimes = $resource->getDowntime($archivedFlag); +echo '

Resources

'; +if(count($resourceDowntimes) > 0) { + foreach ($resourceDowntimes as $downtime) { + $associatedEntities = array(); + if ($associatedResources = $downtime->getAssociatedResources()) { + foreach ($associatedResources as $resource) { + $associatedEntities[] = array("name"=>$resource->titleText,"id"=>$resource->resourceID,"entityType"=>2); + } + } + echo generateDowntimeHTML($downtime,$associatedEntities); + } +} else { + echo "

There are no resource level downtimes.


"; +} +?> \ No newline at end of file diff --git a/ajax_htmldata/getGeneralSubjectDisplay.php b/ajax_htmldata/getGeneralSubjectDisplay.php index 2a71a9f..58e41f5 100644 --- a/ajax_htmldata/getGeneralSubjectDisplay.php +++ b/ajax_htmldata/getGeneralSubjectDisplay.php @@ -13,7 +13,7 @@ ?>
Group NameEmail AddressUsers    
editremove"._("edit").""._("remove")."
   - ' style='font-weight:normal;' target='_blank'>view attachment + ' style='font-weight:normal;' target='_blank'><?php echo _("view attachment");?> canEdit()){ ?> - &modal=true' class='thickbox'>edit '>remove this attachment + &modal=true' class='thickbox'><?php echo _("edit");?> '><?php echo _("remove this attachment");?>
Type:
Details:
Organization:getCORALURL() . "organizations/orgDetail.php?showTab=contacts&organizationID=" . $contact['organizationID'] . "' target='_blank'>Visit Contact in Organizations Module"; ?>getCORALURL() . "organizations/orgDetail.php?showTab=contacts&organizationID=" . $contact['organizationID'] . "' target='_blank'>"._("Visit Contact in Organizations Module").""; ?>
No longer valid:
Title:
Address:
Location:
Phone:
Alt Phone:
Fax:
Email: '>
Notes:
Last Updated:
- + @@ -22,8 +22,8 @@ foreach($instanceArray as $instance) { echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } @@ -32,10 +32,10 @@ "; + echo _("(none found)")."
"; } - echo "add new " . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst($className))) . ""; + echo ""._("add new ") . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst($className))) . ""; ?> diff --git a/ajax_htmldata/getIssues.php b/ajax_htmldata/getIssues.php new file mode 100644 index 0000000..e9a9fc7 --- /dev/null +++ b/ajax_htmldata/getIssues.php @@ -0,0 +1,60 @@ + $resourceID))); + + $util = new Utility(); + $getIssuesFormData = "action=getIssuesList&resourceID=".$resourceID; + $getDowntimeFormData = "action=getDowntimeList&resourceID=".$resourceID; + $exportIssuesUrl = "export_issues.php?resourceID={$resourceID}"; + $exportDowntimesUrl = "export_downtimes.php?resourceID={$resourceID}"; + + +?> + +
Value    
" . $instance['shortName'] . "editremove"._("edit").""._("remove")."
+ + + + + + + + + + + + +
Issues/Problems
report new issue
+ view open issues + + +
+ " class="issuesBtn" id="archivedIssuesBtn">view archived issues + +
+
+ + + + + + + + + + + + + + +
Downtime
report new Downtime
+ view current/upcoming downtime + + +
+ " class="downtimeBtn" id="archiveddowntimeBtn">view archived downtime + +
+
+ diff --git a/ajax_htmldata/getIssuesList.php b/ajax_htmldata/getIssuesList.php new file mode 100644 index 0000000..4e566e8 --- /dev/null +++ b/ajax_htmldata/getIssuesList.php @@ -0,0 +1,111 @@ + $resourceID))); +$util = new Utility(); + + +//shared html template for organization and resource issues +function generateIssueHTML($issue,$associatedEntities=null) { + $html = " +
"; + if (!$issue->dateClosed) { + $html .= " + issueID}&height=120&width=345&modal=true\">close"; + if ($associatedEntities && $associatedEntities[0]['entityType']==1) { + $html .= "issueID}&height=200&width=390&modal=true\">downtime"; + } else { + $html .= "issueID}&height=200&width=390&modal=true\">downtime"; + } + } + $html .= " +
+
Date reported:
+
{$issue->dateCreated}
"; + if ($issue->dateClosed) { + + $html .= "
Date closed:
+
{$issue->dateClosed}
+
Resolution
+
{$issue->resolutionText}
"; + } + + $html .= "
Contact(s):
+
"; + $contacts = $issue->getContacts(); + if ($contacts) { + $html .= ""; + } + + + $html .= "
+
Applies to:
+
"; + if ($associatedEntities) { + $temp =''; + foreach ($associatedEntities as $entity) { + $temp .= " {$entity['name']},"; + } + $html .= rtrim($temp,','); + } + + $html .= "
+
Subject:
+
{$issue->subjectText}
+ +
Body:
+
{$issue->bodyText}
+
+
"; + return $html; +} + +//display any organization level issues for the resource +$organizationArray = $resource->getOrganizationArray(); + +if (count($organizationArray) > 0) { + echo '

Organizational

'; + + $issuedOrgs = array(); + foreach ($organizationArray as $orgData) { + if (!in_array($orgData['organizationID'],$issuedOrgs)) { + $organization = new Organization(new NamedArguments(array('primaryKey' => $orgData['organizationID']))); + + $orgIssues = $organization->getIssues($archivedFlag); + + if(count($orgIssues) > 0) { + foreach ($orgIssues as $issue) { + echo generateIssueHTML($issue,array(array("name"=>$orgData['organization'],"id"=>$organization->organizationID,"entityType"=>1))); + } + } else { + echo "

There are no organization level issues.


"; + } + + $orgIssues = null; + $issuedOrgs[] = $orgData['organizationID']; + } + } +} + +//display any resource level issues for the resource (shows any other resources associated with the issue, too) +$resourceIssues = $resource->getIssues($archivedFlag); +echo '

Resources

'; +if(count($resourceIssues) > 0) { + foreach ($resourceIssues as $issue) { + $associatedEntities = array(); + if ($associatedResources = $issue->getAssociatedResources()) { + foreach ($associatedResources as $resource) { + $associatedEntities[] = array("name"=>$resource->titleText,"id"=>$resource->resourceID,"entityType"=>2); + } + } + echo generateIssueHTML($issue,$associatedEntities); + } +} else { + echo "

There are no resource level issues.


"; +} +?> \ No newline at end of file diff --git a/ajax_htmldata/getOutstandingQueue.php b/ajax_htmldata/getOutstandingQueue.php index a80035b..9fc197b 100644 --- a/ajax_htmldata/getOutstandingQueue.php +++ b/ajax_htmldata/getOutstandingQueue.php @@ -4,23 +4,23 @@ $resourceArray = array(); $resourceArray = $user->getOutstandingTasks(); - echo "
Outstanding Tasks
"; + echo "
"._("Outstanding Tasks")."
"; if (count($resourceArray) == "0"){ - echo "No outstanding requests"; + echo ""._("No outstanding requests").""; }else{ ?> - +
- - - - - + + + + + $resource['statusID']))); ?> - ' style='padding:0x;margin:0px;height:100%;'> + ' style='padding:0px;margin:0px;height:100%;'> diff --git a/ajax_htmldata/getProductDetails.php b/ajax_htmldata/getProductDetails.php index b746da9..8dd3b1d 100644 --- a/ajax_htmldata/getProductDetails.php +++ b/ajax_htmldata/getProductDetails.php @@ -66,18 +66,18 @@ - + - + @@ -87,7 +87,7 @@ - - + - + - + - - + + resourceAltURL) { ?> - - + + descriptionText){ ?> - + @@ -270,7 +270,7 @@
IDNameAcquisition TypeRouting StepStart Date
>'> >'> >shortName; ?> titleText; ?>shortName . " " . $resourceFormat->shortName . " " . $resourceType->shortName; ?> - canEdit()){ ?>edit isAdmin){ ?>remove resource remove resource and its children + canEdit()){ ?><?php echo _("edit");?> isAdmin){ ?><?php echo _("remove resource");?> <?php echo _("remove resource and its children");?>
Record ID: resourceID; ?>
Status: shortName; ?>
- Archived: + @@ -96,9 +96,9 @@ echo format_date($resource->archiveDate); if ($archiveUser->getDisplayName){ - echo " by " . $archiveUser->getDisplayName; + echo _(" by ") . $archiveUser->getDisplayName; }else if ($resource->archiveLoginID){ - echo " by " . $resource->archiveLoginID; + echo _(" by ") . $resource->archiveLoginID; } ?> @@ -112,7 +112,7 @@
- Created: + @@ -121,9 +121,9 @@ echo format_date($resource->createDate); if ($createUser->getDisplayName){ - echo " by " . $createUser->getDisplayName; + echo _(" by ") . $createUser->getDisplayName; }else if ($resource->createLoginID){ - echo " by " . $resource->createLoginID; + echo _(" by ") . $resource->createLoginID; } ?> @@ -137,7 +137,7 @@
- Last Update: + @@ -145,9 +145,9 @@ echo format_date($resource->updateDate); if ($updateUser->getDisplayName){ - echo " by " . $updateUser->getDisplayName; + echo _(" by ") . $updateUser->getDisplayName; }else if ($resource->updateLoginID){ - echo " by " . $resource->updateLoginID; + echo _(" by ") . $resource->updateLoginID; } ?> @@ -162,7 +162,7 @@ if ((count($parentResourceArray) > 0) || (count($childResourceArray) > 0)){ ?>
Related Products: + 0) { foreach ($parentResourceArray as $parentResource){ $parentResourceObj = new Resource(new NamedArguments(array('primaryKey' => $parentResource['relatedResourceID']))); - echo $parentResourceObj->titleText . "  (Parent)  view resource
"; + echo $parentResourceObj->titleText . "  (Parent)  "._("view resource")."
"; } } @@ -178,7 +178,7 @@ $childResource['resourceID']))); - echo $childResourceObj->titleText . "view resource
"; + echo $childResourceObj->titleText . ""._("view resource")."
"; } @@ -194,7 +194,7 @@ if ($isbnOrIssns = $resource->getIsbnOrIssn()) { ?>
ISSN / ISBN: 0){ ?>
Aliases:
Organizations: settings->organizationsModule == 'Y'){ - echo "" . $organization['organizationRole'] . ":" . $organization['organization'] . "  View " . $organization[
"; + echo "" . $organization['organizationRole'] . ":" . $organization['organization'] . "  "._("View ") . $organization[
"; }else{ echo "" . $organization['organizationRole'] . ":" . $organization['organization'] . "
"; } @@ -246,23 +246,23 @@ if ($resource->resourceURL) { ?>
Resource URL:resourceURL; ?>  Visit Resource URLresourceURL; ?>  <?php echo _(" title="" style='vertical-align:top;'>
Alt URL:resourceAltURL; ?>  Visit Secondary Resource URLresourceAltURL; ?>  <?php echo _(" title="" style='vertical-align:top;'>
Description: descriptionText); ?>
canEdit()){ ?> - edit product details
+

@@ -298,7 +298,7 @@ ?> - +
Subjects @@ -337,7 +337,7 @@ canEdit() && $canDelete){ ?> - remove subject + <?php echo _("remove subject");?> @@ -358,7 +358,7 @@ if ($user->canEdit()){ ?> - add new subject + - + @@ -416,10 +416,10 @@ - +
Additional Notes canEdit()){ ?> - add new note +

canEdit()){ ?> - &modal=true' class='thickbox'>edit ' tab='Product'>remove note + &modal=true' class='thickbox'><?php echo _("edit");?> ' tab='Product'><?php echo _("remove note");?>


@@ -427,7 +427,7 @@ }else{ if ($user->canEdit()){ ?> - add new note + getLicenseArray(); echo "
"; - echo ""; + echo ""; if (($resource->systemNumber) && ($config->settings->catalogURL != '')) { - echo ""; + echo ""; } echo "
"; @@ -47,7 +47,7 @@
0)){ - echo "
Parent Record(s)
"; + echo "
"._("Parent Record(s)")."
"; foreach ($parentResourceArray as $parentResource){ $parentResourceObj = new Resource(new NamedArguments(array('primaryKey' => $parentResource['relatedResourceID']))); echo ""; @@ -55,7 +55,7 @@ } if ((count($childResourceArray) > 0)){ - echo "
Child Record(s)
"; + echo "
"._("Child Record(s)")."
"; foreach ($childResourceArray as $childResource){ $childResourceObj = new Resource(new NamedArguments(array('primaryKey' => $childResource['resourceID']))); @@ -74,7 +74,7 @@ ?>
-
Organizations Module
+
-
Licensing Module
+
includeStats == 1) && ($config->settings->usageModule == 'Y')){ ?>
-
Usage Statistics Module
+
"; echo ""; echo ""; - echo ""; + echo ""; echo ""; ?> diff --git a/ajax_htmldata/getRoutingDetails.php b/ajax_htmldata/getRoutingDetails.php index dc8b12f..867a1c9 100644 --- a/ajax_htmldata/getRoutingDetails.php +++ b/ajax_htmldata/getRoutingDetails.php @@ -10,18 +10,20 @@ if (count($resourceSteps) == "0"){ if (($resource->statusID != $completeStatusID) && ($resource->statusID != $archiveStatusID)){ - echo "No workflow steps have been set up for this resource's combination of Acquisition Type and Resource Format.
If you think this is in error, please contact your workflow administrator.
"; + echo ""._("No workflow steps have been set up for this resource's combination of Acquisition Type and Resource Format.")."
"._("If you think this is in error, please contact your workflow administrator.")."
"; }else{ - echo "Not entered into workflow."; + echo ""._("Not entered into workflow.").""; } }else{ ?> - - - - + + + + + + - - - - + + + + + 0) && ($resource->statusID == $completeStatusID)){ if ($rUser->firstName){ - echo "Workflow completed on " . format_date($resource->workflowRestartDate) . " by " . $rUser->firstName . " " . $rUser->lastName . "
"; + echo ""._("Workflow completed on ") . format_date($resource->workflowRestartDate) . _(" by ") . $rUser->firstName . " " . $rUser->lastName . "
"; }else{ - echo "Workflow completed on " . format_date($resource->workflowRestartDate) . " by " . $resource->workflowRestartLoginID . "
"; + echo ""._("Workflow completed on ") . format_date($resource->workflowRestartDate) . _(" by ") . $resource->workflowRestartLoginID . "
"; } }else{ if ($rUser->firstName){ - echo "Workflow restarted on " . format_date($resource->workflowRestartDate) . " by " . $rUser->firstName . " " . $rUser->lastName . "
"; + echo ""._("Workflow restarted on ") . format_date($resource->workflowRestartDate) . " by " . $rUser->firstName . " " . $rUser->lastName . "
"; }else{ - echo "Workflow restarted on " . format_date($resource->workflowRestartDate) . " by " . $resource->workflowRestartLoginID . "
"; + echo ""._("Workflow restarted on ") . format_date($resource->workflowRestartDate) . (" by ") . $resource->workflowRestartLoginID . "
"; } } } @@ -92,8 +103,8 @@ if ($user->canEdit()){ if (($resource->statusID != $completeStatusID) && ($resource->statusID != $archiveStatusID)){ - echo "  restart workflow
"; - echo "  mark entire workflow complete
"; + echo "  "._("restart workflow")."
"; + echo "  "._("mark entire workflow complete")."
"; } } diff --git a/ajax_htmldata/getSavedQueue.php b/ajax_htmldata/getSavedQueue.php index 81f4b3b..955ebb9 100644 --- a/ajax_htmldata/getSavedQueue.php +++ b/ajax_htmldata/getSavedQueue.php @@ -3,22 +3,22 @@ $resourceArray = array(); $resourceArray = $user->getResourcesInQueue('saved'); - echo "
Saved Requests
"; + echo "
"._("Saved Requests")."
"; if (count($resourceArray) == "0"){ - echo "No saved requests"; + echo ""._("No saved requests").""; }else{ ?>
StepGroupStart DateComplete 
>stepName; ?>>groupName; ?>>stepStartDate) { echo format_date($resourceStep->stepStartDate); } ?>> + >stepName; ?> >stepEndDate)){ + echo 'edit'; + } ?> >groupName; ?> >stepStartDate) { echo format_date($resourceStep->stepStartDate); } ?> > stepEndDate) { if (($eUser->firstName) || ($eUser->lastName)){ - echo format_date($resourceStep->stepEndDate) . " by " . $eUser->firstName . " " . $eUser->lastName; + echo format_date($resourceStep->stepEndDate) . _(" by ") . $eUser->firstName . " " . $eUser->lastName; }else{ - echo format_date($resourceStep->stepEndDate) . " by " . $resourceStep->endLoginID; + echo format_date($resourceStep->stepEndDate) . _(" by ") . $resourceStep->endLoginID; } }else{ //add if user is in group or an admin and resource is not completed or archived if ((($user->isAdmin) || ($user->isInGroup($resourceStep->userGroupID))) && ($resourceStep->stepStartDate) && ($resource->statusID != $archiveStatusID) && ($resource->statusID != $completeStatusID)){ - echo "mark complete"; + echo ""._("mark complete").""; } //track how many open steps there are $openStep++; }?> stepEndDate){ + echo 'delete'; + } ?> +
- - - - - + + + + + @@ -46,8 +46,8 @@ diff --git a/ajax_htmldata/getSearchResources.php b/ajax_htmldata/getSearchResources.php index b6ddd78..8c20e44 100644 --- a/ajax_htmldata/getSearchResources.php +++ b/ajax_htmldata/getSearchResources.php @@ -35,7 +35,7 @@ $resourceArray = $resourceObj->search($whereAdd, $orderBy, $limit); if (count($resourceArray) == 0){ - echo "

Sorry, no requests fit your query"; + echo "

"._("Sorry, no requests fit your query").""; $i=0; }else{ //maximum number of pages to display on screen at one time @@ -49,7 +49,7 @@ } //div for displaying record count - echo "Displaying " . $displayStartingRecNumber . " to " . $displayEndingRecNumber . " of " . $totalRecords . " Resource Records"; + echo ""._("Displaying ") . $displayStartingRecNumber . _(" to ") . $displayEndingRecNumber . _(" of ") . $totalRecords . _(" Resource Records").""; //print out page selectors as long as there are more records than the number that should be displayed @@ -61,7 +61,7 @@ echo "<< "; }else{ $prevPage = $page - 1; - echo "<< "; + echo "<< "; } @@ -95,7 +95,7 @@ if ($nextPage >= $maxPages){ echo ">> "; }else{ - echo ">> "; + echo ">> "; } echo ""; @@ -109,12 +109,12 @@ ?>
IDNameDate CreatedAcquisition TypeStatus  
>shortName; ?> >shortName; ?> style='text-align:right; width:40px;'> - &modal=true' class='thickbox'>edit  - '>remove request + &modal=true' class='thickbox'><?php echo _("edit");?>  + '><?php echo _("remove request");?>
- - - - - - + + + + + + << "; }else{ $prevPage = $page - 1; - echo "<< "; + echo "<< "; } @@ -192,7 +192,7 @@ if ($nextPage >= $maxPages){ echo ">> "; }else{ - echo ">> "; + echo ">> "; } } ?> @@ -209,7 +209,7 @@ } ?> - records per page +
ID
Name
Creator
Date Created
Acquisition Type
Status
diff --git a/ajax_htmldata/getSubmittedQueue.php b/ajax_htmldata/getSubmittedQueue.php index 6320475..1aa1d6c 100644 --- a/ajax_htmldata/getSubmittedQueue.php +++ b/ajax_htmldata/getSubmittedQueue.php @@ -2,20 +2,20 @@ $resourceArray = array(); $resourceArray = $user->getResourcesInQueue('progress'); - echo "
Submitted Requests
"; + echo "
"._("Submitted Requests")."
"; if (count($resourceArray) == "0"){ - echo "No submitted requests"; + echo ""._("No submitted requests").""; }else{ ?> - - - - - + + + + + diff --git a/ajax_processing/deleteDetailedSubject.php b/ajax_processing/deleteDetailedSubject.php index bec6ce0..7c27070 100644 --- a/ajax_processing/deleteDetailedSubject.php +++ b/ajax_processing/deleteDetailedSubject.php @@ -9,7 +9,7 @@ $instance->delete(); } catch (Exception $e) { //print out a friendly message... - echo "Unable to delete. Please make sure no resources are set up with this information."; + echo _("Unable to delete. Please make sure no resources are set up with this information."); } ?> diff --git a/ajax_processing/deleteGeneralSubject.php b/ajax_processing/deleteGeneralSubject.php index 8870edd..8270781 100644 --- a/ajax_processing/deleteGeneralSubject.php +++ b/ajax_processing/deleteGeneralSubject.php @@ -9,7 +9,7 @@ $instance->deleteGeneralSubject(); } catch (Exception $e) { //print out a friendly message... - echo "Unable to delete. Please make sure no resources are set up with this information."; + echo _("Unable to delete. Please make sure no resources are set up with this information."); } ?> diff --git a/ajax_processing/deleteInstance.php b/ajax_processing/deleteInstance.php index 78c589c..b238157 100644 --- a/ajax_processing/deleteInstance.php +++ b/ajax_processing/deleteInstance.php @@ -9,13 +9,13 @@ if ($numberOfChildren > 0){ //print out a friendly message... - echo "Unable to delete - this " . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst($className))) . " is in use. Please make sure no resources are set up with this information."; + echo _("Unable to delete - this " ). strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst($className))) . _(" is in use. Please make sure no resources are set up with this information."); }else{ try { $instance->delete(); } catch (Exception $e) { //print out a friendly message... - echo "Unable to delete. Please make sure no resources are set up with this information."; + echo _("Unable to delete. Please make sure no resources are set up with this information."); } } ?> diff --git a/ajax_processing/deleteResource.php b/ajax_processing/deleteResource.php index 9aa0ff0..54b6c34 100644 --- a/ajax_processing/deleteResource.php +++ b/ajax_processing/deleteResource.php @@ -4,7 +4,7 @@ try { $resource->removeResource(); - echo "Resource successfully deleted."; + echo _("Resource successfully deleted."); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/ajax_processing/deleteResourceAndChildren.php b/ajax_processing/deleteResourceAndChildren.php index 9946ac9..f11a776 100644 --- a/ajax_processing/deleteResourceAndChildren.php +++ b/ajax_processing/deleteResourceAndChildren.php @@ -5,7 +5,7 @@ try { $resource->removeResourceAndChildren(); - echo "Resource successfully deleted."; + echo _("Resource successfully deleted."); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/ajax_processing/deleteResourceNote.php b/ajax_processing/deleteResourceNote.php index 409e16a..96fa4ef 100644 --- a/ajax_processing/deleteResourceNote.php +++ b/ajax_processing/deleteResourceNote.php @@ -4,7 +4,7 @@ try { $resourceNote->delete(); - echo "Note successfully deleted."; + echo _("Note successfully deleted."); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/ajax_processing/deleteResourceStep.php b/ajax_processing/deleteResourceStep.php new file mode 100644 index 0000000..18a8e59 --- /dev/null +++ b/ajax_processing/deleteResourceStep.php @@ -0,0 +1,14 @@ + $resourceStepID))); + +try { + $resourceStep->delete(); + $resourceStep->startNextStepsOrComplete(); + + //TODO fix the display order sequence if there are later steps + + +} catch (Exception $e) { + echo $e->getMessage(); +} diff --git a/ajax_processing/insertDowntime.php b/ajax_processing/insertDowntime.php new file mode 100644 index 0000000..7b1299c --- /dev/null +++ b/ajax_processing/insertDowntime.php @@ -0,0 +1,24 @@ +entityID = $_POST['sourceOrganizationID']; + $newDowntime->entityTypeID = 1; +} else { + $newDowntime->entityID = $_POST['sourceResourceID']; + $newDowntime->entityTypeID = 2; +} + +$newDowntime->creatorID = $user->loginID; +$newDowntime->downtimeTypeID = $_POST['downtimeType']; +$newDowntime->issueID = $_POST['issueID']; +$newDowntime->startDate = date('Y-m-d H:i:s', strtotime($_POST['startDate'])); +$newDowntime->endDate = date('Y-m-d H:i:s', strtotime($_POST['endDate'])); + +$newDowntime->dateCreated = date( 'Y-m-d H:i:s'); +$newDowntime->note = ($_POST['note']) ? $_POST['note']:null; + +$newDowntime->save(); + +?> \ No newline at end of file diff --git a/ajax_processing/insertIssue.php b/ajax_processing/insertIssue.php new file mode 100644 index 0000000..d177914 --- /dev/null +++ b/ajax_processing/insertIssue.php @@ -0,0 +1,102 @@ + $sourceResourceID))); + + +$issueEmails = array(); + +if (!empty($_POST["ccEmails"])) { + $issueEmails = explode(',',$_POST["ccEmails"]); +} + +$newIssue = new Issue(); + +$newIssue->creatorID = $user->loginID; +$newIssue->dateCreated = date( 'Y-m-d H:i:s'); + +if($_POST["ccCreator"]) { + $issueEmails[] = $user->emailAddress; +} + +if(!is_numeric($formDataArray["reminderInterval"])) { + $formDataArray["reminderInterval"] = 0; +} + +foreach($formDataArray as $key => $value) { + $newIssue->$key = $value; +} + +$newIssue->save(); + +//start building the email body +$emailMessage = "{$newIssue->bodyText}\r\n\r\n"; + +if ($organizationID) { + $newIssueRelationship = new IssueRelationship(); + $newIssueRelationship->issueID = $newIssue->primaryKey; + $newIssueRelationship->entityID = $organizationID; + $newIssueRelationship->entityTypeID = 1; + $newIssueRelationship->save(); + + $organizationArray = $sourceResource->getOrganizationArray(); + + $issuedOrgs = array(); + foreach ($organizationArray as $orgData) { + if (!in_array($orgData['organizationID'],$issuedOrgs)) { + $issuedOrgs[] = $orgData['organizationID']; + } + } +} else { + foreach($resourceIDArray as $resourceID) { + $newIssueRelationship = new IssueRelationship(); + $newIssueRelationship->issueID = $newIssue->primaryKey; + $newIssueRelationship->entityID = $resourceID; + $newIssueRelationship->entityTypeID = 2; + $newIssueRelationship->save(); + unset($newIssueRelationship); + } +} + +if (count($issueEmails) > 0) { + foreach ($issueEmails as $email) { + $newIssueEmail = new IssueEmail(); + $newIssueEmail->issueID = $newIssue->primaryKey; + $newIssueEmail->email = $email; + $newIssueEmail->save(); + unset($newIssueEmail); + } +} + +if (count($contactIDs)) { + foreach ($contactIDs as $contactID) { + $newIssueContact = new IssueContact(); + $newIssueContact->issueID = $newIssue->primaryKey; + $newIssueContact->contactID = $contactID; + $newIssueContact->save(); + unset($newIssueContact); + } + + $organizationContactsArray = $sourceResource->organizationContactsArray($sourceOrganizationID); + + //send emails to contacts + foreach ($organizationContactsArray as $contactData) { + if (in_array($contactData['contactID'],$contactIDs)) { + mail($email, "{$newIssue->subjectText}",$emailMessage,"From: {$user->emailAddress}\r\nReply-To: {$user->emailAddress}"); + } + } +} + +if (count($issueEmails) > 0) { + //send emails to CCs + foreach ($issueEmails as $email) { + mail($email, "{$newIssue->subjectText}",$emailMessage,"From: {$user->emailAddress}\r\nReply-To: {$user->emailAddress}"); + } +} +?> \ No newline at end of file diff --git a/ajax_processing/removeResourceSubjectRelationship.php b/ajax_processing/removeResourceSubjectRelationship.php index 7c08296..2f44646 100644 --- a/ajax_processing/removeResourceSubjectRelationship.php +++ b/ajax_processing/removeResourceSubjectRelationship.php @@ -7,7 +7,7 @@ try { $resourceSubject->removeResourceSubject($resourceID, $generalDetailSubjectID); - echo "Subject successfully removed."; + echo _("Subject successfully removed."); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/ajax_processing/submitCloseIssue.php b/ajax_processing/submitCloseIssue.php new file mode 100644 index 0000000..01ceed8 --- /dev/null +++ b/ajax_processing/submitCloseIssue.php @@ -0,0 +1,12 @@ + $issueID))); + $issue->resolutionText = $_POST['resolutionText']; + $issue->dateClosed = date("Y-m-d H:i:s"); + try { + $issue->save(); + } catch (Exception $e) { + echo $e->getMessage(); + } +} \ No newline at end of file diff --git a/ajax_processing/updateDetailedSubject.php b/ajax_processing/updateDetailedSubject.php index 8660e97..8329285 100644 --- a/ajax_processing/updateDetailedSubject.php +++ b/ajax_processing/updateDetailedSubject.php @@ -19,7 +19,7 @@ echo $e->getMessage(); } } else { - echo "A duplicate " . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst($className))) . " exists."; + echo _("A duplicate ") . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst($className))) . _(" exists."); } ?> diff --git a/ajax_processing/updateGeneralSubject.php b/ajax_processing/updateGeneralSubject.php index 41a3819..30cb250 100644 --- a/ajax_processing/updateGeneralSubject.php +++ b/ajax_processing/updateGeneralSubject.php @@ -18,7 +18,7 @@ echo $e->getMessage(); } } else { - echo "A duplicate " . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst($className))) . " exists."; + echo _("A duplicate ") . strtolower(preg_replace("/[A-Z]/", " \\0" , lcfirst($className))) . _(" exists."); } ?> diff --git a/ajax_processing/updateResourceStep.php b/ajax_processing/updateResourceStep.php new file mode 100644 index 0000000..f2a201a --- /dev/null +++ b/ajax_processing/updateResourceStep.php @@ -0,0 +1,34 @@ + $resourceStepID))); + + //business logic + $step->userGroupID = $userGroupID; + + //if apply to all selected, we need to cycle through later steps. + + try { + $step->restartReassignedStep(); + + if ($applyToAll){ + //get later open steps and restart those. + $laterSteps = $step->getLaterOpenSteps(); + if (count($laterSteps) > 0){ + foreach($laterSteps as $laterStep){ + $laterStep->userGroupID = $userGroupID; + $laterStep->restartReassignedStep(); + } + } + } + } catch (Exception $e) { + echo $e->getMessage(); + } +}else{ + //do something for empty result + echo "There was an error. Invalid or missing step."; +} diff --git a/ajax_processing/updateUserData.php b/ajax_processing/updateUserData.php index 27bebfe..055b678 100644 --- a/ajax_processing/updateUserData.php +++ b/ajax_processing/updateUserData.php @@ -23,7 +23,7 @@ try { $user->save(); - echo "User successfully saved."; + echo _("User successfully saved."); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/ajax_processing/uploadAttachment.php b/ajax_processing/uploadAttachment.php index 96785d2..7915ae8 100644 --- a/ajax_processing/uploadAttachment.php +++ b/ajax_processing/uploadAttachment.php @@ -26,7 +26,7 @@ echo "success uploading!"; } else { header('HTTP/1.1 500 Internal Server Error'); - echo "
There was a problem saving your file to $target_path. Please ensure your attachments directory is writable.
"; + echo "
"._("There was a problem saving your file to ").$target_path._(". Please ensure your attachments directory is writable.")."
"; } } diff --git a/css/style.css b/css/style.css index 1b64713..f21aa98 100644 --- a/css/style.css +++ b/css/style.css @@ -10,7 +10,6 @@ body { 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; @@ -98,14 +97,14 @@ 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;} @@ -118,10 +117,10 @@ 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; } +.optionStyle { color: #3D545D; font-family: "arial"; font-size: 8pt;} -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: 95%;} /* following is for the right panel (helpful links) in the resource page @@ -157,7 +156,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; @@ -167,7 +166,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'); @@ -190,7 +189,7 @@ table.queueMenuTable tr { td.queueRightPanel { - border-width: 1px 1px 1px 1px; + border-width: 1px; border-style: solid; border-color: #e6e5e9; border-collapse: collapse; @@ -214,7 +213,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; @@ -266,7 +265,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; @@ -276,7 +275,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'); @@ -299,7 +298,7 @@ table.adminMenuTable tr { td.adminRightPanel { - border-width: 1px 1px 1px 1px; + border-width: 1px; border-style: solid; border-color: #e6e5e9; border-collapse: collapse; @@ -323,7 +322,7 @@ table.linedDataTable { table.linedDataTable td { margin: 0; - padding: 3px 3px 3px 3px; + padding: 3px; border-width: 1px 0 0 0; border-style: solid; border-color: #e6e5e9; @@ -562,18 +561,18 @@ table.sample { margin:0px; border-width: 0px; border-spacing: 0px; - border-style: inset inset inset inset; + border-style: 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-width: 1px; + padding: 3px; + border-style: solid; border-color: gray gray gray white; - -moz-border-radius: 0px 0px 0px 0px; + -moz-border-radius: 0px; } table.sample td.selected { @@ -581,21 +580,21 @@ table.sample td.selected { height:15px; border-width: 1px 0px 1px 1px; padding: 8px 3px 8px 3px; - border-style: solid solid solid solid; + border-style: solid; border-color: gray white gray gray; - -moz-border-radius: 0px 0px 0px 0px; + -moz-border-radius: 0px; } table.sample td.unselected { width:110px; height:15px; - border-width: 1px 1px 1px 1px; + border-width: 1px; padding: 8px 3px 8px 3px; - border-style: solid solid solid solid; - border-color: gray gray gray gray; + border-style: solid; + border-color: gray; background-color: #adc6de; - -moz-border-radius: 0px 0px 0px 0px; + -moz-border-radius: 0px; } @@ -603,9 +602,9 @@ table.sample td.unselected { 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-width: 1px; + padding: 3px; + border-style: solid; border-color: white gray white white; -moz-border-radius: 0px 0px 0px 0px; @@ -674,7 +673,7 @@ table.sample td.bottom { .printContent{ - padding: 24px 24px 24px 24px; + padding: 24px; background-color: white; text-align:left; background-color: white; @@ -712,7 +711,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; @@ -761,7 +760,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 +771,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; @@ -966,13 +965,121 @@ table.borderedHeadTable tr { vertical-align:middle; } +table.issueTabTable tr th { + background:#f5f8fa; +} + +table.issueTabTable#downTimeTable { + margin-top: 25px; +} + +div.issueList, +div.downtimeList { + display: none; + width: 85%; + padding: 0 10px 5px 25px; +} + +div.issueList .issue { + width: 85%; +} + +div.issue a.action { + float: right; + margin-right: 6px; +} + +div.issueList dl, +div.downtimeList dl { + margin-top: 15px; +} + +div.issueList dl dt, +div.downtimeList dl dt { + margin-top: 5px; + font-weight: bold; + display: inline; +} + +div.issueList dl dd, +div.downtimeList dl dd { + display: inline; +} + +div.issueList dl dd:after, +div.downtimeList dl dd:after { + content:"\A"; white-space:pre; +} + +div.issueList dl dt.block, +div.downtimeList dl dt.block { + display: block; +} +div#closeIssue .text-left { + text-align: left; +} + +div#closeIssue .text-right { + text-align: right; +} + +#newIssueForm #contactIDs, +#newIssueForm #bodyText, +#newIssueForm #resourceIDs { + min-width: 200px; + min-height: 50px; +} + +#inlineContact { + display: none; + border: 1px solid #dfdfdf; + padding: 10px; +} + +form#newIssueForm #resourceIDs { + display: none; +} + +#newIssueForm table.thickboxTable { + width: 100%; + background-image:url('../images/title.gif'); + background-repeat:no-repeat; +} + +#newIssueForm table.thickboxTable td:first-child { + width: 25%; +} + +#newIssueForm table.thickboxTable td:last-child { + width: 75%; +} + +#newIssueForm .form-element { + margin: 2px; + padding: 4px; +} + +#newIssueForm .form-element-tight { + display: inline-block; + margin: 2px; + padding: 4px; +} + +#newIssueForm .form-element label, #newIssueForm .form-element input { + display: inline-block; + min-width: 20%; +} + +#newIssueForm .form-element-tight label, #newIssueForm .form-element-tight input { + min-width: 10%; +} 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 tr { border:0px;margin:0px; padding:0px; vertical-align:middle; } table.noMargin td { border:0px;margin:0px; padding:0px; } @@ -987,7 +1094,6 @@ table.thickboxTable{ color: #2c3c42; font-family: "arial"; font-size: 8pt; - font-weight: heavy; } table.thickboxTable td{ @@ -996,9 +1102,9 @@ table.thickboxTable td{ .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} +.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;} @@ -1032,7 +1138,7 @@ input.dp-applied { } .adminAddInput{margin-top:5px;} -.licenseAddInput{margin-top:5px;margin-bottom;5px;} +.licenseAddInput{margin-top:5px;margin-bottom:5px;} @@ -1080,7 +1186,34 @@ select option.changeSelect{ .changeDefaultWhite{ border: solid 1px #a5acb2; color: #526972; -} +} + +/* Change Module */ +.changeMod{ + position: absolute; + background: #e4f5fc; /* Old browsers */ + background: linear-gradient(to bottom, #c8d8e9 3%,#e2f0ff 52%,#c7cefc 100%); /* W3C */ + border: none; + border-radius: 5px; + text-align: center; + cursor: pointer; +} + +/* Change language */ +.dropDownLang{ + float:right; + position:absolute; + margin-left:135px; + margin-top:-22px; + color: #3D545D; + background: #e4f5fc; /* Old browsers */ + background: linear-gradient(to bottom, #c8d8e9 3%,#e2f0ff 52%,#c7cefc 100%); /* W3C */ + border: none; + border-radius: 5px; + font-weight: bolder; + height:20px; + cursor: pointer; +} #importPage { text-align:left; @@ -1112,3 +1245,11 @@ select option.changeSelect{ #importPage h1, h2 { color: #2c3c42; } + +.text-center { + text-align: center; +} + +.issueList h3 { + margin-top: 8px; +} diff --git a/css/thickbox.css b/css/thickbox.css index f3cff58..ae1cbbd 100644 --- a/css/thickbox.css +++ b/css/thickbox.css @@ -161,5 +161,5 @@ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = d border:none; margin-bottom:-1px; margin-top:1px; - _margin-bottom:1px; + margin-bottom:1px; } diff --git a/directory.php b/directory.php index 4e4c0f6..76925bd 100644 --- a/directory.php +++ b/directory.php @@ -143,6 +143,7 @@ function resource_sidemenu($selected_link = '') { 'cataloging' => 'cataloging', 'contacts' => 'contacts', 'accounts' => 'lock', + 'issues' => 'help', 'attachments' => 'attachment', 'routing' => 'routing', ); @@ -179,4 +180,21 @@ 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,2); + $http_lang = $lang_name->getLanguage($codeL); +} +putenv("LC_ALL=$http_lang"); +setlocale(LC_ALL, $http_lang.".utf8"); +bindtextdomain("messages", "./locale"); +textdomain("messages"); + ?> diff --git a/export_downtimes.php b/export_downtimes.php new file mode 100644 index 0000000..e64b894 --- /dev/null +++ b/export_downtimes.php @@ -0,0 +1,43 @@ + $resourceID))); +$util = new Utility(); + +$organizationArray = $resource->getOrganizationArray(); + +$exportDowntimes = array(); + +if (count($organizationArray) > 0) { + $downtimedOrgs = array(); + foreach ($organizationArray as $orgData) { + if (!in_array($orgData['organizationID'],$downtimedOrgs)) { +// todo: create downtimes repo so we don't have to initialize an organization object from the wrong module + $organization = new Organization(new NamedArguments(array('primaryKey' => $orgData['organizationID']))); + $exportDowntimes = array_merge($exportDowntimes,$organization->getExportableDowntimes($archivedFlag)); + $downtimedOrgs[] = $orgData['organizationID']; + } + } +} + +$exportDowntimes = array_merge($exportDowntimes,$resource->getExportableDowntimes($archivedFlag)); + +header("Pragma: public"); +header("Content-type: text/csv"); +header("Content-Disposition: attachment; filename=\"downtimes.csv\""); + +$out = fopen('php://output', 'w'); + +fputcsv($out,array_keys($exportDowntimes[0])); + +foreach ($exportDowntimes as $downtime) { + fputcsv($out, $downtime); +} +fclose($out); + +?> \ No newline at end of file diff --git a/export_issues.php b/export_issues.php new file mode 100644 index 0000000..1fd95f1 --- /dev/null +++ b/export_issues.php @@ -0,0 +1,44 @@ + $resourceID))); +$util = new Utility(); + +$organizationArray = $resource->getOrganizationArray(); + +$exportIssues = array(); + +if (count($organizationArray) > 0) { + $issuedOrgs = array(); + foreach ($organizationArray as $orgData) { + if (!in_array($orgData['organizationID'],$issuedOrgs)) { +// todo: create issues repo so we don't have to initialize an organization object from the wrong module + $organization = new Organization(new NamedArguments(array('primaryKey' => $orgData['organizationID']))); + + $exportIssues = array_merge($exportIssues,$organization->getExportableIssues($archivedFlag)); + $issuedOrgs[] = $orgData['organizationID']; + } + } +} + +$exportIssues = array_merge($exportIssues,$resource->getExportableIssues($archivedFlag)); + +header("Pragma: public"); +header("Content-type: text/csv"); +header("Content-Disposition: attachment; filename=\"issues.csv\""); + +$out = fopen('php://output', 'w'); + +fputcsv($out,array_keys($exportIssues[0])); + +foreach ($exportIssues as $issue) { + fputcsv($out, $issue); +} +fclose($out); + +?> \ No newline at end of file diff --git a/images/help.gif b/images/help.gif new file mode 100644 index 0000000..bb3d178 Binary files /dev/null and b/images/help.gif differ diff --git a/images/help_bw.gif b/images/help_bw.gif new file mode 100644 index 0000000..db3cd58 Binary files /dev/null and b/images/help_bw.gif differ diff --git a/import.php b/import.php index 963cfae..486ea7d 100644 --- a/import.php +++ b/import.php @@ -19,9 +19,9 @@ session_start(); include_once 'directory.php'; //print header -$pageTitle='Resources import'; +$pageTitle=_('Resources import'); include 'templates/header.php'; -?>

CSV File import

0, 'resourceURL' => 0, 'resourceAltURL' => 0, 'parentResource' => 0, 'organization' => 0, 'role' => 0); if ($_POST['submit']) { @@ -29,7 +29,7 @@ $uploaddir = 'attachments/'; $uploadfile = $uploaddir . basename($_FILES['uploadFile']['name']); if (move_uploaded_file($_FILES['uploadFile']['tmp_name'], $uploadfile)) { - print '

The file has been successfully uploaded.

'; + print '

'._("The file has been successfully uploaded.").'

'; // Let's analyze this file if (($handle = fopen($uploadfile, "r")) !== FALSE) { @@ -39,18 +39,18 @@ $available_columns[$value] = $key; } } else { - $error = 'Unable to get columns headers from the file'; + $error = _("Unable to get columns headers from the file"); } } else { - $error = 'Unable to open the uploaded file'; + $error = _("Unable to open the uploaded file"); } } else { - $error = 'Unable to upload the file'; + $error = _("Unable to upload the file"); } if ($error) { - print "

Error: $error.

"; + print "

"._("Error: ").$error.".

"; } else { - print "

Please choose columns from your CSV file:

"; + print "

"._("Please choose columns from your CSV file:")."

"; print "
"; foreach ($required_columns as $rkey => $rvalue) { print "
- Import options - + +
- + " />
@@ -65,11 +65,11 @@
IDNameDate CreatedAcquisition TypeStatus
- Search
- new search +
+
 
- @@ -80,27 +80,27 @@

-
margin-left:123px;'>
+
margin-left:123px;'>
- - - - - - -
+

-
margin-left:123px;'>
+
margin-left:123px;'>
+

-
margin-left:123px;'>
+
margin-left:123px;'>
+
+
+
+
+
+

-
margin-left:123px;'>
+
margin-left:123px;'>
+
+
+
- +