rt.patch 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. Index: html/Elements/Header
  2. --- html/Elements/Header.orig 2003-11-18 01:31:11.000000000 +0100
  3. +++ html/Elements/Header 2003-11-25 17:08:38.000000000 +0100
  4. @@ -40,9 +40,10 @@
  5. "
  6. % }
  7. >
  8. +% if ($session{'CurrentUser'} && $session{'CurrentUser'}->Id && $LoggedIn) {
  9. <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
  10. <tr>
  11. - <td colspan=2><a href="http://bestpractical.com"><img src="<%$RT::WebImagesURL%>/bplogo.gif" alt="" width="230" height="50"></a></td>
  12. + <td colspan=2><a href="<%$RT::LogoLink%>"><img src="<%$RT::LogoURL%>" alt="" width="230" height="50"></a></td>
  13. <td>&nbsp;</td>
  14. <td>&nbsp;</td>
  15. <td width="50%" align="right">
  16. @@ -62,6 +63,7 @@
  17. </td>
  18. </tr>
  19. </table>
  20. +% }
  21. <%INIT>
  22. $r->header_out('Pragma' => 'no-cache');
  23. Index: html/Elements/Login
  24. --- html/Elements/Login.orig 2003-11-18 01:31:11.000000000 +0100
  25. +++ html/Elements/Login 2003-11-25 17:08:38.000000000 +0100
  26. @@ -87,12 +87,13 @@
  27. If you've forgotten your username or password, RT can <A
  28. href="/NoAuth/Reminder.html">send you a reminder</a>.
  29. -->
  30. +<!--
  31. <BR>
  32. <BR>
  33. <BR>
  34. <HR>
  35. <&|/l, '2003'&>RT is &copy; Copyright 1996-[_1] Jesse Vincent &lt;jesse@bestpractical.com&gt;. It is distributed under <a href="http://www.gnu.org/copyleft/gpl.html">Version 2 of the GNU General Public License.</a></&>
  36. -
  37. +-->
  38. <%ARGS>
  39. $user => ""
  40. $pass => undef
  41. Index: html/Ticket/Elements/ShowMessageStanza
  42. --- html/Ticket/Elements/ShowMessageStanza.orig 2003-11-18 01:31:12.000000000 +0100
  43. +++ html/Ticket/Elements/ShowMessageStanza 2003-11-25 17:19:25.000000000 +0100
  44. @@ -23,23 +23,44 @@
  45. %# END LICENSE BLOCK
  46. <%perl>
  47. if (ref($Message)) {
  48. -foreach my $stanza (@$Message) {
  49. - if ( ref $stanza eq "ARRAY" ) {
  50. - $m->comp( 'ShowMessageStanza',
  51. - Depth => $Depth + 1,
  52. - Transaction => $Transaction,
  53. - Message => $stanza );
  54. + my $msg='';
  55. + my $wrapfunc = sub {
  56. + my $max = 0;
  57. + foreach ( split ( /\n/, $_[0] ) ) {
  58. + $max = length if length > $max;
  59. + }
  60. + if ( $max > 76 ) {
  61. + require Text::Wrapper;
  62. + my $wrapper = new Text::Wrapper(
  63. + columns => 70,
  64. + body_start => ( $max > 70 * 3 ? ' ' : '' ),
  65. + par_start => '');
  66. + $_[0] = $wrapper->wrap($_[0]);
  67. + }
  68. + RT::Interface::Web::EscapeUTF8(\$_[0]);
  69. + $m->comp('/Elements/Callback', content => \$_[0], %ARGS);
  70. + };
  71. + foreach my $stanza (@$Message) {
  72. + if ( ref $stanza eq "ARRAY" ) {
  73. + if ($msg ne '') {
  74. + $wrapfunc->($msg);
  75. +</%perl>
  76. +<font color="<%$colors[$Depth]%>"><pre><%$msg |n%></pre></font>
  77. +<%perl>
  78. + $msg = '';
  79. + }
  80. + $m->comp( 'ShowMessageStanza',
  81. + Depth => $Depth + 1,
  82. + Transaction => $Transaction,
  83. + Message => $stanza );
  84. + }
  85. + elsif ( ref $stanza eq "HASH" ) {
  86. + $msg .= "$stanza->{raw}\n";
  87. + }
  88. }
  89. - elsif ( ref $stanza eq "HASH" ) {
  90. - my $content = $stanza->{raw};
  91. - RT::Interface::Web::EscapeUTF8(\$content);
  92. - $m->comp('/Elements/Callback', content => \$content, %ARGS);
  93. - $content =~ s/\n/<br>/gi;
  94. -
  95. + $wrapfunc->($msg);
  96. </%perl>
  97. -<font color="<%$colors[$Depth]%>"><%$content |n%><br></font>
  98. -% }
  99. -% }
  100. +<font color="<%$colors[$Depth]%>"><pre><%$msg |n%></pre></font>
  101. % } else {
  102. % my $content = $Message;
  103. % RT::Interface::Web::EscapeUTF8(\$content);
  104. Index: lib/RT/Attachment_Overlay.pm
  105. --- lib/RT/Attachment_Overlay.pm.orig 2003-11-18 01:31:13.000000000 +0100
  106. +++ lib/RT/Attachment_Overlay.pm 2003-11-25 17:08:38.000000000 +0100
  107. @@ -318,10 +318,11 @@
  108. # If we somehow fail to do the decode, at least push out the raw bits
  109. eval {return( Encode::decode_utf8($content))} || return ($content);
  110. }
  111. -
  112. - eval { Encode::from_to($content, 'utf8' => $enc);};
  113. - if ($@) {
  114. - $RT::Logger->error("Could not convert attachment from assumed utf8 to '$enc' :".$@);
  115. + if (!$enc) {
  116. + eval { Encode::from_to($content, 'utf8' => $enc);};
  117. + if ($@) {
  118. + $RT::Logger->error("Could not convert attachment from assumed utf8 to '$enc' :".$@);
  119. + }
  120. }
  121. return $content;
  122. }
  123. Index: lib/RT/User_Overlay.pm
  124. --- lib/RT/User_Overlay.pm.orig 2003-11-18 01:31:14.000000000 +0100
  125. +++ lib/RT/User_Overlay.pm 2003-11-25 17:08:38.000000000 +0100
  126. @@ -279,7 +279,7 @@
  127. #If the create failed.
  128. unless ($id) {
  129. $RT::Handle->Rollback();
  130. - $RT::Logger->error("Could not create a new user - " .join('-'. %args));
  131. + $RT::Logger->error("Could not create a new user - " .join('-', %args));
  132. return ( 0, $self->loc('Could not create user') );
  133. }