Changeset 6347

Show
Ignore:
Timestamp:
08/11/08 18:01:51 (5 years ago)
Author:
p_lindheimer
Message:

fixes #2530 so conflicts when creating users result in proper display, when creating extensions returns to main extension page

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.5/core/functions.inc.php

    r6345 r6347  
    40754075    if ( is_string($extdisplay) ) {  
    40764076 
    4077       if (!isset($_GLOBALS['abort']) || $_GLOBALS['abort'] !== true) { 
     4077      if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 
    40784078        $extenInfo=core_users_get($extdisplay); 
    40794079        extract($extenInfo); 
     
    40844084      if ( $display == 'extensions' ) { 
    40854085        $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Extension").": $extdisplay", false), 0); 
    4086         if (!isset($_GLOBALS['abort']) || $_GLOBALS['abort'] !== true) { 
     4086        if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 
    40874087          $tlabel = sprintf(_("Delete Extension %s"),$extdisplay); 
    40884088          $label = '<span><img width="16" height="16" border="0" title="'.$tlabel.'" alt="" src="images/user_delete.png"/>&nbsp;'.$tlabel.'</span>'; 
     
    40964096      } else { 
    40974097        $currentcomponent->addguielem('_top', new gui_pageheading('title', _("User").": $extdisplay", false), 0); 
    4098         if (!isset($_GLOBALS['abort']) || $_GLOBALS['abort'] !== true) { 
     4098        if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 
    40994099          $tlabel = sprintf(_("Delete User %s"),$extdisplay); 
    41004100          $label = '<span><img width="16" height="16" border="0" title="'.$tlabel.'" alt="" src="images/user_delete.png"/>&nbsp;'.$tlabel.'</span>'; 
     
    42414241  if (isset($extension) && !checkRange($extension)){ 
    42424242    echo "<script>javascript:alert('". _("Warning! Extension")." ".$extension." "._("is not allowed for your account").".');</script>"; 
    4243     $_GLOBALS['abort'] = true; 
     4243    $GLOBALS['abort'] = true; 
    42444244  } else { 
    42454245    //if submitting form, update database 
     
    42504250        $usage_arr = framework_check_extension_usage($_REQUEST['extension']); 
    42514251        if (!empty($usage_arr)) { 
    4252           $_GLOBALS['abort'] = true; 
     4252          $GLOBALS['abort'] = true; 
    42534253          $conflict_url = framework_display_extension_usage_alert($usage_arr,true); 
    42544254          global $currentcomponent; 
    42554255          $id=0; 
     4256          $currentcomponent->addguielem('_top', new gui_link_label('conflict', _("Conflicting Extensions"), _("The following extension numbers are in conflict, you can click on the item(s) below to edit the conflicting entity."), true)); 
    42564257          foreach ($conflict_url as $edit_link) { 
    42574258            $currentcomponent->addguielem('_top', new gui_link('conflict'.$i++, $edit_link['label'], $edit_link['url'])); 
    42584259          } 
     4260          $msg = ($_REQUEST['display'] == 'users') ? _("Configure user again:") : _("Configure extension again:"); 
     4261          $currentcomponent->addguielem('_top', new gui_subheading('conflict_end', $msg, false)); 
     4262          unset($_REQUEST['action']); 
     4263          redirect_standard_continue(); 
    42594264        } elseif (core_users_add($_REQUEST)) { 
    42604265          needreload(); 
     
    42654270          // this like voicemail! 
    42664271          // 
    4267           $_GLOBALS['abort'] = true; 
     4272          $GLOBALS['abort'] = true; 
    42684273        } 
    42694274      break; 
     
    42834288        } else { 
    42844289          // really bad hack - but if core_users_edit fails, want to stop core_devices_edit 
    4285           $_GLOBALS['abort'] = true; 
     4290          $GLOBALS['abort'] = true; 
    42864291        } 
    42874292      break; 
     
    45434548    case "add": 
    45444549    // really bad hack - but if core_users_add fails, want to stop core_devices_add 
    4545     if (!isset($_GLOBALS['abort']) || $_GLOBALS['abort'] !== true) { 
     4550    if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 
    45464551      if (core_devices_add($deviceid,$tech,$devinfo_dial,$devicetype,$deviceuser,$description,$emergency_cid)) { 
    45474552        needreload(); 
     
    45594564    case "edit":  //just delete and re-add 
    45604565      // really bad hack - but if core_users_edit fails, want to stop core_devices_edit 
    4561       if (!isset($_GLOBALS['abort']) || $_GLOBALS['abort'] !== true) { 
     4566      if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 
    45624567        core_devices_del($extdisplay,true); 
    45634568        core_devices_add($deviceid,$tech,$devinfo_dial,$devicetype,$deviceuser,$description,$emergency_cid,true); 
  • modules/branches/2.5/dictate/functions.inc.php

    r5897 r6347  
    152152  }  
    153153  if ($action == "add" || $action == "edit") { 
    154     if (!isset($_GLOBALS['abort']) || $_GLOBALS['abort'] !== true) { 
     154    if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 
    155155      dictate_update($extdisplay, $dictenabled, $dictformat, $dictemail); 
    156156    } 
  • modules/branches/2.5/languages/functions.inc.php

    r6123 r6347  
    183183  }  
    184184  if ($action == "add" || $action == "edit") { 
    185     if (!isset($_GLOBALS['abort']) || $_GLOBALS['abort'] !== true) { 
     185    if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 
    186186      languages_user_update($extdisplay, $langcode); 
    187187    } 
  • modules/branches/2.5/paging/functions.inc.php

    r6024 r6347  
    595595 
    596596  if ($action == "add" || $action == "edit") { 
    597     if (!isset($_GLOBALS['abort']) || $_GLOBALS['abort'] !== true) { 
     597    if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 
    598598      if ($in_default_page_grp !== false) { 
    599599        paging_set_default($extdisplay, $in_default_page_grp); 
  • modules/branches/2.5/vmblast/functions.inc.php

    r5897 r6347  
    298298   
    299299  if (($action == "add" || $action == "edit") && $vm_enabled) { 
    300     if (!isset($_GLOBALS['abort']) || $_GLOBALS['abort'] !== true) { 
     300    if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 
    301301      if ($in_default_vmblast_grp !== false) { 
    302302        vmblast_set_default($extdisplay, $in_default_vmblast_grp); 
  • modules/branches/2.5/voicemail/functions.inc.php

    r6309 r6347  
    242242  } 
    243243 
    244   if ($tech_hardware != null || $extdisplay != '' || $pagename == 'users') {  
     244  if ($tech_hardware != null || $extdisplay != '' || $pagename == 'users') { 
    245245    // JS function needed for checking voicemail = Enabled 
    246246    $js = 'return (theForm.vm.value == "enabled");'; 
     
    336336    // ** WARNING ** 
    337337    // Mailbox must be processed before adding / deleting users, therefore $sortorder = 1 
    338     $currentcomponent->addprocessfunc('voicemail_configprocess', 1); 
     338    // 
     339    // More hacky-ness from components, since this is called first, we need to determine if 
     340    // it there is a conclict indpenendent from the user component so we know if we should 
     341    // redisplay the or not. While we are at it, we won't add the process function if there 
     342    // is a conflict 
     343    // 
     344    if ($_REQUEST['display'] == 'users') { 
     345      $usage_arr = framework_check_extension_usage($_REQUEST['extension']); 
     346      if (empty($usage_arr)) { 
     347        $currentcomponent->addprocessfunc('voicemail_configprocess', 1); 
     348      } else { 
     349        voicemail_applyhooks();  
     350      } 
     351    } else { 
     352      $currentcomponent->addprocessfunc('voicemail_configprocess', 1); 
     353    } 
    339354  } elseif ($extdisplay != '' || $pagename == 'users') {  
    340355  // We're now viewing an extension, so we need to display _and_ process.  
     
    600615  switch ($action) { 
    601616    case "add": 
    602       if (!isset($_GLOBALS['abort']) || $_GLOBALS['abort'] !== true) { 
     617      if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 
    603618        $usage_arr = framework_check_extension_usage($_REQUEST['extension']); 
    604619        if (!empty($usage_arr)) { 
    605           $_GLOBALS['abort'] = true; 
     620          $GLOBALS['abort'] = true; 
    606621        } else { 
    607622          voicemail_mailbox_add($extdisplay, $_REQUEST); 
     
    618633    break; 
    619634    case "edit": 
    620       if (!isset($_GLOBALS['abort']) || $_GLOBALS['abort'] !== true) { 
     635      if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 
    621636        voicemail_mailbox_del($extdisplay); 
    622637        if ( $vm != 'disabled' )