OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Adding an existing field to Director's "unassigned" tab

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

Adding an existing field to Director's "unassigned" tab

Postby r2d2 » Tue Oct 20, 2009 2:16 pm

Hi Alec,

I have been trying add an existing field (affiliation) to the UNASSIGNED tab of the director's page. The idea is that the chair wants to see user afiliations beforehand. I have figured out to make appropriate changes in the following files:

/templates/director/submissionsInReview.tpl

/classes/paper/paper.inc.php

/classes/paper/paperDAO.inc.php

Is there any other file(s) I need to edit? The affiliation data is correctly displayed if I manually enter data in to the 'affiliate' column in the table 'papers' (I have added that column already). However, the 'affiliate' column does not draw data from the original 'affiliate' column in the 'users' table. Any help or direction will be appreciated.

Regards,
Jason
r2d2
 
Posts: 32
Joined: Fri Aug 28, 2009 1:36 pm

Re: Adding an existing field to Director's "unassigned" tab

Postby r2d2 » Sat Oct 24, 2009 7:08 pm

Any help or direction on this?

Regards,

Jason
r2d2
 
Posts: 32
Joined: Fri Aug 28, 2009 1:36 pm

Re: Adding an existing field to Director's "unassigned" tab

Postby mcrider » Mon Oct 26, 2009 10:55 am

Hi Jason,

The director's unassigned papers page is populated by the getDirectorSubmissionsUnassigned function in classes/director/submission/DirectorSubmissionDAO.inc.php, not PaperDAO. Also, the template that displays that page is templates/director/submissionsUnassigned.tpl. You should be able to do this without needing to modify anything but the template file; The Submission class that populates the page has a function called 'getAuthors()', which you can iterate through and call $author->getAffiliation() on to get the affiliation. So in the submissionsUnassigned.tpl file, within the {iterate from=submissions item=submission} block, you would add a {foreach from=$submission->getAuthors() item=$author} and within that block, call $author->getAffiliation(). You'd also have to wrap that call in a table column and also add a heading to the table (in the HTML above the {iterate} block.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: Adding an existing field to Director's "unassigned" tab

Postby r2d2 » Fri Oct 30, 2009 1:13 pm

Hi Matt,

Thank you for your reply. I tried what you have recommended, but got a fatal Smarty error:

Fatal error: Smarty error: [in director/submissionsUnassigned.tpl line 37]: syntax error: 'foreach: item' must be a variable name (literal string) (Smarty_Compiler.class.php, line 1165) in C:\...\lib\smarty\Smarty.class.php on line 1095

Below is the piece of code I inserted in \templates\director\submissionsUnassigned.tpl (those between the last <td></td>):

Code: Select all
{iterate from=submissions item=submission}
  <tr valign="top">
    <td>{$submission->getPaperId()}</td>
    <td>{$submission->getDateSubmitted()|date_format:$dateFormatTrunc}</td>
    <td>{$submission->getTrackAbbrev()|escape}</td>
    <td>{$submission->getPresenterString(true)|truncate:40:"..."|escape}</td>
    <td><a href="{url op="submission" path=$submission->getPaperId()}" class="action">{$submission->getPaperTitle()|strip_unsafe_html|truncate:60:"..."}</a></td>
    <td>
      {foreach from=$submission->getAuthors() item=$author}
        $author->getAffiliation()
      {/foreach}
    </td>
  </tr>


Jason
r2d2
 
Posts: 32
Joined: Fri Aug 28, 2009 1:36 pm

Re: Adding an existing field to Director's "unassigned" tab

Postby mcrider » Fri Oct 30, 2009 4:33 pm

Hi Jason,

Take a look at templates/submission/metadata/metadata.tpl for an example that iterates through the submission authors. In particular, you have to make sure that any variables/php code you call in a template are wrapped in {} brackets. In the metadata template, it uses
Code: Select all
{$author->getAffiliation()|escape|nl2br|default:"&mdash;"}
...which should work for you.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: Adding an existing field to Director's "unassigned" tab

Postby r2d2 » Sat Oct 31, 2009 8:06 am

Hi Matt,

Thanks for your patience with me :-)

I have changed the code as you suggested as follows:

Code: Select all
<td>
 {foreach from=$submission->getAuthors() item=author}
    {$author->getAffiliation()|escape|nl2br|default:"&mdash;"}
 {/foreach}
</td>


Now, I receive the following error:

Fatal error: Call to undefined function: getauthors() in C:\...\cache\t_compile\%%95^95F^95FFC06A%%submissionsInReview.tpl.php on line 62

Any suggestion?

Jason
r2d2
 
Posts: 32
Joined: Fri Aug 28, 2009 1:36 pm

Re: Adding an existing field to Director's "unassigned" tab

Postby mcrider » Sat Oct 31, 2009 2:14 pm

Hi Jason,

Oops, i forgot you were using OCS. Try changing getAuthors to getPresenters.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: Adding an existing field to Director's "unassigned" tab

Postby r2d2 » Sun Nov 01, 2009 7:02 am

Thanks, Matt. It works now like a charm.

Jason
r2d2
 
Posts: 32
Joined: Fri Aug 28, 2009 1:36 pm


Return to OCS Technical Support

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests