Some of the publishers of the journal sometimes need author client numbers so they can contact the author to notify the information about the submission process. However, in OJS this field is not available by default. It needs to make some modifications on the core ojs and theme file to achieve this
In this case, we will add phone as the additional field on the registration form.
Notice :
This step required some core ojs modification. Experienced personnel are required to finish this step. Before continuing please make sure you have backup your OJS. By taking this step make sure you repeat the same step when you have to upgrade your ojs version. This only works on OJS 3.
Here how to do it :
Add the phone number field when app execute the registration process #
1. Open this file on your OJS installation :
2. Find the function named as: readInputData() On those function you should add the new field as in this example we add new phone
3. On the same file, find the function named as: execute()
Add this line (please change based as the new custom field you have added before) :
$user->setPhone($this->getData(‘phone’));
So the code on the execute() would be :
Add the custom field on the registration form template : #
- Find the template for your registration form. If you are using default theme it can be found on :
However, if you are using our template either Academic Pro or Unify you can find the registration Form file here :
Open the file and take attention to the pointed string as we add the new code. - Add a new form field on the file, here is the code :
For OJS version 3.1.2.x
<div class="phone">
<label>
<span class="label">
<span class="label">
<span class="required">*</span>
<span class="pkp_screen_reader">{translate key="common.required"}
</span>
</span>
<input type="text" name="phone" id="phone" value="{$phone|escape}" maxlength="40" required>
</label>
</div>
For OJS version 3.3.x
<div class="form-group phone">
<label>
{translate key="user.phone"}
<span class="form-control-required">*</span>
<span class="sr-only">{translate key="common.required"}</span>
<input class="form-control" type="text" name="phone" id="phone" value="{$phone|escape}" required>
</label>
</div>
3. Test the registration with any new user data.
4. After you have succeeded the registration.
You should make sure that the new phone data is saved on the database by accessing the user profile and check whether this field is filled with phone number data.
That’s it.
Reference :