For basic information on plugins, please refer: Infocapture plugins
In this section we would write a plugin which checks start date is always less than end date
You can find the xml file of the test project here:
Lets suppose we have got this test project with ID = 15
For this purpose, we would require the following file... plugin_15_pre_add_issue.php
<?php function hd_plugin_15_pre_add_issue($params) { $values = $params["issue"]["fields_values"]; if ($values['start_date'] >= $values['end_date']) { return array("error_message" => "Start date must be before the end date"); } } ?>
Place the above file in folder: /httpdocs/intranet/helpdesk/plugins/
If you enter start date greater than end date, you would get following error message and you wont be able to submit the issue