Completed
Pull Request — v3.0 (#146)
by
unknown
125:06 queued 113:39
created
web_interface/astpp/system/helpers/template_inheritance_helper.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -283,8 +283,7 @@
 block discarded – undo
283 283
 		//echo 'tttttttttttt';
284 284
 		if (isset($GLOBALS['CI'])) {
285 285
 			$GLOBALS['CI']->load->view($GLOBALS['TI_CURRENT_BASE_TEMPLATE']);
286
-		}
287
-		else {
286
+		} else {
288 287
 			include realpath( TI_VIEWS_DIR . $GLOBALS['TI_CURRENT_BASE_TEMPLATE']);
289 288
 		}
290 289
 	}
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/form_helper.php 1 patch
Braces   +25 added lines, -18 removed lines patch added patch discarded remove patch
@@ -83,10 +83,11 @@  discard block
 block discarded – undo
83 83
 if(!function_exists('form_breadcrumb')){
84 84
 	function form_breadcrumb($info=''){
85 85
 	 $form=false;
86
-	 if(!empty($info))
87
- 	$form.="<div class='breadcrumb'>
86
+	 if(!empty($info)) {
87
+	  	$form.="<div class='breadcrumb'>
88 88
 	        <a href='".$info['url']."'>".$info['name']."</a>
89
-		</div>";
89
+		</div>";
90
+	 }
90 91
 	return $form;
91 92
 	}
92 93
 }
@@ -212,7 +213,7 @@  discard block
 block discarded – undo
212 213
                    		</span>
213 214
                    </div>
214 215
                </div>';
215
-		}else{
216
+		} else{
216 217
 			return "<div class='col-md-5 no-padding'><image "._parse_form_attributes($data, $defaults).$extra." /></div>";
217 218
 		}	
218 219
 		
@@ -375,22 +376,25 @@  discard block
 block discarded – undo
375 376
 			}
376 377
 		}
377 378
 
378
-		if ($extra != '') $extra = ' '.$extra;
379
+		if ($extra != '') {
380
+			$extra = ' '.$extra;
381
+		}
379 382
 		$multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : '';
380 383
 				if(is_array($name)){
381 384
 					 $str=null;
382 385
 					 foreach($name as $key=>$value){
383
-					  if($key !='class' && $key!='disabled')
384
-					  $str.=$key."='$value' ";
386
+					  if($key !='class' && $key!='disabled') {
387
+					  					  $str.=$key."='$value' ";
388
+					  }
385 389
 					 }
386 390
 					 if(isset($name['disabled']) && $name['disabled']== 'disabled'){
387 391
 					  $str.='disabled = "disabled"';
388 392
 					 }
389 393
 							   $form = '<select '.$str." class='col-md-5 form-control selectpicker ".$name['class'].$extra."' data-live-search='true'>\n";
390
-				}else{
394
+				} else{
391 395
 					if(!empty($extra)){
392 396
 						$form = '<select  name="'.$name.'"' .$multiple." class='col-md-5 form-control selectpicker ".$extra."' data-live-search='true'>\n";
393
-					}else{
397
+					} else{
394 398
 						$form = '<select  name="'.$name.'"' .$multiple." class='col-md-5 form-control selectpicker' data-live-search='true'>\n";
395 399
 					}
396 400
 				}
@@ -448,15 +452,16 @@  discard block
 block discarded – undo
448 452
 				$selected = array($_POST[$name]);
449 453
 			}
450 454
 		}
451
-		if ($extra != '') $extra = ' '.$extra;
455
+		if ($extra != '') {
456
+			$extra = ' '.$extra;
457
+		}
452 458
 				$class= isset($name['class']) && !empty($name['class']) ? "col-md-5 form-control selectpicker $name[class]" :"col-md-5 form-control selectpicker";
453 459
 		$multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : '';
454 460
 		if(is_array($name) && !isset($name["id"])){
455 461
 					$form = '<select name="'.$name['name'].'"'." class='$class' data-live-search='true'>\n";
456
-				}else if(is_array($name) && isset($name["id"])){
462
+				} else if(is_array($name) && isset($name["id"])){
457 463
 					$form = '<select name="'.$name['name'].'" id="'.$name['id'].'"'."class='$class' data-live-search='true'>\n";
458
-				}
459
-				else{
464
+				} else{
460 465
 					$form = '<select name="'.$name.'"' .$multiple." class='$class' data-live-search='true'>\n";
461 466
 				}   
462 467
 
@@ -517,7 +522,9 @@  discard block
 block discarded – undo
517 522
 		/*
518 523
 		  ASTPP  3.0  For Search Display In
519 524
 		*/
520
-		if ($extra != '' && !is_array($extra)) $extra = ' '.$extra;
525
+		if ($extra != '' && !is_array($extra)) {
526
+			$extra = ' '.$extra;
527
+		}
521 528
 			/**********************************************************/
522 529
 
523 530
 		$class= isset($name['class']) && !empty($name['class']) ? "col-md-5 form-control selectpicker $name[class]" :"col-md-5 form-control selectpicker";
@@ -530,15 +537,15 @@  discard block
 block discarded – undo
530 537
 				/*********************************/
531 538
 		if(is_array($name) && !isset($name["id"])){
532 539
 					$form = '<select name="'.$name['name'].'"'." class='col-md-5 form-control $class' style='margin-left:5px;' data-live-search='true'>\n";
533
-				}else if(is_array($name) && isset($name["id"])){
540
+				} else if(is_array($name) && isset($name["id"])){
534 541
 					$form = '<select name="'.$name['name'].'" id="'.$name['id'].'"'."class='col-md-5 form-control $class' style='margin-left:5px;' data-live-search='true'>\n";
535
-				}else{
542
+				} else{
536 543
 					$form = '<select name="'.$name.'"' .$multiple." class='col-md-5 form-control $class' style='margin-left:5px;' data-live-search='true'>\n";
537 544
 				}   
538 545
  /*
539 546
 		  ASTPP  3.0  For Search Display In
540 547
 		*/
541
-				}else{
548
+				} else{
542 549
 
543 550
 					$form = '<select name="'.$name['name'].'" id="'.$name['id'].'"'."class='".$extra['class']." $class' style='".$extra['style']."' data-live-search='true'>\n";
544 551
 				 }
@@ -690,7 +697,7 @@  discard block
 block discarded – undo
690 697
 //echo "<pre>".$value; print_r($extra); exit;
691 698
 		if(isset($extra[$value]) && !empty($extra) && $extra[$value] == '0'){
692 699
 		$class='onoffswitch-inner';
693
-		}else{
700
+		} else{
694 701
 		$class='onoffswitch-inner';
695 702
  		}
696 703
 /*            if(isset($extra) && $extra != ''){
Please login to merge, or discard this patch.
freeswitch/fs/lib/astpp.cdr.php 1 patch
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	if ($dataVariable['billsec'] == 0 && $dataVariable['hangup_cause'] == 'NORMAL_CLEARING')
48 48
 	{
49 49
 		$hangup_cause = isset($dataVariable['last_bridge_hangup_cause'])?$dataVariable['last_bridge_hangup_cause']:$dataVariable['hangup_cause'];
50
-	}else{
50
+	} else{
51 51
 		$hangup_cause = $dataVariable['hangup_cause'];
52 52
 	}   
53 53
 
@@ -86,10 +86,12 @@  discard block
 block discarded – undo
86 86
 	$actual_calltype = $dataVariable['calltype'];
87 87
 	
88 88
 	//Normalize origination and termination rates array 		   
89
-	if(isset($dataVariable['origination_rates']))
90
-	   $origination_rate = normalize_origination_rate($dataVariable['origination_rates']);
91
-	if(isset($dataVariable['termination_rates']))
92
-	   $termination_rate = normalize_rate($dataVariable['termination_rates']);
89
+	if(isset($dataVariable['origination_rates'])) {
90
+		   $origination_rate = normalize_origination_rate($dataVariable['origination_rates']);
91
+	}
92
+	if(isset($dataVariable['termination_rates'])) {
93
+		   $termination_rate = normalize_rate($dataVariable['termination_rates']);
94
+	}
93 95
 
94 96
 	//If receiver account id found then explicitly set call direction and call type 
95 97
 	if(isset($dataVariable['receiver_accid']))
@@ -441,11 +443,12 @@  discard block
 block discarded – undo
441 443
 	$query_counter = "SELECT id,seconds FROM counters  WHERE  accountid = ".$accountid." AND package_id = ".$package_id." AND status=1 LIMIT 1";
442 444
 	$counter = $db->run($query_counter);
443 445
 	$logger->log("GET Counters  : " . $query_counter);
444
-	if($counter)
445
-		return $counter[0];	
446
-	else
447
-		return "";
448
-}
446
+	if($counter) {
447
+			return $counter[0];
448
+	} else {
449
+			return "";
450
+	}
451
+	}
449 452
 
450 453
 //Get user info
451 454
 function get_accounts($parent_id,$logger, $db) {
Please login to merge, or discard this patch.
freeswitch/fs/lib/astpp.lib.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@
 block discarded – undo
28 28
 	function get_configurations($db) {
29 29
 		$query = "SELECT * FROM system WHERE group_title IN ('global','opensips')";
30 30
 		$res_conf = $db->run($query);
31
-		foreach ($res_conf as $res_conf_key => $res_conf_value)
32
-			$this->config[$res_conf_value['name']] = $res_conf_value['value'];
31
+		foreach ($res_conf as $res_conf_key => $res_conf_value) {
32
+					$this->config[$res_conf_value['name']] = $res_conf_value['value'];
33
+		}
33 34
 
34 35
 		return $this->config;
35 36
 	}
Please login to merge, or discard this patch.
freeswitch/fs/lib/astpp.db.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,10 +52,11 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function cleanup($bind) {
54 54
         if ( ! is_array($bind)) {
55
-            if ( ! empty($bind))
56
-                $bind = array($bind);
57
-            else
58
-                $bind = array();
55
+            if ( ! empty($bind)) {
56
+                            $bind = array($bind);
57
+            } else {
58
+                            $bind = array();
59
+            }
59 60
         }
60 61
         return $bind;
61 62
     }
@@ -68,10 +69,11 @@  discard block
 block discarded – undo
68 69
         try {
69 70
             $pdostmt = $this->prepare($this->sql);
70 71
             if ($pdostmt->execute($this->bind) !== false) {
71
-                if (preg_match("/^(".implode("|", array("select", "describe", "pragma")).") /i", $this->sql))
72
-                    return $pdostmt->fetchAll(PDO::FETCH_ASSOC);
73
-                elseif (preg_match("/^(".implode("|", array("delete", "insert", "update")).") /i", $this->sql))
74
-                    return $pdostmt->rowCount();
72
+                if (preg_match("/^(".implode("|", array("select", "describe", "pragma")).") /i", $this->sql)) {
73
+                                    return $pdostmt->fetchAll(PDO::FETCH_ASSOC);
74
+                } elseif (preg_match("/^(".implode("|", array("delete", "insert", "update")).") /i", $this->sql)) {
75
+                                    return $pdostmt->rowCount();
76
+                }
75 77
             }
76 78
         } catch (PDOException $e) {
77 79
             $this->error = $e->getMessage();
Please login to merge, or discard this patch.
freeswitch/fs/lib/astpp.xml.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -154,8 +154,9 @@
 block discarded – undo
154 154
 
155 155
 		$sp_gw_settings  = json_decode($sp_gw_value['gateway_data'], true);
156 156
 			foreach ($sp_gw_settings as $sp_gw_settings_key => $sp_gw_settings_value) {
157
-				if ($sp_gw_settings_value != "")
158
-					$xml .= "           <param name=\"" . $sp_gw_settings_key . "\" value=\"" . $sp_gw_settings_value . "\"/>\n";
157
+				if ($sp_gw_settings_value != "") {
158
+									$xml .= "           <param name=\"" . $sp_gw_settings_key . "\" value=\"" . $sp_gw_settings_value . "\"/>\n";
159
+				}
159 160
 			}
160 161
 			$xml .= "       </gateway>\n";
161 162
 		}
Please login to merge, or discard this patch.
freeswitch/fs/lib/astpp.logger.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,22 +29,25 @@
 block discarded – undo
29 29
 	function logger($lib) {
30 30
 		$this->config = $lib->config;
31 31
 		$this->config['log_path'] = "/var/log/astpp/";
32
-		if ($this->config['debug'] == '0')
33
-			$this->fp = fopen($this->config['log_path'] . 'astpp_' . date('Y-m-d') . '.txt', 'a');
32
+		if ($this->config['debug'] == '0') {
33
+					$this->fp = fopen($this->config['log_path'] . 'astpp_' . date('Y-m-d') . '.txt', 'a');
34
+		}
34 35
 	}
35 36
 
36 37
 	function log($log) {
37 38
 		if ($this->config['debug'] == '0') {
38
-			if (is_array($log))
39
-				fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . print_r($log, TRUE));
40
-			else
41
-				fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . $log . "\n");
39
+			if (is_array($log)) {
40
+							fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . print_r($log, TRUE));
41
+			} else {
42
+							fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . $log . "\n");
43
+			}
42 44
 		}
43 45
 	}
44 46
 
45 47
 	function close() {
46
-		if ($this->config['debug'] == '0')
47
-			fclose($this->fp);
48
+		if ($this->config['debug'] == '0') {
49
+					fclose($this->fp);
50
+		}
48 51
 	}
49 52
 
50 53
 }
Please login to merge, or discard this patch.
freeswitch/fs/scripts/astpp.directory.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,10 +28,11 @@
 block discarded – undo
28 28
 
29 29
 if (isset($_REQUEST['user']) && isset($_REQUEST['domain'])) {
30 30
 	$xml = load_directory($logger, $db);
31
-	if ($xml == "")
32
-		xml_not_found();
31
+	if ($xml == "") {
32
+			xml_not_found();
33
+	}
33 34
 	echo $xml;
34
-}else {
35
+} else {
35 36
 	xml_not_found();
36 37
 }
37 38
 $logger->log("*************************** Directory Ends **********************************");
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/taxes/libraries/taxes_form.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@
 block discarded – undo
22 22
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 23
 ###############################################################################
24 24
 
25
-if (!defined('BASEPATH'))
26
-	exit('No direct script access allowed');
25
+if (!defined('BASEPATH')) {
26
+	exit('No direct script access allowed');
27
+}
27 28
 
28 29
 class Package_form {
29 30
 
Please login to merge, or discard this patch.