Check whether start date is less than end date

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/

From Claromentis 5.6 onwards, plugins are stored in /httpdocs/intranet/infocapture/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