http://www.freeside.biz/mediawiki/index.php?title=Freeside:1.9:Documentation:Developer/FS/part_event/Condition&feed=atom&action=history
Freeside:1.9:Documentation:Developer/FS/part event/Condition - Revision history
2024-03-28T08:43:59Z
Revision history for this page on the wiki
MediaWiki 1.27.7
http://www.freeside.biz/mediawiki/index.php?title=Freeside:1.9:Documentation:Developer/FS/part_event/Condition&diff=4487&oldid=prev
Ivan: Edit via perl MediaWiki framework (1.13)
2009-02-07T01:16:53Z
<p>Edit via perl MediaWiki framework (1.13)</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 01:16, 7 February 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l94" >Line 94:</td>
<td colspan="2" class="diff-lineno">Line 94:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:Returns the label for the specified option name.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:Returns the label for the specified option name.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">; option_age_from OPTION FROM_TIMESTAMP</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">:Retreives a condition option, parses it from a frequency (such as "1d", "1w" or "12m"), and subtracts that interval from the supplied timestamp. It is primarily intended for use in '''condition'''.</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; condition_sql_option OPTION</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; condition_sql_option OPTION</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:This is a class method that returns an SQL fragment for retreiving a condition option. It is primarily intended for use in '''condition_sql'''.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:This is a class method that returns an SQL fragment for retreiving a condition option. It is primarily intended for use in '''condition_sql'''.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l117" >Line 117:</td>
<td colspan="2" class="diff-lineno">Line 119:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; Around line 254&#58;</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; Around line 254&#58;</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:'=item' outside of any '=over'</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:'=item' outside of any '=over'</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>; Around line <del class="diffchange diffchange-inline">402</del>&#58;</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>; Around line <ins class="diffchange diffchange-inline">436</ins>&#58;</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:You forgot a '=back' before '=head1'</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:You forgot a '=back' before '=head1'</div></td></tr>
</table>
Ivan
http://www.freeside.biz/mediawiki/index.php?title=Freeside:1.9:Documentation:Developer/FS/part_event/Condition&diff=3559&oldid=prev
Ivan: import from POD
2008-02-19T02:18:54Z
<p>import from POD</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 02:18, 19 February 2008</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l71" >Line 71:</td>
<td colspan="2" class="diff-lineno">Line 71:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:This method is used for optimizing event queries. You may want to add indices for any columns referenced. It is acceptable to return an SQL fragment which partially tests the condition; doing so will still reduce the number of records which much be returned and tested with the '''condition''' method.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:This method is used for optimizing event queries. You may want to add indices for any columns referenced. It is acceptable to return an SQL fragment which partially tests the condition; doing so will still reduce the number of records which much be returned and tested with the '''condition''' method.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">; disabled</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">:Condition classes may optionally define a disabled method. Returning a true value disbles the condition entirely.</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; implicit_flag</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>; implicit_flag</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:This is used internally by the ''once'' and ''balance'' conditions. You probably do '''not''' want to define this method for new custom conditions, unless you're sure you want '''every''' new action to start with your condition.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:This is used internally by the ''once'' and ''balance'' conditions. You probably do '''not''' want to define this method for new custom conditions, unless you're sure you want '''every''' new action to start with your condition.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l92" >Line 92:</td>
<td colspan="2" class="diff-lineno">Line 94:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:Returns the label for the specified option name.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:Returns the label for the specified option name.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>; condition_sql_option</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>; condition_sql_option <ins class="diffchange diffchange-inline">OPTION</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:This is a class method that returns an SQL fragment for retreiving a condition option. It is primarily intended for use in '''condition_sql'''.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:This is a class method that returns an SQL fragment for retreiving a condition option. It is primarily intended for use in '''condition_sql'''.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">; condition_sql_option_age_from OPTION FROM_TIMESTAMP</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">:This is a class method that returns an SQL fragment that will retreive a condition option, parse it from a frequency (such as "1d", "1w" or "12m"), and subtract that interval from the supplied timestamp. It is primarily intended for use in '''condition_sql'''.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">; condition_sql_option_age OPTION</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">:This is a class method that returns an SQL fragment for retreiving a condition option, and additionaly parsing it from a frequency (such as "1d", "1w" or "12m") into an approximate number of seconds.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">:Note that since months vary in length, the results of this method should '''not''' be used in computations (use condition_sql_option_age_from for that). They are useful for for ordering and comparison to other ages.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">:This method is primarily intended for use in '''order_sql'''.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">; age2seconds_sql</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">:Class method returns an SQL fragment for parsing an arbitrary frequeny (such as "1d", "1w", "12m", "2y" or "12h") into an approximate number of seconds.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">:Approximate meaning: months are considered to be 30 days, years to be 365.25 days. Otherwise the numbers of seconds returned is exact.</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==NEW CONDITION CLASSES==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==NEW CONDITION CLASSES==</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l101" >Line 101:</td>
<td colspan="2" class="diff-lineno">Line 115:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Hey! '''The above document had some coding errors, which are explained below:'''</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Hey! '''The above document had some coding errors, which are explained below:'''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>; Around line <del class="diffchange diffchange-inline">241</del>&#58;</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>; Around line <ins class="diffchange diffchange-inline">254</ins>&#58;</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:'=item' outside of any '=over'</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:'=item' outside of any '=over'</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>; Around line <del class="diffchange diffchange-inline">260</del>&#58;</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>; Around line <ins class="diffchange diffchange-inline">402</ins>&#58;</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:You forgot a '=back' before '=head1'</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>:You forgot a '=back' before '=head1'</div></td></tr>
</table>
Ivan
http://www.freeside.biz/mediawiki/index.php?title=Freeside:1.9:Documentation:Developer/FS/part_event/Condition&diff=2714&oldid=prev
Ivan: import from POD
2007-10-04T00:27:52Z
<p>import from POD</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 00:27, 4 October 2007</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l96" >Line 96:</td>
<td colspan="2" class="diff-lineno">Line 96:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==NEW CONDITION CLASSES==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==NEW CONDITION CLASSES==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>A module should be added in FS/FS/part_event/Condition/ which implements the methods desribed above in [[<del class="diffchange diffchange-inline">Freeside:1.9:Documentation:Developer/#METHODS|"METHODS"|</del>#METHODS|"METHODS"]]. An example may be found in the eg/part_event-Condition-template.pm file.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>A module should be added in FS/FS/part_event/Condition/ which implements the methods desribed above in [[#METHODS|"METHODS"]]. An example may be found in the eg/part_event-Condition-template.pm file.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==POD ERRORS==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==POD ERRORS==</div></td></tr>
</table>
Ivan
http://www.freeside.biz/mediawiki/index.php?title=Freeside:1.9:Documentation:Developer/FS/part_event/Condition&diff=2585&oldid=prev
Ivan: import from POD
2007-10-03T23:52:27Z
<p>import from POD</p>
<p><b>New page</b></p><div>==NAME==<br />
FS::part_event::Condition - Base class for event conditions<br />
<br />
==SYNOPSIS==<br />
package FS::part_event::Condition::mycondition;<br />
<br />
use base FS::part_event::Condition;<br />
<br />
==DESCRIPTION==<br />
FS::part_event::Condition is a base class for event conditions classes.<br />
<br />
==METHODS==<br />
These methods are implemented in each condition class.<br />
<br />
; description<br />
:Condition classes must define a description method. This method should return a scalar description of the condition.<br />
; eventtable_hashref<br />
:Condition classes must define an eventtable_hashref method if they can only be tested against some kinds of tables. This method should return a hash reference of eventtables (values set true indicate the condition can be tested):<br />
<code><br />
sub eventtable_hashref {<br />
{ 'cust_main' => 1,<br />
'cust_bill' => 1,<br />
'cust_pkg' => 0,<br />
'cust_pay_batch' => 0,<br />
};<br />
}<br />
</code><br />
; option_fields<br />
:Condition classes may define an option_fields method to indicate that they accept one or more options.<br />
<br />
:This method should return a list of option names and option descriptions. Each option description can be a scalar description, for simple options, or a hashref with the following values:<br />
:; label - Description:; type - Currently text, money, checkbox, checkbox-multiple, select, select-agent, select-pkg_class, select-part_referral, select-table, fixed, hidden, (others can be implemented as httemplate/elements/tr-TYPE.html mason components). Defaults to text.:; options - For checkbox-multiple and select, a list reference of available option values.:; option_labels - For checkbox-multiple (and select?), a hash reference of availble option values and labels.:; value - for checkbox, fixed, hidden (also a default for text, money, more?):; table - for select-table:; name_col - for select-table:; NOTE&#58; See httemplate/elements/select-table.html for a full list of the optinal options for the select-table type<br />
:NOTE: A database connection is '''not''' yet available when this subroutine is executed.<br />
<br />
:Example:<br />
<code><br />
sub option_fields {<br />
(<br />
'field' => 'description',<br />
<br />
'another_field' => { 'label'=>'Amount', 'type'=>'money', },<br />
<br />
'third_field' => { 'label' => 'Types',<br />
'type' => 'checkbox-multiple',<br />
'options' => [ 'h', 's' ],<br />
'option_labels' => { 'h' => 'Happy',<br />
's' => 'Sad',<br />
},<br />
);<br />
}<br />
</code><br />
; condition CUSTOMER_EVENT_OBJECT<br />
:Condition classes must define a condition method. This method is evaluated to determine if the condition has been met. The object which triggered the event (an FS::cust_main, FS::cust_bill or FS::cust_pkg object) is passed as the first argument. Additional arguments are list of key-value pairs.<br />
<br />
:To retreive option values, call the option method on the desired option, i.e.:<br />
<code><br />
my( $self, $cust_object, %opts ) = @_;<br />
$value_of_field = $self->option('field');<br />
</code><br />
<br />
:Available additional arguments:<br />
<code><br />
$time = $opt{'time'}; #use this instead of time or $^T<br />
<br />
$cust_event = $opt{'cust_event'}; #to retreive the cust_event object being tested<br />
</code><br />
<br />
:Return a true value if the condition has been met, and a false value if it has not.<br />
; condition_sql EVENTTABLE<br />
:Condition classes may optionally define a condition_sql method. This '''class''' method should return an SQL fragment that tests for this condition. The fragment is evaluated and a true value of this expression indicates that the condition has been met. The event table (cust_main, cust_bill or cust_pkg) is passed as an argument.<br />
<br />
:This method is used for optimizing event queries. You may want to add indices for any columns referenced. It is acceptable to return an SQL fragment which partially tests the condition; doing so will still reduce the number of records which much be returned and tested with the '''condition''' method.<br />
; implicit_flag<br />
:This is used internally by the ''once'' and ''balance'' conditions. You probably do '''not''' want to define this method for new custom conditions, unless you're sure you want '''every''' new action to start with your condition.<br />
<br />
:Condition classes may define an implicit_flag method that returns true to indicate that all new events should start with this condition. (Currently, condition classes which do so should be applicable to all kinds of ''eventtable''s.) The numeric value of the flag also defines the ordering of implicit conditions.<br />
; remove_warning<br />
:Again, used internally by the ''once'' and ''balance'' conditions; probably not a good idea for new custom conditions.<br />
<br />
:Condition classes may define a remove_warning method containing a string warning message to enable a confirmation dialog triggered when the condition is removed from an event.<br />
; order_sql<br />
:This is used internally by the ''balance_age'' and ''cust_bill_age'' conditions to declare ordering; probably not of general use for new custom conditions.<br />
; order_sql_weight<br />
:In conjunction with order_sql, this defines which order the ordering fragments supplied by different '''order_sql''' should be used.<br />
<br />
==BASE METHODS==<br />
These methods are defined in the base class for use in condition classes.<br />
<br />
; cust_main CUST_OBJECT<br />
:Return the customer object (see [[Freeside:1.9:Documentation:Developer/FS/cust main|FS::cust_main]]) associated with the provided object (the object itself if it is already a customer object).<br />
; option_label OPTIONNAME<br />
:Returns the label for the specified option name.<br />
<br />
; condition_sql_option<br />
:This is a class method that returns an SQL fragment for retreiving a condition option. It is primarily intended for use in '''condition_sql'''.<br />
<br />
==NEW CONDITION CLASSES==<br />
A module should be added in FS/FS/part_event/Condition/ which implements the methods desribed above in [[Freeside:1.9:Documentation:Developer/#METHODS|"METHODS"|#METHODS|"METHODS"]]. An example may be found in the eg/part_event-Condition-template.pm file.<br />
<br />
==POD ERRORS==<br />
Hey! '''The above document had some coding errors, which are explained below:'''<br />
<br />
; Around line 241&#58;<br />
:'=item' outside of any '=over'<br />
; Around line 260&#58;<br />
:You forgot a '=back' before '=head1'</div>
Ivan