BREAKING NEWS

Rabu, 29 April 2026

Cara menambahkan kontak telepon saat registrasi penulis atau author pada OJS

Sebagai pengelola jurnal, kontak telepon diperlukan untuk berkoordinasi dengan penulis/author, karena seringkali komunikasi melalui email berjalan dengan tidak efektif, karena respon yang lambat.

Sebagai author, seringkali tidak melengkapi data profil seperti kontak telepon, dan lain sebagainya. Untuk itu kita perlu menjadikan field kontak telepon sebagai data yang wajib diisi saat registrasi user/author baru.

Caranya bagaimana, ternyata OJS dapat melakukan hal itu dengan sedikit perubahan pada source code, ikuti langkah-langkahnya sebagai berikut:

1. Ubah file RegistrationForm.inc.php

Lokasi path berada di:

\ojs\lib\pkp\classes\user\form\RegistrationForm.inc.php
cari function readInputData, tambahkan 'phone', sehingga menjadi:
        $this->readUserVars(array(
            'username',
            'password',
            'password2',
            'givenName',
            'familyName',
            'affiliation',
            'email',
            'country',
            'interests',
            'emailConsent',
            'privacyConsent',
            'readerGroup',
            'reviewerGroup',
            'phone',
        ));

cari $user->setGivenName($this->getData('givenName'), $currentLocale);
tambahkan $user->setPhone($this->getData('phone')); /* nambahin phone */ di bagian bawah, sehingga menjadi seperti ini:

        // Set the base user fields (name, etc.)
        $user->setGivenName($this->getData('givenName'), $currentLocale);
        $user->setFamilyName($this->getData('familyName'), $currentLocale);
        $user->setEmail($this->getData('email'));
        $user->setCountry($this->getData('country'));
        $user->setAffiliation($this->getData('affiliation'), $currentLocale);
        $user->setPhone($this->getData('phone')); /* nambahin phone */

2. Ubah file registrationForm.tpl


File ini biasanya ada di folder template OJS yang digunakan, pada contoh saya ini,
template yang digunakan adalah novelty by Open journal Theme.

Pathnya sebagai berikut:

\ojs\plugins\generic\ojtPlugin\modules\novelty\templates\frontend\components\registrationForm.tpl

untuk template default dan template lain, bisa menyesuaikan.

copy script berikut ini di bawah div class form-group country

        <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. Lakukan Clear Cache

Supaya perubahan bisa dilihat, di OJS perlu untuk mereset cache, baik itu data cache dan template cache.

4. Uji coba Form Registrasi

Pastikan formulir registrasi kini telah muncul kolom input field phone, lakukan input, dan lihat pada data profil, pastikan data telepon telah berhasil tersimpan ke dalam database.

Formulir registrasi



 
Copyright © 2014 Persada Blog

Powered by Mafsyah