Il faut écouter l'événement « readystatechange » plutôt que « load » pour récupérer...
[Plinn.git] / skins / generic / send_email_form.pt
1 <html xmlns="http://www.w3.org/1999/xhtml"
2 metal:use-macro="here/main_template/macros/master">
3
4 <head>
5 <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
6 <title>Envoi de message</title>
7 </head>
8
9 <body tal:omit-tag="" metal:fill-slot="main" i18n:domain="plinn">
10 <div tal:replace="options/send_fields|nothing"></div>
11 <form action="." method="post" tal:attributes="action string:${here/absolute_url}/send_email">
12 <table tal:define="og python:options.get ;
13 expand python:og('expand', '');
14 other_adr python:og('other_adr', []);
15 batchM python:og('batchM', here.valid_roles());
16 customized_batch python:og('customized_batch', {}) ;
17 subject python:og('subject', '');
18 text_body python:og('text_body', '');
19 send_fields python:og('send_fields', {});
20 wfid request/wfid|nothing;
21 "
22 class="send_email_form">
23 <tr>
24 <td>
25 <h1 i18n:translate="">Send an email</h1>
26 </td>
27 </tr>
28 <tr>
29 <td i18n:translate="">Recipients:</td>
30 </tr>
31 <tr>
32 <td>
33 <div tal:repeat="roleAndMembers here/getRecipients">
34 <fieldset tal:define="r python:roleAndMembers[0] ; mir python:roleAndMembers[1]">
35 <legend tal:content="python:r" i18n:translate="">Role name</legend>
36
37 <div metal:use-macro="template/macros/send_field_chooser">To CC CCi</div>
38
39 <!-- <=10 -->
40 <div tal:repeat="m mir" tal:omit-tag="" tal:condition="python:len(mir) <= 10">
41 <label tal:define="selectAll python:r in batchM">
42 <input type="checkbox"
43 tal:attributes="value m/getId;
44 name python:'customized_batch.%s:list:record' % r;
45 checked python:selectAll or m.getId() in customized_batch.get(r,[])" />
46 <span tal:replace="python:m.getMemberFullName(nameBefore=0)">membre</span>
47 <span tal:condition="python:m == member" i18n:translate="">(as copy)</span>
48 </label>
49 </div>
50
51
52 <!-- >10 -->
53 <div tal:omit-tag="" tal:condition="python:len(mir) > 10">
54
55 <div tal:define="selectAll python:r in batchM or len(customized_batch.get(r,[])) == len(mir)"
56 tal:omit-tag="">
57
58 <!-- condensed display -->
59 <div tal:condition="python:not expand == r" tal:omit-tag="">
60 <label tal:condition="python:selectAll or not customized_batch.has_key(r)">
61 <input type="checkbox" name="batchM:list" value="role" tal:attributes="value r ; checked python:selectAll or r in batchM" />
62 <span i18n:translate="">All (<span i18n:name="nofpers" tal:replace="python:len(mir)">120</span> persons)</span>
63 </label>
64 <div tal:condition="python:not( selectAll or not customized_batch.has_key(r) )" tal:omit-tag="">
65 <span tal:replace="python:len(customized_batch[r])">n</span>/<span tal:replace="python:len(mir)">tot</span> <span i18n:translate="" tal:content="python:len(customized_batch[r])>1 and 'persons selected' or 'person selected'" tal:omit-tag="">persons selected</span>
66 <!-- hidden inputs -->
67 <input type="hidden" tal:attributes="value python:' '.join(customized_batch[r]) ; name python:'customized_batch.%s:tokens:record'%r" />
68 </div>
69 <input type="submit" value="Show list" name="expand.role" tal:attributes="name string:expand.${r}:record" i18n:attributes="value" />
70 </div>
71
72 <!-- collaped display -->
73 <div tal:condition="python:expand == r" tal:omit-tag="">
74 <select size="10" multiple="multiple" name="customized_batch.role:list:record" tal:condition="python:expand == r"
75 tal:attributes="name python:'customized_batch.%s:list:record' % r">
76 <option tal:repeat="m mir" tal:attributes="value m/getId ; selected python:(not customized_batch.has_key(r)) and True or (m.id in customized_batch[r])" tal:content="python:m.getMemberFullName(nameBefore=1)" >PIN Beno&icirc;t</option>
77 </select>
78 <br />
79 <input type="submit" value="Validate" i18n:attributes="value" name="collapse" /> <span i18n:translate="" tal:omit-tag="">(not required)</span>
80 </div>
81 </div>
82 </div>
83 </fieldset>
84 </div>
85 </td>
86 </tr>
87 <tr>
88 <td>
89 <fieldset>
90 <legend i18n:translate="">Others (on address by line)</legend>
91 <textarea name="other_adr:lines" rows="3" cols="74" tal:content="python:'\n'.join(other_adr)"></textarea>
92 </fieldset>
93 </td>
94 </tr>
95 <tr>
96 <td><span i18n:translate="">Subject:</span><br />
97 <textarea name="subject" rows="1" cols="74" tal:content="subject"></textarea>
98 </td>
99 </tr>
100 <tr>
101 <td><span i18n:translate="">Message body:</span><br />
102 <textarea name="text_body" rows="18" cols="74" tal:content="text_body"></textarea>
103 </td>
104 </tr>
105 <tr>
106 <td>
107 <input type="submit" value="Send email" i18n:attributes="value" />
108 <div tal:condition="wfid">
109 <input type="hidden" name="wfid" tal:attributes="value wfid" /><br />
110 <em i18n:translate="">Note: This message will be stored in content history.</em>
111 </div>
112 </td>
113 </tr>
114 </table>
115 </form>
116 </body>
117 </html>
118
119 <tal:block tal:replace="nothing">
120 <div style="float:right" metal:define-macro="send_field_chooser" i18n:domain="plinn">
121 <label>
122 <input type="radio" value="to"
123 tal:attributes="name python:'send_fields.%s:record' % r;
124 checked python:(not send_fields.get(r) and True) or (send_fields.get(r) == 'to')" />
125 <span i18n:translate="mail_to" tal:omit-tag="">To</span>
126 </label>
127 <label>
128 <input type="radio" value="cc"
129 tal:attributes="name python:'send_fields.%s:record' % r;
130 checked python:send_fields.get(r) == 'cc'" />
131 <span i18n:translate="mail_cc" tal:omit-tag="">CC</span>
132 </label>
133 <label>
134 <input type="radio" value="bcc"
135 tal:attributes="name python:'send_fields.%s:record' % r;
136 checked python:send_fields.get(r) == 'bcc'" />
137 <span i18n:translate="mail_bcc" tal:omit-tag="">BCC</span>
138 </label>
139 </div>
140 </tal:block>