Commit 785dc2e3 authored by Alex Vandiver's avatar Alex Vandiver
Browse files

Remove hard tab characters wherever possible

For historical reasons, many parts of the RT code intermix hard tabs and
siace-based indentation.  This commit does not attempt to standardize
indentation, merely the horrid intermixing of hard tabs and spaces.

A few hard tabs remain in t/mail/mime_encoding.t and t/mail/outlook.t,
as the tabs are within strings representing test data; they also remain
in third-party source.

Best viewed with the -w option to `git diff`.
parent 51c1662d
......@@ -305,37 +305,37 @@ sub help {
. "\n";
print loc("It takes several arguments:") . "\n\n";
print " "
print " "
. loc( "[_1] - Specify the search module you want to use", "--search" )
. "\n";
print " "
print " "
. loc( "[_1] - An argument to pass to [_2]", "--search-arg", "--search" )
. "\n";
print " "
print " "
. loc( "[_1] - Specify the condition module you want to use", "--condition" )
. "\n";
print " "
print " "
. loc( "[_1] - An argument to pass to [_2]", "--condition-arg", "--condition" )
. "\n";
print " "
print " "
. loc( "[_1] - Specify the action module you want to use", "--action" )
. "\n";
print " "
print " "
. loc( "[_1] - An argument to pass to [_2]", "--action-arg", "--action" )
. "\n";
print " "
print " "
. loc( "[_1] - Specify name or id of template(s) you want to use", "--template" )
. "\n";
print " "
print " "
. loc( "[_1] - Specify if you want to use either 'first', 'last' or 'all' transactions", "--transaction" )
. "\n";
print " "
print " "
. loc( "[_1] - Specify the comma separated list of transactions' types you want to use", "--transaction-type" )
. "\n";
print " "
print " "
. loc( "[_1] - Adjust LogToScreen config option", "--log" ) . "\n";
print " "
print " "
. loc( "[_1] - Output status updates to STDOUT", "--verbose" ) . "\n";
print "\n";
print "\n";
......
......@@ -194,8 +194,8 @@ sub extract_strings_from_code {
next;
}
$str = substr($str, 1, -1);
$str =~ s/\\'/\'/g;
push @{ $FILECAT{$str} }, [ $filename, $line, '' ];
$str =~ s/\\'/\'/g;
push @{ $FILECAT{$str} }, [ $filename, $line, '' ];
}
# Comment-based qw mark: "qw(...)" # loc_qw
......@@ -223,8 +223,8 @@ sub extract_strings_from_code {
warn "Couldn't process loc_left_pair at $filename:$line";
next;
}
$key =~ s/\\'/\'/g;
push @{ $FILECAT{$key} }, [ $filename, $line, '' ];
$key =~ s/\\'/\'/g;
push @{ $FILECAT{$key} }, [ $filename, $line, '' ];
}
# Comment-based pair mark: "..." => "..." # loc_pair
......@@ -237,11 +237,11 @@ sub extract_strings_from_code {
warn "Couldn't process loc_pair at $filename:$line";
next;
}
$val = substr($val, 1, -1);
$key =~ s/\\'/\'/g;
$val =~ s/\\'/\'/g;
push @{ $FILECAT{$key} }, [ $filename, $line, '' ];
push @{ $FILECAT{$val} }, [ $filename, $line, '' ];
$val = substr($val, 1, -1);
$key =~ s/\\'/\'/g;
$val =~ s/\\'/\'/g;
push @{ $FILECAT{$key} }, [ $filename, $line, '' ];
push @{ $FILECAT{$val} }, [ $filename, $line, '' ];
}
close (_);
......@@ -259,8 +259,8 @@ sub update {
my $out = '';
unless (!-e $file or -w $file) {
warn "Can't write to $lang, skipping...\n";
return;
warn "Can't write to $lang, skipping...\n";
return;
}
print "Updating $lang...\n";
......
......@@ -396,10 +396,10 @@ DocumentRoot $RTHOME/share/html
FastCgiServer $RTHOME/bin/mason_handler.fcgi -processes $PROCESSES -idle-timeout 300
ScriptAlias $PATH $RTHOME/bin/mason_handler.fcgi/
<Location $PATH>
Order allow,deny
Allow from all
Options +ExecCGI
AddHandler fastcgi-script fcgi
Order allow,deny
Allow from all
Options +ExecCGI
AddHandler fastcgi-script fcgi
</Location>
</IfDefine>
......@@ -410,10 +410,10 @@ DocumentRoot $RTHOME/share/html
FcgidMaxRequestLen 1073741824
ScriptAlias $PATH $RTHOME/bin/mason_handler.fcgi/
<Location $PATH>
Order allow,deny
Allow from all
Options +ExecCGI
AddHandler fcgid-script fcgi
Order allow,deny
Allow from all
Options +ExecCGI
AddHandler fcgid-script fcgi
</Location>
</IfDefine>
</IfDefine>
......@@ -427,7 +427,7 @@ DocumentRoot $RTHOME/share/html
SSLMutex file:$RTHOME/var/ssl_mutex
<VirtualHost *:$SSL>
SSLEngine on
SSLCertificateFile $TOOLS/localhost.crt
SSLCertificateKeyFile $TOOLS/localhost.key
SSLCertificateFile $TOOLS/localhost.crt
SSLCertificateKeyFile $TOOLS/localhost.key
</VirtualHost>
</IfDefine>
......@@ -66,7 +66,7 @@ sub acl {
# if there's already an rt_user, use it.
my @row = $dbh->selectrow_array( "SELECT usename FROM pg_user WHERE usename = '$db_user'" );
unless ( $row[0] ) {
push @acls, "CREATE USER \"$db_user\" WITH PASSWORD '$db_pass' NOCREATEDB NOCREATEUSER;";
push @acls, "CREATE USER \"$db_user\" WITH PASSWORD '$db_pass' NOCREATEDB NOCREATEUSER;";
}
my $sequence_right
......
......@@ -224,7 +224,7 @@ Greetings,
This message has been automatically generated in response to the
creation of a trouble ticket regarding:
"{$Ticket->Subject()}",
"{$Ticket->Subject()}",
a summary of which appears below.
There is no need to reply to this message right now. Your ticket has been
......@@ -474,10 +474,10 @@ Your new password is:
}
},
{ Queue => '0',
Name => 'Email Digest', # loc
Description => 'Email template for periodic notification digests', # loc
Content => q[Subject: RT Email Digest
{ Queue => '0',
Name => 'Email Digest', # loc
Description => 'Email template for periodic notification digests', # loc
Content => q[Subject: RT Email Digest
{ $Argument }
],
......
This diff is collapsed.
......@@ -364,14 +364,14 @@ CREATE TABLE Templates (
CREATE TABLE ObjectCustomFieldValues (
id INTEGER NOT NULL ,
CustomField int NOT NULL ,
ObjectType varchar(255) NOT NULL, # Final target of the Object
ObjectId int NOT NULL , # New -- Replaces Ticket
ObjectType varchar(255) NOT NULL, # Final target of the Object
ObjectId int NOT NULL , # New -- Replaces Ticket
SortOrder integer NOT NULL DEFAULT 0 ,
Content varchar(255) NULL ,
LargeContent LONGTEXT NULL, # New -- to hold 255+ strings
ContentType varchar(80) NULL, # New -- only text/* gets searched
ContentEncoding varchar(80) NULL , # New -- for binary Content
LargeContent LONGTEXT NULL, # New -- to hold 255+ strings
ContentType varchar(80) NULL, # New -- only text/* gets searched
ContentEncoding varchar(80) NULL , # New -- for binary Content
Creator integer NOT NULL DEFAULT 0 ,
Created DATETIME NULL ,
......@@ -389,10 +389,10 @@ CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,Ob
CREATE TABLE CustomFields (
id INTEGER NOT NULL ,
Name varchar(200) NULL ,
Type varchar(200) NULL , # Changed -- 'Single' and 'Multiple' is moved out
Type varchar(200) NULL , # Changed -- 'Single' and 'Multiple' is moved out
RenderType varchar(64) NULL ,
MaxValues integer, # New -- was 'Single'(1) and 'Multiple'(0)
Pattern varchar(65536) NULL , # New -- Must validate against this
MaxValues integer, # New -- was 'Single'(1) and 'Multiple'(0)
Pattern varchar(65536) NULL , # New -- Must validate against this
Repeated int2 NOT NULL DEFAULT 0 , # New -- repeated table entry
BasedOn INTEGER NULL,
ValuesClass varchar(64) NULL ,
......
......@@ -342,14 +342,14 @@ CREATE TABLE Templates (
CREATE TABLE ObjectCustomFieldValues (
id INTEGER NOT NULL AUTO_INCREMENT,
CustomField int NOT NULL ,
ObjectType varchar(255) CHARACTER SET ascii NOT NULL, # Final target of the Object
ObjectId int NOT NULL , # New -- Replaces Ticket
ObjectType varchar(255) CHARACTER SET ascii NOT NULL, # Final target of the Object
ObjectId int NOT NULL , # New -- Replaces Ticket
SortOrder integer NOT NULL DEFAULT 0 , # New -- ordering for multiple values
Content varchar(255) NULL ,
LargeContent LONGBLOB NULL, # New -- to hold 255+ strings
ContentType varchar(80) CHARACTER SET ascii NULL, # New -- only text/* gets searched
ContentEncoding varchar(80) CHARACTER SET ascii NULL , # New -- for binary Content
LargeContent LONGBLOB NULL, # New -- to hold 255+ strings
ContentType varchar(80) CHARACTER SET ascii NULL, # New -- only text/* gets searched
ContentEncoding varchar(80) CHARACTER SET ascii NULL , # New -- for binary Content
Creator integer NOT NULL DEFAULT 0 ,
Created DATETIME NULL ,
......@@ -367,10 +367,10 @@ CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,Ob
CREATE TABLE CustomFields (
id INTEGER NOT NULL AUTO_INCREMENT,
Name varchar(200) NULL ,
Type varchar(200) CHARACTER SET ascii NULL , # Changed -- 'Single' and 'Multiple' is moved out
Type varchar(200) CHARACTER SET ascii NULL , # Changed -- 'Single' and 'Multiple' is moved out
RenderType varchar(64) CHARACTER SET ascii NULL ,
MaxValues integer, # New -- was 'Single'(1) and 'Multiple'(0)
Pattern TEXT NULL , # New -- Must validate against this
MaxValues integer, # New -- was 'Single'(1) and 'Multiple'(0)
Pattern TEXT NULL , # New -- Must validate against this
Repeated int2 NOT NULL DEFAULT 0 , # New -- repeated table entry
BasedOn INTEGER NULL,
ValuesClass varchar(64) CHARACTER SET ascii NULL ,
......
CREATE SEQUENCE ATTRIBUTES_seq;
CREATE TABLE Attributes (
id NUMBER(11,0) PRIMARY KEY,
Name VARCHAR2(255) NOT NULL,
Description VARCHAR2(255),
Content CLOB,
id NUMBER(11,0) PRIMARY KEY,
Name VARCHAR2(255) NOT NULL,
Description VARCHAR2(255),
Content CLOB,
ContentType VARCHAR(16),
ObjectType VARCHAR2(25) NOT NULL,
ObjectId NUMBER(11,0) DEFAULT 0 NOT NULL,
Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
Created DATE,
LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL,
LastUpdated DATE
ObjectType VARCHAR2(25) NOT NULL,
ObjectId NUMBER(11,0) DEFAULT 0 NOT NULL,
Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
Created DATE,
LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL,
LastUpdated DATE
);
CREATE INDEX Attributes1 on Attributes(Name);
......
......@@ -22,16 +22,16 @@ our @Attributes = (
Description => 'HomepageSettings',
Content =>
{ 'body' =>
[ { type => 'system', name => 'My Tickets' },
{ type => 'system', name => 'Unowned Tickets' },
{ type => 'component', name => 'QuickCreate'},
],
[ { type => 'system', name => 'My Tickets' },
{ type => 'system', name => 'Unowned Tickets' },
{ type => 'component', name => 'QuickCreate'},
],
'summary' =>
[
{ type => 'component', name => 'MyReminders' },
[
{ type => 'component', name => 'MyReminders' },
{ type => 'component', name => 'Quicksearch' },
{ type => 'component', name => 'RefreshHomepage' },
]
{ type => 'component', name => 'RefreshHomepage' },
]
},
}
);
......
use strict;
use warnings;
our @Templates = (
{ Queue => '0',
Name => 'Email Digest', # loc
Description => 'Email template for periodic notification digests', # loc
Content => q[Subject: RT Email Digest
our @Templates = (
{ Queue => '0',
Name => 'Email Digest', # loc
Description => 'Email template for periodic notification digests', # loc
Content => q[Subject: RT Email Digest
{ $Argument }
],
......
RT::ACE LastUpdated LastUpdatedBy Creator Created
RT::ACE LastUpdated LastUpdatedBy Creator Created
CREATE SEQUENCE OBJECTSCRIPS_seq;
CREATE TABLE ObjectScrips (
id NUMBER(11,0)
id NUMBER(11,0)
CONSTRAINT ObjectScrips_Key PRIMARY KEY,
Scrip NUMBER(11,0) NOT NULL,
Stage VARCHAR2(32) DEFAULT 'TransactionCreate' NOT NULL,
Stage VARCHAR2(32) DEFAULT 'TransactionCreate' NOT NULL,
ObjectId NUMBER(11,0) NOT NULL,
SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL,
Disabled NUMBER(11,0) DEFAULT 0 NOT NULL,
Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
Created DATE,
LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL,
LastUpdated DATE
SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL,
Disabled NUMBER(11,0) DEFAULT 0 NOT NULL,
Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
Created DATE,
LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL,
LastUpdated DATE
);
ALTER TABLE Scrips ADD COLUMN Disabled int2 NOT NULL DEFAULT 0;
......
......@@ -478,7 +478,7 @@ sub InitClasses {
"You should delete or repair this Scrip in the admin UI.\n$@\n");
}
foreach my $class ( grep $_, RT->Config->Get('CustomFieldValuesSources') ) {
foreach my $class ( grep $_, RT->Config->Get('CustomFieldValuesSources') ) {
local $@;
eval "require $class; 1" or $RT::Logger->error(
"Class '$class' is listed in CustomFieldValuesSources option"
......
......@@ -95,16 +95,16 @@ Load an ACE by specifying a paramhash with the following fields:
PrincipalId => undef,
PrincipalType => undef,
RightName => undef,
RightName => undef,
And either:
Object => undef,
Object => undef,
OR
ObjectType => undef,
ObjectId => undef
ObjectType => undef,
ObjectId => undef
=cut
......@@ -139,7 +139,7 @@ sub LoadByValues {
my ($object, $object_type, $object_id) = $self->_ParseObjectArg( %args );
unless( $object ) {
return ( 0, $self->loc("System error. Right not granted.") );
return ( 0, $self->loc("System error. Right not granted.") );
}
$self->LoadByCols( PrincipalId => $princ_obj->Id,
......@@ -207,7 +207,7 @@ sub Create {
}
($args{'Object'}, $args{'ObjectType'}, $args{'ObjectId'}) = $self->_ParseObjectArg( %args );
unless( $args{'Object'} ) {
return ( 0, $self->loc("System error. Right not granted.") );
return ( 0, $self->loc("System error. Right not granted.") );
}
# Validate the principal
......@@ -331,9 +331,9 @@ sub _Delete {
my ( $val, $msg ) = $self->SUPER::Delete(@_);
if ($val) {
#Clear the key cache. TODO someday we may want to just clear a little bit of the keycache space.
# TODO what about the groups key cache?
RT::Principal->InvalidateACLCache();
#Clear the key cache. TODO someday we may want to just clear a little bit of the keycache space.
# TODO what about the groups key cache?
RT::Principal->InvalidateACLCache();
$RT::Handle->Commit() unless $InsideTransaction;
return ( $val, $self->loc('Right revoked') );
}
......@@ -547,21 +547,21 @@ sub _ParseObjectArg {
@_ );
if( $args{'Object'} && ($args{'ObjectId'} || $args{'ObjectType'}) ) {
$RT::Logger->crit( "Method called with an ObjectType or an ObjectId and Object args" );
return ();
$RT::Logger->crit( "Method called with an ObjectType or an ObjectId and Object args" );
return ();
} elsif( $args{'Object'} && ref($args{'Object'}) && !$args{'Object'}->can('id') ) {
$RT::Logger->crit( "Method called called Object that has no id method" );
return ();
$RT::Logger->crit( "Method called called Object that has no id method" );
return ();
} elsif( $args{'Object'} ) {
my $obj = $args{'Object'};
return ($obj, ref $obj, $obj->id);
my $obj = $args{'Object'};
return ($obj, ref $obj, $obj->id);
} elsif ( $args{'ObjectType'} ) {
my $obj = $args{'ObjectType'}->new( $self->CurrentUser );
$obj->Load( $args{'ObjectId'} );
return ($obj, ref $obj, $obj->id);
my $obj = $args{'ObjectType'}->new( $self->CurrentUser );
$obj->Load( $args{'ObjectId'} );
return ($obj, ref $obj, $obj->id);
} else {
$RT::Logger->crit( "Method called with wrong args" );
return ();
$RT::Logger->crit( "Method called with wrong args" );
return ();
}
}
......@@ -706,25 +706,25 @@ sub _CoreAccessible {
{
id =>
{read => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => ''},
{read => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => ''},
PrincipalType =>
{read => 1, write => 1, sql_type => 12, length => 25, is_blob => 0, is_numeric => 0, type => 'varchar(25)', default => ''},
{read => 1, write => 1, sql_type => 12, length => 25, is_blob => 0, is_numeric => 0, type => 'varchar(25)', default => ''},
PrincipalId =>
{read => 1, write => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
{read => 1, write => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
RightName =>
{read => 1, write => 1, sql_type => 12, length => 25, is_blob => 0, is_numeric => 0, type => 'varchar(25)', default => ''},
{read => 1, write => 1, sql_type => 12, length => 25, is_blob => 0, is_numeric => 0, type => 'varchar(25)', default => ''},
ObjectType =>
{read => 1, write => 1, sql_type => 12, length => 25, is_blob => 0, is_numeric => 0, type => 'varchar(25)', default => ''},
{read => 1, write => 1, sql_type => 12, length => 25, is_blob => 0, is_numeric => 0, type => 'varchar(25)', default => ''},
ObjectId =>
{read => 1, write => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
{read => 1, write => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
Creator =>
{read => 1, auto => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
{read => 1, auto => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
Created =>
{read => 1, auto => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''},
{read => 1, auto => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''},
LastUpdatedBy =>
{read => 1, auto => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
{read => 1, auto => 1, sql_type => 4, length => 11, is_blob => 0, is_numeric => 1, type => 'int(11)', default => '0'},
LastUpdated =>
{read => 1, auto => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''},
{read => 1, auto => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''},
}
};
......
......@@ -93,18 +93,18 @@ Set this message's return address to the apropriate queue address
sub SetReturnAddress {
my $self = shift;
my $friendly_name;
if (RT->Config->Get('UseFriendlyFromLine')) {
$friendly_name = $self->TicketObj->QueueObj->Description ||
$self->TicketObj->QueueObj->Name;
}
if (RT->Config->Get('UseFriendlyFromLine')) {
$friendly_name = $self->TicketObj->QueueObj->Description ||
$self->TicketObj->QueueObj->Name;
}
$self->SUPER::SetReturnAddress( @_, friendly_name => $friendly_name );
}
=head2 SetRTSpecialHeaders
......
......@@ -136,11 +136,11 @@ A convoluted example:
my $adminccs = RT::Users->new(RT->SystemUser);
$adminccs->WhoHaveRight(
Right => "AdminGroup",
Object =>$groups->First,
IncludeSystemRights => undef,
IncludeSuperusers => 0,
IncludeSubgroupMembers => 0,
Right => "AdminGroup",
Object =>$groups->First,
IncludeSystemRights => undef,
IncludeSuperusers => 0,
IncludeSubgroupMembers => 0,
);
our @admins;
......
......@@ -88,62 +88,62 @@ sub Describe {
my $self = shift;
return (ref $self . " will move a ticket's priority toward its final priority.");
}
sub Prepare {
my $self = shift;
if ($self->TicketObj->Priority() == $self->TicketObj->FinalPriority()) {
# no update necessary.
return 0;
# no update necessary.
return 0;
}
#compute the number of days until the ticket is due
my $due = $self->TicketObj->DueObj();
# If we don't have a due date, adjust the priority by one
# until we hit the final priority
if ($due->Unix() < 1) {
if ( $self->TicketObj->Priority > $self->TicketObj->FinalPriority ){
$self->{'prio'} = ($self->TicketObj->Priority - 1);
return 1;
}
elsif ( $self->TicketObj->Priority < $self->TicketObj->FinalPriority ){
$self->{'prio'} = ($self->TicketObj->Priority + 1);
return 1;
}
# otherwise the priority is at the final priority. we don't need to
# Continue
else {
return 0;
}
if ( $self->TicketObj->Priority > $self->TicketObj->FinalPriority ){
$self->{'prio'} = ($self->TicketObj->Priority - 1);
return 1;
}
elsif ( $self->TicketObj->Priority < $self->TicketObj->FinalPriority ){
$self->{'prio'} = ($self->TicketObj->Priority + 1);
return 1;
}
# otherwise the priority is at the final priority. we don't need to
# Continue
else {
return 0;
}
}
# we've got a due date. now there are other things we should do
else {
my $diff_in_seconds = $due->Diff(time());
my $diff_in_days = int( $diff_in_seconds / 86400);
#if we haven't hit the due date yet
if ($diff_in_days > 0 ) {
# compute the difference between the current priority and the
# final priority
my $prio_delta =
$self->TicketObj->FinalPriority() - $self->TicketObj->Priority;
my $inc_priority_by = int( $prio_delta / $diff_in_days );
#set the ticket's priority to that amount
$self->{'prio'} = $self->TicketObj->Priority + $inc_priority_by;
}
#if $days is less than 1, set priority to final_priority
else {
$self->{'prio'} = $self->TicketObj->FinalPriority();
}
else {
my $diff_in_seconds = $due->Diff(time());
my $diff_in_days = int( $diff_in_seconds / 86400);
#if we haven't hit the due date yet
if ($diff_in_days > 0 ) {
# compute the difference between the current priority and the
# final priority
my $prio_delta =
$self->TicketObj->FinalPriority() - $self->TicketObj->Priority;