-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 1 filter partly (And a commit log from a previous commit): * bin/coup: fix error 'bad fd number' that sometimes appeared * docbook/literals.ent: Quickbooks entity &QBOOKS; * refs/compatible_5_2: mark obsolete * refs/date_change.filter: small improvement in example and layout
- Loading branch information
Showing
6 changed files
with
238 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
__NAME__ purpose | ||
convert Interchange ACL string to a Perl hash representation | ||
__END__ | ||
|
||
|
||
__NAME__ see also | ||
acl, hash2acl | ||
__END__ | ||
|
||
|
||
__NAME__ description | ||
The filter is specific to the ACL widget and | ||
probably should not be used otherwise. | ||
</para><para> | ||
The filter doesn't need to be selected for the widget to | ||
operate in the &tag-table-editor;. | ||
__END__ | ||
|
||
|
||
__NAME__ online: Filter example | ||
<programlisting> | ||
</programlisting> | ||
__END__ | ||
|
||
__NAME__ missing | ||
Better description | ||
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
__NAME__ purpose | ||
convert MMDDYYYY date (possibly with specified time) to YYYYMMDDhhmm, with NULL for missing dates | ||
__END__ | ||
|
||
|
||
__NAME__ see also | ||
date2time | ||
__END__ | ||
|
||
|
||
__NAME__ description | ||
The filter replaces date specification in form of | ||
</para><para> | ||
<literal><replaceable>MM</replaceable>[/-]<replaceable>DD</replaceable>[/-]<replaceable>YY(YY)?</replaceable>(:<replaceable>hh</replaceable>(<replaceable>mm</replaceable>)?)?</literal> | ||
</para><para> | ||
or | ||
</para><para> | ||
<literal><replaceable>YYYY</replaceable>[/-]<replaceable>MM</replaceable>[/-]<replaceable>DD</replaceable>(:<replaceable>hh</replaceable>(<replaceable>mm</replaceable>)?)?</literal> | ||
</para><para> | ||
to | ||
</para><para> | ||
<literal><replaceable>YYYYMMDD</replaceable>((<replaceable>hh</replaceable>)?(<replaceable>mm</replaceable>)?)?</literal>. | ||
</para><para> | ||
If the year specification contains 2 digits only and is less than | ||
<literal>50</literal>, as is say, <literal>02</literal>, | ||
then it is treated as an offset from year <literal>2000</literal>, and not | ||
<literal>1900</literal>. In other words, <literal>05</literal> is understood | ||
as year <literal>2005</literal>, <literal>80</literal> is understood as year | ||
<literal>1980</literal>. | ||
</para><para> | ||
Time specification unspecified in input get omitted from output as well. | ||
</para><para> | ||
This filter is similar to &filter-date-change;, but is meant for use with | ||
databases such as &PGSQL; that do not accept | ||
invalid dates (the '0000-00-00' used in the &filter-date_change;), but | ||
require <literal>NULL</literal> to indicate absence of a date. | ||
__END__ | ||
|
||
|
||
__NAME__ notes | ||
For more information on &PERL; Regular Expressions, pattern matching and | ||
character classes, see | ||
<citerefentry><refentrytitle>perlre</refentrytitle><manvolnum>1</manvolnum></citerefentry>. | ||
</para><para> | ||
The filter is most commonly used with date selection fields. | ||
</para><para> | ||
If only two out of four time digits are specified, then due to the operation | ||
of the <function>sprintf()</function> function, they tend to indicate minutes | ||
and not hours! | ||
</para><para> | ||
When the input data starts with year specification, the year must have | ||
4-digit format (i.e. <literal>2005</literal> and | ||
<emphasis role='bold'>not</emphasis> just <literal>05</literal>)! | ||
__END__ | ||
|
||
__NAME__ online: Using date_change_null | ||
<programlisting><![CDATA[ | ||
[filter date_change_null]2005-01-01[/filter] <br/> | ||
[filter date_change_null]2005/01/01[/filter] <br/> | ||
<br/> | ||
[filter date_change_null]2005-01-01:10[/filter] <br/> | ||
[filter date_change_null]2005/05/29:1536[/filter] <br/> | ||
<br/> | ||
[filter date_change_null]05-29-2005:1536[/filter] <br/> | ||
[filter date_change_null]05-29-05:1536[/filter] <br/> | ||
<br/> | ||
[filter date_change_null]0000-00-00[/filter] <br/> | ||
[filter date_change_null][/filter] <br/> | ||
]]></programlisting> | ||
__END__ | ||
|
||
__NAME__ missing | ||
Example from real date widget (use widget "date_blank", filter "date_change_null", and optionally set the default value to "0000-00-00" ) | ||
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
__NAME__ purpose | ||
convert Interchange ACL hash to string representation | ||
__END__ | ||
|
||
|
||
__NAME__ see also | ||
acl, acl2hash | ||
__END__ | ||
|
||
|
||
__NAME__ description | ||
The filter is specific to the ACL widget and | ||
probably should not be used otherwise. | ||
</para><para> | ||
The filter doesn't need to be selected for the widget to | ||
operate in the &tag-table-editor;. | ||
__END__ | ||
|
||
|
||
__NAME__ online: Filter example | ||
<programlisting> | ||
</programlisting> | ||
__END__ | ||
|
||
__NAME__ missing | ||
Better description | ||
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
__NAME__ purpose | ||
perform lookup in another database | ||
__END__ | ||
|
||
|
||
__NAME__ see also | ||
__END__ | ||
|
||
|
||
__NAME__ description | ||
The filter performs a lookup in another database. | ||
</para><para> | ||
See <xref linkend='lookup_examples'/> for clarification. | ||
__END__ | ||
|
||
|
||
__NAME__ example: Filter example | ||
Suppose we have two databases, <database>products</database> and | ||
<database>support</database>, as follows: | ||
<screen> | ||
code price description | ||
144 12 Item 144 | ||
145 84 Item 145 | ||
146 314 Item 146 | ||
</screen> | ||
and | ||
<screen> | ||
code product_supported | ||
144 0 | ||
145 1 | ||
146 -1 | ||
</screen> | ||
</para><para> | ||
Then, performing | ||
<code>[filter lookup.support.product_supported]144[/filter]</code> would | ||
yield <literal>0</literal>. | ||
__END__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
__NAME__ purpose | ||
perform lookup in another database | ||
__END__ | ||
|
||
|
||
__NAME__ see also | ||
__END__ | ||
|
||
|
||
__NAME__ description | ||
__END__ | ||
|
||
|
||
__NAME__ example: Filter example | ||
__END__ | ||
|
||
|
||
* Add new filter, "next_sequential". Allows selection of a next-sequential | ||
value based on a field (and qualified by a field). | ||
|
||
[filter op=3D"next_sequential.survey_q.sort"][cgi sort][/filter] | ||
|
||
will: | ||
|
||
1. Return the existing value if present. | ||
2. If existing value is blank, return max + 1 in the sort field, | ||
i.e. equivalent to: | ||
|
||
SELECT sort FROM survey_q | ||
ORDER BY sort DESC | ||
LIMIT 1 | ||
|
||
If another argument of a field name is passed, i.e. | ||
|
||
filter =3D> 'next_sequential.survey_q.sort.sel', | ||
|
||
then you get: | ||
|
||
SELECT sort FROM survey_q | ||
WHERE sel =3D '[cgi sel]' | ||
ORDER BY sort DESC | ||
LIMIT 1 | ||
|
||
This allows a next-sequential numbering for things that need it. | ||
|
||
Developed to support general-purpose survey UI for Ton's excellent | ||
product rating system. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
__NAME__ purpose | ||
make input safe for QuickBooks by removing unfriendly characters | ||
__END__ | ||
|
||
|
||
__NAME__ see also | ||
__END__ | ||
|
||
|
||
__NAME__ description | ||
The filter makes data safe for &QBOOKS;, because | ||
QB will crash at the drop of a hat. | ||
__END__ | ||
|
||
|
||
__NAME__ example: Filter example | ||
&filter-qb_safe; the input and limit it to 25 characters. | ||
<programlisting> | ||
[filter op="qb_safe 25" interpolate=1][ol-param sku][/filter] | ||
</programlisting> | ||
__END__ | ||
|