Ignore:
Timestamp:
Oct 19, 2009, 3:07:22 AM (15 years ago)
Author:
LucMorizur
Message:

[Event Cats] Add entry modification ability, as finally it is required for outdating

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/event_cats/admin/template/autolog_new.tpl

    r4048 r4058  
    2121<form class = "filter" method = "post" name = "ec_new_code" action = "" onsubmit = "return ec_check_submit();">
    2222  <input type = "hidden" id = "ec_act1_id" name = "ec_act1" />
     23  <input type = "hidden" id = "ec_act2_id" name = "ec_entry_sel" />
    2324 
    2425  <div style = "text-align:center;">
    25     <a href = "#ec_top" name = "ec_top">
    26       <span style = "font-weight:bold; font-size:120%;" title = "{'ec_top_title'|@translate}">{'ec_new_entry_table_title'|@translate}</span>
    27     </a><br>
    28     <br>
    29     <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'ec_new_full_auto'|@translate}"
    30      id = "ec_submit_gen_full_auto_id" onclick = "ec_gen_full_auto();" style = "margin-top:0;"/>
     26    <span style = "font-weight:bold; font-size:120%;">
     27      {if $ec_hidden_when_no_code != ''}
     28        <a href = "#ec_top" name = "ec_top" title = "{'ec_top_title'|@translate}">
     29      {/if}
     30      <label for = "ec_page_type_create" onclick = "ec_mark_type('create');">
     31        <input type = "radio" id = "ec_page_type_create" onclick = "ec_mark_type('create');" {if $ec_is_creation} checked = "checked" {/if} />
     32        {'ec_new_entry_title'|@translate}
     33      </label>
     34      {if $ec_hidden_when_no_code == ''}
     35        <a href = "#ec_top" name = "ec_top" title = "{'ec_top_title'|@translate}">&nbsp;/&nbsp;
     36      {/if}
     37      </a>
     38      <label for = "ec_page_type_modify" onclick = "ec_mark_type('modify_entry_ask');" {$ec_hidden_when_no_code}>
     39        <input type = "radio" id = "ec_page_type_modify" onclick = "ec_mark_type('modify_entry_ask');" {if !$ec_is_creation} checked = "checked" {/if} />
     40        {'ec_modify_entry_title'|@translate}
     41      </label>
     42    </span>
     43    {if $ec_is_creation}
     44      <br><br>
     45      <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'ec_new_full_auto'|@translate}"
     46       id = "ec_submit_gen_full_auto_id" onclick = "ec_gen_full_auto();" style = "margin-top:0;"/>
     47    {/if}
    3148  </div><br>
    3249 
    3350  <table style = "border-spacing:15px" width = "97%">
    3451   
    35     {* <!-- Code selection --> *}
    3652    <tr>
    37       <td style = "vertical-align:top;"><strong>{'ec_new_entry'|@translate}</strong></td>
     53      <td style = "vertical-align:top; font-weight:bold;">
     54        {if $ec_is_creation}
     55          {'ec_new_entry'|@translate}
     56        {else}
     57          {'ec_sel_entry'|@translate}
     58        {/if}
     59      </td>
    3860      <td>
    39         <li>
    40           {* <!-- New code (to create) --> *}
    41           <label for = "ec_in_up_code_id" onclick = "ec_mark_code('ec_sel_code_new');" {$ec_hidden_when_no_code}>
    42             <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_id" value = "new"
    43              id = "ec_sel_code_new" onclick = "ec_mark_code('ec_sel_code_new');" {$ec_hidden_when_no_code}
    44             />
    45             {'ec_up_code_lbl_code_new'|@translate}
    46           </label>
    47           &nbsp;
    48           <label for = "ec_in_up_code_id" style = "margin:0;">
    49             <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'ec_new_entry_button'|@translate}"
    50              id = "ec_submit_gen_code_id" onclick = "ec_gen_code();" style = "margin:0;"
    51             />
    52           </label>
    53           {'ec_gen_code_nb_pre'|@translate}
    54           <select name = "ec_in_up_auto_code_length" id = "ec_in_up_auto_code_length_id" onchange = "ec_auto_code_digits_nb = this.value;">
    55             <option value =  "4" >4{'ec_gen_code_nb_min'|@translate}</option>
    56             <option value =  "5" >5</option>
    57             <option value =  "8" >8</option>
    58             <option value = "10">10</option>
    59             <option value = "12">12</option>
    60             <option value = "15">15</option>
    61             <option value = "16">16</option>
    62             <option value = "20">20</option>
    63             <option value = "24">24</option>
    64             <option value = "25">25</option>
    65             <option value = "30">30</option>
    66             <option value = "32">32{'ec_gen_code_nb_max'|@translate}</option>
    67           </select>
    68           {'ec_gen_code_nb_end'|@translate}<br>
    69           <ul><li>
    70             <input type = "text" name = "ec_in_up_code" maxlength = "32" size = "40"
    71              id = "ec_in_up_code_id" onblur = "ec_check_code_text();"
    72             />
    73           </li></ul>
    74         </li>
    75        
    76         <li>
    77           {* <!-- Known code --> *}
    78           <label for = "ec_in_up_code_list_id" onclick = "ec_mark_code('ec_sel_code_old');" {$ec_hidden_when_no_code} >
    79             <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_list_id" {$ec_hidden_when_no_code}
    80              value = "old" id = "ec_sel_code_old" onclick = "ec_mark_code('ec_sel_code_old');"
    81             />
    82             {'ec_up_code_lbl_code_old'|@translate}
    83           </label>
    84           <select name = "ec_in_up_code_list" id = "ec_in_up_code_list_id" onclick = "ec_mark_code('ec_sel_code_old');"
    85            onchange = "ec_change_code_list(this.value);" {$ec_hidden_when_no_code}
    86           >
    87             <option label = "------------" value = "-1" {* id = "ec_old_code_-1" *} {$ec_hidden_when_no_code} >------------</option>
    88             {foreach from=$ec_lists.duplicable_codes key=ec_key item=ec_val}
    89               <option label = "{$ec_val.user_id}" value = "{$ec_val.id}" {* id = "ec_old_code_{$ec_val.id}" *}>{$ec_key}</option>
    90             {/foreach}
    91           </select><br>
    92         </li>
     61        {if $ec_is_creation}
     62         
     63          {* <!-- Code selection --> *}
     64          <li>
     65            {* <!-- New code (to create) --> *}
     66            <label for = "ec_in_up_code_id" onclick = "ec_mark_code('ec_sel_code_new');" {$ec_hidden_when_no_code} >
     67              <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_id" value = "new"
     68               id = "ec_sel_code_new" onclick = "ec_mark_code('ec_sel_code_new');"
     69              />
     70              {'ec_up_code_lbl_code_new'|@translate}
     71            </label>
     72            &nbsp;
     73            <label for = "ec_in_up_code_id" style = "margin:0;">
     74              <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'ec_new_entry_button'|@translate}"
     75               id = "ec_submit_gen_code_id" onclick = "ec_gen_code();" style = "margin:0;"
     76              />
     77            </label>
     78            {'ec_gen_code_nb_pre'|@translate}
     79            <select name = "ec_in_up_auto_code_length" id = "ec_in_up_auto_code_length_id" onchange = "ec_auto_code_digits_nb = this.value;">
     80              <option value =  "4" >4{'ec_gen_code_nb_min'|@translate}</option>
     81              <option value =  "5" >5</option>
     82              <option value =  "8" >8</option>
     83              <option value = "10">10</option>
     84              <option value = "12">12</option>
     85              <option value = "15">15</option>
     86              <option value = "16">16</option>
     87              <option value = "20">20</option>
     88              <option value = "24">24</option>
     89              <option value = "25">25</option>
     90              <option value = "30">30</option>
     91              <option value = "32">32{'ec_gen_code_nb_max'|@translate}</option>
     92            </select>
     93            {'ec_gen_code_nb_end'|@translate}<br>
     94            <ul><li>
     95              <input type = "text" name = "ec_in_up_code" maxlength = "32" size = "40"
     96               id = "ec_in_up_code_id" onblur = "ec_check_code_text();"
     97              />
     98            </li></ul>
     99          </li>
     100         
     101          <li>
     102            {* <!-- Known code --> *}
     103            <label for = "ec_in_up_code_list_id" onclick = "ec_mark_code('ec_sel_code_old');" {$ec_hidden_when_no_code}>
     104              <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_list_id"
     105                value = "old" id = "ec_sel_code_old" onclick = "ec_mark_code('ec_sel_code_old');"
     106              />
     107              {'ec_up_code_lbl_code_old'|@translate}
     108            </label>
     109            <select name = "ec_in_up_code_list" id = "ec_in_up_code_list_id" onclick = "ec_mark_code('ec_sel_code_old');"
     110             onchange = "ec_change_code_list(this.value);" {$ec_hidden_when_no_code}
     111            >
     112              <option label = "------------" value = "-1">------------</option>
     113              {foreach from=$ec_lists.duplicable_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          {* <!-- 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              <option label = "" value = "-1">------------</option>
     126              {foreach from=$ec_lists.ec_table item=ec_val}
     127                <option value = "{$ec_val.id}" label = "{$ec_val.user_id},{$ec_val.action},{$ec_val.arg1},{$ec_val.arg2},{$ec_val.forced}">
     128                  {$ec_val.id} : {$ec_val.code}
     129                </option>
     130              {/foreach}
     131            </select>
     132          </li>
     133         
     134        {/if}
    93135      </td>
    94136    </tr>
     
    96138    {* <!-- User to identify --> *}
    97139    <tr>
    98       <td style = "vertical-align:top;"><strong>{'ec_up_code_lbl_user'|@translate}</strong></td>
     140      <td style = "vertical-align:top; font-weight:bold;">{'ec_up_code_lbl_user'|@translate}</td>
    99141      <td>
     142        {if !$ec_is_creation}
     143          <li>
     144            {* <!-- None --> *}
     145            <label onclick = "ec_mark_user('ec_sel_user_none');">
     146              <input type = "radio" name = "ec_sel_user" value = "none" id = "ec_sel_user_none"
     147               onclick = "ec_mark_user('ec_sel_user_none');"
     148              />
     149              {'ec_up_code_lbl_user_none'|@translate}
     150            </label><br>
     151          </li>
     152        {/if}
     153       
    100154        <li>
    101155          {* <!-- New user (to create) --> *}
     
    139193           onchange = "ec_selected_old_user = this.value;" {$ec_hidden_when_no_user}
    140194          >
    141             <option label = "------------" value = "-1" {* id = "ec_old_user_-1" *} {$ec_hidden_when_no_user} >------------</option>
     195            <option label = "------------" value = "-1" {$ec_hidden_when_no_user} >------------</option>
    142196            {foreach from=$ec_lists.user_ids key=ec_key item=ec_val}
    143               <option label = "{$ec_val}" value = "{$ec_key}" {* id = "ec_old_user_{$ec_key}" *} >{$ec_val}</option>
     197              <option label = "{$ec_val}" value = "{$ec_key}" >{$ec_val}</option>
    144198            {/foreach}
    145199          </select><br>
     
    150204    {* <!-- Page to display --> *}
    151205    <tr>
    152       <td style = "vertical-align:top;"><strong>{'ec_up_code_lbl_action'|@translate}</strong></td>
     206      <td style = "vertical-align:top;">
     207        <span style = "font-weight:bold;">{'ec_up_code_lbl_action'|@translate}</span><br>
     208        <label class = "ec_block" for = "ec_in_up_forced_id" style = "margin-top:5px;" onclick = "ec_mark_forced();">
     209          <input type = "checkbox" name = "ec_in_up_forced" id = "ec_in_up_forced_id" onclick = "ec_mark_forced();">
     210          <span id = "ec_style_forced_id"></span>
     211        </label>
     212      </td>
    153213      <td>
    154214       
    155         {* <!-- Additionnal Page, provided the plugin is activated --> *}
     215        {* <!-- Additionnal Page, provided the plugin is activated and at least one Add. P. is available --> *}
    156216        <label class = "ec_block" for = "ec_in_up_aps_id" onclick = "ec_mark_action('ec_input_action_add_p');"
    157          {if !$ec_ap_ok}style = "display:none;"{/if}
     217         {if !$ec_ap_ok or count($ec_lists.add_pages) == 0} style = "display:none;"{/if}
    158218        >
    159219          <input type = "radio" name = "ec_input_action" value = "add_p" id = "ec_input_action_add_p" for = "ec_in_up_aps_id"
     
    202262          {'ec_up_code_lbl_home'|@translate}
    203263        </label>
     264       
     265        {* <!-- Access denied page (only when modifying an entry) --> *}
     266        {if !$ec_is_creation}
     267          <label class = "ec_block" onclick = "ec_mark_action('ec_input_action_refused');">
     268            <input type = "radio" name = "ec_input_action" value = "refused" id = "ec_input_action_refused"
     269             onclick = "ec_mark_action('ec_input_action_refused');"
     270            />
     271            {'ec_up_code_lbl_refused'|@translate}
     272          </label>
     273        {/if}
    204274      </td>
    205275    </tr>
     
    214284<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script>
    215285<script type = "text/javascript"><!--
     286  ec_up_code_lbl_forced_txt              = "{'ec_up_code_lbl_forced'|@translate}";
    216287  ec_JS_message['ec_gen_user_act_miss']  = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
    217288  ec_JS_message['ec_act_cat_miss']       = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
     
    224295  ec_JS_message['ec_submit_code_bad']    = "{'ec_submit_code_bad'|@translate}";
    225296  ec_default_action                      = "{$ec_default_action}";
     297  ec_default_entry                       = "{$ec_default_entry}";
    226298  ec_auto_code_digits_nb                 = "{$ec_def_auto_code_dg_nb}";
    227299  {foreach from=$ec_lists.duplicable_codes.ids key=ec_key item=ec_val}
Note: See TracChangeset for help on using the changeset viewer.