<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>BugIn' Developer Docco</title>
</head>
<body>
<ol>
<li>
<h2><a href="#basics">Basics</a></h2>
<ol type="I">
<li><a href="#dir_struct">Directory Structure</a></li>
</ol>
</li>
<li>
<h2><a href="#Subsystems">Subsystems</a></h2>
<ol type="I">
<li><a href="#auth">Authentication</a></li>
<li><a href="#ACL">Access Control Lists</a></li>
<li><a href="#Triggers">Triggers</a><br>
</li>
</ol>
</li>
</ol>
<br>
<hr>
<h1><a name="basics">1. The Basics</a></h1>
Basic information text goes here<br>
<br>
<br>
<h2><a name="dir_struct">I. Directory Structure</a></h2>
Directory Information Goes Here<br>
<br>
<hr>
<h1><a name="subsystems">2. Subsystems</a><br>
</h1>
Subsystems of BugIn' are documented here<br>
<h2><a name="auth">I. Authentication</a></h2>
Authentication information here<br>
<h2><a name="ACL">II. Access Control Lists</a></h2>
Access Control Lists documented here....<br>
<h2><a name="Triggers"></a>III. Triggers</h2>
Triggers are rules that define "things that happen in the system". Here's
the list of goals that inspired this (feel free to contribute other ideas):<br>
<ol>
<li>Alerting when a ticket has been idle for an amount of time (project
based).</li>
<li>Give the user the ability to make a ticket change status at a given
time.</li>
<li>Alert to a particular person if a ticket in a given project has it's
priority changed.<br>
</li>
</ol>
They are composed of several tables, containing information about the triggers,
noted here:<br>
<br>
<ul>
<li><b>trigger</b>: This table defines the base trigger. It has
the following cells:<br>
<ol>
<li><font color="#000099"><b>id</b>: The trigger ID</font></li>
<li><font color="#000099"><b>type</b>: the type, 'p' for 'project',
or 't' for 'ticket'</font></li>
<li><font color="#000099"><b>typeid</b>: the ID for the type. This
is the ID of the ticket or project. If the type is 'p' and the typeid is '0',
then it affects all projects (or all tickets, if you will.)</font></li>
<li><font color="#000099"><b>flags</b>: the trigger contains the following
flags (BIT flags):</font><br>
<ol type="i">
<li><font color="#006600"><b>TRIGGER_FLAG_DISABLED</b>: The trigger
is disabled if this flag is set, otherwise it is enabled.</font></li>
<li><font color="#006600"><b>TRIGGER_FLAG_MATCH_ANY</b>: Match
any rule in the rule list, otherwise all rules must match</font></li>
<li><font color="#006600"><b>TRIGGER_FLAG_ADD</b>:
Check trigger rule on ADD</font></li>
<li><font color="#006600"><b>TRIGGER_FLAG_MODIFY</b>: Check trigger
rule on MODIFY</font></li>
<li><font color="#006600"><b>TRIGGER_FLAG_TIME</b>: Check trigger
on scheduler.</font><br>
</li>
</ol>
</li>
</ol>
</li>
<li><b>trigger_rule</b>: this defines the rules of the trigger, and contains
the following cells:<br>
<ol>
<li><font color="#000099"><b>id</b>: The unique ID of the rule</font></li>
<li><font color="#000099"><b>tid</b>: The trigger ID (for multiple
rules)</font></li>
<li><font color="#000099"><b>type</b>: This defines the rule type
(these are exclusive in a single rule set (non-bit-flags)):</font><br>
<ol type="i">
<li><font color="#006600"><b>TRIGGER_RULE_AFTER_TIME</b>: Run
after X <u>[trigger_rule/<b>value</b>]</u> UNIX time X)</font></li>
<li><font color="#006600"><b>TRIGGER_RULE_AFTER_UNMODIFIED</b>:
Run after a ticket has not been modified for X amount of <u>[<font
color="#006600">trigger_rule/<b>value</b></font></u></font><u>]</u>.</li>
<li><font color="#006600"><b>TRIGGER_RULE_FIELD_CHANGE</b>: Run
if <u>[trigger_rule/<b>value]</b></u> is modified. (Only available on </font><font
color="#006600"><b>TRIGGER_FLAG_MODIFY</b>)</font></li>
<li><font color="#006600"><b>TRIGGER_RULE_FIELD_CHANGED_TO</b>:
Run if <u>[<font color="#006600">trigger_rule/<b>value</b></font></u></font><font
color="#006600"><u>]</u> is changed to <u>[</u></font><u><font
color="#006600"><font color="#006600">trigger_rule/<b>fid</b></font></font><font
color="#006600">]</font></u><font color="#006600"> (Only available on </font><font
color="#006600"><b>TRIGGER_FLAG_MODIFY</b>)</font></li>
<li><font color="#006600"><b>TRIGGER_RULE_IS_NOT_CLOSED</b>: Run
if ticket is not closed.</font><br>
</li>
</ol>
</li>
<li><b><font color="#000099">value</font></b><font
color="#000099">:</font><br>
<ol type="i">
<li><font color="#000099">If <b>TRIGGER_RULE_RUNAT</b>: this is
the UNIX time to run at.</font></li>
<li><font color="#000099">else If <b>TRIGGER_RULE_RUNAT_UNMODIFIED</b>:
Run after a ticket has been unmodified for X minutes ( if <b>( ((</b><u>[trigger_rule/<b>value</b>]</u>
x 60) + modTime()) >= time()) )</font></li>
<li><font color="#000099">If <b>TRIGGER_RULE_FIELD_CHANGE</b> is
set, run if this field is changed. (e.g. 'project', 'category', etc)</font></li>
<li><font color="#000099">If </font><font color="#000099"><b>TRIGGER_RULE_FIELD_CHANGED_TO</b></font>
<font color="#000099">is set, and <b>value</b> is set to <b>fid</b></font></li>
</ol>
</li>
<li><font color="#000099"><b>fid</b>: Field ID, only used on <b>TRIGGER_RULE_FIELD_CHANGED_TO</b>
(e.g project id, uid, etc)</font><br>
</li>
</ol>
</li>
<li><b>trigger_affect</b>: this defines the affect of the rule. For
example, changing status, notifying, etc. it contains the following
cells:<br>
<ol>
<li><font color="#000099"><b>id</b>: The unique ID of the rule</font></li>
<li><font color="#000099"><b>tid</b>: The trigger ID (for multiple
actions)</font></li>
<li><font color="#000099"><b>type</b>: This defines the type of action
as follows:</font><br>
<ol type="i">
<li><font color="#006600"><b>TRIGGER_ACTION_NOTFY</b>: Run notification
on ticket. (inclusive of project, creator, and owner)</font></li>
<li><font color="#006600"><b>TRIGGER_ACTION_NOTFY_PROJECT</b>:
Run notification on ticket (project e-mail).</font></li>
<li><font color="#006600"><b>TRIGGER_ACTION_NOTFY_CREATOR</b>:
Run notification on ticket (creator e-mail).</font></li>
<li><font color="#006600"><b>TRIGGER_ACTION_NOTFY_OWNER</b>: Run
notification on ticket (owner e-mail).</font></li>
<li><font color="#006600"><b>TRIGGER_ACTION_NOTFY_OTHER</b>: Run
notification and send to <u>[trigger_affect/<b>value</b>]</u>.</font></li>
<li><font color="#006600"><b>TRIGGER_ACTION_UPDATE_FIELD</b>:
Update information in the ticket <u>[trigger_affect/<b>field</b>]</u> to
<u>[triger_affect/<b>fid</b>]</u>.</font></li>
<li><font color="#006600"><b>TRIGGER_ACTION_DISABLE_TRIGGER</b>:
Disable the trigger after run.<br>
</font></li>
</ol>
</li>
<li><font color="#000099"><b>value</b>: if <b>TRIGGER_ACTION_UPDATE_FIELD</b>,<b>
</b>set <u>[trigger_affect/<b>value</b>]</u> to <u>[trigger_affect/<b>fid]</b></u></font></li>
<li><font color="#000099"><b>fid</b>: id to change <u>[trigger_affect/<b>field</b><b>]</b></u>
to (project id, etc)<br>
</font></li>
</ol>
</li>
</ul>
<br>
<br>
</body>
</html>