Adding a Case Tab

From PikaDocs

In this example, we are adding a case tab named "fhip".

Adding a new case tab to the Pika CMS requires the creation of several files. The first of which is the template file that the user sees on the screen (case_fhip.html) and the second which creates all of the non-standard menus and handles data formatting (case-fhip.php). All data operations are handled automatically by the Pika update_case.php file and do not require any alteration to function.

case_fhip.html – subtemplates/

(See attached case_fhip.html)

The case_fhip.html file contains html formatting and template variables that will be filled in by the Pika templating function as input fields. For example:

%%[protected_class1,protected_class]%% - creates a dropdown box containing the value of protected_class1 (from the cases table in the database) and the menu values from the menu table protected_class (menu_protected_class). It will appear on the form as a single selection dropdown box with the labels stored in the menu_protected_class table as its items and stores the value associtated with each when the case is saved.

<input type="text" name='date_refer' value='%%[date_refer]%%' tabindex="1"> - Creates an input box linked to the database field date_refer.

Once you have completed formatting the fields in the arraingment that you would like them to appear in the Cases screen save the completed html file in the subtemplates directory.

case-fhip.php – modules/

(See attached case-fhip.php)

This is the file that is called when a user selects the case tab from the case screen. This file creates any special menus that need to appear on the case tab (Such as the staff menu). It can also be used to re-format or change data prior to display (such as unmogrifying dates). Once all of the special menus and fields are properly formatted it calls the template function and builds the case_fhip.html file (changing the template values into valid HTML for display.

Enabling the tab

To enable the new case tab you must go to the Menus and Special Tables system screen in Pika and add the line fhip | FHIP/HUD then save. This tells Pika to load all the necessary files for the tab by giving it the suffix of the files to load. In this case the 'fhip' prior to the pipe “|” character corresponds to the case-fhip.php file and the text following “|” is the label that will appear on the tab in the case screen. So, for example, if you were creating a case tab named xyz you would create case_xyz.html under subtemplates, case-xyz.php under modules, and add the line “xyz | XYZ's label” in the Menus and Special Tables system screen in Pika.