Changeset 4011


Ignore:
Timestamp:
Oct 9, 2009, 11:29:39 PM (11 years ago)
Author:
LucMorizur
Message:

[Event Cats] $_POST analysis beginning

Location:
extensions/event_cats
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • extensions/event_cats/admin/autolog_entries.inc.php

    r4002 r4011  
    3838if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    3939
    40 global $template, $conf, $lang, $test1, $prefixeTable, $ec_err, $page,
     40global $template, $conf, $page,
    4141 $ec_lists,   // array of following arrays :
    4242              //   $ec_lists['ec_table'] :
  • extensions/event_cats/admin/autolog_new.inc.php

    r4002 r4011  
    3838if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    3939
    40 global $template, $conf, $lang, $test1, $prefixeTable, $ec_err, $page,
     40global $template, $conf, $page,
    4141 $ec_lists,   // array of following arrays :
    4242              //   $ec_lists['ec_table'] :
     
    5454/****************************************************************************/
    5555
    56 $code_list = array();
    5756build_ec_lists(); // in evntcats_funcs.php
    5857
     
    6160*****************************************************************************/
    6261
     62if (isset($_POST['ec_act1']) and $_POST['ec_act1'] == 'duplicate_entry') {
     63  if (isset($_POST['ec_entry_sel'])) {
     64    if (array_key_exists($_POST['ec_entry_sel'], $ec_lists['ec_table'])) {
     65      // Des variables donnant les valeur par défaut des champs à modifier lors
     66      // d'une nouvelle entrée, prennent les valeurs établies trouvées dans la table
     67      // (si quelqu'un comprend cette phrase...)
     68    }
     69    else {
     70      $page['errors'][] = 'Tentative de duplication d\'une entrée inexistante';
     71    }
     72  }
     73  else {
     74    $page['errors'][] = 'Tentative de duplication sans entrée';
     75  }
     76}
     77
     78
    6379/****************************************************************************/
    6480
     81
    6582$template->assign('ec_ap_ok',$ec_ap_ok);
    66 $template->assign('code_list',$code_list);
     83$template->assign('ec_lists',$ec_lists);
    6784
    6885?>
  • extensions/event_cats/admin/evntcats_admin.php

    r4002 r4011  
    7171// |                            Tabsheet
    7272// +-----------------------------------------------------------------------+
     73
     74// Effectuer quand même un test sur $_POST['act1'] : si demande de création d'entré, mais
     75// que cette demande ne peut aboutir, rediriger sur page création d'entrée ; sinon sur entrées existantes.
     76
    7377$page['tab'] = (!($ec_exist_entries = (mysql_fetch_row(pwg_query('
    7478  SELECT * FROM `'.EVNTCATS_TABLE.'`
     
    98102               l10n('ec_tab_config'),
    99103               $my_base_url.'&tab=config');
    100 $tabsheet->select($page['tab']);
    101 $tabsheet->assign();
    102104
    103105$template->assign(
     
    112114include(EVNTCATS_PATH.'admin/'.$page['tab'].'.inc.php');
    113115
     116$tabsheet->select($page['tab']);
     117$tabsheet->assign();
     118
    114119/*
    115120print '<pre>';
     
    121126$template->assign('ec_howto', (count($page['errors']) == 0 and count($page['infos']) == 0));
    122127
    123 $template->assign('ec_lists',$ec_lists);
    124128$template->assign('EVNTCATS_PATH',EVNTCATS_PATH);
    125129$template->assign('RACINE_URL',ROOT_URL);
  • extensions/event_cats/admin/template/autolog_entries.js

    r4002 r4011  
    3939
    4040function ec_duplicate_entry(ec_id) {
     41  ec_mark_line(ec_id);
     42  document.getElementById('ec_act1_id').value = 'duplicate_entry';
     43  document.forms['ec_view_codes'].submit();
    4144}
    4245
  • extensions/event_cats/admin/template/autolog_entries.tpl

    r4002 r4011  
    4545  <input type = "radio" name = "ec_entry_sel" value = "-1" id = "selection--1" style = "display:none;"/>
    4646 
    47   <div style = "text-align:center; font-weight:bold; font-size:120%;">{'ec_entry_table_title'|@translate}</div><br>
     47  <div style = "text-align:center; font-weight:bold; font-size:120%;">
     48    <a href = "#ec_top" name = "ec_top" title = "{'ec_top_title'|@translate}">{'ec_entry_table_title'|@translate}</a><br>
     49  </div><br>
    4850 
    4951  {* <!-- Table to show codes present in MySQL table --> *}
  • extensions/event_cats/admin/template/autolog_new.tpl

    r4002 r4011  
    4545 
    4646  <div style = "text-align:center;">
    47     <span style = "font-weight:bold; font-size:120%;">{'ec_new_entry_table_title'|@translate}</span><br>
     47    <a href = "#ec_top" name = "ec_top">
     48      <span style = "font-weight:bold; font-size:120%;" title = "{'ec_top_title'|@translate}">{'ec_new_entry_table_title'|@translate}</span>
     49    </a><br>
    4850    <br>
    4951    <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;"/>
     52     {* id = "ec_submit_gen_full_auto_id" *} onclick = "ec_gen_full_auto();" style = "margin-top:0;"/>
    5153  </div>
    5254 
    53   <table style="border-spacing:30px" width = "97%">
    54    
    55     {* <!-- New entry --> *}
    56     {* <!--
    57     <tr>
    58       <td>
    59         <label for = "selection--1">
    60           <input type = "radio" name = "ec_entry_sel" value = "-1" id = "selection--1" />
    61           <span style = "font-weight:bold; font-style:italic; font-size:120%; text-decoration:underline;">{'ec_create_modify_code'|@translate}</span>
    62         </label>
    63       </td>
    64       <td>
    65       </td>
    66     </tr>
    67     --> *}
     55  <table style = "border-spacing:30px" width = "97%">
    6856   
    6957    {* <!-- Code selection --> *}
     
    7765        <label for = "ec_in_up_code_id" style = "margin:0;">
    7866          <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'ec_new_entry_button'|@translate}"
    79            id = "ec_submit_gen_code_id" onclick = "ec_gen_code();" style = "margin:0;"
     67           {* id = "ec_submit_gen_code_id" *} onclick = "ec_gen_code();" style = "margin:0;"
    8068          />
    8169        </label>
    8270        {'ec_gen_code_nb_pre'|@translate}
    83         <select name = "ec_in_up_auto_code_length" id = "ec_in_up_auto_code_length_id" onchange = "ec_auto_code_digits_nb = this.value;">
     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;">
    8472          <option value = "4">4</option>
    8573          <option value = "5">5</option>
     
    10492      <td>
    10593      <li>
    106         {* <!-- None --> *}
    107         <label onclick = "ec_mark_user('ec_sel_user_none');">
    108           <input type = "radio" name = "ec_sel_user" value = "none" id = "ec_sel_user_none"
    109            onclick = "ec_mark_user('ec_sel_user_none');"
    110           />
    111           {'ec_up_code_lbl_user_none'|@translate}
    112         </label><br>
    113       </li>
    114        
    115       <li>
    11694        {* <!-- New user (to create) --> *}
    11795        <label for = "ec_in_up_usr_txt_id" onclick = "ec_mark_user('ec_sel_user_new');">
     
    123101        &nbsp;
    124102        <input class = "submit" type = "button" name = "ec_submit_gen_user" value = "{'ec_up_code_lbl_gen_user'|@translate}"
    125          id = "ec_submit_gen_user_id" onclick = "ec_gen_user();"
     103         {* id = "ec_submit_gen_user_id" *} onclick = "ec_gen_user();"
    126104        /><br>
    127105        <ul><li>
     
    221199  </table>
    222200  <p>
    223     <input class = "submit" type = "submit" name = "ec_submit" value = "{'Submit'|@translate}"/>
    224     <input class = "submit" type = "reset" name = "ec_reset" value = "{'Reset'|@translate}" onclick = "ec_init();"/>
     201    <input class = "submit" type = "submit{* button *}" {* name = "ec_submit" *} value = "{'Submit'|@translate}" onclick = "ec_validate();"/>
     202    <input class = "submit" type = "reset" {* name = "ec_reset" *} value = "{'Reset'|@translate}" onclick = "ec_init();"/>
    225203  </p>
    226204</form>
  • extensions/event_cats/include/evntcats_funcs.inc.php

    r3985 r4011  
    4646 
    4747  $ec_lists['ec_table'] = array();
    48   // $ec_lists['ec_codes'] = array(); // Useful ?
    4948 
    5049  if (isset($conf['auto_log'])) {
     
    6059       'arg2'    => NULL,
    6160       'forced'  => 'false',
    62       )) - 1; // key($ec_lists['ec_table']) does not work as expected
     61      )) - 1;
    6362      $ec_lists['ec_table'][$ec_current_entry]['id'] = $ec_current_entry;
    64       /* $ec_lists['ec_codes'][$ec_current_code] = array(
    65        'count' => 1,
    66        'id'    => $ec_current_entry
    67       ); */
    6863      if (isset($conf['prior_page'])) {
    6964        if (array_key_exists($ec_current_code, $conf['prior_page'])) {
     
    9489           'arg2'    => $ec_current_AP,
    9590           'forced'  => 'true',
    96           )) - 1; // key($ec_lists['ec_table']) problem
     91          )) - 1;
    9792          $ec_lists['ec_table'][$ec_current_entry]['id'] = $ec_current_entry;
    98           /* $ec_lists['ec_codes'][$ec_current_code] = array(
    99            'id'     => $ec_current_entry,
    100            'count'  => 1
    101           ); */
    10293        }
    10394      }
     
    114105    while ($r = mysql_fetch_assoc($q)) {
    115106      $ec_lists['ec_table'][intval($r['id'])] = $r;
    116       /* $ec_current_entry = intval($r['id']);
    117       $ec_current_code = $r['code'];
    118       if (array_key_exists($ec_current_code, $ec_lists['ec_codes'])) {
    119         $ec_lists[$ec_current_code]['count']++;
    120       }
    121       else {
    122         $ec_lists['ec_codes'][$ec_current_code] = array(
    123          'id'     => $ec_current_entry,
    124          'count'  => 1
    125         ); */
    126107    }
    127108  }
     
    145126    $first = array();
    146127    $to_correct = array();
     128   
    147129    // $to_correct is needed because following code would not work anywhere :
    148130    /*
     
    159141    // Internet provider).
    160142    */
     143   
    161144    foreach ($ec_lists['ec_table'] as &$ec_entry) { // & is not really needed
    162145      $ec_current_code = $ec_entry['code'];
  • extensions/event_cats/language/fr_FR/plugin.lang.php

    r4002 r4011  
    2121$lang['ec_entry_table_title']     = 'Entrées du paramètre "autolog"';
    2222$lang['ec_new_entry_table_title'] = 'Nouvelle entrée du paramètre "autolog"';
     23$lang['ec_top_title']             = 'Placer ce titre en haut de la page';
    2324// Table
    2425$lang['ec_col_name_entry']        = 'Entrée';
     
    4546$lang['ec_gen_code_nb_end']       = 'caractères';
    4647$lang['ec_up_code_lbl_user']      = 'Utilisateur identifié';
    47 $lang['ec_up_code_lbl_user_none'] = 'Aucun (accès refusé)';
    4848$lang['ec_up_code_lbl_user_new']  = 'Nouvel utilisateur :';
    4949$lang['ec_new_user_name']         = 'Nom d\'utilisateur';
Note: See TracChangeset for help on using the changeset viewer.