OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



New custom review form element

OCS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, michael

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page. While these are OJS-specific, the OCS codebase is similar enough to OJS they should be of help. There is also an [url=http://pkp.sfu.ca/ocs_documentation[/url]OCS Documentation[/url] page with some more general documentation that might also be of interest.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a technical support question, try the OCS Technical Support subforum.

New custom review form element

Postby wbt » Fri Nov 13, 2009 10:56 am

Hi,

I like the custom review form feature, but when using it there is apparently not a way for a reviewer to give confidential information to a director. I have added a new type of textarea which is not included when peer reviews are imported in the e-mail sent to the authors. I added
Code: Select all
define('REVIEW_FORM_ELEMENT_TYPE_TEXTAREA_NO_AUTHOR', 0x000007); 

and
Code: Select all
REVIEW_FORM_ELEMENT_TYPE_TEXTAREA_NO_AUTHOR => 'manager.reviewFormElements.textareanoauthor', 

to classes/reviewForm/ReviewFormElement.inc.php;
Code: Select all
<message key="manager.reviewFormElements.textareanoauthor">Extended text box not visible to authors</message>

to locale/en_US/locale.xml;
I changed
Code: Select all
{elseif $reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_TEXTAREA} 

to
Code: Select all
{elseif $reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_TEXTAREA or $reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_TEXTAREA_NO_AUTHOR} 

in templates/submission/reviewForm/reviewFormResponse.tpl, templates/manager/reviewForms/previewReviewForm.tpl and templates/trackDirector/previewReviewForm.tpl; and most importantly, I added
Code: Select all
if ($reviewFormElement->getElementType() != REVIEW_FORM_ELEMENT_TYPE_TEXTAREA_NO_AUTHOR) {
...
}
 

around the code in the foreach ($reviewFormElements as $reviewFormElement) construct in classes/submission/trackDirector/TrackDirectorAction.inc.php.

I hope this helps anyone andd perhaps it can be included in an upcoming release.

Wouter
wbt
 
Posts: 14
Joined: Thu Nov 12, 2009 1:25 pm

Re: New custom review form element

Postby jmacgreg » Tue Nov 17, 2009 12:07 pm

Hi Wouter,

That's a great addition! Would you be willing to post your changes as a unified diff, either here or preferably in our Bugzilla database as a feature request? I can't say that it'll make it into 2.3, but possibly in the next release.

Cheers,
James
jmacgreg
 
Posts: 4162
Joined: Tue Feb 14, 2006 10:50 am

Re: New custom review form element

Postby wbt » Thu Nov 19, 2009 11:43 am

Hi James,

I did one better and added an extra setting for review form elements so that you can indicate for all types of elements whether they should be included in the message to authors. I posted a feature request on Bugzilla as bug #4888 and added the patch in unified diff format. I hope this is useful to others.

Cheers,
Wouter
wbt
 
Posts: 14
Joined: Thu Nov 12, 2009 1:25 pm

Re: New custom review form element

Postby lixh » Wed Jan 13, 2010 7:02 pm

Dear Sir,

I like this setting very much, but when I patching this to our OJS 2.3.1 system, I got:

patch -p0 < not_included.diff
patching file classes/manager/form/ReviewFormElementForm.inc.php
Hunk #1 succeeded at 81 (offset 1 line).
Hunk #2 succeeded at 93 (offset 1 line).
Hunk #3 succeeded at 114 (offset 1 line).
patching file classes/reviewForm/ReviewFormElement.inc.php
patching file classes/reviewForm/ReviewFormElementDAO.inc.php
can't find file to patch at input line 109
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: dbscripts/xml/ocs_schema.xml
|===================================================================
|--- dbscripts/xml/ocs_schema.xml 2009-11-19 16:43:00.000000000 +0100
|+++ dbscripts/xml/ocs_schema.xml 2009-11-19 16:43:04.000000000 +0100
--------------------------
File to patch: ojs_schema.xml
ojs_schema.xml: No such file or directory
Skip this patch? [y] n
File to patch: dbscripts/xml/ojs_schema.xml
patching file dbscripts/xml/ojs_schema.xml
patching file locale/en_US/locale.xml
Hunk #1 FAILED at 59.
1 out of 1 hunk FAILED -- saving rejects to file locale/en_US/locale.xml.rej

patching file templates/manager/reviewForms/reviewFormElementForm.tpl
Hunk #1 succeeded at 62 (offset 2 lines).
can't find file to patch at input line 151
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: classes/submission/trackDirector/TrackDirectorAction.inc.php
|===================================================================
|--- classes/submission/trackDirector/TrackDirectorAction.inc.php 2009-11-20 11:46:25.000000000 +0100
|+++ classes/submission/trackDirector/TrackDirectorAction.inc.php 2009-11-19 22:50:18.000000000 +0100
--------------------------
File to patch: classes/submission/sectionEditor/SectionEditorAction.inc.php
patching file classes/submission/sectionEditor/SectionEditorAction.inc.php
Hunk #1 FAILED at 1485.
Hunk #2 FAILED at 1504.
2 out of 2 hunks FAILED -- saving rejects to file classes/submission/sectionEditor/SectionEditorAction.inc.php.rej


============================
for "locale.xml", I using manager.xml to instead,
after L133:
I added "<message key="manager.reviewFormElements.notIncluded">Not included in message to author</message>"
for "classes/submission/trackDirector/TrackDirectorAction.inc.php" I use "classes/submission/sectionEditor/SectionEditorAction.inc.php" instead,
after L1981: I added "if (!$reviewFormElement->getIncluded()) {"
after L2000:, I added a "}"
--------------------------

After doing this, I goto our journal, and after I choose to "CREATE NEW ITEM", there two selection at bottom of the item box:
Reviewers required to complete item
Not included in message to author
But if I select "Not included in message to author" and save the item, I got
"DB Error: Unknown column 'included' in 'field list'"

Would you please tell me what's wrong with this?

Thank you in advance!
Sincerely,
Xianghua
lixh
 
Posts: 33
Joined: Fri Nov 28, 2008 1:03 am

Re: New custom review form element

Postby lixh » Wed Jan 13, 2010 7:59 pm

OK, I resolve this, I added a field "included" at our Database, and it works!
Please let me know if there are better ways to resolve this!

Xianghua
lixh
 
Posts: 33
Joined: Fri Nov 28, 2008 1:03 am

Re: New custom review form element

Postby otitay » Sat Mar 06, 2010 7:25 am

lixh wrote:OK, I resolve this, I added a field "included" at our Database, and it works!


Dear Xianghua,

I am using OJS 2.2.4.0 and tried to implement the changes as mentioned above. I am getting the same DB error as yours, could you please send the details of how you added "included" field at the database. I thought adding
Code: Select all
<field name="included" type="I1" />
to ojs_schema.xml would be enough.

Thanks in advance, -otitay
otitay
 
Posts: 1
Joined: Sat Mar 06, 2010 7:19 am

Re: New custom review form element

Postby lixh » Tue May 18, 2010 6:22 pm

Dear otitay,

In fact, I added the field "included" using PhpMyAdmin.

Sincerely,
Xianghua
lixh
 
Posts: 33
Joined: Fri Nov 28, 2008 1:03 am


Return to OCS Development

Who is online

Users browsing this forum: No registered users and 1 guest