/[smecontribs]/rpms/smeserver-vacation/contribs9/smeserver-vacation-1.1.delegate_vacation_message_by_groups.patch
ViewVC logotype

Annotation of /rpms/smeserver-vacation/contribs9/smeserver-vacation-1.1.delegate_vacation_message_by_groups.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Wed Jul 6 05:25:38 2016 UTC (8 years, 4 months ago) by stephdl
Branch: MAIN
CVS Tags: smeserver-vacation-1_1-22_el6_sme, smeserver-vacation-1_1-24_el6_sme, smeserver-vacation-1_1-21_el6_sme, smeserver-vacation-1_1-17_el6_sme, smeserver-vacation-1_1-20_el6_sme, smeserver-vacation-1_1-14_el6_sme, smeserver-vacation-1_1-26_el6_sme, smeserver-vacation-1_1-25_el6_sme, smeserver-vacation-1_1-16_el6_sme, smeserver-vacation-1_1-18_el6_sme, smeserver-vacation-1_1-19_el6_sme, smeserver-vacation-1_1-15_el6_sme, smeserver-vacation-1_1-23_el6_sme, HEAD
* Wed Jul 06 2016 stephane de Labrusse <stephdl@de-labrusse.fr> 1.1-14.sme
- Add translation smeserver-vacation-1.1-locale-2016-07-06.patch
- delegate the vacation messages by group permissions [SME: 9657]

1 stephdl 1.1 diff -Nur smeserver-vacation-1.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/uservacations smeserver-vacation-1.1.new/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/uservacations
2     --- smeserver-vacation-1.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/uservacations 2016-06-21 09:58:59.709887389 +0200
3     +++ smeserver-vacation-1.1.new/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/uservacations 2016-06-22 01:01:17.588304177 +0200
4     @@ -91,4 +91,8 @@
5     ]]>
6     </trans>
7     </entry>
8     + <entry>
9     + <base>NO_USERS_IN_GRANTED_GROUPS</base>
10     + <trans>There are no users in the group(s) that you are granted to manage.</trans>
11     + </entry>
12     </lexicon>
13     diff -Nur smeserver-vacation-1.1.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/uservacations.pm smeserver-vacation-1.1.new/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/uservacations.pm
14     --- smeserver-vacation-1.1.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/uservacations.pm 2016-06-21 09:58:59.710887388 +0200
15     +++ smeserver-vacation-1.1.new/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/uservacations.pm 2016-06-22 00:59:15.014349221 +0200
16     @@ -28,6 +28,8 @@
17     our $PanelUser = $ENV{'REMOTE_USER'} ||'';
18     $PanelUser = $1 if ($PanelUser =~ /^([a-z][\.\-a-z0-9]*)$/);
19    
20     +our %delegatedVacations;
21     +
22     sub new {
23     shift;
24     my $self = esmith::FormMagick->new(filename => '/etc/e-smith/web/functions/uservacations');
25     @@ -52,8 +54,30 @@
26     my $self = shift;
27     my $q = $self->{cgi};
28    
29     +#We want to retrieve granted group from DB, and retrieve users of groups
30     + my $record = $adb->get($PanelUser);
31     + my $dg=$record->prop('delegatedVacations')||'';
32     + $dg =~ s/ //g;
33     + my @g = split(/,/, $dg);
34     + my @visiblemembers = ();
35     +
36     + foreach my $g (@g) {
37     + my $members = $adb->get_prop("$g",'Members');
38     + next unless defined $members;
39     + $members =~ s/ //g;
40     + my @members = split(/,/, $members);
41     + push @visiblemembers , @members ;
42     + }
43     +
44     + foreach my $k ( @visiblemembers )
45     + {
46     + $delegatedVacations{$k}=1;
47     + }
48     +
49     +
50     my @users = $adb->users;
51     return $self->localise("ACCOUNT_USER_NONE") if (@users == 0);
52     + return $self->localise("NO_USERS_IN_GRANTED_GROUPS") if (@visiblemembers == 0 && $dg ne '');
53    
54     my $vacation_table =
55     {
56     @@ -83,6 +107,7 @@
57    
58     for my $user (@users)
59     {
60     + next if %delegatedVacations and not $delegatedVacations{$user->key};
61     # make it clearer which uses have vacation
62     my $EmailVacation = $user->prop('EmailVacation') || '';
63     my $EmailVacationFrom = $user->prop('EmailVacationFrom') || '';

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed