/[smecontribs]/rpms/smeserver-vacation/contribs10/smeserver-vacation-1.1-SME10-Move-to-manager2.patch
ViewVC logotype

Annotation of /rpms/smeserver-vacation/contribs10/smeserver-vacation-1.1-SME10-Move-to-manager2.patch

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


Revision 1.1 - (hide annotations) (download)
Mon May 18 15:54:30 2020 UTC (4 years, 5 months ago) by brianr
Branch: MAIN
CVS Tags: smeserver-vacation-1_1-34_el7_sme, smeserver-vacation-1_1-31_el7_sme, smeserver-vacation-1_1-32_el7_sme, smeserver-vacation-1_1-30_el7_sme, smeserver-vacation-1_1-35_el7_sme, smeserver-vacation-1_1-36_el7_sme, smeserver-vacation-1_1-27_el7_sme, smeserver-vacation-1_1-33_el7_sme, smeserver-vacation-1_1-28_el7_sme, smeserver-vacation-1_1-29_el7_sme, HEAD
* Tue Apr 28 2020 Brian Read <brianr@bjsystems.co.uk> 1.1-27.sme
- Update to SME10 - rework server manager panels to use manager2 [SME:10927]

1 brianr 1.1 diff -urN smeserver-vacation-1.1.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Uservacations.pm smeserver-vacation-1.1/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Uservacations.pm
2     --- smeserver-vacation-1.1.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Uservacations.pm 1970-01-01 01:00:00.000000000 +0100
3     +++ smeserver-vacation-1.1/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Uservacations.pm 2020-05-18 15:32:00.000000000 +0100
4     @@ -0,0 +1,370 @@
5     +package SrvMngr::Controller::Uservacations;
6     +#----------------------------------------------------------------------
7     +# heading : Collaboration
8     +# description : User Vacations
9     +# navigation : 3000 3150
10     +#
11     +# name : Uservacationsget, method : get, url : /uservacations, ctlact : Uservacations#main
12     +# name : Uservacationspost,method : post, url : /Uservacations, ctlact : Uservacations#do_display
13     +# name : Uservacations1, method : get, url : /Uservacations1, ctlact : Uservacations#do_display
14     +# name : Uservacations2, method : post, url : /Uservacations2, ctlact : Uservacations#do_display
15     +# routes : end
16     +#----------------------------------------------------------------------
17     +
18     +use strict;
19     +use warnings;
20     +use Mojo::Base 'Mojolicious::Controller';
21     +
22     +#use DateTime; #Not part of SME10 mix
23     +use POSIX;
24     +
25     +use Locale::gettext;
26     +use SrvMngr::I18N;
27     +use SrvMngr qw(theme_list init_session_cgi);
28     +
29     +use Data::Dumper;
30     +use esmith::util;
31     +use esmith::HostsDB;
32     +use esmith::AccountsDB;
33     +
34     +our $db = esmith::ConfigDB->open();
35     +our $adb = esmith::AccountsDB->open();
36     +
37     +our $PanelUser = $ENV{'REMOTE_USER'} ||'';
38     +$PanelUser = $1 if ($PanelUser =~ /^([a-z][\.\-a-z0-9]*)$/);
39     +
40     +our %delegatedVacations;
41     +
42     +use constant FALSE => 0;
43     +use constant TRUE => 1;
44     +
45     +sub main {
46     +
47     + my $c = shift;
48     + $c->app->log->info( $c->log_req );
49     +
50     + my %vac_datas = ();
51     + my $title = $c->l('vac_FORM_TITLE');
52     + my $modul = '';
53     +
54     + $vac_datas{trt} = 'LIST';
55     +
56     + my @vacations = get_vacation_table($c);
57     + my $empty = (scalar @vacations == 0);
58     +
59     + $vac_datas{"first"} = 'vac_MODIFY_DESCRIPTION';
60     +
61     + $c->stash(
62     + title => $title,
63     + modul => $modul,
64     + vac_datas => \%vac_datas,
65     + vacations =>\@vacations,
66     + empty => $empty
67     + );
68     + $c->render( template => 'uservacations' );
69     +}
70     +
71     +sub do_display {
72     +
73     + my $c = shift;
74     + $c->app->log->info( $c->log_req );
75     +
76     + my $rt = $c->current_route;
77     + my $trt = ( $c->param('trt') || 'LIST' );
78     +
79     + $trt = 'ADD' if ( $rt eq 'Uservacations1' );
80     + $trt = 'ADD1' if ( $rt eq 'Uservacations2' );
81     +
82     + my %vac_datas = ();
83     + my $title = $c->l('vac_FORM_TITLE');
84     + my $modul = '';
85     +
86     +
87     + if ( $trt eq 'ADD' ) {
88     + # Add or change a vacation message - called from the list panel
89     + # Get the data and pass it across.
90     + my $account = $c->param("account");
91     + my $user = $adb->get($account);
92     + my $username = $user->prop("FirstName")." ".$user->prop("LastName");
93     + my $EmailVacation = $user->prop('EmailVacation') || '';
94     + my $EmailVacationFrom = $user->prop('EmailVacationFrom') || '';
95     + my $EmailVacationTo = $user->prop('EmailVacationTo') || '';
96     + my $VacText = get_vacation_text($c);
97     + $c->stash(account=>$account,
98     + username=>$username,
99     + EmailVacation=>$EmailVacation,
100     + EmailVacationFrom=>$EmailVacationFrom,
101     + EmailVacationTo=>$EmailVacationTo,
102     + VacText=>$VacText
103     + );
104     + }
105     +
106     + if ( $trt eq 'ADD1' ) {
107     + #Add or edit vacation message.
108     + my $ret = add_vac_message($c);
109     + #Return to list page if success
110     + if ($ret eq "OK") {
111     + $trt = "LIST";
112     + $vac_datas{success} = "vac_SUCCESS";
113     +
114     + } else {
115     + my $account = $c->param("account");
116     + my $user = $adb->get($account);
117     + my $username = $user->prop("FirstName")." ".$user->prop("LastName");
118     + my $EmailVacationFrom = $c->param('EmailVacationFrom') || '';
119     + my $EmailVacationTo = $c->param('EmailVacationTo') || '';
120     + my $EmailVacation = $c->param('EmailVacation') || '';
121     + my $VacText = $c->param("VacText");
122     + $c->stash(account=>$account,
123     + username=>$username,
124     + EmailVacation=>$EmailVacation,
125     + EmailVacationFrom=>$EmailVacationFrom,
126     + EmailVacationTo=>$EmailVacationTo,
127     + VacText=>$VacText
128     + );
129     + #Error - return to Add page
130     + $trt = "ADD";
131     + $vac_datas{error} = $ret;
132     + }
133     + }
134     +
135     + if ( $trt eq 'LIST' ) {
136     +
137     + #List all the users and vacation message details.
138     + my @vacations = get_vacation_table($c);
139     + my $empty = (scalar @vacations == 0);
140     + $c->stash(
141     + empty => $empty,
142     + vacations =>\@vacations
143     + );
144     + }
145     +
146     +
147     + $vac_datas{'trt'} = $trt;
148     + $c->stash( title => $title, modul => $modul, vac_datas => \%vac_datas );
149     + $c->render( template => 'uservacations' );
150     +}
151     +
152     +sub user_accounts_exist
153     +{
154     + my $q = shift;
155     + #return scalar $adb->users;
156     + if (scalar $adb->users)
157     + { return $q->l('vac_DESCRIPTION'); }
158     +}
159     +
160     +sub get_vacation_table
161     +{
162     + my $self = shift;
163     + #my $q = $self->{cgi};
164     +
165     +#We want to retrieve granted group from DB, and retrieve users of groups
166     + my $record = $adb->get($PanelUser);
167     + my $dg=$record->prop('delegatedVacations')||'';
168     + $dg =~ s/ //g;
169     + my @g = split(/,/, $dg);
170     + my @visiblemembers = ();
171     +
172     + foreach my $g (@g) {
173     + my $members = $adb->get_prop("$g",'Members');
174     + next unless defined $members;
175     + $members =~ s/ //g;
176     + my @members = split(/,/, $members);
177     + push @visiblemembers , @members ;
178     + }
179     +
180     + foreach my $k ( @visiblemembers )
181     + {
182     + $delegatedVacations{$k}=1;
183     + }
184     +
185     +
186     + my @users = $adb->users;
187     + return () if (@users == 0); ##$self->l("ACCOUNT_USER_NONE")
188     + return () if (@visiblemembers == 0 && $dg ne '');#; #$self->l("NO_USERS_IN_GRANTED_GROUPS")
189     +
190     + my @data = ();
191     +
192     + for my $user (@users)
193     + {
194     + next if %delegatedVacations and not $delegatedVacations{$user->key};
195     + # make it clearer which uses have vacation
196     + my $EmailVacation = $user->prop('EmailVacation') || '';
197     + my $EmailVacationFrom = $user->prop('EmailVacationFrom') || '';
198     + my $EmailVacationTo = $user->prop('EmailVacationTo') || '';
199     + my $status = $user->prop('EmailVacation') || '';
200     + if ($status eq 'yes') { $status = 'YES'; } else { $status = ''; }
201     +
202     + push @data,
203     + { User => $user->key,
204     + FullName => $user->prop('FirstName') . " " .$user->prop('LastName'),
205     + status => $self->l($status),
206     + EmailVacation => $EmailVacation,
207     + EmailVacationFrom => $EmailVacationFrom,
208     + EmailVacationTo => $EmailVacationTo,
209     + Modify => $self->l('vac_MODIFY'),
210     + }
211     + }
212     + return @data;
213     +}
214     +
215     +sub modify_link
216     +{
217     + my ($data_item, $row, $field) = @_;
218     +
219     + return "uservacations?" .
220     + join("&",
221     + "page=0",
222     + "page_stack=",
223     + "Next=Next",
224     + "User=" . $row->{User},
225     + "FullName=" . $row->{FullName},
226     + "EmailVacation=" . $row->{EmailVacation},
227     + "EmailVacationFrom=" . $row->{EmailVacationFrom},
228     + "EmailVacationTo=" . $row->{EmailVacationTo},
229     + "wherenext=VACATION_PAGE_MODIFY");
230     +}
231     +
232     +# this formats the text to display on screen
233     +sub get_vacation_text
234     +{
235     + my $q = shift;
236     + my $domain = $db->get_value('DomainName');
237     + my $user = $q->param('account');
238     +
239     + my $fullname = $adb->get_prop($user, "FirstName") . " " .
240     + $adb->get_prop($user, "LastName");
241     +
242     + my $vfile = "/home/e-smith/files/users/$user/.vacation.msg";
243     +
244     + my $from = $q->l('vac_FROM');
245     + my $Subject = $q->l('vac_SUBJECT');
246     + my $away = $q->l('vac_AWAY_FROM_MAIL');
247     + my $return = $q->l('vac_ANSWER_TO_OBJECT_SENDER');
248     +
249     + my $ExistingMessage = "$from $fullname &lt\;$user\@$domain&gt\;\n"."$Subject $return\n".
250     + "\n$away\n"."\n--\n$fullname";
251     +
252     + # if exists and is not empty
253     + if (( -e $vfile ) && (! -z $vfile ))
254     + {
255     + open (VACATION, "<$vfile")
256     + or die "Error: Could not open file: $vfile\n";
257     + my @vacationTemp;
258     +
259     + #reformat so email address isn't hidden inside < >
260     + while (<VACATION>)
261     + {
262     + $_ =~ s/</&lt\;/;
263     + $_ =~ s/>/&gt\;/;
264     + push (@vacationTemp, $_);
265     + }
266     +
267     + $ExistingMessage = join ("", @vacationTemp);
268     +
269     + close VACATION;
270     + }
271     + return $ExistingMessage;
272     +}
273     +
274     +# saves the text to .vacation.msg
275     +sub add_vac_message
276     +{
277     + my $q = shift;
278     +
279     + my $domain = $db->get_value('DomainName');
280     + my $user = $q->param('account');
281     +
282     + my $EmailVacation = $q->param('EmailVacation')||"no";
283     + #die($EmailVacation);
284     + #if ($EmailVacation eq "yes") {$EmailVacation = "yes";} else {$EmailVacation = "no";}
285     +
286     + #Decode To and FROM to standard format - comes over in html5 iso format yyyy-mm-dd
287     + my $EmailVacationFrom = trim($q->param('EmailVacationFrom'));
288     + my ($fromYear,$fromMonth,$fromDay) = ($EmailVacationFrom =~ /(\d{4})-(\d{2})-(\d{2})/);
289     + $EmailVacationFrom = $fromYear.$fromMonth.$fromDay;
290     + if ($EmailVacationFrom !~ m/^2[0-9]{3}[0|1][0-9][0-3][0-9]$/ and $EmailVacationFrom ne "") {return "vac_FROM_DATE_INCORRECT";}
291     + my $EmailVacationTo = trim($q->param('EmailVacationTo'));
292     + my ($toYear,$toMonth,$toDay) = ($EmailVacationTo =~ /(\d{4})-(\d{2})-(\d{2})/);
293     + $EmailVacationTo = $toYear.$toMonth.$toDay;
294     +# $EmailVacationTo =~ s/-//g; #Just take out "-".
295     + if ($EmailVacationTo !~ m/^2[0-9]{3}[0|1][0-9][0-3][0-9]$/ and $EmailVacationFrom ne "") {return "vac_TO_DATE_INCORRECT";}
296     + #Check not the same or From follows To.
297     + if ($EmailVacationTo ne "" and $EmailVacationTo eq $EmailVacationFrom) {return "vac_DATES_THE_SAME";}
298     + my $UnixFrom = mktime(0,0,0,$fromDay,$fromMonth,$fromYear);
299     + my $UnixTo = mktime(0,0,0,$toDay,$toMonth,$toYear);
300     + if ($UnixTo < $UnixFrom) {return "vac_TO_DATE_MUST_BE_LATER";}
301     +
302     +
303     + my $new_message = $q->param('VacText');
304     + my $vfile = "/home/e-smith/files/users/$user/.vacation.msg";
305     +
306     + my $fullname = $adb->get_prop($user, "FirstName") . " " .
307     + $adb->get_prop($user, "LastName");
308     +
309     + my $from = 'From:';
310     + my $away = $q->l('vac_AWAY_FROM_MAIL');
311     + my $return = $q->l('vac_ANSWER_TO_OBJECT_SENDER');
312     +
313     + my $vacation_text = "$from $fullname \<$user\@$domain\>\n"."Subject: $return\n".
314     + "\n$away \n"."\n--\n$fullname";
315     +
316     + my $reset = $vacation_text;
317     +
318     + # if exists and is not empty
319     + if (( -e $vfile ) && (! -z $vfile ))
320     + {
321     + open (VACATION, "<$vfile")
322     + or die "Error: Could not open file: $vfile\n";
323     + my @vacationTemp = <VACATION>;
324     + $vacation_text = join ("", @vacationTemp);
325     +
326     + close VACATION;
327     + }
328     +
329     + chomp $new_message;
330     +
331     + # reset msg to default,
332     + if ($new_message =~ /reset/)
333     + { $vacation_text = $reset; }
334     + else
335     + {
336     + #or save new_message
337     + unless ($new_message eq "")
338     + { $vacation_text = $new_message; }
339     + }
340     +
341     + # Strip out DOS Carriage Returns (CR)
342     + $vacation_text =~ s/\r//g;
343     +
344     + unlink $vfile;
345     + open (VACATION, ">$vfile")
346     + or die ("Error opening vacation message.\n");
347     +
348     + print VACATION "$vacation_text";
349     + close VACATION;
350     +
351     + esmith::util::chownFile($user, $user,
352     + "/home/e-smith/files/users/$user/.vacation.msg");
353     +
354     + $adb->set_prop($user, 'EmailVacation', $EmailVacation);
355     + $adb->set_prop($user, 'EmailVacationFrom', $EmailVacationFrom);
356     + $adb->set_prop($user, 'EmailVacationTo', $EmailVacationTo);
357     +
358     + #the first is more correct but is slower
359     + #system ("/sbin/e-smith/signal-event", "email-update", $user) == 0
360     + system ("/etc/e-smith/events/actions/qmail-update-user event $user") == 0
361     + or die ("Error occurred updating .qmail\n");
362     +
363     + if (($EmailVacation eq 'no') && ( -e "/home/e-smith/files/users/$user/.vacation"))
364     + {
365     + system ("/bin/rm /home/e-smith/files/users/$user/.vacation") == 0
366     + or die ("Error resetting vacation db.\n");
367     + }
368     +
369     + return "OK";
370     +}
371     +
372     +sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
373     +
374     +1;
375     diff -urN smeserver-vacation-1.1.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Modules/Uservacations/en.pm smeserver-vacation-1.1/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Modules/Uservacations/en.pm
376     --- smeserver-vacation-1.1.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Modules/Uservacations/en.pm 1970-01-01 01:00:00.000000000 +0100
377     +++ smeserver-vacation-1.1/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Modules/Uservacations/en.pm 2020-05-18 16:21:00.000000000 +0100
378     @@ -0,0 +1,63 @@
379     +package SrvMngr::I18N::Modules::Uservacations::en;
380     +use strict;
381     +use warnings;
382     +use utf8;
383     +use Mojo::Base 'SrvMngr::I18N';
384     +
385     +use SrvMngr::I18N::Modules::General::en;
386     +
387     +my %lexicon = (
388     +'vac_User vacations' =>'User vacations',
389     +'vac_Vacation Message' =>'Vacation Message',
390     +'vac_FORM_TITLE' =>'Change user vacation settings',
391     +'vac_DESCRIPTION' =>' You can modify a users vacation message by clicking
392     + on the link to the right of their name below.
393     +',
394     +'vac_LABEL_VACATION' =>'Vacation',
395     +'vac_NO_FORWARDS'=>'No users found for forwarding',
396     +'vac_VACATION_FROM' =>'Vacation starts on <br>(YYYYMMDD)',
397     +'vac_VACATION_TO' =>'Vacation finishes on <br>(YYYYMMDD)',
398     +'vac_VACATION_FROM1' =>'Vacation starts on',
399     +'vac_VACATION_TO1' =>'Vacation finishes on',
400     +'vac_MESSAGE' =>'Vacation message',
401     +'vac_VACATION_STATUS' =>'Enable vacation messages',
402     +'vac_FROM' =>'From:',
403     +'vac_SUBJECT' =>'Subject:',
404     +'vac_AWAY_FROM_MAIL' =>'I will not be reading my mail for a while. Your mail regarding $SUBJECT will be read when I return.',
405     +'vac_NO_USERS_IN_GRANTED_GROUPS' =>'There are no users in the group(s) that you are granted to manage.',
406     +'vac_ANSWER_TO_OBJECT_SENDER' => 'Re: $SUBJECT - Away from my email ',
407     +'vac_FROM_DATE_INCORRECT'=>'From date must have YYYYMMDD format',
408     +'vac_TO_DATE_INCORRECT'=>'To date must have YYYYMMDD format',
409     +'vac_DATES_THE_SAME'=>"The Start and Finish dates cannot be the same",
410     +'vac_TO_DATE_MUST_BE_LATER'=>"The Finish dates cannot be earlier than the Start date",
411     +'vac_SUCCESS'=>'Vacation message saved sucessfully',
412     +'vac_MODIFY_DESCRIPTION' =>'
413     + <p>
414     + Enter a vacation message here. You can use $SUBJECT
415     + anywhere in the text to be replaced with the subject line
416     + from the email that activated the auto-reply.</p>
417     +
418     + <p>
419     + This message must be composed of two parts separated by a blank line.
420     + The first will be integrated into the headings of the email reply,
421     + you must thus ensure you leave at least a blank line before typing your message.
422     + The primary domain is added to the address automatically,or you can insert a virtual domain by replacing the domain part of the sender address
423     + in the first line of the message with the virtual domain name (eg. replace the default From: user@primary.domain with From: user@virtual.domain).
424     + To change the vacation message back to the default type reset.</p>
425     + <p>
426     + You can also fill out the Enable vacation on and Disable vacation on fields in order to
427     + automatically enable and disable sending of the vacation message for this user account on the given dates.
428     + </p>
429     + <p>
430     + The dates in the two fields must not be the same.<br>
431     + If you want to use this functionality, leave the Enable vacation messages setting at No - it will be automatically activated based on the date given.
432     + </p>'
433     +);
434     +
435     +our %Lexicon = (
436     + %{ SrvMngr::I18N::Modules::General::en::Lexicon },
437     + %lexicon
438     +);
439     +
440     +
441     +1;
442     diff -urN smeserver-vacation-1.1.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_vac_add.html.ep smeserver-vacation-1.1/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_vac_add.html.ep
443     --- smeserver-vacation-1.1.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_vac_add.html.ep 1970-01-01 01:00:00.000000000 +0100
444     +++ smeserver-vacation-1.1/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_vac_add.html.ep 2020-05-18 15:29:00.000000000 +0100
445     @@ -0,0 +1,54 @@
446     +<div id='vac_add'>
447     +
448     + % my $btn = l('ADD');
449     +
450     + % if ($config->{debug} == 1) {
451     + <p>
452     + %= dumper $c->current_route
453     + %= dumper $EmailVacation
454     + </p>
455     + % }
456     +
457     + %= form_for '/Uservacations2' => (method => 'POST') => begin
458     +
459     + <span class=label>
460     + %=l 'ACCOUNT'
461     + </span><span class=data>
462     + %= $account
463     + </span><br><br>
464     + <span class=label>
465     + %=l 'USER_NAME'
466     + </span><span class=data>
467     + %=$username
468     + </span><br><br>
469     + <span class=label>
470     + %=$c->render_to_string(inline =>$c->l('vac_VACATION_FROM1'))
471     + </span>
472     + <span class=data>
473     + %=date_field 'EmailVacationFrom' =>$EmailVacationFrom
474     + </span><br><br>
475     + <span class=label>
476     + %=$c->render_to_string(inline =>$c->l('vac_VACATION_TO1'))
477     + </span>
478     + <span class=data>
479     + %=date_field 'EmailVacationTo' =>$EmailVacationTo
480     + </span><br><br>
481     + <span class=label>
482     + %=l 'vac_MESSAGE'
483     + </span>
484     + <span class=data>
485     + %=text_area 'VacText' => $VacText, cols=>55, rows=>15
486     + </span><br><br>
487     + <span class=label>
488     + %=l 'vac_VACATION_STATUS'
489     + </span>
490     + <span class=data>
491     + % param EmailVacation => "$EmailVacation";
492     + %=select_field EmailVacation =>[['Yes'=>'yes'],['No'=>'no']]
493     + </span><br><br>
494     + %= hidden_field 'account' => $account
495     +
496     + %= submit_button "$btn", class => 'action'
497     + %end
498     +
499     +</div>
500     diff -urN smeserver-vacation-1.1.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_vac_list.html.ep smeserver-vacation-1.1/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_vac_list.html.ep
501     --- smeserver-vacation-1.1.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_vac_list.html.ep 1970-01-01 01:00:00.000000000 +0100
502     +++ smeserver-vacation-1.1/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_vac_list.html.ep 2020-05-07 09:02:00.000000000 +0100
503     @@ -0,0 +1,50 @@
504     +<div id='vac_list'>
505     +
506     + %# my $btn = l('vac_CREATE_RULE');
507     +
508     + %= form_for '/Uservacations1' => (method => 'POST') => begin
509     + <br><br>
510     +
511     + % if ($empty){
512     + <br>
513     + %=l 'vac_NO_FORWARDS'
514     + % } else {
515     + <table class="sme-border"><tbody>
516     + <tr>
517     + <th class='sme-border'>
518     + %=l 'ACCOUNT'
519     + </th>
520     + <th class='sme-border'>
521     + %=l 'USER_NAME'
522     + </th>
523     + <th class='sme-border'>
524     + %=l 'vac_LABEL_VACATION'
525     + </th>
526     +
527     + <th class='sme-border'>
528     + %=$c->render_to_string(inline =>l('vac_VACATION_FROM'))
529     + </th>
530     + <th class='sme-border'>
531     + %=$c->render_to_string(inline =>l('vac_VACATION_TO'))
532     + </th>
533     + <th class='sme-border' '>
534     + %=l 'ACTION'
535     + </th>
536     + </tr>
537     + % foreach my $vacation (@$vacations) {
538     + <tr>
539     + %= t td => (class => 'sme-border') => $vacation->{"User"}
540     + %= t td => (class => 'sme-border') => $vacation->{"FullName"}
541     + %= t td => (class => 'sme-border') => $vacation->{"status"}
542     + %= t td => (class => 'sme-border') => $vacation->{"EmailVacationFrom"}
543     + %= t td => (class => 'sme-border') => $vacation->{"EmailVacationTo"}
544     + <td>
545     + <a href="/server-manager2/Uservacations1?trt=ADD&account=<%= $vacation->{"User"}%>"><%=l 'MODIFY'%></a>
546     + </td>
547     + </tr>
548     + %}
549     + </tbody>
550     + </table>
551     + %}
552     + % end
553     +</div>
554     diff -urN smeserver-vacation-1.1.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/uservacations.html.ep smeserver-vacation-1.1/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/uservacations.html.ep
555     --- smeserver-vacation-1.1.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/uservacations.html.ep 1970-01-01 01:00:00.000000000 +0100
556     +++ smeserver-vacation-1.1/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/uservacations.html.ep 2020-05-07 09:02:00.000000000 +0100
557     @@ -0,0 +1,42 @@
558     +% layout 'default', title => "Sme server 2 - User Vacations", share_dir => './';
559     +
560     +% content_for 'module' => begin
561     +<div id="module">
562     +
563     + % if ($config->{debug} == 1) {
564     + <p>
565     + %= dumper $c->current_route
566     + </p>
567     + % }
568     +
569     + <h1><%=$title%></h1>
570     + %= $modul
571     +
572     + %if ($vac_datas->{first}) {
573     + <br>
574     + %=$c->render_to_string(inline =>$c->l($vac_datas->{first}))
575     +
576     + %} elsif ($vac_datas->{success}) {
577     + <div class='"success"'>
578     + <h2> Operation Status Report</h2>
579     + %= $c->l($vac_datas->{success});
580     + </div>
581     +
582     + %} elsif ($vac_datas->{error}) {
583     + <div class='sme-error'>
584     + <h2> Operation Status Report - error</h2>
585     + %= $c->l($vac_datas->{error});
586     + </div>
587     + %}
588     +
589     +
590     + % if ($vac_datas->{trt} eq 'ADD') {
591     + %= include 'partials/_vac_add'
592     + %} elsif ($vac_datas->{trt} eq 'ADD1') {
593     + %= include 'partials/_vac_add'
594     + %} else {
595     + %= include 'partials/_vac_list'
596     + %}
597     +
598     +</div>
599     +%end

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