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
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

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: 10015
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: No registered users and 2 guests