Describe the issue or problem
I’m currently developing the rqc plugin for OJS 3.5 (prior 3.3) and continue the work for @prechelt
In 3.3 there was the possibility to add a custom button to the editorial workflow page because the PKPEditorDecisionActionsManager made the editing of the buttons very straight forward. I could hook in via ‘EditorAction::modifyDecisionOptions’ and inject a button with a title, a name and an operation. So it looks like this when the “RQC-Grade the Reviews” button is added.
In the changenotes of 3.4 ‘Workflow::Decisions’ is given as the replacement, but the objects that I can inject via this Hook are always decisionTypes. I understand (but I don’t know if I’m correct) that every button in that compartment is created based upon a decisionType and has to make a decision that is stored in the database. So I can’t put in a custom operation any more, as the decision value of the decisionType is taken and submitted with the button click (I guess?).
Is there a way to get around this problem or is there another way to insert a button at this place? We really need a button like that as it is a central component of our plugin.
What application are you using?
The current 3.5 stable branch of OJS
To explain the background of this question a bit: The plugin connects OJS to RQC, the Review Quality Collector.
The purpose of the button is to make OJS send reviewing data to RQC. Editors can then grade the reviews at RQC which is often a good preparation step for making a decision. From OJS’ point of view however, this is mostly a non-operation. Therefore, leaving a decision object in the database as a side effect would be odd (or worse).
I found something that was very odd for me.
If I hook into the Workflow::Decisions like this
(so I get the $decisionTypes and add the RQCGrade decisionType to the array), I have the problem that the button that I added isn’t shown in the UI. Its there in the response in the availableEditorialDecisions
but not there in the UI.
In fact one other button is also not shown:
So I thought that maybe some js filters depending on the getDecisions() and I guess that that is the case and duplicates are not allowed.
So if I instead of adding the RQCGrade decisionType to the array, I replace the whole array with an array with just the custom button (like this: $decisionTypes = [new RQCGrade()];
) it just gets weirder:
The decisionType with the label "RQC-Grade the reviews"
is turned into "Create a new Review Round"
(I assume its because of the getDecision int that is returned).
So I thought that it has something to do with some js translating it (that I could not find) but then I replaced the only two definitions of "Create a new Review Round"
. One in the locale.po in php and one in globals.js to see from where the "Create a new Review Round"
came from, and it comes from the locale.po. So its translated in php I guess?
So somewhere the decision constant is taken to define which label is shown at the button depending on the decision constant, but I don’t know where. It has to be in php (I think) as the .po is used and not the globale.js where these translations are also done. But meanwhile the whole array of availableEditorialDecisions
is shipped to the browser as I expect it to be, and I cannot see where it is used and which (other?) array is used for the buttons.
So there are multiple things that I have questions about:
- If I use a constant e.g. 500 for
getDecision()
that isn’t already defined (like Decision::NEW_EXTERNAL_ROUND
) then the button is filtered out. Where is that filtering taking place?
- If I reuse a
getDecision()
that is already in use, the second usage is also excluded.
- Where is the place where this decision constant is taken to get all the labels and actions that should be done when the button is pressed?
- Where can I inject a custom value to add a custom button with a custom popup?
For @prechelt and me developing this plugin, it is really important to add such a button as without the RQC-plugin is somewhat useless.
I hope that one can answer me and show me where I go off the right track. Thank you!