source: extensions/event_cats/admin/template/autolog_new.tpl @ 7693

Last change on this file since 7693 was 7693, checked in by LucMorizur, 13 years ago

JS on validity date

File size: 21.6 KB
Line 
1{* <!-- Event Cats (event categories) LucMorizur June 2009 - ... --> *}
2
3{* <!-- Keeps file coded in UTF-8 without BOM : é --> *}
4
5{include file = $HeaderIncTPL}
6{include file = 'include/datepicker.inc.tpl'}
7
8{* <!-- Remove a strange unwanted line at the bottom of the screen --> *}
9{html_head} {literal}
10  <style type = "text/css"> #ui-datepicker-div { display:none; } </style>
11{/literal} {/html_head}
12
13{* <!-- Whether plugin Additionnal Pages is active or not, and help banner management --> *}
14<div style = "text-align:right; font-style:italic;">
15  <span id = "ec_help_banner2">
16    {'Help banner'|@translate}&nbsp;
17    <label for = "ec_help_banner2_1" onclick = "ec_mark_help('ec_help_banner_1');">
18      <input type = "radio" name = "ec_help_banner2_onoff" id = "ec_help_banner2_1"/>
19      {'Show'|@translate}
20    </label>
21    &nbsp;
22    <label for = "ec_help_banner2_0" onclick = "ec_mark_help('ec_help_banner_0');">
23      <input type = "radio" name = "ec_help_banner2_onoff" id = "ec_help_banner2_0"/>
24      {'Hide'|@translate}
25    </label>
26    &nbsp;—&nbsp;
27  </span>
28  {if $ec_ap_ok}
29    {'Additional Pages active'|@translate}
30    <script type = "text/javascript">
31      var ec_ap_ok = {if count($ec_lists.add_pages) == 0}false{else}true{/if};
32    </script>
33  {else}
34    {'Additional Pages inactive'|@translate}
35    <script type = "text/javascript">
36      var ec_ap_ok = false;
37    </script>
38  {/if}
39</div><span id = "ec_help_ban"></span>
40<script type = "text/javascript"><!--
41  document.getElementById('ec_help_banner2').style.display = "none";
42//--></script>
43
44{* <!-- Parameters list --> *}
45<form class = "filter" method = "post" name = "ec_new_code" action = "" onsubmit = "return ec_check_submit();">
46  <p>
47    <input type = "hidden" id = "ec_act1_id" name = "ec_act1">
48    <input type = "hidden" id = "ec_act2_id" name = "ec_entry_sel">
49  </p>
50 
51  {* <!-- Page title. Can be "New entry" or "Entry modification" --> *}
52  <div style = "text-align:center;">
53    <a style = "font-weight:bold; font-size:120%;" href = "#ec_top" name = "ec_top" title = "{'Place title on top ttip'|@translate}">
54      <!--[if !IE]> <--> <label> <!--> <![endif]-->
55        {if $ec_is_creation}
56          {'New entry title'|@translate}
57        {else}
58          {'Modify entry title'|@translate}
59        {/if}
60      <!--[if !IE]> <--> </label> <!--> <![endif]-->
61      <!-- What we're able to do for our "prefered" browser |-( ...!  -->
62    </a>
63    {if $ec_is_creation}
64      <br><br>
65      <input class = "submit" type = "button" value = "{'Full auto'|@translate}"
66       id = "ec_submit_gen_full_auto_id" onclick = "ec_gen_full_auto();" style = "margin-top:0;"/>
67    {/if}
68  </div>
69 
70  {* <!-- [ [ [New] / [existing] code] / [Existing entry] ] selection --> *}
71  <fieldset>
72    <legend style = "font-weight:bold;">
73      {if $ec_is_creation}
74        {'Code'|@translate}
75      {else}
76        {'Selected entry'|@translate}
77      {/if}
78    </legend>
79    <ul>
80   
81      {if $ec_is_creation}
82        <li>
83          {* <!-- New code (to create) --> *}
84          <label for = "ec_in_up_code_id" onclick = "ec_mark_code('ec_sel_code_new');" {$ec_hidden_when_no_code} >
85            <input type = "radio" name = "ec_sel_code" value = "new" id = "ec_sel_code_new"/>
86            {'New code'|@translate}
87          </label>
88          <span {$ec_hidden_when_no_code} >&nbsp;</span>
89          <label for = "ec_in_up_code_id" style = "margin:0;">
90            <input class = "submit" type = "button" value = "{'Auto code button'|@translate}"
91             id = "ec_submit_gen_code_id" onclick = "ec_gen_code();" style = "margin:0;"
92           >
93          </label>
94          {'Auto code mid'|@translate}
95          <select name = "ec_in_up_auto_code_length" id = "ec_in_up_auto_code_length_id" onchange = "ec_auto_code_digits_nb = this.value;">
96            {foreach from = $ec_auto_code_dg_nb item = ec_item name = listloop}
97              <option value = "{$ec_item}">
98                {$ec_item}
99                {if $smarty.foreach.listloop.index == 0}
100                  {'Auto code min'|@translate}
101                {/if}
102                {if $smarty.foreach.listloop.index == count($ec_auto_code_dg_nb) - 1}
103                  {'Auto code max'|@translate}
104                {/if}
105              </option>
106            {/foreach}
107          </select>
108          {'Auto code end'|@translate}<br>
109        </li>
110       
111        <li style = "padding-left: 30px;">
112          <input type = "text" name = "ec_in_up_code" maxlength = "32" size = "40"
113           id = "ec_in_up_code_id" onblur = "ec_check_code_text(this.value);"
114         >
115          &nbsp;—&nbsp;
116          <label for = "ec_in_up_comment_id" style = "margin:0;" title = "{'Optional'|@translate}">
117            <span style = "font-weight:bold; font-style:italic;">{'Comment'|@translate}</span>
118            <input type = "text" name = "ec_in_up_comment" maxlength = "100" size = "50" id = "ec_in_up_comment_id"
119              onchange = "ec_new_comment_text = this.value;"
120           >
121          </label>
122        </li>
123       
124        <li>
125          {* <!-- Known code --> *}
126          <label for = "ec_in_up_code_list_id" onclick = "ec_mark_code('ec_sel_code_old');" {$ec_hidden_when_no_code}>
127            <input type = "radio" name = "ec_sel_code" {$ec_hidden_when_no_code} value = "old" id = "ec_sel_code_old">
128            {'Existing code'|@translate}
129          </label>
130          <select name = "ec_in_up_code_list" id = "ec_in_up_code_list_id" onchange = "ec_change_code_list(this.value);" {$ec_hidden_when_no_code} >
131            {foreach from = $ec_lists.duplicable_codes.codes key = ec_key item = ec_val}
132              <option value = "{$ec_val.id}">
133                {$ec_key}
134                {if $ec_val.comment != ''}
135                  &nbsp;—&nbsp;{$ec_val.comment}
136                {/if}
137              </option>
138            {/foreach}
139          </select>
140        </li>
141       
142      {else}
143       
144        {* <!-- Existing entry selection --> *}
145        <li>
146          {* <!-- Entry choice --> *}
147          <select name = "ec_in_up_entry_list" id = "ec_in_up_entry_list_id" onchange = "ec_mark_entry(this.value);">
148            {foreach from = $ec_lists.ec_table item = ec_val}
149              <option value = "{$ec_val.id}">
150                {$ec_val.id} : {$ec_val.code}
151                {if $ec_val.comment != ''}
152                  &nbsp;—&nbsp;{$ec_val.comment}
153                {/if}
154              </option>
155            {/foreach}
156          </select>
157          &nbsp;—&nbsp;
158            <label for = "ec_in_up_comment_id" style = "margin:0;" title = "{'Optional'|@translate}">
159              <span style = "font-weight:bold;  font-style:italic;">{'Comment'|@translate}</span>
160              <input type = "text" name = "ec_in_up_comment" maxlength = "100" size = "50" id = "ec_in_up_comment_id"
161               onchange = "ec_new_comment_text = this.value;">
162            </label>
163        </li>
164       
165      {/if}
166   
167    </ul>
168  </fieldset>
169 
170  {* <!-- User to identify --> *}
171  <fieldset>
172    <legend style = "font-weight:bold;">
173      {'Identified user'|@translate}
174      <span style = "font-weight:bold; color:red;" id = "ec_in_up_pwd_warn">&nbsp;</span><br>
175    </legend>
176      <ul>
177     
178        {if !$ec_is_creation}
179          <li>
180            {* <!-- None --> *}
181            <label onclick = "return ec_mark_user('ec_sel_user_none');">
182              <input type = "radio" name = "ec_sel_user" value = "none" id = "ec_sel_user_none">
183              {'No user'|@translate}
184            </label><br>
185          </li>
186        {/if}
187       
188        <li>
189          {* <!-- New user (to create) --> *}
190          <label for = "ec_in_up_usr_txt_id" onclick = "return ec_mark_user('ec_sel_user_new');" {$ec_hidden_when_no_user} >
191            <input type = "radio" name = "ec_sel_user" value = "new" id = "ec_sel_user_new" {$ec_hidden_when_no_user}>
192            {'New generic user'|@translate}
193          </label>
194          <span {$ec_hidden_when_no_user} >&nbsp;</span>
195          <label for = "ec_in_up_usr_txt_id" style = "margin:0;">
196            <input class = "submit" type = "button" value = "{'Generate username'|@translate}"
197             id = "ec_submit_gen_user_id" onclick = "ec_gen_user();"
198           >
199          </label>
200        </li>
201        <li style = "padding-left: 30px;">
202          <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'New username'|@translate}<br>
203            <input type = "text" name = "login" id = "ec_in_up_usr_txt_id" maxlength = "50"
204             size = "20" onblur = "ec_new_user_text = this.value; ec_check_user_text();"
205           >
206          </label>
207          <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'New password'|@translate}<br>
208            <input type = "text" name = "password" id = "ec_in_up_psd_txt_id" maxlength = "32"
209             size = "20" onblur = "ec_new_psd_text = this.value; ec_check_pwd_text();"
210           >
211          </label>
212          <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'Confirm password'|@translate}<br>
213            <input type = "password" id = "ec_confirm_psd_txt_id" maxlength = "32" size = "20"/>
214          </label>
215          <label class = "ec_block" onclick = "ec_check_grp_text(); return ec_mark_user('ec_sel_user_new');" for = "ec_in_up_grp_txt_id">
216            <input type = "checkbox" name = "ec_in_up_newgroup" id = "ec_in_up_newgroup_id"
217             onchange = "ec_selected_old_group = (this.checked != '');"
218           >
219            <span onMouseover = "ec_chk_over_grp = true;" onMouseout = "ec_chk_over_grp = false;">
220              {'New group'|@translate}
221            </span><br>
222            <input type = "text" name = "groupname" id = "ec_in_up_grp_txt_id" maxlength = "32"
223             size = "20" onblur = "ec_new_grp_text = this.value; if (this.value != '') ec_selected_old_group = true;"
224           >
225          </label><br>
226        </li>
227       
228        <li>
229          {* <!-- Known user --> *}
230          <label for = "ec_in_up_usr_list_id" onclick = "return ec_mark_user('ec_sel_user_old');" {$ec_hidden_when_no_user} >
231            <input type = "radio" name = "ec_sel_user" {$ec_hidden_when_no_user} value = "old" id = "ec_sel_user_old">
232            {'Existing user'|@translate}
233          </label>
234          <select name = "ec_in_up_usr_list" id = "ec_in_up_usr_list_id" onchange = "ec_change_user_list(this.value);" {$ec_hidden_when_no_user} >
235            {foreach from = $ec_lists.user_ids key = ec_key item = ec_val}
236              <option label = "{$ec_val}" value = "{$ec_key}" >{$ec_val}</option>
237            {/foreach}
238          </select><br>
239        </li>
240   
241      </ul>
242  </fieldset>
243 
244  {* <!-- Page to display --> *}
245  <fieldset>
246    <legend style = "font-weight:bold;">{'Displayed page'|@translate}</legend>
247    <ul>
248   
249      <li>
250        <label class = "ec_block" for = "ec_in_up_forced_id" style = "margin-top:5px;" onclick = "ec_mark_forced();">
251          <input type = "checkbox" name = "ec_in_up_forced" id = "ec_in_up_forced_id">
252          <span id = "ec_style_forced_id">&nbsp;</span>
253        </label>
254      </li>
255     
256      <li>
257        {* <!-- Additionnal Page, provided the plugin is activated and at least one Add. P. is available --> *}
258        <label class = "ec_block" for = "ec_in_up_aps_id" onclick = "return ec_mark_action('ec_input_action_add_p');"
259         {if !$ec_ap_ok or count($ec_lists.add_pages) == 0} style = "display:none;" {/if}
260        >
261          <input type = "radio" name = "ec_input_action" value = "add_p" id = "ec_input_action_add_p">
262          {'Additional Page'|@translate}<br>
263          <select class = "categoryList" name = "ec_in_up_aps" size = "30" id = "ec_in_up_aps_id" onchange = "ec_selected_AP = this.value;" >
264            {html_options options = $ec_lists.add_pages}
265          </select>
266        </label>
267       
268        {* <!-- Category, provided at least one category is available --> *}
269        <label class = "ec_block" for = "ec_in_up_cats_id" onclick = "return ec_mark_action('ec_input_action_cat');"
270         {if count($ec_lists.categories) == 0} style = "display:none;" {/if}
271        >
272          <input type = "radio" name = "ec_input_action" value = "cat" id = "ec_input_action_cat"
273            onMouseover = "ec_chk_nover_cat = false;" onMouseout = "ec_chk_nover_cat = true;"
274         >
275          <span onMouseover = "ec_chk_nover_cat = false;" onMouseout = "ec_chk_nover_cat = true;">{'Category'|@translate}</span><br>
276          <select class = "categoryList" name = "ec_in_up_cat" size = "30" id = "ec_in_up_cats_id" onchange = "ec_selected_cat = this.value;">
277            {html_options options = $ec_lists.categories}
278          </select>
279        </label>
280       
281        {* <!-- Image, provided at least one category is available and at least one image is associated to one category --> *}
282        <label class = "ec_block" for = "ec_in_up_imgs_id" onclick = "return ec_mark_action('ec_input_action_img');"
283         {if $ec_no_assoc or count($ec_lists.categories) == 0} style = "display:none;" {/if}
284        >
285          <input type = "radio" name = "ec_input_action" value = "img" id = "ec_input_action_img">
286          {'Image id'|@translate}<br>
287          <input type = "text" name = "ec_in_up_img" id = "ec_in_up_imgs_id" maxlength = "6"
288           size = "10" onblur = "ec_selected_img = this.value; ec_check_img_text();" onfocus = "return ec_mark_action('ec_input_action_img');"
289         ><br>
290          <span id = "ec_in_up_imgs_warn">&nbsp;</span><br>
291        </label>
292       
293        {* <!-- Index page --> *}
294        <label class = "ec_block" onclick = "return ec_mark_action('ec_input_action_home');">
295          <input type = "radio" name = "ec_input_action" value = "home" id = "ec_input_action_home">
296          {'Home'|@translate}
297        </label>
298       
299        {* <!-- Access denied page (only when modifying an entry) --> *}
300        {if !$ec_is_creation}
301          <label class = "ec_block" onclick = "return ec_mark_action('ec_input_action_refused');">
302            <input type = "radio" name = "ec_input_action" value = "refused" id = "ec_input_action_refused">
303            {'Access denied'|@translate}
304          </label>
305        {/if}
306      </li>
307   
308    </ul>
309  </fieldset>
310 
311  {* <!-- Validity date --> *}
312  <fieldset>
313    <legend style = "font-weight:bold;">Date de validité</legend>
314   
315    <table style = "margin-left: 0px; text-align:left;">
316      <tr>
317        <td style="vertical-align:top; margin-top:0;">
318          <p style = "text-align:left; margin-bottom:0.5em;">
319            <label for = "ec_valid_date_on_id">
320              <input type = "checkbox" name = "ec_valid_date_on" id = "ec_valid_date_on_id">
321              Activer
322            </label>
323          </p>
324          <p style = "text-align:left;">
325            <select id = "ec_validity_day_id" name = "ec_validity_day" onchange = "ec_update_ts();">
326              <option value = "0">--</option>
327              {section name=day start=1 loop=32}
328                <option value = "{$smarty.section.day.index}">
329                  {$smarty.section.day.index}
330                </option>
331              {/section}
332            </select>
333            <select id = "ec_validity_month_id" name = "ec_validity_month" onchange = "ec_update_ts();">
334              {html_options options=$month_list}
335            </select>
336            <input id = "ec_validity_year_id" name = "ec_validity_year" type = "text" size = "4" maxlength = "4" value = "" onchange = "ec_update_ts();">
337            <input id = "ec_validity_time_id" name = "ec_validity_time" type = "text" size = "5" maxlength = "5" value = "" onchange = "ec_update_ts();">
338           
339            {* <!-- ec_linked_date_id représente la date indiquée par les listes déroulantes, et permet de limiter
340                    le choix dans la date, en l'occurrence à des dates uniquement postérieures (grâce au 6° paramètre de pwg_initialization_datepicker) --> *}
341            <input id = "ec_linked_date_id" name = "ec_linked_date" type = "hidden" size = "10" disabled = "disabled">
342          </p>
343          <p style = "text-align:left;">
344            <input id = "ec_date_add_btn_id" type = "button" value = "Ajouter"
345             onclick = "ec_update_date(document.getElementById('ec_date_add_val_id').value, document.getElementById('ec_date_add_kind_id').selectedIndex);">&nbsp;
346            <input id = "ec_date_add_val_id" type = "text" size = "5" maxlength = "5" value = "">&nbsp;
347            <select id = "ec_date_add_kind_id" name = "ec_date_add_kind">
348              <option label = "minute(s)" value = "minutes">minute(s)</option>
349              <option label = "heure(s)"  value = "hours"  >heure(s)</option>
350              <option label = "jour(s)"   value = "days"   >jour(s)</option>
351              <option label = "mois"      value = "months" >mois</option>
352              <option label = "année(s)"  value = "years"  >année(s)</option>
353            </select>
354          </p>
355          <p style = "text-align:left;">
356            <input id = "ec_date_today_btn_id" type = "button" value = "Aujourd'hui" onclick = "">
357          </p>
358          {* <!-- For tests purpose ; must be removed --> *}
359          <p style = "text-align:left;">
360            <span id = "ec_span_tst_id"></span>
361          </p>
362          {* <!-- /For tests purpose ; must be removed --> *}
363        </td>
364       
365        <td>
366          <table>
367            <tr>
368              <td style = "text-align:right; vertical-align:top; font-weight:bold; padding-right:1em;">
369                Page à utiliser après que le code a expiré&nbsp;:
370              </td>
371              <td style = "text-align:left;">
372                <label for = "ec_date_unknown_0_id">
373                  <input type = "radio" name = "ec_date_unknown" value = "0" id = "ec_date_unknown_0_id">
374                  {'Home'|@translate}
375                </label><br>
376                <label for = "ec_date_unknown_1_id">
377                  <input type = "radio" name = "ec_date_unknown" value = "1" id = "ec_date_unknown_1_id">
378                  {'Access denied'|@translate}
379                </label><br>
380                {* <!-- Additionnal Page, provided the plugin is activated and at least one Add. P. is available --> *}
381                <label class = "ec_date_block" for = "ec_date_in_up_aps_id" {if !$ec_ap_ok or count($ec_lists.add_pages) == 0} style = "display:none;" {/if} >
382                  <input type = "radio" name = "ec_date_unknown" value = "2" id = "ec_date_unknown_2_id">
383                  {'Additional Page'|@translate}<br>
384                  <select class = "categoryList" name = "ec_date_in_up_aps" size = "30" id = "ec_date_in_up_aps_id" >
385                    {html_options options = $ec_lists.add_pages}
386                  </select>
387                </label>
388              </td>
389            </tr>
390          </table>
391        </td>
392       
393      </tr>
394    </table>
395   
396  </fieldset>
397 
398 
399  <p style = "margin-top:0;">
400    <input class = "submit" type = "submit" value = "{'Submit'|@translate}" style = "margin-top:1em;">
401    <input class = "submit" type = "submit" value = "{'Reset'|@translate}" onclick = "return ec_init();" style = "margin-top:1em;">
402  </p>
403</form>
404
405{* <!-- JavaScript functions --> *}
406<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script>
407<script type = "text/javascript"><!--
408  ec_is_creation                          = {if $ec_is_creation}true{else}false{/if};
409  ec_validity_on                          = {if $ec_validity_on}true{else}false{/if};
410  valid_timestamp                         = 0{$valid_timestamp};
411  ec_up_code_lbl_forced_txt               = "{'Forced'|@translate}";
412  ec_JS_message['ec_gen_user_act_miss']   = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
413  ec_JS_message['ec_act_cat_miss']        = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
414  ec_JS_message['ec_act_img_miss']        = "{'ec_act_img_miss'|@translate|@escape:javascript}";
415  ec_JS_message['ec_new_pwd_gen']         = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
416  ec_JS_message['ec_clk_entry_miss']      = "{'ec_clk_entry_miss'|@translate|@escape:javascript}";
417  ec_JS_message['ec_confirm_force']       = "{'ec_confirm_force'|@translate|@escape:javascript}";
418  ec_JS_message['ec_confirm_del_other']   = "{'ec_confirm_del_other'|@translate|@escape:javascript}";
419  ec_JS_message['ec_user_already_exists'] = "{'ec_user_already_exists'|@translate|@escape:javascript}";
420  ec_JS_message['ec_code_already_exists'] = "{'ec_code_already_exists'|@translate|@escape:javascript}";
421  ec_JS_message['ec_conf_pwd_dont_match'] = "{'ec_conf_pwd_dont_match'|@translate|@escape:javascript}";
422  ec_JS_message['ec_confirm_change_user'] = "{'ec_confirm_change_user'|@translate|@escape:javascript}";
423  ec_JS_message['Home']                   = "{'Home'|@translate}";
424  ec_JS_message['ec_submit_code_miss']    = "{'ec_submit_code_miss'|@translate}";
425  ec_JS_message['ec_submit_user_miss']    = "{'ec_submit_user_miss'|@translate}";
426  ec_JS_message['ec_submit_action_miss']  = "{'ec_submit_action_miss'|@translate}";
427  ec_JS_message['ec_submit_code_bad']     = "{'ec_submit_code_bad'|@translate}";
428  ec_default_action                       = "{$ec_default_action}";
429  ec_default_entry                        = "{$ec_default_entry}";
430  ec_auto_code_digits_nb                  = "{$ec_def_auto_code_dg_nb}";
431  {if $ec_is_creation}
432    {foreach from = $ec_lists.duplicable_codes.ids key = ec_key item = ec_val}
433      ec_duplic_codes[{$ec_key}] = {$ec_val};
434    {/foreach}
435  {/if}
436  {foreach from = $ec_lists.ec_table item = ec_val name = listloop}
437    ec_lists_temp[{$smarty.foreach.listloop.index}]  =
438     "{$ec_val.id};{$ec_val.code};{$ec_val.user_id};{$ec_val.action};{$ec_val.arg1};{$ec_val.arg2};{$ec_val.forced};{$ec_val.comment}";
439  {/foreach}
440  ec_build_ec_lists();
441  pwg_initialization_datepicker("#ec_validity_day_id", "#ec_validity_month_id",
442   "#ec_validity_year_id", "#ec_linked_date_id", null, "#ec_linked_date_id");
443  ec_init();
444  //-->
445</script>
446
447{include file = $FooterIncTPL}
Note: See TracBrowser for help on using the repository browser.