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

Revision 4179, 15.3 KB checked in by LucMorizur, 10 years ago (diff)

[Event Cats] Entry creation in DB OK.

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