pari: branch 2.0 r4364 - in /branches/2.0/config: ./ js/
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Tue Dec 16 17:36:25 CST 2008
Author: pari
Date: Tue Dec 16 17:36:25 2008
New Revision: 4364
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=4364
Log:
Added a custom destination option for calling rules
Modified:
branches/2.0/config/callingrules.html
branches/2.0/config/js/astman.js
branches/2.0/config/js/callingrules.js
Modified: branches/2.0/config/callingrules.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/callingrules.html?view=diff&rev=4364&r1=4363&r2=4364
==============================================================================
--- branches/2.0/config/callingrules.html (original)
+++ branches/2.0/config/callingrules.html Tue Dec 16 17:36:25 2008
@@ -92,8 +92,14 @@
</label>
</legend>
<table width='580'>
- <TR> <TD align="right" width='40%'>Destination :</TD>
- <TD><select id='new_crl_localDest'></select></TD>
+ <TR> <TD align="right" width='40%' valign='top'>Destination :</TD>
+ <TD>
+ <select id='new_crl_localDest'></select>
+ <div id='new_crl_localDest_CUSTOM_container' style='margin-top:3px;display:none'>
+ <input id='new_crl_localDest_CUSTOM' size=30> <BR>
+ Ex: Macro(someMacro,${EXTEN:1})
+ </div>
+ </TD>
</TR>
</table>
</fieldset>
Modified: branches/2.0/config/js/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=4364&r1=4363&r2=4364
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Tue Dec 16 17:36:25 2008
@@ -1073,6 +1073,7 @@
},
getFieldValue : function(el){ // ASTGUI.getFieldValue(el)
+ if( !el ){ return ''; }
if ( typeof el == 'string'){ el = _$(el) ; }
switch(el.type){
case 'checkbox':
Modified: branches/2.0/config/js/callingrules.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/callingrules.js?view=diff&rev=4364&r1=4363&r2=4364
==============================================================================
--- branches/2.0/config/js/callingrules.js (original)
+++ branches/2.0/config/js/callingrules.js Tue Dec 16 17:36:25 2008
@@ -212,11 +212,23 @@
var localajaxinit = function() {
top.document.title = "Edit Calling Rules";
- ASTGUI.selectbox.populateArray( 'new_crl_localDest' , parent.miscFunctions.getAllDestinations() );
+
+ var tmp_someArray = parent.miscFunctions.getAllDestinations() ;
+ tmp_someArray.push({ optionText: 'Custom' , optionValue: 'CUSTOM' });
+ ASTGUI.selectbox.populateArray( 'new_crl_localDest' , tmp_someArray);
ASTGUI.domActions.showHideClassByCheckBox( 'toLocalDest', 'STT_TR_OPTIONS', true );
load_DOMelements();
update_CRLSTable();
ASTGUI.events.add( 'restore_default_clrs_button', 'click' , restore_default_callingRules );
+
+ $('#new_crl_localDest').change(function(){
+ if( this.value == 'CUSTOM'){
+ $('#new_crl_localDest_CUSTOM_container').show();
+ $('#new_crl_localDest_CUSTOM').val('').focus();
+ }else{
+ $('#new_crl_localDest_CUSTOM_container').hide();
+ }
+ });
};
@@ -286,7 +298,12 @@
}
if( _$('toLocalDest').checked ){
- var as = DOM_new_crl_pattern.value + ',1,' + ASTGUI.getFieldValue('new_crl_localDest') ;
+ var tmp_new_crl_localDest = ASTGUI.getFieldValue('new_crl_localDest') ;
+ if( tmp_new_crl_localDest == 'CUSTOM' ){
+ var as = DOM_new_crl_pattern.value + ',1,' + ASTGUI.getFieldValue('new_crl_localDest_CUSTOM') ; ////// <<<<<<<<<<<<<<<<<<<
+ }else{
+ var as = DOM_new_crl_pattern.value + ',1,' + tmp_new_crl_localDest ;
+ }
}else{
var t1 = ASTGUI.getFieldValue(DOM_new_crl_trunk);
var t2 = ASTGUI.getFieldValue(DOM_new_crl_fotrunk);
More information about the asterisk-gui-commits
mailing list