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

Last change on this file since 4115 was 4115, checked in by LucMorizur, 15 years ago

[Event Cats] the two simplest actions added : delete entry and duplicate entry. Some JS bugs removed.

File size: 14.8 KB
Line 
1{* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *}
2
3{include file='../../../plugins/event_cats/admin/template/header.inc.tpl'}
4
5{* <!-- Whether plugin Additionnal Pages is active or not --> *}
6<div style = "text-align:right; font-style:italic;">
7  {if $ec_ap_ok}
8    {'ec_plugin_ap_ok'|@translate}
9    <script type = "text/javascript"><!--
10      var ec_ap_ok = true; //-->
11    </script>
12  {else}
13    {'ec_plugin_ap_nok'|@translate}
14    <script type = "text/javascript"><!--
15      var ec_ap_ok = false; //-->
16    </script>
17  {/if}
18</div>
19
20{* <!-- Parameters list --> *}
21<form class = "filter" method = "post" name = "ec_new_code" action = "" onsubmit = "return ec_check_submit();">
22  <input type = "hidden" id = "ec_act1_id" name = "ec_act1" />
23  <input type = "hidden" id = "ec_act2_id" name = "ec_entry_sel" />
24 
25  {* <!-- Page title. Can be "New entry" or "New entry / Entry modification" whether some entries already exist or not --> *}
26  <div style = "text-align:center;">
27    <span style = "font-weight:bold; font-size:120%;">
28      {if $ec_hidden_when_no_code != ''}
29        <a href = "#ec_top" name = "ec_top" title = "{'ec_top_title'|@translate}">
30      {/if}
31      <label for = "ec_page_type_create" {if $ec_hidden_when_no_code == ''} onclick = "ec_mark_type('create_ask');" {/if}>
32        {if $ec_hidden_when_no_code == ''}
33          <input type = "radio" id = "ec_page_type_create" {* onclick = "ec_mark_type('create_ask');" *} {if $ec_is_creation} checked = "checked" {/if} />
34        {/if}
35        <span {if $ec_is_creation and $ec_hidden_when_no_code == ''} style = "text-decoration:underline;" {/if}>{'ec_new_entry_title'|@translate}</span>
36      </label>
37      {if $ec_hidden_when_no_code == ''}
38        <a href = "#ec_top" name = "ec_top" title = "{'ec_top_title'|@translate}">
39         <label style = "font-weight:bold; font-size:120%;">&nbsp;//&nbsp;</label>
40      {/if}
41      </a>
42      <label for = "ec_page_type_modify" onclick = "ec_mark_type('modify_entry_ask');" {$ec_hidden_when_no_code}>
43        <input type = "radio" id = "ec_page_type_modify" {* onclick = "ec_mark_type('modify_entry_ask');" *} {if !$ec_is_creation} checked = "checked" {/if} />
44        <span {if !$ec_is_creation} style = "text-decoration:underline;" {/if}>{'ec_modify_entry_title'|@translate}</span>
45      </label>
46    </span>
47    {if $ec_is_creation}
48      <br><br>
49      <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'ec_new_full_auto'|@translate}"
50       id = "ec_submit_gen_full_auto_id" onclick = "ec_gen_full_auto();" style = "margin-top:0;"/>
51    {/if}
52  </div><br>
53 
54  {* <!-- Table (borders not visible) with 3 rows for parameters adjustment --> *}
55  <table style = "border-spacing:15px" width = "97%">
56   
57    <tr>
58     
59      {* <!-- [ [New / existing code] / [Existing entry] ] selection --> *}
60      <td style = "vertical-align:top; font-weight:bold;">
61        {if $ec_is_creation}
62          {'ec_new_entry'|@translate}
63        {else}
64          {'ec_sel_entry'|@translate}
65        {/if}
66      </td>
67      <td>
68        {if $ec_is_creation}
69          <li>
70            {* <!-- New code (to create) --> *}
71            <label for = "ec_in_up_code_id" onclick = "ec_mark_code('ec_sel_code_new');" {$ec_hidden_when_no_code} >
72              <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_id" value = "new" id = "ec_sel_code_new"/>
73              {'ec_up_code_lbl_code_new'|@translate}
74            </label>
75            <span {$ec_hidden_when_no_code} >&nbsp;</span>
76            <label for = "ec_in_up_code_id" style = "margin:0;">
77              <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'ec_new_entry_button'|@translate}"
78               id = "ec_submit_gen_code_id" onclick = "ec_gen_code();" style = "margin:0;"
79              />
80            </label>
81            {'ec_gen_code_nb_pre'|@translate}
82            <select name = "ec_in_up_auto_code_length" id = "ec_in_up_auto_code_length_id" onchange = "ec_auto_code_digits_nb = this.value;">
83              <option value =  "4" >4{'ec_gen_code_nb_min'|@translate}</option>
84              <option value =  "5" >5</option>
85              <option value =  "8" >8</option>
86              <option value = "10">10</option>
87              <option value = "12">12</option>
88              <option value = "15">15</option>
89              <option value = "16">16</option>
90              <option value = "20">20</option>
91              <option value = "24">24</option>
92              <option value = "25">25</option>
93              <option value = "30">30</option>
94              <option value = "32">32{'ec_gen_code_nb_max'|@translate}</option>
95            </select>
96            {'ec_gen_code_nb_end'|@translate}<br>
97            <ul><li>
98              <input type = "text" name = "ec_in_up_code" maxlength = "32" size = "40"
99               id = "ec_in_up_code_id" onblur = "ec_check_code_text();"
100              />
101            </li></ul>
102          </li>
103         
104          <li>
105            {* <!-- Known code --> *}
106            <label for = "ec_in_up_code_list_id" onclick = "ec_mark_code('ec_sel_code_old');" {$ec_hidden_when_no_code}>
107              <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_list_id" {$ec_hidden_when_no_code} value = "old" id = "ec_sel_code_old" />
108              {'ec_up_code_lbl_code_old'|@translate}
109            </label>
110            <select name = "ec_in_up_code_list" id = "ec_in_up_code_list_id"
111             onchange = "ec_change_code_list(this.value);" {$ec_hidden_when_no_code}
112            >
113              {foreach from=$ec_lists.duplicable_codes.codes key=ec_key item=ec_val}
114                <option label = "{$ec_val.user_id}" value = "{$ec_val.id}">{$ec_key}</option>
115              {/foreach}
116            </select><br>
117          </li>
118         
119        {else}
120         
121          {* <!-- Existing entry selection --> *}
122          <li>
123            {* <!-- Entry choice --> *}
124            <select name = "ec_in_up_entry_list" id = "ec_in_up_entry_list_id" onchange = "ec_mark_entry(this.value);">
125              {foreach from=$ec_lists.ec_table item=ec_val}
126                <option value = "{$ec_val.id}">{$ec_val.id} : {$ec_val.code}</option>
127              {/foreach}
128            </select>
129          </li>
130         
131        {/if}
132      </td>
133    </tr>
134   
135    {* <!-- User to identify --> *}
136    <tr>
137      <td style = "vertical-align:top; font-weight:bold;">{'ec_up_code_lbl_user'|@translate}</td>
138      <td>
139        {if !$ec_is_creation}
140          <li>
141            {* <!-- None --> *}
142            <label onclick = "return ec_mark_user('ec_sel_user_none');">
143              <input type = "radio" name = "ec_sel_user" value = "none" id = "ec_sel_user_none" />
144              {'ec_up_code_lbl_user_none'|@translate}
145            </label><br>
146          </li>
147        {/if}
148       
149        <li>
150          {* <!-- New user (to create) --> *}
151          <label for = "ec_in_up_usr_txt_id" onclick = "return ec_mark_user('ec_sel_user_new');" {$ec_hidden_when_no_user} >
152            <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_txt_id" value = "new" id = "ec_sel_user_new" {$ec_hidden_when_no_user} />
153            {'ec_up_code_lbl_user_new'|@translate}
154          </label>
155          <span {$ec_hidden_when_no_user} >&nbsp;</span>
156          <label for = "ec_in_up_usr_txt_id" style = "margin:0;">
157            <input class = "submit" type = "button" name = "ec_submit_gen_user" value = "{'ec_up_code_lbl_gen_user'|@translate}"
158             id = "ec_submit_gen_user_id" onclick = "ec_gen_user();"
159            />
160          </label><br>
161          <ul><li>
162            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'ec_new_user_name'|@translate}<br>
163              <input type = "text" name = "ec_in_up_usr_txt" id = "ec_in_up_usr_txt_id" maxlength = "32"
164               size = "20" onblur = "ec_new_user_text = this.value;"
165              />
166            </label>
167            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'ec_new_user_pswd'|@translate}<br>
168              <input type = "text" name = "ec_in_up_psd_txt" id = "ec_in_up_psd_txt_id" maxlength = "32"
169               size = "20" onblur = "ec_new_psd_text = this.value; ec_check_pwd_text();"
170              />
171            </label>
172            <label class = "ec_block">&nbsp;<br>
173              <span style = "font-weight:bold; color:red;" id = "ec_in_up_pwd_warn">&nbsp;</span>
174            </label>
175           
176          </li></ul><br>
177        </li>
178       
179        <li>
180          {* <!-- Known user --> *}
181          <label for = "ec_in_up_usr_list_id" onclick = "return ec_mark_user('ec_sel_user_old');" {$ec_hidden_when_no_user} >
182            <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_list_id" {$ec_hidden_when_no_user} value = "old" id = "ec_sel_user_old" />
183            {'ec_up_code_lbl_user_old'|@translate}
184          </label>
185          <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} >
186            {foreach from=$ec_lists.user_ids key=ec_key item=ec_val}
187              <option label = "{$ec_val}" value = "{$ec_key}" >{$ec_val}</option>
188            {/foreach}
189          </select><br>
190        </li>
191      </td>
192    </tr>
193   
194    {* <!-- Page to display --> *}
195    <tr>
196      <td style = "vertical-align:top;">
197        <span style = "font-weight:bold;">{'ec_up_code_lbl_action'|@translate}</span><br>
198        <label class = "ec_block" for = "ec_in_up_forced_id" style = "margin-top:5px;" onclick = "ec_mark_forced();">
199          <input type = "checkbox" name = "ec_in_up_forced" id = "ec_in_up_forced_id">
200          <span id = "ec_style_forced_id">&nbsp;</span>
201        </label>
202      </td>
203      <td>
204       
205        {* <!-- Additionnal Page, provided the plugin is activated and at least one Add. P. is available --> *}
206        <label class = "ec_block" for = "ec_in_up_aps_id" onclick = "return ec_mark_action('ec_input_action_add_p');"
207         {if !$ec_ap_ok or count($ec_lists.add_pages) == 0} style = "display:none;" {/if}
208        >
209          <input type = "radio" name = "ec_input_action" value = "add_p" id = "ec_input_action_add_p" for = "ec_in_up_aps_id" />
210          {'ec_up_code_lbl_aps'|@translate}<br>
211          <select class = "categoryList" name = "ec_in_up_aps" size="30" id = "ec_in_up_aps_id" onchange = "ec_selected_AP = this.value;" >
212            {html_options options=$ec_lists.add_pages}
213          </select>
214        </label>
215       
216        {* <!-- Category --> *}
217        <label class = "ec_block" for = "ec_in_up_cats_id" onclick = "return ec_mark_action('ec_input_action_cat');">
218          <input type = "radio" name = "ec_input_action" value = "cat" id = "ec_input_action_cat" for = "ec_in_up_cats_id"
219            onMouseover = "ec_chk_nover_cat = false;" onMouseout = "ec_chk_nover_cat = true;"
220          />
221          <span onMouseover = "ec_chk_nover_cat = false;" onMouseout = "ec_chk_nover_cat = true;">{'ec_up_code_lbl_cats'|@translate}</span><br>
222          <select class = "categoryList" name = "ec_in_up_cat" size = "30" id = "ec_in_up_cats_id" onchange = "ec_selected_cat = this.value;">
223            {html_options options=$ec_lists.categories}
224          </select>
225        </label>
226       
227        {* <!-- Image --> *}
228        <label class = "ec_block" for = "ec_in_up_imgs_id" onclick = "return ec_mark_action('ec_input_action_img');">
229          <input type = "radio" name = "ec_input_action" value = "img" id = "ec_input_action_img" for = "ec_in_up_imgs_id" />
230          {'ec_up_code_lbl_img'|@translate}<br>
231          <input type = "text" name = "ec_in_up_img" id = "ec_in_up_imgs_id" maxlength = "6"
232           size = "10" onblur = "ec_selected_img = this.value; ec_check_img_text();" onfocus = "return ec_mark_action('ec_input_action_img');"
233          /><br>
234          <span id = "ec_in_up_imgs_warn"></span>
235        </label>
236       
237        {* <!-- Index page --> *}
238        <label class = "ec_block" onclick = "return ec_mark_action('ec_input_action_home');">
239          <input type = "radio" name = "ec_input_action" value = "home" id = "ec_input_action_home" />
240          {'ec_up_code_lbl_home'|@translate}
241        </label>
242       
243        {* <!-- Access denied page (only when modifying an entry) --> *}
244        {if !$ec_is_creation}
245          <label class = "ec_block" onclick = "return ec_mark_action('ec_input_action_refused');">
246            <input type = "radio" name = "ec_input_action" value = "refused" id = "ec_input_action_refused" />
247            {'ec_up_code_lbl_refused'|@translate}
248          </label>
249        {/if}
250      </td>
251    </tr>
252  </table>
253  <p>
254    <input class = "submit" type = "submit" value = "{'Submit'|@translate}"/>
255    <input class = "submit" type = "submit" value = "{'Reset'|@translate}" onclick = "return ec_init();"/>
256  </p>
257</form>
258
259{* <!-- JavaScript functions --> *}
260<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script>
261<script type = "text/javascript"><!--
262  ec_is_creation                          = {if $ec_is_creation}true{else}false{/if};
263  ec_up_code_lbl_forced_txt               = "{'ec_up_code_lbl_forced'|@translate}";
264  ec_JS_message['ec_gen_user_act_miss']   = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
265  ec_JS_message['ec_act_cat_miss']        = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
266  ec_JS_message['ec_act_img_miss']        = "{'ec_act_img_miss'|@translate|@escape:javascript}";
267  ec_JS_message['ec_new_pwd_gen']         = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
268  ec_JS_message['ec_act_entry_miss']      = "{'ec_act_entry_miss'|@translate|@escape:javascript}";
269  ec_JS_message['ec_confirm_del_other']   = "{'ec_confirm_del_other'|@translate|@escape:javascript}";
270  ec_JS_message['ec_up_code_lbl_home']    = "{'ec_up_code_lbl_home'|@translate}";
271  ec_JS_message['ec_submit_code_miss']    = "{'ec_submit_code_miss'|@translate}";
272  ec_JS_message['ec_submit_user_miss']    = "{'ec_submit_user_miss'|@translate}";
273  ec_JS_message['ec_submit_action_miss']  = "{'ec_submit_action_miss'|@translate}";
274  ec_JS_message['ec_submit_code_bad']     = "{'ec_submit_code_bad'|@translate}";
275  ec_default_action                       = "{$ec_default_action}";
276  ec_default_entry                        = "{$ec_default_entry}";
277  ec_auto_code_digits_nb                  = "{$ec_def_auto_code_dg_nb}";
278  {if $ec_is_creation}
279    {foreach from=$ec_lists.duplicable_codes.ids key=ec_key item=ec_val}
280      ec_duplic_codes[{$ec_key}] = {$ec_val};
281    {/foreach}
282  {else}
283    {foreach from=$ec_lists.ec_table item=ec_val}
284      ec_lists['user_id']['{$ec_val.id}'] = "{$ec_val.user_id}";
285      ec_lists['action']['{$ec_val.id}']  = "{$ec_val.action}";
286      ec_lists['arg1']['{$ec_val.id}']    = "{$ec_val.arg1}";
287      ec_lists['arg2']['{$ec_val.id}']    = "{$ec_val.arg2}";
288      ec_lists['forced']['{$ec_val.id}']  = "{$ec_val.forced}";
289    {/foreach}
290  {/if}
291  ec_init();
292//--></script>
293
294{include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
295
296{* <!--
297--> *}
Note: See TracBrowser for help on using the repository browser.