diff --git a/core/components/com_publications/admin/controllers/items.php b/core/components/com_publications/admin/controllers/items.php index c28dfa347c0..d4137f36d57 100644 --- a/core/components/com_publications/admin/controllers/items.php +++ b/core/components/com_publications/admin/controllers/items.php @@ -348,8 +348,21 @@ public function editauthorTask() if (!empty($this->view->author->user_id)) { $user = \Components\Members\Models\Member::oneOrNew($this->view->author->user_id); - $this->view->author->orcid = $user->get('orcid'); - $this->view->author->organization = $user->get('organization'); + + if (empty($this->view->author->organization) && !empty($user->get('organization'))) + { + $this->view->author->organization = $user->get('organization'); + } + + if (empty($this->view->author->orgid) && !empty($user->get('orgid'))) + { + $this->view->author->orgid = $user->get('orgid'); + } + + if (empty($this->view->author->orcid) && !empty($user->get('orcid'))) + { + $this->view->author->orcid = $user->get('orcid'); + } } // Version ID diff --git a/core/components/com_publications/admin/language/en-GB/en-GB.com_publications.ini b/core/components/com_publications/admin/language/en-GB/en-GB.com_publications.ini index 80748a5df83..165f33e7f4e 100644 --- a/core/components/com_publications/admin/language/en-GB/en-GB.com_publications.ini +++ b/core/components/com_publications/admin/language/en-GB/en-GB.com_publications.ini @@ -311,6 +311,7 @@ COM_PUBLICATIONS_EDIT_AUTHOR_INFO="Edit Author Info" COM_PUBLICATIONS_FIELD_AUTHOR_NAME="Author Name" COM_PUBLICATIONS_FIELD_AUTHOR_NAME_FIRST_AND_MIDDLE="First Name (and Middle Initial)" COM_PUBLICATIONS_FIELD_AUTHOR_NAME_LAST="Last Name" +COM_PUBLICATIONS_FIELD_AUTHOR_DEPARTMENT="School or department" COM_PUBLICATIONS_FIELD_AUTHOR_ORGANIZATION="Organization" COM_PUBLICATIONS_FIELD_AUTHOR_ORCID="ORCID" COM_PUBLICATIONS_FIELD_AUTHOR_ORCID_ID_DESC="*ORCID ID is 16-digit" diff --git a/core/components/com_publications/admin/views/items/tmpl/editauthor.php b/core/components/com_publications/admin/views/items/tmpl/editauthor.php index 67dd1d26854..bd1294208c3 100644 --- a/core/components/com_publications/admin/views/items/tmpl/editauthor.php +++ b/core/components/com_publications/admin/views/items/tmpl/editauthor.php @@ -100,6 +100,12 @@ +
*
+ pub->authors()) > 1) { ?>*
diff --git a/core/plugins/projects/team/assets/js/selector.js b/core/plugins/projects/team/assets/js/selector.js index 522e7b33456..634d9199573 100644 --- a/core/plugins/projects/team/assets/js/selector.js +++ b/core/plugins/projects/team/assets/js/selector.js @@ -335,22 +335,46 @@ $(function(){ appendTo: '#autocomplete-organization', }); } -}); - -$('[name = "orcid"]').on('input', function(){ - var regex = /^[0-9]{4}-([0-9]{4}-){2}[0-9X]{4}/; - var orcidInput = $('[name = "orcid"]').val(); - if (!regex.test(orcidInput)) - { - $('#orcid-message').addClass("prompt"); - $('#orcid-message').text('*Invalid ORCID ID. Please enter the 16-digit ORCID ID'); - $('#orcid-message').show(); - } - else - { - $('#orcid-message').removeClass("prompt"); - $('#orcid-message').text('*You have successfully entered a valid 16-digit ORCID ID'); - $('#orcid-message').show(); + $('[name = "orcid"]').on('input', function(){ + var regex = /^[0-9]{4}-([0-9]{4}-){2}[0-9X]{4}/; + var orcidInput = $('[name = "orcid"]').val(); + + if (!regex.test(orcidInput)) + { + $('#orcid-message').addClass("prompt"); + $('#orcid-message').text('*Invalid ORCID ID. Please enter the 16-digit ORCID ID'); + $('#orcid-message').show(); + } + else + { + $('#orcid-message').removeClass("prompt"); + $('#orcid-message').text('*You have successfully entered a valid 16-digit ORCID ID'); + $('#orcid-message').show(); + } + }) + + if ($(".departmentAvailable")[0]){ + $('[name="department"]').autocomplete({ + source: function(req, resp){ + var deptURL = "index.php?option=com_publications&controller=curation&task=getDepartment&term=" + $('[name="department"]').val(); + + $.ajax({ + url:deptURL, + data: null, + dataType: "json", + success:function(result){ + resp(result); + }, + error:function(jqXHR, textStatus, errorThrown){ + console.log(textStatus); + console.log(errorThrown); + console.log(jqXHR.responseText); + } + }); + }, + + appendTo: '#autocomplete-department' + }); } -}) \ No newline at end of file +}); \ No newline at end of file diff --git a/core/plugins/projects/team/language/en-GB/en-GB.plg_projects_team.ini b/core/plugins/projects/team/language/en-GB/en-GB.plg_projects_team.ini index 65b092e371a..f77cc565f89 100644 --- a/core/plugins/projects/team/language/en-GB/en-GB.plg_projects_team.ini +++ b/core/plugins/projects/team/language/en-GB/en-GB.plg_projects_team.ini @@ -45,14 +45,16 @@ PLG_PROJECTS_TEAM_OR="OR" PLG_PROJECTS_TEAM_SELECTOR_FIRST_NAME="First name" PLG_PROJECTS_TEAM_SELECTOR_LAST_NAME="Last name" PLG_PROJECTS_TEAM_SELECTOR_EMAIL="Email" +PLG_PROJECTS_TEAM_SELECTOR_DEPARTMENT="School or Department" PLG_PROJECTS_TEAM_SELECTOR_ORGANIZATION="Institution" PLG_PROJECTS_TEAM_SELECTOR_ORCID="ORCID" -PLG_PROJECTS_TEAM_SELECTOR_ORCID_DESC="*Please enter the 16-digit ORCID ID" +PLG_PROJECTS_TEAM_SELECTOR_ORCID_DESC="*Please enter the 16-digit ORCID ID only" PLG_PROJECTS_TEAM_SELECTOR_SAVE_NEW="add author" PLG_PROJECTS_TEAM_AUTHORS_EDIT_UNCONFIRMED_TIPS="Name and institution fields are required. You may also provide an email address for the person to send out an invitation to join the publication team." PLG_PROJECTS_TEAM_SELECTOR_AUTHOR_UNCONFIRMED="unconfirmed" PLG_PROJECTS_TEAM_SELECTOR_LOOK_UP_BY_ID="Look up author by name (optional)" -PLG_PROJECTS_TEAM_SELECTOR_HINT="*Name and organization fields are required" +PLG_PROJECTS_TEAM_SELECTOR_FIRST_NAME_REQUIRED="*First name is required" +PLG_PROJECTS_TEAM_SELECTOR_LAST_NAME_REQUIRED="*Last name is required" PLG_PROJECTS_TEAM_SELECTOR_USERID="User ID" PLG_PROJECTS_TEAM_SELECTOR_AUTHOR_NOT_PART_OF_TEAM="Author not part of project team yet?" diff --git a/core/plugins/projects/team/views/selector/tmpl/newauthor.php b/core/plugins/projects/team/views/selector/tmpl/newauthor.php index da9293a494a..548317f75c3 100644 --- a/core/plugins/projects/team/views/selector/tmpl/newauthor.php +++ b/core/plugins/projects/team/views/selector/tmpl/newauthor.php @@ -103,19 +103,34 @@