Please describe the issue you're having
If you accept the answer, please mark the topic as [SOLVED] by clicking the tick.

Moderators: RussH, cptr13

Forum rules: Just please remember to play nicely once you walk through the door. You can disagree with us, or any other commenters in this forum, but respect our space and keep your comments directed to the topic at hand.
#1258
Hello,

I'm currently setting up OpenCATS 0.9.1 for a company but I've run into a problem. You see, they want to have an online application which I can do but the problem is the extra fields they need. Basically, I will add applicants with a form to SQL PHP script but, I found out, the extra fields are not only stored in a separate database but they don't go by name but by applicant ID which is created after the person is entered. So, I need a way to add custom fields into the default Candidate fields. My PHP sucks but I can read and recreate it fairly well so I tried modifying the Candidates.php file to include a custom field but it didn't work. What can I do to add a custom field to the Candidate area? I've adding the field to the SQL already and here is a cutting of what I added.

* @param string 12 Years English Education.

$yearseducation

$this->_db->makeQueryString($yearseducation),

years_education = %s,

candidate.years_education AS yearseducation,

'12 Years English Education' => array('select' => 'candidate.years_education AS yearseducation',
'sortableColumn' => 'yearseducation',
'pagerWidth' => 50,
'filter' => 'candidate.years_education'),
#1259
Answering my own question:

You need to edit five documents and the SQL database in order to add custom fields to and areas. Those documents are: C
ATSroot/lib/Candidate.php
CATSroot/modules/candidates/CandidatesUI.php
CATSroot/modules/candidates/Add.tpl
CATSroot/modules/candidates/Edit.tpl
CATSroot/modules/candidates/Show.tpl

The php files are there for database interaction so you need to add fields for every custom field you want to add in every section. I found putting tags wherever the "notes" tag was helpful. You do not need to add them to the search fields or anything like that. You can copy certain fields to make the work faster (I added 100 extra fields just fine).

The .tpl files are basically the layout of the pages. Show is the summary page, Edit is the edit page and Add is the add page. If you do not add the fields to Edit.tpl you can erase data you have entered via an outside form. I found it useful to modify the Show page to have different sections or "bars" just before the tables so it is easier to parse through the information rather than having it all just there.

You can even add collapsing tables via divs and javascript. The javascript files go in CATSroot/js/ folder and you need to edit the CATSroot/lib/TemplateUtility.php to add the js file to the header. You can expand it by clicking the title using the following javascript and tags.

js file:
function togDisplay(id){
var style = document.getElementById(id).style;
style.display= (style.display=="block")
? "none":"block";
}

Tags:
<p style="cursor:pointer;cursor:hand;" onClick="togDisplay('emergencycontact')" class="note">Emergency Contact Information</p>
<div id="emerg" style="display:none;">
<table class="detailsOutside" width="925">
<tr style="vertical-align:top;">
<td width="390" height="100%">
<table class="detailsInside" height="100%">
<tr>
<td class="vertical">Name:</td>
<td class="data"><?php $this->_($this->data['name']); ?></td>
</tr>...etc
</table> <--(detailsOutside) </div>

Here is a picture with what I've added with the large section that is the application form hidden.



tag.
CATS.jpg
CATS.jpg (108.75 KiB) Viewed 10795 times

This is the &quot;import from resume&quot;[…]

EMAIL CONFIGURATION

Hi, the email configuration (including different[…]

as the title says...

It's essential to keep these synchronized to ensur[…]