Line # Revision Author
1 296 ahitrov % unless ($errstr) {
2 Принято!
3 % } else {
4 <div class="error"><% $errstr %></div>
5 <& "/comps/$prj/feedback_form.msn", ajax => 1, %ARGS &>
6 % }
7 <%args>
8
9 $filled => undef
10
11 </%args>
12 <%init>
13
14 my $prj = $request->{project};
15 my $profile = $request->{project_profile};
16 my $root = $request->{project_section};
17
18 my $errstr;
19 my ($document, $section);
20
21 my $CP = 'UTF8';
22 if ( $filled ) {
23 $CP = 'ISO' if Convert::Cyrillic::cstocs('ISO', 'UTF8', $filled) eq 'Отправить';
24 $CP = 'KOI8' if Convert::Cyrillic::cstocs('KOI8', 'UTF8', $filled) eq 'Отправить';
25 $CP = 'WIN' if Convert::Cyrillic::cstocs('WIN', 'UTF8', $filled) eq 'Отправить';
26
27 my $emailto = $profile->mailto || 'ahitrov@mail.ru';
28 $ARGS{name} = Convert::Cyrillic::cstocs($CP, 'UTF8', $ARGS{name});
29 $ARGS{lastname} = Convert::Cyrillic::cstocs($CP, 'UTF8', $ARGS{lastname});
30 $ARGS{job} = Convert::Cyrillic::cstocs($CP, 'UTF8', $ARGS{job});
31 $ARGS{position} = Convert::Cyrillic::cstocs($CP, 'UTF8', $ARGS{position});
32 $ARGS{question} = Convert::Cyrillic::cstocs($CP, 'UTF8', $ARGS{question});
33 if ( $ARGS{doc_id} ) {
34 $document = $keeper->get_document_by_id ( $ARGS{doc_id},
35 class => 'promosuite::Article',
36 );
37 }
38 if ( ref $document && $document->sections ) {
39 ($section) = $keeper->get_sections (
40 id => $document->{sections},
41 class => 'promosuite::SubSection',
42 limit => 1,
43 order_by => 'sorder',
44 );
45 }
46 if ( $ARGS{email} =~ /([\w\.-]+)\@([a-zA-Z\.-]+)/ ) {
47 my $msg = {
48 to => $emailto,
49 from => $ARGS{email},
50 subject => 'RAMBLER 2 Developers - обратная связь на проекте',
51 body => $m->scomp ("/comps/$prj/feedback_template.msn", section => $section, doc => $document, %ARGS),
52 };
53 $m->comp('/subs/sendmail.msn', email => $msg) if $msg->{body};
54 } else {
55 $errstr = 'Указан неверный e-mail';
56 }
57 }
58
59 </%init>