I would like to extend the editors notify users (Home->Editor->Notify Users) functionality with a possibility to send email notification to all reviewers. That is to add a new radio button “All reviewers” on the “Send Email” page.
I have basically copied the code from the “All readers” option in several files, but I think the most important is the “IssueManagementHandler.inc.php” file. The new code I have added is:
case 'allReviewers':
$recipients =& $roleDao->getUsersByRoleId(
ROLE_ID_REVIEWER,
$journal->getId()
);
break;
The problem is that I don’t get any reviewers listed (in the “Send email” page it says 0 users). If I change the “ROLE_ID_REVIEWER” to the “ROLE_ID_READER” it works correctly.
Any idea what I am doing wrong? I would expect that just changing the role ID is enough that the call “getUsersByRoleID” returns users with the selected role ID, but obviously not.
Good point, I forgot to check the log file, but I was sure the constant is OK.
However, I have checked the log and nothing there. The point is that I have tried with the value itself as well, with the value that works directly in DB with an SQL statement.
I would suggest turning on the debug option in your config.inc.php (warning – this will dump the full SQL query list to the browser for all users), capturing the resulting database query, and testing it manually on your database.
Regards,
Alec Smecher
Public Knowledge Project Team
After turning on the debug I suspect I am not looking into correct files. I don’t get the SQL statement I should.
Now I have a situation where I have changed the IssueManagementHandler.inc.php, in the notifyUsers I modified the case "“AllReaders” so that it should return all reviewers (the role define is ROLE_ID_REVIEWER). So I should get a list of reviewers instead of readers for this case. But the SQL statement still contains the role for readers in stead of reviewers.
So I guess the IssueManagementHandler.inc.php file is not the correct one. Am I right? Which file is that the one I should change?
Oh, I have done clear all data cache and clear template cache…
I am sorry I am not good enough with the GitHub But I simplified my changes so it is very easy to understand.
I have “undo” all the changes and changed only the file “IssueManagementHandler.inc.php”. What I would like to try is to get a list of reviewers instead of a list of readers.
My understanding is that the template “notifyUsers.tpl” calls “IssueManagementHandler.inc.php”, precisely that the code
Hi @asmecher
Thank you for your help. After some more looking in to the code it turned out that my first attempt has been in right direction, but not all changes have been done.
Beside the code changes above there is another location in the IssueManagementHandler.inc.php that has to be changed/added. That is at the end of the function NotifyUsers in the call $email->displayEditForm where the array has to be extended with the reviewers element: