Skip to content

Commit

Permalink
Merge branch '4.0-trunk' into 4.2-trunk
Browse files Browse the repository at this point in the history
Conflicts:
	lib/RT/Config.pm
	lib/RT/Handle.pm
	share/html/Elements/EditCustomFieldAutocomplete
	share/html/Elements/EditCustomFieldDateTime
	share/html/Elements/EditCustomFieldFreeform
	share/html/Elements/EditCustomFieldSelect
	share/html/Elements/EditCustomFieldText
	share/html/Elements/EditCustomFieldWikitext
	share/html/Elements/ShowLink
	share/html/Elements/SimpleSearch
	share/html/Search/Bulk.html
	share/static/js/cascaded.js
	t/validator/group_members.t
  • Loading branch information
alexmv committed Feb 14, 2014
2 parents 15026fd + 5161fe0 commit 1f4a0bc
Show file tree
Hide file tree
Showing 29 changed files with 685 additions and 118 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/bin/rt
/etc/RT_Config.pm
/etc/upgrade/3.8-ical-extension
/etc/upgrade/4.0-customfield-checkbox-extension
/etc/upgrade/split-out-cf-categories
/etc/upgrade/generate-rtaddressregexp
/etc/upgrade/upgrade-articles
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ dnl Configure the output files, and generate them.
dnl Binaries that should be +x
AC_CONFIG_FILES([
etc/upgrade/3.8-ical-extension
etc/upgrade/4.0-customfield-checkbox-extension
etc/upgrade/split-out-cf-categories
etc/upgrade/generate-rtaddressregexp
etc/upgrade/upgrade-articles
Expand Down
3 changes: 3 additions & 0 deletions docs/UPGRADING-4.0
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ If you deploy RT with mod_perl, Apache will no longer start with C<SetHandler>
set to `perl-script`. F<docs/web_deployment.pod> contains the
new configuration.

RT::Extension::CustomField::Checkbox has been integrated into core, so you
MUST uninstall it before upgrading. In addition, you must run
etc/upgrade/4.0-customfield-checkbox-extension script to convert old data.

=head2 RT_SiteConfig.pm

Expand Down
2 changes: 1 addition & 1 deletion docs/extending/clickable_links.pod
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ add action types. Values are subroutine references which will get
called when needed. They should return the modified string. Note that
subroutine B<must escape> HTML.

=item handler
=item handle

A subroutine reference; modify it only if you have to. This can be used
to add pre- or post-processing around all actions.
Expand Down
50 changes: 7 additions & 43 deletions docs/initialdata.pod
Original file line number Diff line number Diff line change
Expand Up @@ -80,55 +80,19 @@ For a full list of fields, read the documentation for L<RT::User/Create>.
push @Groups, {
Name => 'Example Employees',
Description => 'All of the employees of my company',
Members => { Users => [ qw/ alexmv trs falcone / ],
Groups => [ qw/ extras / ] },
};

Creates a new L<RT::Group> for each hashref. In almost all cases you'll want
to follow the example above to create a group just as if you had done it from
the admin interface.

Additionally, the C<MemberOf> field is specially handled to make it easier to
add the new group to other groups. C<MemberOf> may be a single value or an
array ref. Each value should be a user-defined group name or hashref to pass
into L<RT::Group/LoadByCols>. Each group found will have the new group
added as a member.

Unfortunately you can't specify the I<members> of a group at this time. As a
workaround, you can push a subref into C<@Final> which adds members to your new
groups. An example, using a convenience function to avoid repeating yourself:

push @Final, sub {
add_members('My New Group Name' => qw(trs alex ruslan));
add_members('My Second Group' => qw(jesse kevin sunnavy jim));
};

sub add_members {
my $group_name = shift;
my @members = @_;

my $group = RT::Group->new( RT->SystemUser );
$group->LoadUserDefinedGroup($group_name);

if ($group->id) {
for my $name (@members) {
my $member = RT::User->new( RT->SystemUser );
$member->LoadByCols( Name => $name );

unless ($member->Id) {
RT->Logger->error("Unable to find user '$name'");
next;
}

my ($ok, $msg) = $group->AddMember( $member->PrincipalObj->Id );
if ($ok) {
RT->Logger->info("Added member $name to $group_name");
} else {
RT->Logger->error("Unable to AddMember $name to $group_name: $msg");
}
}
} else {
RT->Logger->error("Unable to find group '$group_name'!");
}
}
In addition to the C<Members> option shown above, which can take both
users and groups, the C<MemberOf> field may be a single value or an
array ref. Each value should be a user-defined group name or hashref to
pass into L<RT::Group/LoadByCols>. Each group found will have the new
group added as a member.

=head2 C<@Queues>

Expand Down
Loading

0 comments on commit 1f4a0bc

Please sign in to comment.