@@ -56,12 +56,11 @@ public function ajaxHandler() {
5656
5757 // TODO: Need to be more specific on reload and only reload if critical settings changed.
5858 $ res = $ this ->aminterface ->core_sccp_reload ();
59- return true ;
59+ return array ( ' status ' => true , ' message ' => ' Data saved ' , ' reload ' => true , ' toastFlag ' => ' success ' , ' search ' => ' ?display=sccpsettings ' , ' hash ' => '' ) ;
6060 break ;
6161 case 'save_sip_device ' :
6262 case 'save_device ' :
63- $ this ->saveSccpDevice ($ request );
64- return array ('status ' => true , 'search ' => '?display=sccp_phone ' , 'hash ' => 'sccpdevice ' );
63+ return $ this ->saveSccpDevice ($ request );
6564 break ;
6665 case 'save_ruser ' :
6766 //$res = $request;
@@ -515,15 +514,6 @@ function handleSubmit($request, $validateonly = false) {
515514 // rewrite sccp.conf
516515 $ this ->createDefaultSccpConfig ($ this ->sccpvalues , $ this ->sccppath ["asterisk " ]);
517516 $ this ->createDefaultSccpXml ();
518-
519- $ toastFlag = 'success ' ;
520- $ msg = 'Data saved ' ;
521- $ search = '?display=sccpsettings ' ;
522- $ hash = '' ;
523-
524- echo json_encode (array ('status ' => true , 'message ' => $ msg , 'reload ' => true , 'toastFlag ' => $ toastFlag , 'search ' => $ search , 'hash ' => $ hash )). ";#; " ;
525- ob_flush ();
526- flush ();
527517 }
528518
529519 public function getMyConfig ($ var = null , $ id = "noid " ) {
@@ -782,10 +772,7 @@ function saveSccpDevice($get_settings, $validateonly = false) {
782772 }
783773 }
784774 $ search = '?display=sccp_phone ' ;
785- echo json_encode (array ('status ' => true , 'message ' => $ msg , 'reload ' => true , 'toastFlag ' => $ toastFlag , 'search ' => $ search , 'hash ' => $ hash )). ";#; " ;
786- ob_flush ();
787- flush ();
788- return true ;
775+ return array ('status ' => true , 'message ' => $ msg , 'reload ' => true , 'toastFlag ' => $ toastFlag , 'search ' => $ search , 'hash ' => $ hash );
789776 }
790777
791778}
0 commit comments