[Jifty-commit] r2295 - in jifty/branches/template-declare: . lib/Jifty lib/Jifty/Action lib/Jifty/Action/Record

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Dec 3 04:51:55 EST 2006


Author: audreyt
Date: Sun Dec  3 04:51:55 2006
New Revision: 2295

Modified:
   jifty/branches/template-declare/   (props changed)
   jifty/branches/template-declare/lib/Jifty/Action/Record.pm
   jifty/branches/template-declare/lib/Jifty/Action/Record/Search.pm
   jifty/branches/template-declare/lib/Jifty/ClassLoader.pm
   jifty/branches/template-declare/share/po/en.po
   jifty/branches/template-declare/share/po/fr.po
   jifty/branches/template-declare/share/po/ja.po
   jifty/branches/template-declare/share/po/zh_cn.po
   jifty/branches/template-declare/share/po/zh_tw.po

Log:
* Merge down into template-declare branch.

Modified: jifty/branches/template-declare/lib/Jifty/Action/Record.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Action/Record.pm	(original)
+++ jifty/branches/template-declare/lib/Jifty/Action/Record.pm	Sun Dec  3 04:51:55 2006
@@ -274,9 +274,9 @@
 
                     $collection->unlimit;
                     $collection->rows_per_page(20);
-                    $collection->limit(column => $field, value => $value, operator => 'STARTSWITH') if length($value);
-                    $collection->limit(column => $field, value => 'NULL', operator => 'IS NOT');
-                    $collection->limit(column => $field, value => '', operator => '!=');
+                    $collection->limit(column => $field, value => $value, operator => 'STARTSWITH', entry_aggregator => 'AND') if length($value);
+                    $collection->limit(column => $field, value => 'NULL', operator => 'IS NOT', entry_aggregator => 'AND');
+                    $collection->limit(column => $field, value => '', operator => '!=', entry_aggregator => 'AND');
                     $collection->columns('id', $field);
                     $collection->order_by(column => $field);
                     $collection->group_by(column => $field);

Modified: jifty/branches/template-declare/lib/Jifty/Action/Record/Search.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Action/Record/Search.pm	(original)
+++ jifty/branches/template-declare/lib/Jifty/Action/Record/Search.pm	Sun Dec  3 04:51:55 2006
@@ -36,13 +36,14 @@
 
 =item C<date>, or C<timestamp> fields
 
-Create C<field>_before and C<field>_after arguments
+Create C<field>_before, C<field>_after, C<field>_since and
+C<field>_until arguments.
 
 =item C<integer>, C<float>, C<double>, C<decimal> or C<numeric> fields
 
-Generate C<field>_lt and C<field>_gt arguments, as well as a C<field>_dwim
-field that accepts a prefixed comparison operator in the search value,
-such as C<< >100 >> and C<< !100 >>.
+Generate C<field>_lt, C<field>_gt, C<field>_le and C<field>_ge arguments, as
+well as a C<field>_dwim field that accepts a prefixed comparison operator in
+the search value, such as C<< >100 >> and C<< !100 >>.
 
 =back
 
@@ -113,11 +114,15 @@
         } elsif($type =~ /(?:date|time)/) {
             $args->{"${field}_after"} = { %$info, label => _("%1 after", $label) };
             $args->{"${field}_before"} = { %$info, label => _("%1 before", $label) };
+            $args->{"${field}_since"} = { %$info, label => _("%1 since", $label) };
+            $args->{"${field}_until"} = { %$info, label => _("%1 until", $label) };
         } elsif(    $type =~ /(?:int|float|double|decimal|numeric)/
                 && !$column->refers_to) {
             $args->{"${field}_gt"} = { %$info, label => _("%1 greater than", $label) };
             $args->{"${field}_lt"} = { %$info, label => _("%1 less than", $label) };
-            $args->{"${field}~"} = { %$info };
+            $args->{"${field}_ge"} = { %$info, label => _("%1 greater or equal to", $label) };
+            $args->{"${field}_le"} = { %$info, label => _("%1 less or equal to", $label) };
+            $args->{"${field}_dwim"} = { %$info };
         }
     }
 
@@ -176,6 +181,10 @@
                     $op = '>';
                 } elsif($op eq 'before' || $op eq 'lt') {
                     $op = '<';
+                } elsif($op eq 'since' || $op eq 'ge') {
+                    $op = '>=';
+                } elsif($op eq 'until' || $op eq 'le') {
+                    $op = '<=';
                 } elsif($op eq 'dwim') {
                     $op = '=';
                     if (defined($value) and $value =~ s/^\s*([<>!=]{1,2})\s*//) {

Modified: jifty/branches/template-declare/lib/Jifty/ClassLoader.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/ClassLoader.pm	(original)
+++ jifty/branches/template-declare/lib/Jifty/ClassLoader.pm	Sun Dec  3 04:51:55 2006
@@ -125,7 +125,7 @@
 #                . "use base qw/Jifty::Action/; sub _autogenerated { 1 };\n"
 #                . "1;" );
 #    }
-    elsif ( $module =~ m!^(?:$base)::(Record|Collection|Notification|Dispatcher|Bootstrap|Upgrade|Handle|Event|Event::Model)$! ) {
+    elsif ( $module =~ m!^(?:$base)::(Record|Collection|Notification|Dispatcher|Bootstrap|Upgrade|Handle|Event|Event::Model|Action::Record::\w+)$! ) {
         return $self->return_class(
                   "use warnings; use strict; package $module;\n"
                 . "use base qw/Jifty::$1/; sub _autogenerated { 1 };\n"
@@ -166,7 +166,7 @@
 
         return $self->return_class(
                   "use warnings; use strict; package $module;\n"
-                . "use base qw/Jifty::Action::Record::$1/;\n"
+                . "use base qw/$base\::Action::Record::$1/;\n"
                 . "sub record_class { '$modelclass' };\n"
                 . "sub autogenerated { 1 };\n"
                 . "1;" );

Modified: jifty/branches/template-declare/share/po/en.po
==============================================================================
--- jifty/branches/template-declare/share/po/en.po	(original)
+++ jifty/branches/template-declare/share/po/en.po	Sun Dec  3 04:51:55 2006
@@ -15,37 +15,47 @@
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: lib/Jifty/Action/Record/Search.pm:106
+#: lib/Jifty/Action/Record/Search.pm:115 lib/Jifty/z:26
 #. ($label)
 msgid "%1 after"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:107
+#: lib/Jifty/Action/Record/Search.pm:116 lib/Jifty/z:27
 #. ($label)
 msgid "%1 before"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:103
+#: lib/Jifty/Action/Record/Search.pm:112
 #. ($label)
 msgid "%1 contains"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:110
+#: lib/Jifty/Action/Record/Search.pm:123 lib/Jifty/z:35
+#. ($label)
+msgid "%1 greater or equal to"
+msgstr ""
+
+#: lib/Jifty/Action/Record/Search.pm:121 lib/Jifty/z:32
 #. ($label)
 msgid "%1 greater than"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:99
+#: lib/Jifty/Action/Record/Search.pm:108
 #. ($label)
 msgid "%1 is not"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:104
+#: lib/Jifty/Action/Record/Search.pm:113
 #. ($label)
 msgid "%1 lacks"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:111
+#: lib/Jifty/Action/Record/Search.pm:124 lib/Jifty/z:36
+#. ($label)
+msgid "%1 less or equal to"
+msgstr ""
+
+#: lib/Jifty/Action/Record/Search.pm:122 lib/Jifty/z:33
 #. ($label)
 msgid "%1 less than"
 msgstr ""
@@ -60,7 +70,17 @@
 msgid "%1 seconds"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:73
+#: lib/Jifty/Action/Record/Search.pm:117 lib/Jifty/z:28
+#. ($label)
+msgid "%1 since"
+msgstr ""
+
+#: lib/Jifty/Action/Record/Search.pm:118 lib/Jifty/z:29
+#. ($label)
+msgid "%1 until"
+msgstr ""
+
+#: lib/Jifty/Action/Record/Search.pm:77
 msgid "(any)"
 msgstr ""
 
@@ -84,7 +104,7 @@
 msgid "An error occurred.  Try again later"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:115
+#: lib/Jifty/Action/Record/Search.pm:129
 msgid "Any field contains"
 msgstr ""
 
@@ -180,7 +200,7 @@
 msgid "Next Page"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:116
+#: lib/Jifty/Action/Record/Search.pm:130
 msgid "No field contains"
 msgstr ""
 

Modified: jifty/branches/template-declare/share/po/fr.po
==============================================================================
--- jifty/branches/template-declare/share/po/fr.po	(original)
+++ jifty/branches/template-declare/share/po/fr.po	Sun Dec  3 04:51:55 2006
@@ -15,37 +15,47 @@
 "Content-Type: text/plain; charset=ISO8859-15\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: lib/Jifty/Action/Record/Search.pm:106
+#: lib/Jifty/Action/Record/Search.pm:115 lib/Jifty/z:26
 #. ($label)
 msgid "%1 after"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:107
+#: lib/Jifty/Action/Record/Search.pm:116 lib/Jifty/z:27
 #. ($label)
 msgid "%1 before"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:103
+#: lib/Jifty/Action/Record/Search.pm:112
 #. ($label)
 msgid "%1 contains"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:110
+#: lib/Jifty/Action/Record/Search.pm:123 lib/Jifty/z:35
+#. ($label)
+msgid "%1 greater or equal to"
+msgstr ""
+
+#: lib/Jifty/Action/Record/Search.pm:121 lib/Jifty/z:32
 #. ($label)
 msgid "%1 greater than"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:99
+#: lib/Jifty/Action/Record/Search.pm:108
 #. ($label)
 msgid "%1 is not"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:104
+#: lib/Jifty/Action/Record/Search.pm:113
 #. ($label)
 msgid "%1 lacks"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:111
+#: lib/Jifty/Action/Record/Search.pm:124 lib/Jifty/z:36
+#. ($label)
+msgid "%1 less or equal to"
+msgstr ""
+
+#: lib/Jifty/Action/Record/Search.pm:122 lib/Jifty/z:33
 #. ($label)
 msgid "%1 less than"
 msgstr ""
@@ -60,7 +70,17 @@
 msgid "%1 seconds"
 msgstr "%1 secondes"
 
-#: lib/Jifty/Action/Record/Search.pm:73
+#: lib/Jifty/Action/Record/Search.pm:117 lib/Jifty/z:28
+#. ($label)
+msgid "%1 since"
+msgstr ""
+
+#: lib/Jifty/Action/Record/Search.pm:118 lib/Jifty/z:29
+#. ($label)
+msgid "%1 until"
+msgstr ""
+
+#: lib/Jifty/Action/Record/Search.pm:77
 msgid "(any)"
 msgstr ""
 
@@ -84,7 +104,7 @@
 msgid "An error occurred.  Try again later"
 msgstr "Erreur. Ré-essayez plus tard"
 
-#: lib/Jifty/Action/Record/Search.pm:115
+#: lib/Jifty/Action/Record/Search.pm:129
 msgid "Any field contains"
 msgstr ""
 
@@ -180,7 +200,7 @@
 msgid "Next Page"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:116
+#: lib/Jifty/Action/Record/Search.pm:130
 msgid "No field contains"
 msgstr ""
 

Modified: jifty/branches/template-declare/share/po/ja.po
==============================================================================
--- jifty/branches/template-declare/share/po/ja.po	(original)
+++ jifty/branches/template-declare/share/po/ja.po	Sun Dec  3 04:51:55 2006
@@ -15,37 +15,47 @@
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: lib/Jifty/Action/Record/Search.pm:106
+#: lib/Jifty/Action/Record/Search.pm:115 lib/Jifty/z:26
 #. ($label)
 msgid "%1 after"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:107
+#: lib/Jifty/Action/Record/Search.pm:116 lib/Jifty/z:27
 #. ($label)
 msgid "%1 before"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:103
+#: lib/Jifty/Action/Record/Search.pm:112
 #. ($label)
 msgid "%1 contains"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:110
+#: lib/Jifty/Action/Record/Search.pm:123 lib/Jifty/z:35
+#. ($label)
+msgid "%1 greater or equal to"
+msgstr ""
+
+#: lib/Jifty/Action/Record/Search.pm:121 lib/Jifty/z:32
 #. ($label)
 msgid "%1 greater than"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:99
+#: lib/Jifty/Action/Record/Search.pm:108
 #. ($label)
 msgid "%1 is not"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:104
+#: lib/Jifty/Action/Record/Search.pm:113
 #. ($label)
 msgid "%1 lacks"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:111
+#: lib/Jifty/Action/Record/Search.pm:124 lib/Jifty/z:36
+#. ($label)
+msgid "%1 less or equal to"
+msgstr ""
+
+#: lib/Jifty/Action/Record/Search.pm:122 lib/Jifty/z:33
 #. ($label)
 msgid "%1 less than"
 msgstr ""
@@ -60,7 +70,17 @@
 msgid "%1 seconds"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:73
+#: lib/Jifty/Action/Record/Search.pm:117 lib/Jifty/z:28
+#. ($label)
+msgid "%1 since"
+msgstr ""
+
+#: lib/Jifty/Action/Record/Search.pm:118 lib/Jifty/z:29
+#. ($label)
+msgid "%1 until"
+msgstr ""
+
+#: lib/Jifty/Action/Record/Search.pm:77
 msgid "(any)"
 msgstr ""
 
@@ -84,7 +104,7 @@
 msgid "An error occurred.  Try again later"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:115
+#: lib/Jifty/Action/Record/Search.pm:129
 msgid "Any field contains"
 msgstr ""
 
@@ -180,7 +200,7 @@
 msgid "Next Page"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:116
+#: lib/Jifty/Action/Record/Search.pm:130
 msgid "No field contains"
 msgstr ""
 

Modified: jifty/branches/template-declare/share/po/zh_cn.po
==============================================================================
--- jifty/branches/template-declare/share/po/zh_cn.po	(original)
+++ jifty/branches/template-declare/share/po/zh_cn.po	Sun Dec  3 04:51:55 2006
@@ -14,37 +14,47 @@
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: lib/Jifty/Action/Record/Search.pm:106
+#: lib/Jifty/Action/Record/Search.pm:115 lib/Jifty/z:26
 #. ($label)
 msgid "%1 after"
 msgstr "%1 晚于"
 
-#: lib/Jifty/Action/Record/Search.pm:107
+#: lib/Jifty/Action/Record/Search.pm:116 lib/Jifty/z:27
 #. ($label)
 msgid "%1 before"
 msgstr "%1 早于"
 
-#: lib/Jifty/Action/Record/Search.pm:103
+#: lib/Jifty/Action/Record/Search.pm:112
 #. ($label)
 msgid "%1 contains"
 msgstr "%1 包含"
 
-#: lib/Jifty/Action/Record/Search.pm:110
+#: lib/Jifty/Action/Record/Search.pm:123 lib/Jifty/z:35
+#. ($label)
+msgid "%1 greater or equal to"
+msgstr "%1 至少为"
+
+#: lib/Jifty/Action/Record/Search.pm:121 lib/Jifty/z:32
 #. ($label)
 msgid "%1 greater than"
 msgstr "%1 大于"
 
-#: lib/Jifty/Action/Record/Search.pm:99
+#: lib/Jifty/Action/Record/Search.pm:108
 #. ($label)
 msgid "%1 is not"
 msgstr "%1 不等于"
 
-#: lib/Jifty/Action/Record/Search.pm:104
+#: lib/Jifty/Action/Record/Search.pm:113
 #. ($label)
 msgid "%1 lacks"
 msgstr "%1 不包含"
 
-#: lib/Jifty/Action/Record/Search.pm:111
+#: lib/Jifty/Action/Record/Search.pm:124 lib/Jifty/z:36
+#. ($label)
+msgid "%1 less or equal to"
+msgstr "%1 至多为"
+
+#: lib/Jifty/Action/Record/Search.pm:122 lib/Jifty/z:33
 #. ($label)
 msgid "%1 less than"
 msgstr "%1 小于"
@@ -59,7 +69,17 @@
 msgid "%1 seconds"
 msgstr "%1 秒"
 
-#: lib/Jifty/Action/Record/Search.pm:73
+#: lib/Jifty/Action/Record/Search.pm:117 lib/Jifty/z:28
+#. ($label)
+msgid "%1 since"
+msgstr "%1 自"
+
+#: lib/Jifty/Action/Record/Search.pm:118 lib/Jifty/z:29
+#. ($label)
+msgid "%1 until"
+msgstr "%1 至"
+
+#: lib/Jifty/Action/Record/Search.pm:77
 msgid "(any)"
 msgstr "(不限)"
 
@@ -83,7 +103,7 @@
 msgid "An error occurred.  Try again later"
 msgstr "系统无法执行此项操作, 请稍后再试"
 
-#: lib/Jifty/Action/Record/Search.pm:115
+#: lib/Jifty/Action/Record/Search.pm:129
 msgid "Any field contains"
 msgstr "任意字段包含"
 
@@ -183,7 +203,7 @@
 msgid "Next Page"
 msgstr "下一页"
 
-#: lib/Jifty/Action/Record/Search.pm:116
+#: lib/Jifty/Action/Record/Search.pm:130
 msgid "No field contains"
 msgstr "没有字段包含"
 

Modified: jifty/branches/template-declare/share/po/zh_tw.po
==============================================================================
--- jifty/branches/template-declare/share/po/zh_tw.po	(original)
+++ jifty/branches/template-declare/share/po/zh_tw.po	Sun Dec  3 04:51:55 2006
@@ -14,37 +14,47 @@
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: lib/Jifty/Action/Record/Search.pm:106
+#: lib/Jifty/Action/Record/Search.pm:115 lib/Jifty/z:26
 #. ($label)
 msgid "%1 after"
 msgstr "%1 晚於"
 
-#: lib/Jifty/Action/Record/Search.pm:107
+#: lib/Jifty/Action/Record/Search.pm:116 lib/Jifty/z:27
 #. ($label)
 msgid "%1 before"
 msgstr "%1 æ—©æ–¼"
 
-#: lib/Jifty/Action/Record/Search.pm:103
+#: lib/Jifty/Action/Record/Search.pm:112
 #. ($label)
 msgid "%1 contains"
 msgstr "%1 包含"
 
-#: lib/Jifty/Action/Record/Search.pm:110
+#: lib/Jifty/Action/Record/Search.pm:123 lib/Jifty/z:35
+#. ($label)
+msgid "%1 greater or equal to"
+msgstr "%1 至少為"
+
+#: lib/Jifty/Action/Record/Search.pm:121 lib/Jifty/z:32
 #. ($label)
 msgid "%1 greater than"
 msgstr "%1 大於"
 
-#: lib/Jifty/Action/Record/Search.pm:99
+#: lib/Jifty/Action/Record/Search.pm:108
 #. ($label)
 msgid "%1 is not"
 msgstr "%1 不等於"
 
-#: lib/Jifty/Action/Record/Search.pm:104
+#: lib/Jifty/Action/Record/Search.pm:113
 #. ($label)
 msgid "%1 lacks"
 msgstr "%1 不包含"
 
-#: lib/Jifty/Action/Record/Search.pm:111
+#: lib/Jifty/Action/Record/Search.pm:124 lib/Jifty/z:36
+#. ($label)
+msgid "%1 less or equal to"
+msgstr "%1 至多為"
+
+#: lib/Jifty/Action/Record/Search.pm:122 lib/Jifty/z:33
 #. ($label)
 msgid "%1 less than"
 msgstr "%1 小於"
@@ -59,7 +69,17 @@
 msgid "%1 seconds"
 msgstr "%1 秒"
 
-#: lib/Jifty/Action/Record/Search.pm:73
+#: lib/Jifty/Action/Record/Search.pm:117 lib/Jifty/z:28
+#. ($label)
+msgid "%1 since"
+msgstr "%1 自"
+
+#: lib/Jifty/Action/Record/Search.pm:118 lib/Jifty/z:29
+#. ($label)
+msgid "%1 until"
+msgstr "%1 至"
+
+#: lib/Jifty/Action/Record/Search.pm:77
 msgid "(any)"
 msgstr "(不限)"
 
@@ -83,7 +103,7 @@
 msgid "An error occurred.  Try again later"
 msgstr "系統無法執行此項操作, 請稍後再試"
 
-#: lib/Jifty/Action/Record/Search.pm:115
+#: lib/Jifty/Action/Record/Search.pm:129
 msgid "Any field contains"
 msgstr "任意欄位包含"
 
@@ -183,7 +203,7 @@
 msgid "Next Page"
 msgstr "下一頁"
 
-#: lib/Jifty/Action/Record/Search.pm:116
+#: lib/Jifty/Action/Record/Search.pm:130
 msgid "No field contains"
 msgstr "沒有欄位包含"
 


More information about the Jifty-commit mailing list