[OJS3.1] Wanting to customize the Submissions page

I am slowly customizing OJS 3,1 to our needs. We have two Journals hosted on the same OJS system, and I would like to add a button in the submission page for each submission to allow us to transfer a submission from one journal to another.

I was thinking of doing this in the Submissions page. Once a user clicks on the submission dropdown, there are three buttons: “View Submission” “Activity Log & Notes” “Delete”. I would like to another one here “Send to X”. I am going through the code, but am stuck at

templates/dashboard/index.tpl

where there is:

pkp.registry.init('my-submission-list-handler-{$uuid}', 'SubmissionsListPanel', {$myQueueListData});

I understand that this calls a Vue instance, but i cannot find the function in order to add this button.

I could use Vue or Jquery to dynamically add this button after loading, but that does not seem clean code.

Would someone guide me on where pkp.registry.init, and what it does?

thanks

Stephen

Hi Stephen,

The submissions list is a Vue.js component from the new pkp ui-library. You can see the SubmissionListItem component source code here:

If you want to add a button that pops up a modal, you can look at how this is done with the Activity Log & Notes button. In the template, a button is added with a @click handler that calls openInfoCenter:

And the openInfoCenter method instantiates the modal and loads it:

Many thanks!

I will look into this, and report.

Maybe I could then package it as a plugin for others to use.

Regards

Stephen

Where do I find these templates in the file structure? I cannot find them, no matter where I look.

Since this is vue, are these in the tar.gz that we download for installation of OJS3?

thanks

Stephen

OK, i have now managed to compile the OJS system.

However, if I duplicate or remove one of the buttons, the whole script breaks down, with no siubmissions shown.

Any ideas on how to debug?

Stephen

an example:

		<div class="pkpListPanelItem--submission__actions">

			<pkp-button
				element="a"
				:href="item.urlWorkflow"
				:label="i18n.viewSubmission"
				@focus="focusItem"
				@blur="blurItem"
			/>

			<pkp-button
				v-if="currentUserCanDelete"
				:label="i18n.delete"
				:isWarnable="true"
				@click="deleteSubmissionPrompt"
				@focus="focusItem"
				@blur="blurItem"
			/>
		</div>

Any ideas please?

Each time i compile the build.js, the whole system stops working. Even if I do not make any changes to the system.

Stephen

How do you compile the build.js exactly? Do you get any errors in the developer console of the browser? I assume that the AJAX calls are not working anymore.

Hi @j1shin,

The built JS is already included in the .tar.gz file – but if you’re making modifications to that, or running from a git branch, then you would build the JS by running

npm install
npm run build

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @asmecher, that’s right, but i was refering to @ssciberras.

i have followed the instructions:

git clone 3.1.0.1
git clone pkp-lib

cd into directory,

npm install
npm run build

Now I realise that even without modifications, my build.js is 288 kb whilst the original is 234 kb. Also mine has the following:

  • Vue.js v2.5.15
    vs
  • Vue.js v2.5.9

Any ideas?

Stephen

EDIT: I might have used a newer OJS version, so I have recomplied build.js using 3.1.0-1 git version, as this is the one I am using. I am still getting a difference size, and the Submissions page still is empty once I upload to the production site.

The build.js that is compiled is as follows: https://1drv.ms/u/s!Avb-ierd1YFJgYRTlAwmLOs9P3fyzg

Hi @ssciberras,

Have you been working through these instructions?
https://pkp.sfu.ca/wiki/index.php?title=Github_Documentation_for_PKP_Contributors

Regards,
Alec Smecher
Public Knowledge Project Team

Not really, but the only part i missed had been the composer update part

Still, there was no difference: each time, the submissions page is empty.

However, now i realise that it is the ‘My Queue’ tab and ‘Unassigned’ that are empty - the ‘All Active’ and ‘Archived’ are populated.

Any reason why this should happen?

I will soon try changing the submissions page, and rebuild and see what happens

stephen

Hi @ssciberras,

Does anything useful appear in your browser console or PHP error log?

Regards,
Alec Smecher
Public Knowledge Project Team

In the browser console, there are no errors.

PHP log as follows

[29-May-2018 17:17:47 Europe/Malta] PHP Strict Standards: Declaration of PiwikPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home3/ssciberras/public_html/plugins/generic/piwik/PiwikPlugin.inc.php on line 155
[29-May-2018 17:17:47 Europe/Malta] PHP Strict Standards: Declaration of PiwikPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home3/ssciberras/public_html/plugins/generic/piwik/PiwikPlugin.inc.php on line 155
[29-May-2018 17:17:47 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getSeq() should be compatible with BlockPlugin::getSeq($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:47 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:47 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getEnabled() should be compatible with BlockPlugin::getEnabled($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:47 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getContents() should be compatible with BlockPlugin::getContents($templateMgr, $request = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:47 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getSeq() should be compatible with BlockPlugin::getSeq($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:47 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:47 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getEnabled() should be compatible with BlockPlugin::getEnabled($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:47 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getContents() should be compatible with BlockPlugin::getContents($templateMgr, $request = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:47 Europe/Malta] PHP Strict Standards: Declaration of SubmissionFileDAO::fromRow() should be compatible with PKPSubmissionFileDAO::fromRow($row, $fileImplementation) in /home3/ssciberras/public_html/classes/article/SubmissionFileDAO.inc.php on line 23
[29-May-2018 17:17:48 Europe/Malta] PHP Strict Standards: Declaration of PiwikPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home3/ssciberras/public_html/plugins/generic/piwik/PiwikPlugin.inc.php on line 155
[29-May-2018 17:17:48 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getSeq() should be compatible with BlockPlugin::getSeq($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:48 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:48 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getEnabled() should be compatible with BlockPlugin::getEnabled($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:48 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getContents() should be compatible with BlockPlugin::getContents($templateMgr, $request = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of PiwikPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home3/ssciberras/public_html/plugins/generic/piwik/PiwikPlugin.inc.php on line 155
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of PiwikPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home3/ssciberras/public_html/plugins/generic/piwik/PiwikPlugin.inc.php on line 155
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of PiwikPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home3/ssciberras/public_html/plugins/generic/piwik/PiwikPlugin.inc.php on line 155
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of PiwikPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home3/ssciberras/public_html/plugins/generic/piwik/PiwikPlugin.inc.php on line 155
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getSeq() should be compatible with BlockPlugin::getSeq($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getEnabled() should be compatible with BlockPlugin::getEnabled($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getContents() should be compatible with BlockPlugin::getContents($templateMgr, $request = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of SubmissionFileDAO::fromRow() should be compatible with PKPSubmissionFileDAO::fromRow($row, $fileImplementation) in /home3/ssciberras/public_html/classes/article/SubmissionFileDAO.inc.php on line 23
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of SubmissionFileDAO::fromRow() should be compatible with PKPSubmissionFileDAO::fromRow($row, $fileImplementation) in /home3/ssciberras/public_html/classes/article/SubmissionFileDAO.inc.php on line 23
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of PiwikPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home3/ssciberras/public_html/plugins/generic/piwik/PiwikPlugin.inc.php on line 155
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getSeq() should be compatible with BlockPlugin::getSeq($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getEnabled() should be compatible with BlockPlugin::getEnabled($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getContents() should be compatible with BlockPlugin::getContents($templateMgr, $request = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of PiwikPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home3/ssciberras/public_html/plugins/generic/piwik/PiwikPlugin.inc.php on line 155
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getSeq() should be compatible with BlockPlugin::getSeq($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getEnabled() should be compatible with BlockPlugin::getEnabled($contextId = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134
[29-May-2018 17:17:52 Europe/Malta] PHP Strict Standards: Declaration of CustomBlockPlugin::getContents() should be compatible with BlockPlugin::getContents($templateMgr, $request = NULL) in /home3/ssciberras/public_html/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134

stephen

I am using develper tools to go through the AJAX calls. When I click on Submissions, there are three calls to submissions:

http://mmsjournals.org/index.php/MDHG/api/v1/submissions?status=1&assignedTo=-1&searchPhrase=&count=20&offset=0&=1527607302248
Result - {“items”:[],“maxItems”:0}

http://mmsjournals.org/index.php/MDHG/api/v1/submissions?status=1&searchPhrase=&count=20&offset=0&=1527607302249
Result: XML file

http://mmsjournals.org/index.php/MDHG/api/v1/submissions?status%5B%5D=4&status%5B%5D=3&searchPhrase=&count=20&offset=0&=1527607302250
Result: XML file

This is the same whatever build i use, the original or my recompiled.

Stephen

Hi @ssciberras,

If you have PHP errors configured to go to the browser, they’ll interfere with AJAX subrequests. Make sure your errors/warnings are directed to a log, and not the browser, and that may resolve it.

Regards,
Alec Smecher
Public Knowledge Project Team

WEll, as far as I know, these PHP errors go to a log, not to the browser.

Thanks

Stephen

Hi @ssciberras,

Good, that’s as it should be – I thought maybe you were seeing PHP errors in the inspector tools, since you mentioned them.

Odd that you’re seeing XML responses to API requests. You should be seeing AJAX requests only.

Regards,
Alec Smecher
Public Knowledge Project Team

I copied and pasted the url links being sent (found them from the developer tools)

Hence, I can see that the ajax being sent is ok - it is not interpreted correctly from what I gather, when I use my recompiled (unmodified) build.js

Stephen