[Rt-commit] rt branch, lcore, updated. a1f3d5495f3f040dfb14455c3978be8f45429ab3

clkao at bestpractical.com clkao at bestpractical.com
Thu Sep 3 14:18:39 EDT 2009


The branch, lcore has been updated
       via  a1f3d5495f3f040dfb14455c3978be8f45429ab3 (commit)
       via  b318dd8690754e735243f852951fc1cee252813e (commit)
       via  89f42aff429fcf2c025ae0cf10f9c8f2b3851529 (commit)
       via  7705494f0d4865b98c4e58592a643ee226d18929 (commit)
       via  780c5cd12a9a2e69f84a42b67551141fdba5c190 (commit)
       via  81ada69c303f7904d4af5ceea3af2fa436802f66 (commit)
       via  deab3227df6675204591c803d78df95a02df43ef (commit)
       via  f83a8c26d092f8031de63096d3b7b9e9cdd53828 (commit)
       via  32f6e51a9882eeea38c6bbc1c75b14e84c2dac86 (commit)
       via  0f42214a328599addad20c344134e3786ab85b5d (commit)
       via  c1a70f9d564d09bcdf2705b815b4d45f90c922be (commit)
       via  b2fa3bb74bde1708e153c834244a7e6ff14a2e35 (commit)
      from  552fb034effa07ab34afc7150f814c2be3c985b0 (commit)

Summary of changes:
 Makefile.PL                      |    6 +++
 lib/RT.pm                        |   80 ++++++++++++++++----------------------
 lib/RT/Bootstrap.pm              |    3 -
 lib/RT/Dispatcher.pm             |    4 --
 lib/RT/Report/Tickets.pm         |    5 ++-
 lib/RT/Shredder.pm               |    1 +
 lib/RT/Test.pm                   |    1 -
 lib/RT/View/CRUD.pm              |    2 -
 lib/RT/View/RuleBuilder.pm       |   17 ++++++++
 share/html/Search/Chart          |    4 +-
 share/html/Search/Elements/Chart |    4 +-
 11 files changed, 66 insertions(+), 61 deletions(-)

- Log -----------------------------------------------------------------
commit b318dd8690754e735243f852951fc1cee252813e
Merge: 552fb03 89f42af
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Fri Sep 4 02:17:16 2009 +0800

    Merge branch 'master' into lcore
    
    Conflicts:
    	lib/RT.pm

diff --cc lib/RT.pm
index 26eb3b4,a38d548..4b8c8e5
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@@ -115,11 -115,12 +114,13 @@@ sub init 
      #Get a database connection
      init_plugin_paths();
  
-     init_system_objects();
+     $System = RT::System->new();
+ 
      init_plugins();
 +    require RT::Lorzy;
      # enable approval subsystem
      require RT::Approval;
+ 
  }
  
  # Signal handlers
@@@ -439,6 -410,22 +410,23 @@@ sub start 
      #XXX TODO RT pages don't play well with Halo right now
      no warnings 'redefine';
      *Jifty::Plugin::Halo::is_proscribed = sub { 1 };
+     RT::init();
+ 
+     Jifty->web->add_javascript(
+         qw( titlebox-state.js util.js ahah.js fckeditor.js list.js class.js
 -        combobox.js  cascaded.js )
++            jquery.createdomnodes.js combobox.js  cascaded.js rulebuilder.js
++      )
+     );
+ 
+     Jifty::Web->add_trigger(
+         name      => 'after_include_javascript',
+         callback  => sub {
+             my $webpath = RT->config->get('web_path') || '/';
+             Jifty->web->out(
+                 qq{<script type="text/javascript">RT = {};RT.WebPath = '$webpath';</script>}
+             );
+         },
+     );
  }
  
  1;

commit a1f3d5495f3f040dfb14455c3978be8f45429ab3
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Fri Sep 4 02:18:26 2009 +0800

    function json serialization

diff --git a/lib/RT/View/RuleBuilder.pm b/lib/RT/View/RuleBuilder.pm
index d00fb7f..ed613ed 100644
--- a/lib/RT/View/RuleBuilder.pm
+++ b/lib/RT/View/RuleBuilder.pm
@@ -3,10 +3,27 @@ use strict;
 
 package RT::View::RuleBuilder;
 use Jifty::View::Declare -base;
+use JSON;
+
+sub _type_as_string {
+    my ($type) = @_;
+    return $type ? $type->name : undef;
+}
+
+sub _function_as_hash {
+    my ($func) = @_;
+    return { return_type => _type_as_string($func->return_type),
+             parameters => [ map { { name => $_->name, type => _type_as_string($_->type) } } @{ $func->parameters || [] } ] };
+}
 
 template 'index.html' => page {
     title => "rule",
 } content {
+    my $l = $RT::Lorzy::LCORE;
+    my $functions = $l->env->all_functions;
+    my $data = { map { $_ => _function_as_hash($functions->{$_}) } keys %$functions };
+    pre { to_json($data) };
+
     h1 { "Rule Builder"};
     # given transaction :: RT::Model::Transaction
     #       ticket :: RT::Model::Ticket

-----------------------------------------------------------------------


More information about the Rt-commit mailing list