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/autolog_new.inc.php

    r4048 r4058  
    8080
    8181$ec_default_action = 'create';
     82$ec_default_entry  = '-1';
    8283$ec_def_auto_code_dg_nb = read_ec_conf('auto_code_dg_nb');
    8384
     
    8687*****************************************************************************/
    8788
    88 if (isset($_POST['ec_act1']) and $_POST['ec_act1'] == 'duplicate_entry') {
    89   if (isset($_POST['ec_entry_sel'])) {
    90     if (array_key_exists($_POST['ec_entry_sel'], $ec_lists['ec_table']))
    91      $ec_default_action = $_POST['ec_entry_sel'];
    92     else
    93      $page['errors'][] = 'Tentative de duplication d\'une entrée inexistante';
     89if (isset($_POST['ec_act1']) and isset($_POST['ec_entry_sel'])) {
     90  if (
     91    array_key_exists($_POST['ec_entry_sel'], $ec_lists['ec_table']) or
     92    $_POST['ec_entry_sel'] == '-1'
     93  ) {
     94    switch ($_POST['ec_act1']) {
     95      case 'duplicate_entry_ask':
     96      case 'modify_entry_ask':
     97      case 'disable':
     98      case 'create':
     99        $ec_default_action = $_POST['ec_act1'];
     100        $ec_default_entry = $_POST['ec_entry_sel'];
     101      break;
     102      default:
     103        $page['errors'][] = 'Demande inconnue : $_POST[\'ec_act1\'] = '.$_POST['ec_act1'];
     104    }
    94105  }
    95   else {
    96     $page['errors'][] = 'Tentative de duplication sans entrée';
    97   }
     106  else
     107   $page['errors'][] = 'Tentative d\'utilisation d\'une entrée inexistante ($_POST[\'ec_entry_sel\'] = '.$_POST['ec_entry_sel'].')';
    98108}
    99109
     
    108118  (count($ec_lists['user_ids']) == 0) ? 'style = "display:none;"' : ''
    109119);
     120$template->assign('ec_is_creation',
     121  ($ec_default_action == 'duplicate_entry_ask' or
     122   $ec_default_action == 'create')
     123);
    110124$template->assign('ec_default_action',$ec_default_action);
     125$template->assign('ec_default_entry',$ec_default_entry);
    111126$template->assign('ec_def_auto_code_dg_nb',$ec_def_auto_code_dg_nb);
    112127
Note: See TracChangeset for help on using the changeset viewer.