OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Pass checkbox values to database

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

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

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 OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

Pass checkbox values to database

Postby Rames » Tue Apr 22, 2008 10:45 am

I'd like to implement a checkbox in the article submission process that will allow the submitting author to pass information to the database, so that editors can view checked items in the editing phase. Specifically, the author is indicating whether or not they want to participate in an optional open discussion forum on our journal (I'd rather do this by implementing a new checkbox than with comments to the editor). I have successfully added metadata from a form text area (see post #p10689 in this forum), but could use some pointers as to how to pass checkbox values to the db. I took a look at the checkbox on step 5 of the submission process, but it didn't seem like this was passing information to the database.

Cheers,

rames
ojs v2.2, php v5.2.4
Rames
 
Posts: 13
Joined: Mon Mar 24, 2008 1:02 pm

Re: Pass checkbox values to database

Postby jmacgreg » Tue Apr 22, 2008 4:28 pm

Hi Rames,

I've moved this to the Development forum, as it's not so much a support question. I'll also be passing it on to the developers to see if they have any advice.

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

Re: Pass checkbox values to database

Postby smiri » Tue Apr 22, 2008 10:14 pm

Hi Rames,

As Alec mentioned in the post below, those are the files you need to change.
http://pkp.sfu.ca/support/forum/viewtopic.php?f=9&t=3034&p=10689#p9820

And for example, in this file: classes/submission/form/MetadataForm.inc.php

You will need to add a field in readInputData() function to read what the user entered. Then in the execute() function, you can use something like the line below to access the read data and set it using the articleDAO functions:
$article->setAbstract($this->getData('abstract'), null);

Of course you would also have to add a function in Article class file and the DAO file to get and set the new field.

I hope this can get you started.

Regards,
smiri
 
Posts: 183
Joined: Thu Sep 06, 2007 7:01 pm


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest