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

[Event Cats] Bug corrections

Location:
extensions/event_cats/admin
Files:
6 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}";
Note: See TracChangeset for help on using the changeset viewer.