OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Add new fields to Journal Setup

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.

Add new fields to Journal Setup

Postby cristianviza » Tue Jun 18, 2013 1:38 pm

Hello everybody.
I want add a new fields to Journal Setup. Imagen Example: http://postimg.org/image/er02gzrs7/

I read this article http://pkp.sfu.ca/support/forum/viewtopic.php?f=9&t=6941 , and I think is the same, but I don't Know name of the file that I need to modify.

which files would I have to modify to add the field ?

Thanks . regards Cristian
cristianviza
 
Posts: 75
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: Add new fields to Journal Setup

Postby asmecher » Wed Jun 19, 2013 3:29 pm

Hi Cristian,

To add fields to journal setup step 1, you'll need to modify:
  • templates/manager/setup/step1.tpl (the template file)
  • classes/manager/form/setup/JournalSetupStep1Form.inc.php (the form class)
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9214
Joined: Wed Aug 10, 2005 12:56 pm

Re: Add new fields to Journal Setup

Postby cristianviza » Tue Jun 25, 2013 12:23 pm

Hi asmecher, I modify templates/manager/setup/step1.tpl (the template file) : https://docs.google.com/document/d/1d55P1UsFWC1k0DiTNLwr15upX-k5yTxWs7HCJ3lfGqM/edit?usp=sharing
classes/manager/form/setup/JournalSetupStep1Form.inc.php (the form class) https://docs.google.com/document/d/1fhdVhuxlJln4mwhgecZk8_vjKog-UA-nDz11mzcalSs/edit?usp=sharing

also modify /var/www/ojs/locale/es_ES/manager.xml

I see new field and save http://postimg.org/image/ik45nfhnb/ ,but I press F5 or I leave the page and go back inside I appear empty fields. I think the problem is I don't set variable $formLocale

Code: Select all
<tr valign="top">
      <td width="20%"
      class="label">{fieldLabel name="facultad" required="true" key="manager.setup.journalFacultad"}
      </td>
      
      <td width="80%"
      class="value"><input type="text" name="facultad[{$formLocale|escape}]"
      id="facultad" value="{$facultad[$formLocale]|escape}"
      size="40" maxlength="120" class="textField" />
      </td>
   </tr>


regards Cristian
cristianviza
 
Posts: 75
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: Add new fields to Journal Setup

Postby cristianviza » Tue Jun 25, 2013 2:42 pm

cristianviza wrote:Hi asmecher, I modify templates/manager/setup/step1.tpl (the template file) : https://docs.google.com/document/d/1d55P1UsFWC1k0DiTNLwr15upX-k5yTxWs7HCJ3lfGqM/edit?usp=sharing
classes/manager/form/setup/JournalSetupStep1Form.inc.php (the form class) https://docs.google.com/document/d/1fhdVhuxlJln4mwhgecZk8_vjKog-UA-nDz11mzcalSs/edit?usp=sharing

also modify /var/www/ojs/locale/es_ES/manager.xml

I see new field and save http://postimg.org/image/ik45nfhnb/ ,but I press F5 or I leave the page and go back inside I appear empty fields. I think the problem is I don't set variable $formLocale

Code: Select all
<tr valign="top">
      <td width="20%"
      class="label">{fieldLabel name="facultad" required="true" key="manager.setup.journalFacultad"}
      </td>
      
      <td width="80%"
      class="value"><input type="text" name="facultad[{$formLocale|escape}]"
      id="facultad" value="{$facultad[$formLocale]|escape}"
      size="40" maxlength="120" class="textField" />
      </td>
   </tr>


regards Cristian


I solve the problem . Thanks very much
cristianviza
 
Posts: 75
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: Add new fields to Journal Setup

Postby cristianviza » Fri Jun 28, 2013 12:00 pm

Hello everybody
How are you? The next step I want to do in my development with the two fields to add is to make a list of my publications separating them by faculty (facultad).
for example. Type of faculty:
- FICH
- FBBC
- FBC
- ...

My question is, I don't know how obtained this field value "facultad", then after compare this value.
{assign var="typeFaculta" value=$journal->getLocalizedSetting('facultad')}
Code: Select all
{iterate from=journals item=journal}

{assign var="typeFaculta" value=$journal->getLocalizedSetting('facultad')} <!--// is correct put facultad???-->

{assign var="displayHomePageImage" value=$journal->getLocalizedSetting('homepageImage')}
{assign var="displayHomePageLogo" value=$journal->getLocalizedPageHeaderLogo(true)}
{assign var="displayPageHeaderLogo" value=$journal->getLocalizedPageHeaderLogo()}

{if $typeFaculta == "FICH" }  <!-- ?????? -->

<div style="width:170px; height:160px;"> <img width="100" src="{$journalFilesPath}{$journal->getId()}/{$displayHomePageLogo.uploadName|escape:"url"}" {if $altText != ''}alt="{$altText|escape}"{else}alt="{translate key="common.pageHeaderLogo.altText"}"{/if} class="imgborderlist" title="Punto Info 10ª Edición"> <a href="{url journal=$journal->getPath() page="issue" op="current"}"
    class="action">{$journal->getLocalizedTitle()|escape}</a>

    </div>   
   
{/if}
 
 {/iterate}





Regards Cristian
cristianviza
 
Posts: 75
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina


Return to OJS Development

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron