Ignore:
Timestamp:
Nov 6, 2010, 10:58:50 AM (13 years ago)
Author:
LucMorizur
Message:

Implementing validity date

File:
1 edited

Legend:

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

    r7287 r7661  
    66{include file = 'include/datepicker.inc.tpl'}
    77
    8 {html_head}
    9   <style type="text/css">
    10     #ui-datepicker-div {ldelim}
    11       display:none;
    12     }
    13   </style>
    14 {/html_head}
     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}
    1512
    1613{* <!-- Whether plugin Additionnal Pages is active or not, and help banner management --> *}
     
    7168  </div>
    7269 
    73   {* <!-- [ [New / existing code] / [Existing entry] ] selection --> *}
     70  {* <!-- [ [ [New] / [existing] code] / [Existing entry] ] selection --> *}
    7471  <fieldset>
    7572    <legend style = "font-weight:bold;">
     
    8077      {/if}
    8178    </legend>
    82    
    8379    <ul>
     80   
    8481      {if $ec_is_creation}
    8582        <li>
     
    111108          {'Auto code end'|@translate}<br />
    112109        </li>
     110       
    113111        <li style = "padding-left: 30px;">
    114112          <input type = "text" name = "ec_in_up_code" maxlength = "32" size = "40"
     
    161159              <span style = "font-weight:bold;  font-style:italic;">{'Comment'|@translate}</span>
    162160              <input type = "text" name = "ec_in_up_comment" maxlength = "100" size = "50" id = "ec_in_up_comment_id"
    163                 onchange = "ec_new_comment_text = this.value;"
    164               />
     161               onchange = "ec_new_comment_text = this.value;" />
    165162            </label>
    166163        </li>
    167164       
    168165      {/if}
     166   
    169167    </ul>
    170    
    171168  </fieldset>
    172169 
     
    177174      <span style = "font-weight:bold; color:red;" id = "ec_in_up_pwd_warn">&nbsp;</span><br />
    178175    </legend>
     176      <ul>
    179177     
    180       <ul>
    181178        {if !$ec_is_creation}
    182179          <li>
     
    241238          </select><br />
    242239        </li>
     240   
    243241      </ul>
    244    
    245242  </fieldset>
    246243 
    247244  {* <!-- Page to display --> *}
    248   <fieldset style = "float:left;">
     245  <fieldset>
    249246    <legend style = "font-weight:bold;">{'Displayed page'|@translate}</legend>
    250    
    251247    <ul>
     248   
    252249      <li>
    253250        <label class = "ec_block" for = "ec_in_up_forced_id" style = "margin-top:5px;" onclick = "ec_mark_forced();">
     
    308305        {/if}
    309306      </li>
     307   
    310308    </ul>
    311    
    312309  </fieldset>
    313310 
    314   <fieldset style = "float:right;">
    315     <legend style = "font-weight:bold;">Validité</legend>
    316     Date de validité&nbsp;: <br />
    317     <label for = "ec_valid_date_on_off_id">
    318       <input type = "checkbox" name = "ec_valid_date_on_off" id = "ec_valid_date_on_off_id">
    319       Activer
    320     </label><br /><br />
    321     <select id = "date_creation_day" name = "date_creation_day">
    322       <option value = "0">--</option>
    323       <option value = "1" >1</option>
    324       <option value = "2" >2</option>
    325       <option value = "3" >3</option>
    326       <option value = "4" >4</option>
    327       <option value = "5" >5</option>
    328       <option value = "6" >6</option>
    329       <option value = "7" >7</option>
    330       <option value = "8" >8</option>
    331       <option value = "9" >9</option>
    332       <option value = "10" >10</option>
    333       <option value = "11" >11</option>
    334       <option value = "12" selected = "selected">12</option>
    335       <option value = "13" >13</option>
    336       <option value = "14" >14</option>
    337       <option value = "15" >15</option>
    338       <option value = "16" >16</option>
    339       <option value = "17" >17</option>
    340       <option value = "18" >18</option>
    341       <option value = "19" >19</option>
    342       <option value = "20" >20</option>
    343       <option value = "21" >21</option>
    344       <option value = "22" >22</option>
    345       <option value = "23" >23</option>
    346       <option value = "24" >24</option>
    347       <option value = "25" >25</option>
    348       <option value = "26" >26</option>
    349       <option value = "27" >27</option>
    350       <option value = "28" >28</option>
    351       <option value = "29" >29</option>
    352       <option value = "30" >30</option>
    353       <option value = "31" >31</option>
    354     </select>
    355    
    356     <select id = "date_creation_month" name = "date_creation_month">
    357       <option label = "------------" value = "0">------------</option>
    358       <option label = "Janvier"      value = "1">Janvier</option>
    359       <option label = "Février"      value = "2">Février</option>
    360       <option label = "Mars"         value = "3">Mars</option>
    361       <option label = "Avril"        value = "4">Avril</option>
    362       <option label = "Mai"          value = "5">Mai</option>
    363       <option label = "Juin"         value = "6">Juin</option>
    364       <option label = "Juillet"      value = "7">Juillet</option>
    365       <option label = "Août"         value = "8">Août</option>
    366       <option label = "Septembre"    value = "9">Septembre</option>
    367       <option label = "Octobre"      value = "10" selected = "selected">Octobre</option>
    368       <option label = "Novembre"     value = "11">Novembre</option>
    369       <option label = "Décembre"     value = "12">Décembre</option>
    370     </select>
    371    
    372     <input id = "date_creation_year" name = "date_creation_year" type = "text" size = "4" maxlength = "4" value = "2010">
    373     {* <!-- date_creation_linked_date représente la date indiquée par les listes déroulantes, et permet de limiter
    374             le choix dans la date, en l'occurrence à des dates uniquement postérieures (grâce au 6° paramètre de pwg_initialization_datepicker) --> *}
    375     <input id = "date_creation_linked_date" name = "date_creation_linked_date" type = "hidden" size = "10" disabled = "disabled">
    376     <script type = "text/javascript">
    377       pwg_initialization_datepicker("#date_creation_day", "#date_creation_month",
    378        "#date_creation_year", "#date_creation_linked_date", null, "#date_creation_linked_date");
    379     </script><br />
    380     <table>
     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;">
    381316      <tr>
    382         <td style = "text-align:right; vertical-align:top; font-weight:bold;">
    383           Page à utiliser&nbsp;:&nbsp;&nbsp;
     317        <td style="vertical-align:top;">
     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">
     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">
     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 = "" />
     337            <input id = "ec_validity_time_id" name = "ec_validity_time" type = "text" size = "5" maxlength = "5" value = "" />
     338           
     339            <script type = "text/javascript"><!--
     340              {literal}
     341                function de(ec_id) {
     342                  return document.getElementById(ec_id);
     343                }
     344                var maintenant = new Date();
     345                var local_date = maintenant;
     346                var m_offset = maintenant.getTimezoneOffset();
     347                local_date.setTime(maintenant.getTime() + m_offset);
     348                var mlocal_annee = local_date.getFullYear();
     349                var mlocal_mois = local_date.getMonth() + 1; // In JavaScript, January is 0 and December is 11
     350                var mlocal_date = local_date.getDay();
     351                var mlocal_heures = local_date.getHours();
     352                var mlocal_minutes = local_date.getMinutes() + 1; // Validity period cannot be less than one minute
     353                de("ec_validity_day_id").selectedIndex = mlocal_date - 1;
     354                de("ec_validity_month_id").selectedIndex = mlocal_mois - 1;
     355                de("ec_validity_year_id").value = mlocal_annee;
     356                de("ec_validity_time_id").value = mlocal_heures + ":" + mlocal_minutes;
     357              {/literal}
     358              // -->
     359            </script>
     360           
     361            {* <!-- ec_linked_date_id représente la date indiquée par les listes déroulantes, et permet de limiter
     362                    le choix dans la date, en l'occurrence à des dates uniquement postérieures (grâce au 6° paramètre de pwg_initialization_datepicker) --> *}
     363            <input id = "ec_linked_date_id" name = "ec_linked_date" type = "hidden" size = "10" disabled = "disabled" />
     364            <script type = "text/javascript">
     365              pwg_initialization_datepicker("#ec_validity_day_id", "#ec_validity_month_id",
     366               "#ec_validity_year_id", "#ec_linked_date_id", null, "#ec_linked_date_id");
     367            </script><br />
     368          </p>
    384369        </td>
     370       
    385371        <td>
    386           <label for = "ec_date_unknown_0_id">
    387             <input type = "radio" name = "ec_date_unknown" value = "0" id = "ec_date_unknown_0_id" />
    388             {'Home'|@translate}
    389           </label><br />
    390           <label for = "ec_date_unknown_1_id">
    391             <input type = "radio" name = "ec_date_unknown" value = "1" id = "ec_date_unknown_1_id" />
    392             {'Access denied'|@translate}
    393           </label><br />
    394           {* <!-- Additionnal Page, provided the plugin is activated and at least one Add. P. is available --> *}
    395           <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} >
    396             <input type = "radio" name = "ec_date_unknown" value = "2" id = "ec_date_unknown_2_id" />
    397             {'Additional Page'|@translate}<br />
    398             <select class = "categoryList" name = "ec_date_in_up_aps" size = "30" id = "ec_date_in_up_aps_id" >
    399               {html_options options = $ec_lists.add_pages}
    400             </select>
    401           </label>
     372          <table>
     373            <tr>
     374              <td style = "text-align:right; vertical-align:top; font-weight:bold; padding-right:1em;">
     375                Page à utiliser après que le code a expiré&nbsp;:
     376              </td>
     377              <td style = "text-align:left;">
     378                <label for = "ec_date_unknown_0_id">
     379                  <input type = "radio" name = "ec_date_unknown" value = "0" id = "ec_date_unknown_0_id" />
     380                  {'Home'|@translate}
     381                </label><br />
     382                <label for = "ec_date_unknown_1_id">
     383                  <input type = "radio" name = "ec_date_unknown" value = "1" id = "ec_date_unknown_1_id" />
     384                  {'Access denied'|@translate}
     385                </label><br />
     386                {* <!-- Additionnal Page, provided the plugin is activated and at least one Add. P. is available --> *}
     387                <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} >
     388                  <input type = "radio" name = "ec_date_unknown" value = "2" id = "ec_date_unknown_2_id" />
     389                  {'Additional Page'|@translate}<br />
     390                  <select class = "categoryList" name = "ec_date_in_up_aps" size = "30" id = "ec_date_in_up_aps_id" >
     391                    {html_options options = $ec_lists.add_pages}
     392                  </select>
     393                </label>
     394              </td>
     395            </tr>
     396          </table>
    402397        </td>
     398       
    403399      </tr>
    404400    </table>
    405 
     401   
    406402  </fieldset>
    407403 
    408   <p style = "clear:both;">
    409     <input class = "submit" type = "submit" value = "{'Submit'|@translate}"/>
    410     <input class = "submit" type = "submit" value = "{'Reset'|@translate}" onclick = "return ec_init();"/>
     404 
     405  <p style = "margin-top:0;">
     406    <input class = "submit" type = "submit" value = "{'Submit'|@translate}" style = "margin-top:1em;" />
     407    <input class = "submit" type = "submit" value = "{'Reset'|@translate}" onclick = "return ec_init();" style = "margin-top:1em;" />
    411408  </p>
    412409</form>
Note: See TracChangeset for help on using the changeset viewer.