Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contacts appear blank when reporting issues if name is empty #671

Merged
merged 3 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion organizations/admin/classes/domain/Organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public function getIssues($archivedOnly=false) {
public function getExportableIssues($archivedOnly=false){
$orgDB = $this->db->config->database->name;
$resourceDB = $this->db->config->settings->resourcesDatabaseName;
$query = "SELECT i.*,(SELECT GROUP_CONCAT(CONCAT(sc.name,' - ',sc.emailAddress) SEPARATOR ', ')
$query = "SELECT i.*,(SELECT GROUP_CONCAT(CONCAT('=HYPERLINK(\"mailto:',sc.emailAddress,'\",\"',COALESCE(sc.name,sc.emailAddress),'\")') SEPARATOR ', ')
FROM `{$resourceDB}`.IssueContact sic
LEFT JOIN `{$orgDB}`.Contact sc ON sc.contactID=sic.contactID
WHERE sic.issueID=i.issueID) AS `contacts`,
Expand Down
7 changes: 6 additions & 1 deletion organizations/ajax_forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,12 @@
<?php

foreach ($organizationContactsArray as $contact) {
echo " <option value=\"{$contact->contactID}\">{$contact->name}</option>";
$contactname = ($contact->name);
if (!empty($contactname)) {
echo " <option value=\"{$contact->contactID}\">{$contact->name}</option>";
} else {
echo " <option value=\"{$contact->contactID}\">{$contact->emailAddress}</option>";
}
}

?>
Expand Down
6 changes: 5 additions & 1 deletion organizations/ajax_htmldata.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ function generateIssueHTML($issue,$associatedEntities=null) {
if ($contacts) {
$html .= "<ul class=\"contactList\">";
foreach($contacts as $contact) {
$html .= "<li><a href=\"mailto:".urlencode($contact['emailAddress'])."?Subject=RE: {$issue->subjectText}\">{$contact['name']}</a></li>";
if(!empty($contact['name'])) {
$html .= "<li><a href=\"mailto:".urlencode($contact['emailAddress'])."?Subject=RE: {$issue->subjectText}\">{$contact['name']}</a></li>";
} else {
$html .= "<li><a href=\"mailto:".urlencode($contact['emailAddress'])."?Subject=RE: {$issue->subjectText}\">{$contact['emailAddress']}</a></li>";
}
}
$html .= "</ul>";
}
Expand Down
4 changes: 2 additions & 2 deletions organizations/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2054,12 +2054,12 @@ table.titleTable {
padding-left: 8px;
}

/*--- Add space before and after each downtime definition ---*/
/*--- Add space before and after each issue and downtime definition ---*/

dt:first-child {
padding-top: .5em;
}

div.downtime {
div.downtime, div.issue {
padding-bottom: 1em;
}
2 changes: 1 addition & 1 deletion resources/admin/classes/domain/Organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function getExportableIssues($archivedOnly=false) {
$orgField = 'shortName';
}

$query = "SELECT i.*,(SELECT GROUP_CONCAT(CONCAT(sc.name,' - ',sc.emailAddress) SEPARATOR ', ')
$query = "SELECT i.*,(SELECT GROUP_CONCAT(CONCAT('=HYPERLINK(\"mailto:',sc.emailAddress,'\",\"',COALESCE(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`,
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 @@ -395,7 +395,7 @@ public function getExportableIssues($archivedOnly=false){
$contactsDB = $this->db->config->database->name;
}

$query = "SELECT i.*,(SELECT GROUP_CONCAT(CONCAT(sc.name,' - ',sc.emailAddress) SEPARATOR ', ')
$query = "SELECT i.*,(SELECT GROUP_CONCAT(CONCAT('=HYPERLINK(\"mailto:',sc.emailAddress,'\",\"',COALESCE(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`,
Expand Down
6 changes: 5 additions & 1 deletion resources/ajax_forms/getNewIssueForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
<?php

foreach ($contactsArray as $contact) {
echo " <option value=\"{$contact['contactID']}\">{$contact['name']}</option>";
if (!empty($contact['name'])) {
echo " <option value=\"{$contact['contactID']}\">{$contact['name']}</option>";
} else {
echo " <option value=\"{$contact['contactID']}\">{$contact['emailAddress']}</option>";
}
}

?>
Expand Down
6 changes: 5 additions & 1 deletion resources/ajax_htmldata/getIssuesList.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ function generateIssueHTML($issue,$associatedEntities=null) {
if ($contacts) {
$html .= "<ul class=\"contactList\">";
foreach($contacts as $contact) {
$html .= "<li><a href=\"mailto:".urlencode($contact['emailAddress'])."?Subject=RE: {$issue->subjectText}\">{$contact['name']}</a></li>";
if (!empty($contact['name'])) {
$html .= "<li><a href=\"mailto:".urlencode($contact['emailAddress'])."?Subject=RE: {$issue->subjectText}\">{$contact['name']}</a></li>";
} else {
$html .= "<li><a href=\"mailto:".urlencode($contact['emailAddress'])."?Subject=RE: {$issue->subjectText}\">{$contact['emailAddress']}</a></li>";
}
}
$html .= "</ul>";
}
Expand Down
4 changes: 2 additions & 2 deletions resources/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3317,12 +3317,12 @@ input#archiveInd {
vertical-align: 3px;
}

/*--- Add space before and after each downtime definition ---*/
/*--- Add space before and after each issue and downtime definition ---*/

dt:first-child {
padding-top: .5em;
}

div.downtime {
div.downtime, div.issue {
padding-bottom: 1em;
}
64 changes: 25 additions & 39 deletions usage/layouts.ini
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,8 @@ columnToCheck[5] = "Proprietary_ID"
columnToCheck[6] = "Print_ISSN"
columnToCheck[7] = "Online_ISSN"
columnToCheck[8] = "URI"
columnToCheck[9] = "YOP"
columnToCheck[10] = "Metric_Type"
columnToCheck[11] = "Reporting_Period_Total"
columnToCheck[9] = "Metric_Type"
columnToCheck[10] = "Reporting_Period_Total"
columns[] = title
columns[] = publisher
columns[] = publisherID
Expand All @@ -245,7 +244,6 @@ columns[] = pi
columns[] = issn
columns[] = eissn
columns[] = uri
columns[] = yop
columns[] = activityType
columns[] = ytd

Expand All @@ -259,10 +257,9 @@ columnToCheck[5] = "Proprietary_ID"
columnToCheck[6] = "Print_ISSN"
columnToCheck[7] = "Online_ISSN"
columnToCheck[8] = "URI"
columnToCheck[9] = "YOP"
columnToCheck[10] = "Access_Type"
columnToCheck[11] = "Metric_Type"
columnToCheck[12] = "Reporting_Period_Total"
columnToCheck[9] = "Access_Type"
columnToCheck[10] = "Metric_Type"
columnToCheck[11] = "Reporting_Period_Total"
columns[] = title
columns[] = publisher
columns[] = publisherID
Expand All @@ -272,7 +269,6 @@ columns[] = pi
columns[] = issn
columns[] = eissn
columns[] = uri
columns[] = yop
columns[] = accessType
columns[] = activityType
columns[] = ytd
Expand Down Expand Up @@ -334,12 +330,11 @@ columnToCheck[26] = "Component_Print_ISSN"
columnToCheck[27] = "Component_Online_ISSN"
columnToCheck[28] = "Component_URI"
columnToCheck[29] = "Data_Type"
columnToCheck[30] = "Section_Type"
columnToCheck[31] = "YOP"
columnToCheck[32] = "Access_Type"
columnToCheck[33] = "Access_Method"
columnToCheck[34] = "Metric_Type"
columnToCheck[35] = "Reporting_Period_Total"
columnToCheck[30] = "YOP"
columnToCheck[31] = "Access_Type"
columnToCheck[32] = "Access_Method"
columnToCheck[33] = "Metric_Type"
columnToCheck[34] = "Reporting_Period_Total"
columns[] = title
columns[] = publisher
columns[] = publisherID
Expand Down Expand Up @@ -370,7 +365,6 @@ columns[] = componentIssn
columns[] = componentEissn
columns[] = componentUri
columns[] = dataType
columns[] = sectionType
columns[] = yop
columns[] = accessType
columns[] = accessMethod
Expand All @@ -387,21 +381,18 @@ columnToCheck[5] = "Publication_Date"
columnToCheck[6] = "Article_Version"
columnToCheck[7] = "DOI"
columnToCheck[8] = "Proprietary_ID"
columnToCheck[9] = "ISBN"
columnToCheck[10] = "Print_ISSN"
columnToCheck[11] = "Online_ISSN"
columnToCheck[12] = "URI"
columnToCheck[13] = "Parent_Title"
columnToCheck[14] = "Parent_Data_Type"
columnToCheck[15] = "Parent_DOI"
columnToCheck[16] = "Parent_Proprietary_ID"
columnToCheck[17] = "Parent_ISBN"
columnToCheck[18] = "Parent_Print_ISSN"
columnToCheck[19] = "Parent_Online_ISSN"
columnToCheck[20] = "Parent_URI"
columnToCheck[21] = "YOP"
columnToCheck[22] = "Metric_Type"
columnToCheck[23] = "Reporting_Period_Total"
columnToCheck[9] = "Print_ISSN"
columnToCheck[10] = "Online_ISSN"
columnToCheck[11] = "URI"
columnToCheck[12] = "Parent_Title"
columnToCheck[13] = "Parent_DOI"
columnToCheck[14] = "Parent_Proprietary_ID"
columnToCheck[15] = "Parent_Print_ISSN"
columnToCheck[16] = "Parent_Online_ISSN"
columnToCheck[17] = "Parent_URI"
columnToCheck[18] = "Access_Type"
columnToCheck[19] = "Metric_Type"
columnToCheck[20] = "Reporting_Period_Total"
columns[] = title
columns[] = publisher
columns[] = publisherID
Expand All @@ -411,19 +402,16 @@ columns[] = publicationDate
columns[] = articleVersion
columns[] = doi
columns[] = pi
columns[] = isbn
columns[] = issn
columns[] = eissn
columns[] = uri
columns[] = parentTitle
columns[] = parentDataType
columns[] = parentDoi
columns[] = parentPi
columns[] = parentIsbn
columns[] = parentIssn
columns[] = parentEissn
columns[] = parentUri
columns[] = yop
columns[] = accessType
columns[] = activityType
columns[] = ytd

Expand All @@ -435,16 +423,14 @@ columnToCheck[3] = "Platform"
columnToCheck[4] = "DOI"
columnToCheck[5] = "Proprietary_ID"
columnToCheck[6] = "URI"
columnToCheck[7] = "YOP"
columnToCheck[8] = "Metric_Type"
columnToCheck[9] = "Reporting_Period_Total"
columnToCheck[7] = "Metric_Type"
columnToCheck[8] = "Reporting_Period_Total"
columns[] = title
columns[] = publisher
columns[] = publisherID
columns[] = platform
columns[] = doi
columns[] = pi
columns[] = uri
columns[] = yop
columns[] = activityType
columns[] = ytd