Changeset 4171


Ignore:
Timestamp:
Nov 2, 2009, 2:23:52 AM (11 years ago)
Author:
LucMorizur
Message:

[Event Cats] Bug corrections

Location:
extensions/event_cats
Files:
10 edited

Legend:

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

    r4157 r4171  
    110110$template->assign('ec_ap_ok',               $ec_ap_ok);
    111111$template->assign('ec_lists',               $ec_lists);
     112$template->assign('cat_display',            (read_ec_conf('cat_display') == '0'));
    112113$template->assign('ec_default_entry',       $ec_default_entry);
    113114$template->assign('ec_default_action',      $ec_default_action);
  • extensions/event_cats/admin/evntcats_admin.php

    r4169 r4171  
    3838if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    3939
    40 global $template, $conf, $lang, $test1, $prefixeTable, $ec_err, $page,
     40global $template, $conf, $lang, $test1, $prefixeTable, $ec_conf, $page,
    4141 $ec_lists,   // array of following arrays :
    4242              //   $ec_lists['ec_table'] :
     
    188188  'POST'      => str_from_var($_POST),
    189189  'page'      => str_from_var($page),
     190  'ec_conf'   => str_from_var($ec_conf),
    190191  'ec_lists'  => (isset($ec_lists)) ? str_from_var($ec_lists) : '(unset)',
    191192  'code_list' => (isset($code_list)) ? str_from_var($code_list) : '(unset)',
  • extensions/event_cats/admin/template/autolog_entries.js

    r4092 r4171  
    2828
    2929function ec_check_ds(ec_id) {
     30  var t = true;
    3031  ec_mark_line(ec_id);
    31   document.getElementById('ec_act1_id').value = 'disable';
    32   document.forms['ec_view_codes'].submit();
     32  if (!ec_ap_ok) t = confirm(ec_JS_message['ec_confirm_disable']);
     33  if (t) {
     34    document.getElementById('ec_act1_id').value = 'disable';
     35    document.forms['ec_view_codes'].submit();
     36  }
    3337}
    3438
     
    5660    return false;
    5761  }
    58   else return true;
     62  else return confirm(ec_JS_message['ec_confirm_test']);
    5963}
    6064
  • extensions/event_cats/admin/template/autolog_entries.tpl

    r4170 r4171  
    124124<script type = "text/javascript"><!--
    125125  ec_JS_message['ec_confirm_delete']  = "{'ec_confirm_delete'|@translate|@escape:javascript}";
     126  ec_JS_message['ec_confirm_disable'] = "{'ec_confirm_disable'|@translate|@escape:javascript}";
    126127  ec_JS_message['ec_confirm_test']    = "{'ec_confirm_test'|@translate|@escape:javascript}";
    127128  ec_JS_message['ec_confirm_force']   = "{'ec_confirm_force'|@translate|@escape:javascript}";
  • extensions/event_cats/admin/template/autolog_new.js

    r4163 r4171  
    77var ec_flag1                    = false;
    88var ec_flag2                    = false;
     9var cat_display                 = false;
    910var ec_dont_check               = false;
    1011var ec_selected_old_group       = false;
     
    6263function ec_mark_entry(ec_id) {
    6364  var i = 0;
     65  ec_chk_nover_cat = false;
    6466  if (ec_id == '-1') de('ec_in_up_entry_list_id').selectedIndex = '-1';
    6567  else {
     
    8789        case 2: // Additionnal Page
    8890          ec_selected_action = 'ec_input_action_add_p';
    89           ec_selected_cat = (ec_check_exist_value('ec_in_up_aps_id',
     91          ec_selected_AP = (ec_check_exist_value('ec_in_up_aps_id',
    9092           ec_lists['arg2'][ec_id])) ? ec_lists['arg2'][ec_id] : '-1';
    9193        break;
     
    113115    }
    114116  }
     117  ec_chk_nover_cat = true;
    115118}
    116119
     
    267270      switch (ec_selected_action) {
    268271        case 'ec_input_action_add_p': // Additional Page
    269           de('ec_in_up_aps_id').value = ec_selected_AP;
     272          if (ec_selected_AP == '-1')
     273           de('ec_in_up_aps_id').selectedIndex = '-1';
     274          else
     275           de('ec_in_up_aps_id').value = ec_selected_AP;
    270276          de('ec_in_up_cats_id').selectedIndex = '-1';
    271277          de('ec_in_up_imgs_id').value = '';
     
    274280        case 'ec_input_action_cat': // Category
    275281          de('ec_in_up_aps_id').selectedIndex = '-1';
    276           de('ec_in_up_cats_id').value = ec_selected_cat;
     282          if (ec_selected_cat == '-1')
     283           de('ec_in_up_cats_id').selectedIndex = '-1';
     284          else
     285           de('ec_in_up_cats_id').value = ec_selected_cat;
    277286          de('ec_in_up_imgs_id').value = '';
    278287          ec_selected_user = (ec_selected_user == 'ec_sel_user_none') ?
     
    282291        case 'ec_input_action_img': // Image
    283292          de('ec_in_up_aps_id').selectedIndex = '-1';
    284           de('ec_in_up_cats_id').value = ec_selected_cat;
    285           de('ec_in_up_imgs_id').value = ec_selected_img;
     293          if (ec_selected_img == '-1') {
     294            de('ec_in_up_cats_id').selectedIndex = '-1';
     295            de('ec_in_up_imgs_id').value = '';
     296          }
     297          else {
     298            de('ec_in_up_cats_id').value = ec_selected_cat;
     299            de('ec_in_up_imgs_id').value = ec_selected_img;
     300          }
    286301          ec_selected_user = (ec_selected_user == 'ec_sel_user_none') ?
    287302           'ec_sel_user_old' : ec_selected_user;
     
    394409  var ec_reg_ap   = /^\S+/;
    395410  var ec_reg_cat1 = /\/\s(.+)$/;
     411  var ec_reg_cat3 = /^\s*\-\s(.+)$/;
    396412  if (
    397413   ec_selected_action == '' ||
     
    420436            d.ec_new_code.ec_in_up_aps.selectedIndex
    421437           ].label
    422           );
     438          )[0];
     439          ec_new_user_text = ec_new_user_text.substr(0, 32);
    423440          t2 = ec_new_user_text;
    424441        break;
     
    428445            d.ec_new_code.ec_in_up_cat.selectedIndex
    429446           ].label;
    430           ec_new_user_text = (ec_reg_cat2.test(ec_cat_sel)) ?
    431            ec_reg_cat1.exec(ec_cat_sel)[1] : ec_cat_sel;
    432           ec_new_user_text = ec_new_user_text.replace(/\s/, '_');
     447          if (cat_display) ec_new_user_text =
     448           (ec_reg_cat2.test(ec_cat_sel)) ?
     449            ec_reg_cat1.exec(ec_cat_sel)[1] : ec_cat_sel;
     450          else ec_new_user_text = ec_reg_cat3.exec(ec_cat_sel)[1];
     451          ec_new_user_text = ec_new_user_text.replace(/\s/g, '_');
     452          ec_new_user_text = ec_new_user_text.substr(0, 32);
    433453          t2 = ec_new_user_text;
    434454        if (ec_selected_action == 'ec_input_action_img') {
  • extensions/event_cats/admin/template/autolog_new.tpl

    r4158 r4171  
    267267<script type = "text/javascript"><!--
    268268  ec_is_creation                          = {if $ec_is_creation}true{else}false{/if};
     269  cat_display                             = {if $cat_display}true{else}false{/if};
    269270  ec_up_code_lbl_forced_txt               = "{'ec_up_code_lbl_forced'|@translate}";
    270271  ec_JS_message['ec_gen_user_act_miss']   = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
  • extensions/event_cats/include/ec_conf.inc.php

    r4092 r4171  
    3333 _ the number of digits when creating a new code automatically
    3434   ($ec_conf[2] <=> read_ec_conf('auto_code_dg_nb')) ;
     35 _ whether categories are displayed "cat / under_cat / ..." or
     36   "cat <CR LF> - under_cat <CR LF> - ..." ($ec_conf[3] <=>
     37   read_ec_conf('cat_display')) ;
    3538 _ whether the "how to" banner has already been displayed or not
    36    ($ec_conf[3] <=> read_ec_conf('howto')) ;
     39   ($ec_conf[4] <=> read_ec_conf('howto')) ;
    3740 _ what to do in case an unknown code is used with "autolog" parameter
    38    ($ec_conf[4] <=> read_ec_conf('unknown_code')) :
     41   ($ec_conf[5] <=> read_ec_conf('unknown_code')) :
    3942   0 : nothing ("goto" home page, index.php (not logged in of course)) ;
    4043   1 : redirected to "access denied" page ;
    4144   2 : redirected to an Additional Page precised below.
    4245 _ the id of the Additional Page which must be used in case of usage of an
    43    unknow code ($ec_conf[5] <=> read_ec_conf('unknown_code_ap_id')).
     46   unknow code ($ec_conf[6] <=> read_ec_conf('unknown_code_ap_id')).
    4447*****************************************************************************/
    4548
     
    5558}
    5659else {
    57   $ec_conf = explode(',' , '0,1,10,0,0,0');
     60  $ec_conf = explode(',' , '0,1,10,0,0,0,0');
    5861  change_ec_conf('activated', 0);
    5962}
     
    8285      $ec_conf[2] = $v;
    8386    break;
    84     case 'howto':
     87    case 'cat_display':
    8588      $ec_conf[3] = $v;
    8689    break;
    87     case 'unknown_code':
     90    case 'howto':
    8891      $ec_conf[4] = $v;
    8992    break;
     93    case 'unknown_code':
     94      $ec_conf[5] = $v;
     95    break;
    9096    case 'unknown_code_ap_id':
    91       $ec_conf[5] = $v;
     97      $ec_conf[6] = $v;
    9298    break;
    9399    default: return false;
     
    115121    case 'dup_allow'         : return $ec_conf[1];
    116122    case 'auto_code_dg_nb'   : return $ec_conf[2];
    117     case 'howto'             : return $ec_conf[3];
    118     case 'unknown_code'      : return $ec_conf[4];
    119     case 'unknown_code_ap_id': return $ec_conf[5];
     123    case 'cat_display'       : return $ec_conf[3];
     124    case 'howto'             : return $ec_conf[4];
     125    case 'unknown_code'      : return $ec_conf[5];
     126    case 'unknown_code_ap_id': return $ec_conf[6];
    120127    default                  : return false;
    121128  }
  • extensions/event_cats/include/evntcats_main_funcs.inc.php

    r4170 r4171  
    330330     SELECT id,name,uppercats,global_rank
    331331     FROM '.CATEGORIES_TABLE,
    332    $c, 'category_options', true);
     332   $c, 'category_options', (read_ec_conf('cat_display') == '0'));
    333333  $ec_lists['categories'] = $template->smarty->_tpl_vars['category_options'];
    334334 
  • extensions/event_cats/language/en_UK/plugin.lang.php

    r3963 r4171  
    77*/
    88
    9 // $ec_err :
    10 $lang['ec_err_AP_fail'] = 'Reference to an Additional Page which doesn\'t exist'; // 1
    11 $lang['ec_err_cod_dupl_frbdn'] = 'Code should be unique '; // 2
    12 $lang['ec_err_AP_miss'] = 'Redirection to Additional Page, but AP not specified'; // 3
    13 $lang['ec_err_USR_fail'] = 'An entry associates a code to an unknown user_id or username'; // 4
    14 $lang['ec_err_CAT_fail'] = 'An unknown category has been given as arg1'; // 5
    15 $lang['ec_err_IMG_fail'] = 'An image id not found in a certain category, has been given as arg2'; // 6
    16 $lang['ec_err_USR_prbl'] = 'User not clear'; // 7
    17 $lang['ec_err_USR_dupl'] = 'Code is associated to more than one user_id'; // 8
    18 $lang['ec_err_CAT_miss'] = 'Category id misses'; // 9
    19 $lang['ec_err_IMG_miss'] = 'Image id misses'; // 10
    20 $lang['ec_err_forced_prbl'] = 'Outdated code should always be forced'; // 11
    21 
    229
    2310// $lang[''] = '';
  • extensions/event_cats/language/fr_FR/plugin.lang.php

    r4163 r4171  
    7575$lang['ec_confirm_test']          = "Vraiment tester le code sélectionné ?\n\rCela terminera votre session d'administration.";
    7676$lang['ec_confirm_delete']        = "Vraiment supprimer l'entrée sélectionnée ?";
     77$lang['ec_confirm_disable']       = "Vraiment rendre périmé le code sélectionné ?\n\rCela supprimera toutes les autres entrées utilisant le même code, s'il y en a.";
    7778$lang['ec_confirm_force']         = "Vraiment forcer l'affichage pour le code sélectionné ?\n\rCela supprimera toutes les autres entrées utilisant le même code, s'il y en a.";
    7879$lang['ec_confirm_del_other']     = "Cela supprimera toutes les autres entrées utilisant le même code, s'il y en a.\n\rOK ?";
Note: See TracChangeset for help on using the changeset viewer.