[freeside-commits] branch FREESIDE_4_BRANCH updated. 7b081112d1036437511db1227055eb1f82ebbb31

Mitch Jackson mitch at freeside.biz
Sun Mar 31 10:06:25 PDT 2019


The branch, FREESIDE_4_BRANCH has been updated
       via  7b081112d1036437511db1227055eb1f82ebbb31 (commit)
       via  52360059f2b525024d9c3e5cfd205004d00ad328 (commit)
      from  d07e9fcfefbf7cb0f1513004caadf91b3227d540 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7b081112d1036437511db1227055eb1f82ebbb31
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Sun Mar 31 12:47:29 2019 -0400

    RT# 81692 Update use of deprecated widgets in RT

diff --git a/rt/docs/design_docs/string-extraction-guide.txt b/rt/docs/design_docs/string-extraction-guide.txt
index 757a27014..5c77aa8af 100644
--- a/rt/docs/design_docs/string-extraction-guide.txt
+++ b/rt/docs/design_docs/string-extraction-guide.txt
@@ -63,9 +63,9 @@ that this will genereate code which will not work in RT 2.1.3. I need
 to add a bit of framework to make it work in 2.1.4
 
 
-The string	<& /Elements/TitleBoxStart, width=> "40%", titleright => "RT $RT::VERSION for ". RT->Config->Get('rtname'), title => 'Login' &>
+The string	<& /Widgets/TitleBoxStart, width=> "40%", titleright => "RT $RT::VERSION for ". RT->Config->Get('rtname'), title => 'Login' &>
 
-should become 	<& /Elements/TitleBoxStart, 
+should become 	<& /Widgets/TitleBoxStart, 
 			width=> "40%",
 			titleright => loc("RT [_1] for [_2]",$RT::VERSION, RT->Config->Get('rtname')),
 			title => loc('Login'),
diff --git a/rt/share/html/RTx/Statistics/CallsMultiQueue/index.html b/rt/share/html/RTx/Statistics/CallsMultiQueue/index.html
index 512d62d26..17eeb5e1d 100755
--- a/rt/share/html/RTx/Statistics/CallsMultiQueue/index.html
+++ b/rt/share/html/RTx/Statistics/CallsMultiQueue/index.html
@@ -21,7 +21,7 @@ The line chart below shows the same information in a graphical form.
 %	  Statistics::FormatDate($Statistics::PerDayDateFormat, $dates[0]) . " through " .
 %	  Statistics::FormatDate($Statistics::PerDayDateFormat, $dates[$#dates-1]);
 
-<& /Elements/TitleBoxStart, title => $title, title_href => $RT::WebPath."/RTx/Statistics/OpenStalled/index.html?$QueryString"&>
+<& /Widgets/TitleBoxStart, title => $title, title_href => $RT::WebPath."/RTx/Statistics/OpenStalled/index.html?$QueryString"&>
 <TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH="100%">
 % if ($ShowHeader) {
 <& /RTx/Statistics/Elements/CollectionAsTable/Header, 
@@ -97,7 +97,7 @@ The line chart below shows the same information in a graphical form.
 <&  /RTx/Statistics/Elements/CollectionAsTable/Row, Format => \@RowFormat, i => $line, record => $record, maxitems => $maxitems &>
 % }
 </table>
-<& /Elements/TitleBoxEnd&>
+<& /Widgets/TitleBoxEnd&>
 
 <!--    <td>Show:</td>
     <td COLSPAN=2><SELECT NAME="status">
diff --git a/rt/share/html/RTx/Statistics/OpenStalled/index.html b/rt/share/html/RTx/Statistics/OpenStalled/index.html
index 31ef64661..a59246c37 100755
--- a/rt/share/html/RTx/Statistics/OpenStalled/index.html
+++ b/rt/share/html/RTx/Statistics/OpenStalled/index.html
@@ -15,7 +15,7 @@ viewed once (Open) and how many have had their status changed to stalled.</p>
 
 
 %my $title = "New, Open and Stalled Tickets in " . join(', ', @queues);
-<& /Elements/TitleBoxStart, title => $title, title_href => $RT::WebPath."/RTx/Statistics/OpenStalled/index.html?$QueryString"&>
+<& /Widgets/TitleBoxStart, title => $title, title_href => $RT::WebPath."/RTx/Statistics/OpenStalled/index.html?$QueryString"&>
 <TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH="100%">
 % if ($ShowHeader) {
 <& /RTx/Statistics/Elements/CollectionAsTable/Header, 
@@ -63,7 +63,7 @@ viewed once (Open) and how many have had their status changed to stalled.</p>
 %    $values{Statistics_Totals} = $totals{"Totals"};
 <&   /RTx/Statistics/Elements/CollectionAsTable/Row, Format => \@BoldRowFormat, i => $line+1, record => $record, maxitems => $maxitems &>
 </table>
-<& /Elements/TitleBoxEnd&>
+<& /Widgets/TitleBoxEnd&>
 
 % use Data::Dumper;
 % Statistics::DebugLog("Dump of data array is " . Dumper(@data) . "\n");
diff --git a/rt/share/html/Ticket/ModifyCustomers.html b/rt/share/html/Ticket/ModifyCustomers.html
index 72d103b23..ac9739985 100644
--- a/rt/share/html/Ticket/ModifyCustomers.html
+++ b/rt/share/html/Ticket/ModifyCustomers.html
@@ -20,9 +20,9 @@
 <form action="ModifyCustomers.html" method="post">
 <input type="hidden" name="id" value="<%$Ticket->id%>">
 
-<& /Elements/TitleBoxStart, title => loc('Edit Customer Links'), color => "#7f007b"&>
+<& /Widgets/TitleBoxStart, title => loc('Edit Customer Links'), color => "#7f007b"&>
 <& Elements/EditCustomers, Ticket => $Ticket, CustomerString => $CustomerString, ServiceString => $ServiceString &>
-<& /Elements/TitleBoxEnd &>
+<& /Widgets/TitleBoxEnd &>
 <& /Elements/Submit, color => "#7f007b", Label => loc('Save Changes') &>
 </form>
 

commit 52360059f2b525024d9c3e5cfd205004d00ad328
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Sun Mar 31 12:26:28 2019 -0400

    RT# 81692 Update use of deprecated callback element in RT

diff --git a/rt/lib/RT/Interface/Web/Request.pm b/rt/lib/RT/Interface/Web/Request.pm
index 1cd08df3e..9ed7610ba 100644
--- a/rt/lib/RT/Interface/Web/Request.pm
+++ b/rt/lib/RT/Interface/Web/Request.pm
@@ -85,6 +85,12 @@ By default is false, otherwise runs callbacks only once per
 process of the server. Such callbacks can be used to fill
 structures.
 
+=item ReturnComponentOutput
+
+By default, callback returns the status codes of all rendered components, and
+prints the rendered components to STDOUT. If this argument is true, callback
+returns the rendered components instead of printing them to STDOUT.
+
 =back
 
 Searches for callback components in
@@ -102,6 +108,7 @@ sub callback {
 
     my $name = delete $args{'CallbackName'} || 'Default';
     my $page = delete $args{'CallbackPage'} || $self->callers(0)->path;
+    my $use_scomp = delete $args{'ReturnComponentOutput'} ? 1 : 0;
     unless ( $page ) {
         $RT::Logger->error("Couldn't get a page name for callbacks");
         return;
@@ -134,10 +141,16 @@ sub callback {
     }
 
     my @rv;
+    my $scomp_out;
     foreach my $cb ( @$callbacks ) {
-        push @rv, scalar $self->comp( $cb, %args );
+        if ( $use_scomp ) {
+            no warnings 'uninitialized';
+            $scomp_out .= $self->scomp( $cb, %args );
+        } else {
+            push @rv, scalar $self->comp( $cb, %args );
+        }
     }
-    return @rv;
+    return $use_scomp ? $scomp_out : @rv;
 }
 
 sub clear_callback_cache {
diff --git a/rt/share/html/Elements/Header b/rt/share/html/Elements/Header
index 23007ddd1..58136c584 100755
--- a/rt/share/html/Elements/Header
+++ b/rt/share/html/Elements/Header
@@ -148,8 +148,11 @@ jQuery(document).ready(function(){
 
 }
 
-# $m->callback( %ARGS, CallbackName => 'Head' );
-$head .= $m->scomp( '/Elements/Callback', _CallbackName => 'Head', %ARGS );
+$head .= $m->callback(
+  %ARGS,
+  CallbackName => 'Head',
+  ReturnComponentOutput => 1,
+);
 
 #XXX $head .= <& /Elements/Framekiller &>;
 

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

Summary of changes:
 rt/docs/design_docs/string-extraction-guide.txt         |  4 ++--
 rt/lib/RT/Interface/Web/Request.pm                      | 17 +++++++++++++++--
 rt/share/html/Elements/Header                           |  7 +++++--
 rt/share/html/RTx/Statistics/CallsMultiQueue/index.html |  4 ++--
 rt/share/html/RTx/Statistics/OpenStalled/index.html     |  4 ++--
 rt/share/html/Ticket/ModifyCustomers.html               |  4 ++--
 6 files changed, 28 insertions(+), 12 deletions(-)




More information about the freeside-commits mailing list