Skip to content

Commit

Permalink
Merge pull request #227 from Coral-erm/development
Browse files Browse the repository at this point in the history
Merge development into master for 2.0.0 release.
  • Loading branch information
remocrevo authored Jun 8, 2017
2 parents 778a8cc + 24559b0 commit 652438a
Show file tree
Hide file tree
Showing 19 changed files with 93 additions and 92 deletions.
2 changes: 1 addition & 1 deletion reports/admin/configuration_sample.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ baseURL=""
type = "mysql"
host = ""
name = ""
usageDatabase = ""
usageDatabaseName = ""
username = ""
password = ""
22 changes: 0 additions & 22 deletions resources/ReleaseNotes

This file was deleted.

2 changes: 1 addition & 1 deletion resources/admin/classes/common/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function init(NamedArguments $arguments) {
$config = array_replace_recursive($global_config, $module_config);

// use other DBs for tests
if($config["settings"]["environment"] === "test") {
if(isset($config["settings"]["environment"]) && $config["settings"]["environment"] === "test") {
$this->switchAllDbsToTest($config);
}

Expand Down
21 changes: 12 additions & 9 deletions resources/admin/classes/common/DatabaseObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function valueForKey($key) {
$result = $this->db->processQuery($query);
if (isset($result[0])) $this->attributes[$key] = stripslashes($result[0]);
}
return $this->attributes[$key];
return isset($this->attributes[$key]) ? $this->attributes[$key] : NULL;
} else if (array_key_exists($key, $this->parentNames)) {
if (!array_key_exists($key, $this->parents)) {
$parentClassName = $this->parentNames[$key];
Expand Down Expand Up @@ -218,15 +218,18 @@ public function delete() {
public function save() {
$pairs = array();
foreach (array_keys($this->attributeNames) as $attributeName) {
$value = $this->attributes[$attributeName];
if ($value == '' || !isset($value)) {
$value = "NULL";
} else {
$value = $this->db->escapeString($value);
$value = "'$value'";
if (isset($this->attributes[$attributeName]))
{
$value = $this->attributes[$attributeName];
if ($value == '' || !isset($value)) {
$value = "NULL";
} else {
$value = $this->db->escapeString($value);
$value = "'$value'";
}
$pair = "`$attributeName`=$value";
array_push($pairs, $pair);
}
$pair = "`$attributeName`=$value";
array_push($pairs, $pair);
}
$set = implode(', ', $pairs);
if (isset($this->primaryKey)) {
Expand Down
2 changes: 1 addition & 1 deletion resources/admin/classes/domain/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ public static function getSearchDetails() {
$status = new Status();
$completedStatusID = $status->getIDFromName('complete');
$whereAdd[] = "(R.statusID != $completedStatusID AND RS.stepName = '" . $resource->db->escapeString($search['stepName']) . "' AND RS.stepStartDate IS NOT NULL AND RS.stepEndDate IS NULL)";
$searchDisplay[] = _("Routing Step: ") . $search['stepName'];
$searchDisplay[] = _("Workflow Step: ") . $search['stepName'];
}


Expand Down
4 changes: 2 additions & 2 deletions resources/ajax_forms/getImportConfigForm.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
$configID = $_POST['configID'];
if($configID) {
if (isset($_POST['configID'])) {
$configID = $_POST['configID'];
$instance = new ImportConfig(new NamedArguments(array('primaryKey' => $configID)));
$orgMappingInstance = new OrgNameMapping();
$orgMappings=$orgMappingInstance->getOrgNameMappingByImportConfigID($configID);
Expand Down
2 changes: 1 addition & 1 deletion resources/ajax_htmldata/getOutstandingQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<th style='width:45px;'><?php echo _("ID");?></th>
<th style='width:300px;'><?php echo _("Name");?></th>
<th style='width:95px;'><?php echo _("Acquisition Type");?></th>
<th style='width:125px;'><?php echo _("Routing Step");?></th>
<th style='width:125px;'><?php echo _("Workflow Step");?></th>
<th style='width:75px;'><?php echo _("Start Date");?></th>
</tr>

Expand Down
File renamed without changes
File renamed without changes
73 changes: 43 additions & 30 deletions resources/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function searchForShortName($shortName, $array)
<?php
// CSV configuration
$required_columns = array('titleText' => 0, 'resourceURL' => 0, 'resourceAltURL' => 0, 'parentResource' => 0, 'organization' => 0, 'role' => 0);
if ($_POST['submit'])
if (isset($_POST['submit']))
{
//get necessary configuration instances
$importConfigInstanceArray = array();
Expand Down Expand Up @@ -62,7 +62,7 @@ function searchForShortName($shortName, $array)
{
$error = _("Unable to upload the file");
}
if ($error)
if (isset($error))
{
print "<p>"._("Error: ").$error.".</p>";
}
Expand Down Expand Up @@ -189,7 +189,7 @@ function searchForShortName($shortName, $array)
<?php
}
}
elseif ($_POST['matchsubmit'])
elseif (isset($_POST['matchsubmit']))
{
//get the configuration as a php array
$jsonData = $_POST['jsonData'];
Expand Down Expand Up @@ -228,18 +228,22 @@ function searchForShortName($shortName, $array)
$delimiter = $_POST['delimiter'];
$deduping_columns = array();
$dedupeCriteria = array();

$allIsbnOrIssn_columns = array();
foreach($jsonData['isbnOrIssn'] as $isbnOrIssn)
{
$columnObj = array();
$columnObj['column'] = intval($isbnOrIssn['column'])-1;
$columnObj['delimiter'] = $isbnOrIssn['delimiter'];
if($isbnOrIssn['dedupe'] === true)
if (!empty($isbnOrIssn['column']))
{
array_push($dedupeCriteria,$columnObj);
array_push($deduping_columns,intval($isbnOrIssn['column'])-1);
$columnObj = array();
$columnObj['column'] = intval($isbnOrIssn['column'])-1;
$columnObj['delimiter'] = $isbnOrIssn['delimiter'];
if ($isbnOrIssn['dedupe'] === true)
{
array_push($dedupeCriteria, $columnObj);
array_push($deduping_columns, intval($isbnOrIssn['column'])-1);
}
array_push($allIsbnOrIssn_columns, $columnObj);
}
array_push($allIsbnOrIssn_columns,$columnObj);
}
$uploadfile = $_POST['uploadfile'];
// Let's analyze this file
Expand Down Expand Up @@ -305,28 +309,31 @@ function searchForShortName($shortName, $array)
}
}
}
foreach ($allIsbnOrIssn_columns as $columnCriterion)
if (!empty($allIsbnOrIssn_columns))
{
if($columnCriterion['delimiter'] !== '')
foreach ($allIsbnOrIssn_columns as $columnCriterion)
{
$columnValues = explode($columnCriterion['delimiter'],$data[$columnCriterion['column']]);
foreach($columnValues as $value)
if($columnCriterion['delimiter'] !== '')
{
if($value != '')
$columnValues = explode($columnCriterion['delimiter'],$data[$columnCriterion['column']]);
foreach($columnValues as $value)
{
$isbnIssn_values[] = $value;
if($value != '')
{
$isbnIssn_values[] = $value;
}
}
}
}
else
{
if($data[$columnCriterion['column']] != '')
else
{
$isbnIssn_values[] = $data[$columnCriterion['column']];
if($data[$columnCriterion['column']] != '')
{
$isbnIssn_values[] = $data[$columnCriterion['column']];
}
}
}
}
$deduping_count = count($resourceObj->getResourceByIsbnOrISSN($deduping_values));
$deduping_count = isset($deduping_values) ? count($resourceObj->getResourceByIsbnOrISSN($deduping_values)) : 0;
if ($deduping_count == 0)
{
// Convert to UTF-8
Expand Down Expand Up @@ -417,22 +424,28 @@ function searchForShortName($shortName, $array)
}
}


// Let's insert data
$resource->createLoginID = $loginID;
$resource->createDate = date( 'Y-m-d' );
$resource->updateLoginID = '';
$resource->updateDate = date('Y-m-d');
$resource->titleText = trim($data[$resourceTitleColumn]);
$resource->descriptionText = trim($data[$resourceDescColumn]);
$resource->resourceURL = trim($data[$resourceURLColumn]);
$resource->resourceAltURL = trim($data[$resourceAltURLColumn]);
$resource->resourceTypeID = $resourceTypeID;
$resource->resourceFormatID = $resourceFormatID;
$resource->titleText = isset($data[$resourceTitleColumn]) ? trim($data[$resourceTitleColumn]) : '';
$resource->descriptionText = isset($data[$resourceDescColumn]) ? trim($data[$resourceDescColumn]) : '';
$resource->resourceURL = isset($data[$resourceURLColumn]) ? trim($data[$resourceURLColumn]) : '';
$resource->resourceAltURL = isset($data[$resourceAltURLColumn]) ? trim($data[$resourceAltURLColumn]) : '';
$resource->resourceTypeID = isset($resourceTypeID) ? $resourceTypeID : '';
$resource->resourceFormatID = isset($resourceFormatID) ? $resourceFormatID : '';
$resource->acquisitionTypeID = isset($acquisitionTypeID) ? $acquisitionTypeID : '';
$resource->authenticationTypeID = isset($authenticationTypeID) ? $authenticationTypeID : '';
$resource->accessMethodID = isset($accessMethodID) ? $accessMethodID : '';
$resource->coverageText = isset($data[$resourceCoverageColumn]) ? trim($data[$resourceCoverageColumn]) : '';
//$resource->providerText = $data[$_POST['providerText']];
$resource->statusID = 1;
$resource->save();
$resource->setIsbnOrIssn($isbnIssn_values);
if (isset($isbnIssn_values))
{
$resource->setIsbnOrIssn($isbnIssn_values)
}
$inserted++;

// If Alias is mapped, check to see if it exists
Expand Down
2 changes: 1 addition & 1 deletion resources/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@
</tr>

<tr>
<td class='searchRow'><label for='searchStepName'><b><?php echo _("Routing Step");?></b></label>
<td class='searchRow'><label for='searchStepName'><b><?php echo _("Workflow Step");?></b></label>
<br />
<select name='search[stepName]' id='searchStepName' style='width:150px'>
<option value=''><?php echo _("All");?></option>
Expand Down
11 changes: 9 additions & 2 deletions resources/install/protected/2.0-beta-to-rc-manual.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
ALTER TABLE `ResourceStep` ADD `mailReminderDelay` INT UNSIGNED NULL;
ALTER TABLE `ResourceStep` ADD `note` TEXT NULL ;
ALTER TABLE `ResourceNote` MODIFY `updateDate` timestamp NOT NULL default CURRENT_TIMESTAMP;

ALTER TABLE `ResourceStep` ADD `archivingDate` DATETIME NULL AFTER `stepEndDate`;
ALTER TABLE `ResourceStep` ADD `mailReminderDelay` INT UNSIGNED NULL;
ALTER TABLE `ResourceStep` ADD `note` TEXT NULL;

INSERT INTO `ResourceType` (`resourceTypeID`, `shortName`, `includeStats`) VALUES (NULL, 'Any', NULL);
INSERT INTO `ResourceFormat` (`resourceFormatID`, `shortName`) VALUES (NULL, 'Any');
INSERT INTO `AcquisitionType` (`acquisitionTypeID`, `shortName`) VALUES (NULL, 'Any');
2 changes: 1 addition & 1 deletion resources/js/forms/currentWorkflowForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ function submitCurrentWorkflow() {
}else{
kill();
window.parent.tb_remove();
window.parent.updateRouting();
window.parent.updateWorkflow();
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion resources/js/forms/resourceStepForm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions resources/js/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ $(document).ready(function(){
$('#div_contacts').hide();
$('#div_accounts').show();
$('#div_attachments').hide();
$('#div_routing').hide();
$('#div_workflow').hide();
$('#div_fullRightPanel').show();
updateAccounts();
return false;
Expand All @@ -247,9 +247,9 @@ $(document).ready(function(){

$(".showWorkflow").click(function () {
$('.resource_tab_content').hide();
$('#div_routing').show();
$('#div_workflow').show();
$('#div_fullRightPanel').hide();
updateRouting();
updateWorkflow();
$('#restartWorkflowDiv').hide();
return false;
});
Expand Down Expand Up @@ -659,18 +659,18 @@ function updateAttachmentsNumber(){
}


function updateRouting(){
$("#icon_routing").html("<img src='images/littlecircle.gif' />");
function updateWorkflow(){
$("#icon_workflow").html("<img src='images/littlecircle.gif' />");
$.ajax({
type: "GET",
url: "ajax_htmldata.php",
cache: false,
data: "action=getRoutingDetails&resourceID=" + $("#resourceID").val(),
data: "action=getWorkflowDetails&resourceID=" + $("#resourceID").val(),
success: function(html) {
$("#div_routing .div_mainContent").html(html);
$("#div_workflow .div_mainContent").html(html);
tb_reinit();
bind_routing();
$("#icon_routing").html("<img src='images/routing.gif' />");
bind_workflow();
$("#icon_workflow").html("<img src='images/workflow.gif' />");
}


Expand Down Expand Up @@ -872,7 +872,7 @@ function bind_removes(){



function bind_routing(){
function bind_workflow(){



Expand All @@ -883,7 +883,7 @@ function bind_routing(){
cache: false,
data: "action=markComplete&resourceStepID=" + $(this).attr("id"),
success: function(html) {
updateRouting();
updateWorkflow();
}


Expand All @@ -908,7 +908,7 @@ $("select").change(function() {
cache: false,
data: "action=restartWorkflow&resourceID=" + $(this).attr("id") + "&deleteWorkflow=" + $("#deleteWorkflow").is(':checked') + "&workflow=" + $("#workflowArchivingDate").val(),
success: function(html) {
updateRouting();
updateWorkflow();
}


Expand All @@ -935,7 +935,7 @@ $("select").change(function() {
cache: false,
data: "action=markResourceComplete&resourceID=" + $(this).attr("id"),
success: function(html) {
updateRouting();
updateWorkflow();
}
});
}
Expand All @@ -949,7 +949,7 @@ $("select").change(function() {
cache: false,
data: "action=deleteResourceStep&resourceStepID=" + $(this).attr("id"),
success: function(html) {
updateRouting();
updateWorkflow();
}


Expand Down
2 changes: 1 addition & 1 deletion resources/resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@

</div>

<div style="display:none;width: 897px;" id='div_routing' class="resource_tab_content">
<div style="display:none;width: 897px;" id='div_workflow' class="resource_tab_content">
<table cellpadding="0" cellspacing="0" style="width: 100%;">
<tr>
<td class="sidemenu">
Expand Down
4 changes: 2 additions & 2 deletions templates/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<div class="push">&nbsp;</div>
</div>

<div class="footer"><?php echo _("Copyright");?> &copy; 2017. <?php echo _("CORAL version");?> 2.0.0 Release Candidate 1<br/>
<a href="http://coral-erm.org/"><?php echo _("CORAL Project Website");?></a> |
<div class="footer"><?php echo _("Copyright");?> &copy; 2017. <?php echo _("CORAL version");?> 2.0.0<br/>
<a href="http://coral-erm.org/"><?php echo _("CORAL Project Website");?></a> |
<a href="https://github.com/Coral-erm/Coral/issues"><?php echo _("Report an issue");?></a></div>
</body>
</html>
Loading

0 comments on commit 652438a

Please sign in to comment.