Cas' Community

Andere Informatie

Query for Mantis

Started by administrator, 22 Apr 2024, 13:51:27

Previous topic - Next topic


This plugin will enable you to define multiple queries/scripts which:

can be run online (by admin)
can be scheduled in which case results are emailed to nominated recipients
Installation As any other plugin, place the Query directory in your plugins directory. After installing it within Mantis, click on the module to finaliuze the settings.

Samples The distribution comes with 5 samples. Please use the sql found in doc\plugin_Query_samples.txt to load them using a tool like phpmyadmin.

scripts In case the report requirements go beyond a straight forward sql query, you can also insert a script to the query engine. Your script should return the value that should be downloaded and contain no PHP tags. A very simple script would look like: $to_download = "Hello world"; $to_download .= "\r\n"; $to_download .= "Greetings, Cas"; return $to_download;

When adding the code to the system it will not try to trap any parsing errors so you should ensure that it does generate the required output. Finally there is the option to add a script which handles everything itself, so no emailing is done by the system.

Mailing It uses a direct mail function hence smtp host needs to be set correctly in php.ini

Scheduling Scheduling has 2 parts. Within the plugin a set of jobs can be defined which should run as a type of batch job. For each job the following can be defined :

Select query definition to be used
Optionally add an additional filter for type Q/S
Define recipients (mantis usernames and/or normal email addresses separated by comma)
Define frequency There are 4 frequencies available:
Every day
Weekdays only (Monday till Friday)
Weekly (Mondays)
Monthly (First day of the month)
Finally one job needs to be scheduled on your server to run daily, shortly after midnight. This needs to be set up by your admin using either CRON or Windows Scheduled tasks. In order to run in batch mode, one needs to schedule the following job:

exec_schedule.php (http://localhost/m1210/plugins/Query/pages/exec_schedule.php)


This plugin has had a big overhaul, go for the latest version (2.18) here:

Powered by EzPortal