pari: branch 2.0 r3635 - /branches/2.0/config/js/astman.js

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Thu Aug 7 14:00:32 CDT 2008


Author: pari
Date: Thu Aug  7 14:00:32 2008
New Revision: 3635

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3635
Log:

 Asterisk 1.6/trunk will fail " updateconfig -> update "  if the variable does not already exist

 making ASTGUI.updateaValue() check for the variable first and behave accordingly 




Modified:
    branches/2.0/config/js/astman.js

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=3635&r1=3634&r2=3635
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Thu Aug  7 14:00:32 2008
@@ -2205,8 +2205,16 @@
 
 	updateaValue: function(e){
 		// ASTGUI.updateaValue(  {file:'users.conf', context :'6000', variable :'hassip', value :'yes'}   )
+		var cxt = context2json({ filename : e.file , context : e.context , usf : 1 }) ;
+
 		var u = new listOfSynActions(e.file) ;
-		u.new_action('update', e.context, e.variable , e.value );
+
+		if( cxt.hasOwnProperty(e.variable) ){
+			u.new_action('delete', e.context, e.variable , '' , '');
+		}else{
+			u.new_action('append', e.context, e.variable , e.value );
+		}
+
 		var g = u.callActions();
 		return (g.contains('Response: Success')) ? true : false ;
 	},




More information about the asterisk-gui-commits mailing list