Hi all,
Is there anyway to find whether a user is viewing a submission as an editor or section-editor?
I want to change editorDecision.tpl
(this is why), but it seems that this file is common between the two roles. so, the only way is to check the user’s current role.
I thought this would be possible by checking the page url; but could not make it.
Any ideas?
Thanks
Hi @alirezaaa,
See the Validation
class:
https://pkp.sfu.ca/ojs/doxygen/stable/html/classValidation.html
Regards,
Alec Smecher
Public Knowledge Project Team
Thanks @asmecher,
I tried and it is working, but I am facing a problem.
suppose that a user has the Editor role in the journal and is the Section-editor for a specific article. When he enters the Review page as the section-editor, both below statement become true; however, I only want the second statement to be true, so that I will be able to differentiate “editor decision” and “section-editor decision”.
if (Validation::isEditor()){ ... }
if(Validation::isSectionEditor()){ ... }
is there any way so that I can find page specific role?
Thanks
Hi @alirezaaa,
If you want to know what the editor assignments are for a specific article, you’ll need to use the EditAssignmentDAO
:
$editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');
$editAssignments =& $editAssignmentDao->getEditAssignmentsByArticleId($articleId);
while ($editAssignment =& $editAssignments->next()) {
// Check what kind of assignment it is
unset($editAssignment);
}
Regards,
Alec Smecher
Public Knowledge Project Team
Thank you @asmecher,
I appreciate your quick responses.
Best,
Ali