📄 localexts.html.svn-base
字号:
<!-- * Asterisk-GUI - an Asterisk configuration interface * * Local Extension Preferences * * Copyright (C) 2006-2007, Digium, Inc. * * Mark Spencer <markster@digium.com> * Pari Nannapaneni <pari@digium.com> * * See http://www.asterisk.org for more information about * the Asterisk project. Please do not directly contact * any of the maintainers of this project for assistance; * the project provides a web site, mailing lists and IRC * channels for your use. * * This program is free software, distributed under the terms of * the GNU General Public License Version 2. See the LICENSE file * at the top of the source tree. *--><script src="scripts/prototype.js"></script><script src="scripts/astman.js"></script><script src="scripts/tooltip.js"></script><link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" /><script>var usercallbacks = new Object;var fieldnames = ['allow_aliasextns', 'allow_an_extns', 'callwaiting', 'cancel', 'hasagent', 'hasdirectory', 'hasiax', 'hasmanager', 'hassip', 'hasvoicemail', 'localextenlength', 'save', 'threewaycalling', 'userbase', 'vmsecret', 'login_exten', 'login_callback_exten','operatorExtension'];var widgets = {};var agent_extens={};var OPE; // Operator extension before changesusercallbacks.format = function(t) { if(t.name == "general" ){ return t.name; } if( !t.fieldbyname['trunkstyle'] ){ // all entries from users.conf other than trunks var ht = (t.fieldbyname['fullname'])? unescape(t.fieldbyname['fullname'])+" ("+t.name+")" : "Local Extension ("+t.name+")"; ASTGUI.selectbox.append(_$('operatorExtension'),ht, t.name); } return null;}usercallbacks.savechanges = function(){ var p=0, uri = ""; if( _$('login_exten').value != agent_extens.login_exten_old){ if(agent_extens.login_exten_old){ uri += build_action('delete', p, specialcontext ,'exten', "", agent_extens.login_exten_old + ',1,agentlogin()' ); p++; } if(_$('login_exten').value.length){ uri += build_action('append', p, specialcontext ,'exten', _$('login_exten').value + ',1,agentlogin()' );p++; } } if( _$('login_callback_exten').value != agent_extens.login_callback_exten_old){ if(agent_extens.login_callback_exten_old){ uri += build_action('delete', p, specialcontext ,'exten', "", agent_extens.login_callback_exten_old + ',1,agentcallbacklogin()' );p++; } if(_$('login_callback_exten').value.length){ uri += build_action('append', p, specialcontext ,'exten', _$('login_callback_exten').value + ',1,agentcallbacklogin()' );p++; } } if( _$('operatorExtension').value != OPE ){ if(OPE){ uri += build_action('delete', p, specialcontext ,'exten', "",'o,1,Goto(default,'+OPE+',1)' ); p++; } if(_$('operatorExtension').value.length){ uri += build_action('append', p, specialcontext ,'exten', 'o,1,Goto(default,' + _$('operatorExtension').value + ',1)' );p++; } } if(uri!=""){ makerequest('u','extensions.conf', uri,function(t){}); }}usercallbacks.beforeSaving= function(){ if( _$('localextenlength').value != "0" && _$('localextenlength').value != _$('userbase').value.length ){ gui_feedback("'length of Local Extensions' does not match <BR> the length of 'First Extension number'"); return false; } if( _$('login_exten').value != "" && _$('login_exten').value == _$('login_callback_exten').value ){ gui_alert("You can not use the same extension for 'Agent Login' and 'Agent Callback Login' "); return false; } OPE = _$('devices').stored_config.catbyname['general'].fieldbyname['operatorExtension'] ; agent_extens.login_exten_old = _$('devices').stored_config.catbyname['general'].fieldbyname['login_exten'] ; agent_extens.login_callback_exten_old = _$('devices').stored_config.catbyname['general'].fieldbyname['login_callback_exten'] ; return true;}usercallbacks.loaded = function(){ var d = _$('devices'); d.selectitem(0); if ( typeof d.stored_config.catbyname['general'].fieldbyname['localextenlength'] == "undefined" ){ makerequest('u','users.conf','&Action-000000=update&Cat-000000=general&Var-000000=localextenlength&Value-000000=4', function(t){ _$('localextenlength').selectedIndex = 2 ; parent.loadscreen(this); } ); return; } parent.loadscreen(this);}function localajaxinit(){ ASTGUI.events.add(document, 'mouseover', show_tooltip); if (top._$('AdvancedOptions').style.display == "none"){ _$('advbasic').innerHTML = '(Show Advanced Options)'; }else{ _$('advbasic').innerHTML = '(Hide Advanced Options)'; } setWindowTitle("Local Extension Settings"); for (var x =0 ; x < fieldnames.length ; x++ ) { widgets[fieldnames[x]] = _$(fieldnames[x]); widgets[fieldnames[x]].disabled = true; } ASTGUI.events.add( _$('localextenlength') , 'change' , update_spae ) ; parent.astmanEngine.config2list("users.conf", _$('devices'),widgets, usercallbacks);}function update_spae(){ var lel = _$('localextenlength'); var ub = _$('userbase') ; if( lel.value == "0" ) { return; } if( lel.value == ub.value.length ) { return; }else if( lel.value < ub.value.length ){ ub.value = ub.value.substr(0,lel.value); return; }else if( lel.value > ub.value.length ){ while ( lel.value != ub.value.length ){ ub.value = ub.value + "0" ; } }}function free_mem( ){ if( navigator.userAgent.indexOf("MSIE") == -1 ){ return true; } try{ widgets['save'].hostselectbox = null ; widgets['cancel'].hostselectbox = null ; purge( document.body ); } catch(e){ }}function flipadvbasic(){ if(_$('advbasic').innerHTML.toLowerCase().match('show') ){ _$('advbasic').innerHTML = '(Hide Advanced Options)'; top._$('AdvancedOptions').style.display = ''; top._$('AdvancedOptionsSelect').selectedIndex=-1; return; } if(_$('advbasic').innerHTML.toLowerCase().match('hide') ){ _$('advbasic').innerHTML = '(Show Advanced Options)'; top._$('AdvancedOptions').style.display = 'none'; return; }}</script><body id="foo" onload="localajaxinit()" bgcolor="EFEFEF" onunload="free_mem()"><div class="mainscreenTitleBar"> <span style="margin-left: 4px;font-weight:bold">Admin Settings</span> <span style="display:none; margin-left: 14px;font-weight:bold; cursor: pointer" id="advbasic" onclick="flipadvbasic();">(Show Advanced Options)</span> <span><a href="options.html" style="margin-left: 240px;font-weight:bold; cursor: pointer; color: #FFFFFF;">Change Password</a></span></div><div class="mainscreenContentBox" id="userscontent"><table class="mainscreenTable" align="center"><tr> <td align="center" valign="top"> <select id="devices" style="display:none"></select> <fieldset style="width: 420px; padding : 3px 0px 0px 0px;"> <legend> Local Extension Settings: </legend> <table align='center' cellpadding=2 cellspacing=1> <tr ><td class="field_text" align=left> Local Extensions are <select id="localextenlength" class="input9"> <option value="2">2 digits</option> <option value="3">3 digits</option> <option value="4">4 digits</option> <option value="5">5 digits</option> <option value="0">Varying</option> </select> </td> </tr> <tr><td class="field_text" align=left>First Extension Number : <input type=text id="userbase" size=5 class="input9"></td></tr> <tr ><td class="field_text" align=left> Operator Extension : <select id="operatorExtension" class="input9"></select> </td> </tr> <tr><td class="field_text" align="left"><input type=checkbox id="allow_aliasextns">Allow analog phones to be assigned to multiple extensions</td></tr> <tr><td class="field_text" align="left"><input type=checkbox id="allow_an_extns">Allow extensions to be AlphaNumeric (SIP/IAX users)</td></tr> </table> </fieldset><BR> <fieldset style="width: 420px"> <legend> Agent Login Settings: </legend> <table align='center' cellpadding=2 cellspacing=1> <tr> <td tip="en,users,18" class="field_text" align=right>Agent Login Extension : </td> <td><input type=text id="login_exten" size=5 class="input9"></td> </tr> <tr> <td tip="en,users,19" class="field_text" align=right>Agent Callback Login Extension : </td> <td><input type=text id="login_callback_exten" size=5 class="input9"></td> </tr> <tr> <td tip="en,users,20" class="field_text" align=right>Agent Logout : </td> <td tip="en,users,20"> See Tooltip</td> </tr> </table> </fieldset><BR> <fieldset style="width: 420px"> <legend> Default Settings for a New User: </legend> <table align='center' cellpadding=2 cellspacing=1> <tr> <td tip="en,users,15" class="field_text" align="right"><input type='checkbox' id='hasagent'></td> <td tip="en,users,15" class="field_text" >Is Agent</td> <td tip="en,users,8" align=right><input type='checkbox' id='hasvoicemail'></td> <td tip="en,users,8" class="field_text" align="left">Voicemail</td> </tr> <tr> <td tip="en,users,9" class="field_text" align="right"><input type='checkbox' id='hasdirectory'></td> <td tip="en,users,9" class="field_text" >In Directory</td> <td tip="en,users,12" align=right><input type='checkbox' id='hasmanager'></td> <td tip="en,users,12" class="field_text" align="left">CTI</td> </tr> <tr> <td tip="en,users,10" class="field_text" align="right"><input type='checkbox' id='hassip'></td> <td tip="en,users,10" class="field_text" >SIP</td> <td tip="en,users,11" align=right><input type='checkbox' id='hasiax'></td> <td tip="en,users,11" class="field_text" align="left">IAX</td> </tr> <tr> <td tip="en,users,13" class="field_text" align="right"><input type='checkbox' id='callwaiting'></td> <td tip="en,users,13" class="field_text" >Call Waiting</td> <td tip="en,users,14" align=right><input type='checkbox' id='threewaycalling'></td> <td tip="en,users,14" class="field_text" align="left">3-Way Calling</td> </tr> <tr> <td tip="en,users,16" align=right><input size='3' id='vmsecret' pattern='^[0-9*]*$' class="input9"> </td> <td tip="en,users,16" class="field_text" align="left">VoiceMail Password</td> <td align=right></td> <td class="field_text" align="left"></td> </tr> </table> </fieldset> <center> <div height=10></div><BR> <input type=button id="save" value="Save"> <input type=button id="cancel" value="Cancel"> </center></td></tr><tr valign="top" height="18"><td></td></tr></table></div></body>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -