Completed
Pull Request — master (#532)
06:37
created
app/admin/import-export/export-vlan-field-select.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -5,40 +5,40 @@  discard block
 block discarded – undo
5 5
  */
6 6
 
7 7
 # include required scripts
8
-require( dirname(__FILE__) . '/../../../functions/functions.php' );
8
+require(dirname (__FILE__).'/../../../functions/functions.php');
9 9
 
10 10
 # initialize user object
11 11
 $Database 	= new Database_PDO;
12
-$User 		= new User ($Database);
13
-$Admin 		= new Admin ($Database);
12
+$User = new User ($Database);
13
+$Admin = new Admin ($Database);
14 14
 $Tools	    = new Tools ($Database);
15 15
 
16 16
 # verify that user is logged in
17
-$User->check_user_session();
17
+$User->check_user_session ();
18 18
 
19 19
 # fetch all l2 domains
20
-$vlan_domains = $Admin->fetch_all_objects("vlanDomains", "id");
20
+$vlan_domains = $Admin->fetch_all_objects ("vlanDomains", "id");
21 21
 
22 22
 # get all custom fields
23
-$custom_fields = $Tools->fetch_custom_fields('vlans');
23
+$custom_fields = $Tools->fetch_custom_fields ('vlans');
24 24
 # prepare HTML variables
25 25
 $custom_fields_names = "";
26 26
 $custom_fields_boxes = "";
27 27
 
28 28
 
29
-if(sizeof($custom_fields) > 0) {
30
-	foreach($custom_fields as $myField) {
29
+if (sizeof ($custom_fields) > 0) {
30
+	foreach ($custom_fields as $myField) {
31 31
 		//change spaces to "___" so it can be used as element id
32
-		$myField['nameTemp'] = str_replace(" ", "___", $myField['name']);
33
-		$custom_fields_names.= "	<th>$myField[name]</th>";
34
-		$custom_fields_boxes.= "	<td><input type='checkbox' name='$myField[nameTemp]' checked> </td>";
32
+		$myField['nameTemp'] = str_replace (" ", "___", $myField['name']);
33
+		$custom_fields_names .= "	<th>$myField[name]</th>";
34
+		$custom_fields_boxes .= "	<td><input type='checkbox' name='$myField[nameTemp]' checked> </td>";
35 35
 	}
36 36
 }
37 37
 
38 38
 ?>
39 39
 
40 40
 <!-- header -->
41
-<div class="pHeader"><?php print _("Select VLAN fields to export"); ?></div>
41
+<div class="pHeader"><?php print _ ("Select VLAN fields to export"); ?></div>
42 42
 
43 43
 <!-- content -->
44 44
 <div class="pContent" style="overflow:auto;">
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
 print "	<table class='table table-striped table-condensed'>";
53 53
 
54 54
 print "	<tr>";
55
-print "	<th>"._('Name')."</th>";
56
-print "	<th>"._('Number')."</th>";
57
-print "	<th>"._('Domain')."</th>";
58
-print "	<th>"._('Description')."</th>";
55
+print "	<th>"._ ('Name')."</th>";
56
+print "	<th>"._ ('Number')."</th>";
57
+print "	<th>"._ ('Domain')."</th>";
58
+print "	<th>"._ ('Description')."</th>";
59 59
 print $custom_fields_names;
60 60
 print "	</tr>";
61 61
 
62 62
 print "	<tr>";
63
-print "	<td><input type='checkbox' name='name' checked title='"._('Mandatory')."'></td>";
63
+print "	<td><input type='checkbox' name='name' checked title='"._ ('Mandatory')."'></td>";
64 64
 print "	<td><input type='checkbox' name='number' checked> </td>";
65 65
 print "	<td><input type='checkbox' name='domain' checked> </td>";
66 66
 print "	<td><input type='checkbox' name='description' checked> </td>";
@@ -73,29 +73,29 @@  discard block
 block discarded – undo
73 73
 # print section form
74 74
 print '<form id="selectExportDomains">';
75 75
 
76
-if(sizeof($vlan_domains) > 0) {
76
+if (sizeof ($vlan_domains) > 0) {
77 77
 	print '<h4>L2 Domains</h4>';
78 78
 	print "	<table class='table table-striped table-condensed'>";
79 79
 	print "	<tr>";
80
-    print "	<th>"._('Name')."</th>";
81
-    print "	<th>"._('Description')."</th>";
82
-    print "	<th>"._('Export')."</th>";
80
+    print "	<th>"._ ('Name')."</th>";
81
+    print "	<th>"._ ('Description')."</th>";
82
+    print "	<th>"._ ('Export')."</th>";
83 83
     print "	</tr>\n";
84 84
 
85
-	foreach($vlan_domains as $domain) {
85
+	foreach ($vlan_domains as $domain) {
86 86
 		$domain = (array) $domain;
87 87
 
88 88
 		print "	<tr>";
89 89
 		print "	<td>".$domain['name']."</th>";
90 90
 		print "	<td>".$domain['description']."</th>";
91
-		print "	<td><input type='checkbox' name='exportDomain__".str_replace(" ", "_",$domain['name'])."' checked> </td>";
91
+		print "	<td><input type='checkbox' name='exportDomain__".str_replace (" ", "_", $domain['name'])."' checked> </td>";
92 92
 		print "	</tr>\n";
93 93
 	}
94 94
 }
95 95
 
96 96
 print '</table>';
97 97
 
98
-print '<div class="checkbox"><label><input type="checkbox" name="exportVLANDomains" checked>'._("Include the L2 domains in a separate sheet.").'</label></div>';
98
+print '<div class="checkbox"><label><input type="checkbox" name="exportVLANDomains" checked>'._ ("Include the L2 domains in a separate sheet.").'</label></div>';
99 99
 
100 100
 print '</form>';
101 101
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 <!-- footer -->
107 107
 <div class="pFooter">
108 108
 	<div class="btn-group">
109
-		<button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button>
110
-		<button class="btn btn-sm btn-success" id="dataExportSubmit" data-type="vlan"><i class="fa fa-upload"></i> <?php print _('Export'); ?></button>
109
+		<button class="btn btn-sm btn-default hidePopups"><?php print _ ('Cancel'); ?></button>
110
+		<button class="btn btn-sm btn-success" id="dataExportSubmit" data-type="vlan"><i class="fa fa-upload"></i> <?php print _ ('Export'); ?></button>
111 111
 	</div>
112 112
 </div>
Please login to merge, or discard this patch.
app/admin/import-export/import-vlan.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@  discard block
 block discarded – undo
4 4
  ************************************************/
5 5
 
6 6
 # include required scripts
7
-require( dirname(__FILE__) . '/../../../functions/functions.php' );
7
+require(dirname (__FILE__).'/../../../functions/functions.php');
8 8
 
9 9
 # initialize user object
10
-$Database 	= new Database_PDO;
10
+$Database = new Database_PDO;
11 11
 $User = new User ($Database);
12 12
 
13 13
 # verify that user is logged in, to guard against direct access of page and possible exploits
14
-$User->check_user_session();
14
+$User->check_user_session ();
15 15
 
16 16
 # load data from uploaded file
17 17
 include 'import-load-data.php';
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 ?>
22 22
 
23 23
 <!-- header -->
24
-<div class="pHeader"><?php print _("VLAN import"); ?></div>
24
+<div class="pHeader"><?php print _ ("VLAN import"); ?></div>
25 25
 
26 26
 <!-- content -->
27 27
 <div class="pContent">
@@ -35,21 +35,21 @@  discard block
 block discarded – undo
35 35
 foreach ($data as &$cdata) {
36 36
 	if (($cdata['action'] == "add") || ($cdata['action'] == "edit")) {
37 37
 		# set update array
38
-		$values = array("vlanId"=>$cdata['vlanId'],
38
+		$values = array ("vlanId"=>$cdata['vlanId'],
39 39
 						"number"=>$cdata['number'],
40 40
 						"name"=>$cdata['name'],
41 41
 						"description"=>$cdata['description'],
42 42
 						"domainId"=>$cdata['domainId']
43 43
 						);
44 44
 		# add custom fields
45
-		if(sizeof($custom_fields) > 0) {
46
-			foreach($custom_fields as $myField) {
47
-				if(isset($cdata[$myField['name']])) { $values[$myField['name']] = $cdata[$myField['name']]; }
45
+		if (sizeof ($custom_fields) > 0) {
46
+			foreach ($custom_fields as $myField) {
47
+				if (isset($cdata[$myField['name']])) { $values[$myField['name']] = $cdata[$myField['name']]; }
48 48
 			}
49 49
 		}
50 50
 
51 51
 		# update
52
-		$cdata['result'] = $Admin->object_modify("vlans", $cdata['action'], "vlanId", $values);
52
+		$cdata['result'] = $Admin->object_modify ("vlans", $cdata['action'], "vlanId", $values);
53 53
 
54 54
 		if ($cdata['result']) {
55 55
 			$trc = $colors[$cdata['action']];
@@ -58,13 +58,13 @@  discard block
 block discarded – undo
58 58
 			$trc = "danger";
59 59
 			$msg = "VLAN ".$cdata['action']." failed.";
60 60
 		}
61
-		$rows.="<tr class='".$trc."'><td><i class='fa ".$icons[$cdata['action']]."' rel='tooltip' data-placement='bottom' title='"._($msg)."'></i></td>
61
+		$rows .= "<tr class='".$trc."'><td><i class='fa ".$icons[$cdata['action']]."' rel='tooltip' data-placement='bottom' title='"._ ($msg)."'></i></td>
62 62
 			<td>".$cdata['name']."</td>
63 63
 			<td>".$cdata['number']."</td>
64 64
 			<td>".$cdata['description']."</td>
65 65
 			<td>".$cdata['domain']."</td>
66 66
 			".$cfieldtds."
67
-			<td>"._($msg)."</td></tr>";
67
+			<td>"._ ($msg)."</td></tr>";
68 68
 	}
69 69
 }
70 70
 
@@ -78,5 +78,5 @@  discard block
 block discarded – undo
78 78
 
79 79
 <!-- footer -->
80 80
 <div class="pFooter">
81
-	<button class="btn btn-sm btn-default hidePopups"><?php print _('Close'); ?></button>
81
+	<button class="btn btn-sm btn-default hidePopups"><?php print _ ('Close'); ?></button>
82 82
 </div>
Please login to merge, or discard this patch.
app/admin/import-export/import-vrf-preview.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -5,15 +5,15 @@  discard block
 block discarded – undo
5 5
  ************************************/
6 6
 
7 7
 # include required scripts
8
-require( dirname(__FILE__) . '/../../../functions/functions.php' );
8
+require(dirname (__FILE__).'/../../../functions/functions.php');
9 9
 
10 10
 # initialize required objects
11
-$Database 	= new Database_PDO;
12
-$Result		= new Result;
13
-$User		= new User ($Database);
11
+$Database = new Database_PDO;
12
+$Result = new Result;
13
+$User = new User ($Database);
14 14
 
15 15
 # verify that user is logged in
16
-$User->check_user_session();
16
+$User->check_user_session ();
17 17
 
18 18
 # load data from uploaded file
19 19
 include 'import-load-data.php';
@@ -23,26 +23,26 @@  discard block
 block discarded – undo
23 23
 ?>
24 24
 
25 25
 <!-- header -->
26
-<div class="pHeader"><?php print _("VRF import data preview"); ?></div>
26
+<div class="pHeader"><?php print _ ("VRF import data preview"); ?></div>
27 27
 
28 28
 <!-- content -->
29 29
 <div class="pContent">
30 30
 <?php
31 31
 
32
-print '<h4>'._("Uploaded data").'</h4><hr>';
33
-print _("The entries marked with ")."<i class='fa ".$icons['add']."'></i>, "._("will be added,
34
-	the ones marked with ")."<i class='fa ".$icons['edit']."'></i>, "._("will be updated
35
-	and the ones marked with ")."<i class='fa ".$icons['skip']."'></i> "._("will be skipped.");
32
+print '<h4>'._ ("Uploaded data").'</h4><hr>';
33
+print _ ("The entries marked with ")."<i class='fa ".$icons['add']."'></i>, "._ ("will be added,
34
+	the ones marked with ")."<i class='fa ".$icons['edit']."'></i>, "._ ("will be updated
35
+	and the ones marked with ")."<i class='fa ".$icons['skip']."'></i> "._ ("will be skipped.");
36 36
 
37
-print "<b>"._("Summary: ")."</b>".($counters['add'] > 0 ? $counters['add'] : "no")._(" new entries.
38
-		").($counters['edit'] > 0 ? $counters['edit'] : "no")._(" updated entries.
39
-		").($counters['error'] > 0 ? $counters['error'] : "no")._(" entries skipped due to errors.
40
-		").($counters['skip'] > 0 ? $counters['skip'] : "no")._(" duplicate entries.
41
-		")._("Scroll down for details.");
37
+print "<b>"._ ("Summary: ")."</b>".($counters['add'] > 0 ? $counters['add'] : "no")._ (" new entries.
38
+		").($counters['edit'] > 0 ? $counters['edit'] : "no")._ (" updated entries.
39
+		").($counters['error'] > 0 ? $counters['error'] : "no")._ (" entries skipped due to errors.
40
+		").($counters['skip'] > 0 ? $counters['skip'] : "no")._ (" duplicate entries.
41
+		")._ ("Scroll down for details.");
42 42
 
43 43
 print "<form id='selectImportFields'>";
44
-print "<input name='expfields' type='hidden' value='".implode('|',$expfields)."' style='display:none;'>";
45
-print "<input name='reqfields' type='hidden' value='".implode('|',$reqfields)."' style='display:none;'>";
44
+print "<input name='expfields' type='hidden' value='".implode ('|', $expfields)."' style='display:none;'>";
45
+print "<input name='reqfields' type='hidden' value='".implode ('|', $reqfields)."' style='display:none;'>";
46 46
 print $hiddenfields;
47 47
 print "<input name='filetype' id='filetype' type='hidden' value='".$filetype."' style='display:none;'>";
48 48
 print "</form>";
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 <!-- footer -->
58 58
 <div class="pFooter">
59 59
 	<div class="btn-group">
60
-		<button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button>
61
-		<button class="btn btn-sm btn-default" id="dataImportSubmit" data-type="vrf" disabled><i class="fa fa-download"></i> <?php print _('Import'); ?></button>
60
+		<button class="btn btn-sm btn-default hidePopups"><?php print _ ('Cancel'); ?></button>
61
+		<button class="btn btn-sm btn-default" id="dataImportSubmit" data-type="vrf" disabled><i class="fa fa-download"></i> <?php print _ ('Import'); ?></button>
62 62
 	</div>
63 63
 </div>
64 64
 
Please login to merge, or discard this patch.
app/admin/import-export/import-button.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 # include required scripts
4
-require_once( dirname(__FILE__) . '/../../../functions/functions.php' );
4
+require_once(dirname (__FILE__).'/../../../functions/functions.php');
5 5
 
6 6
 # initialize user object, if not already set
7
-if (!isset($Database)) { $Database 	= new Database_PDO; }
7
+if (!isset($Database)) { $Database = new Database_PDO; }
8 8
 if (!isset($User)) { $User = new User ($Database); }
9 9
 if (!isset($Tools)) { $Tools = new Tools ($Database); }
10 10
 
11 11
 # verify that user is logged in, to guard against direct access of page and possible exploits
12
-$User->check_user_session();
12
+$User->check_user_session ();
13 13
 
14 14
 ?>
15 15
 
@@ -17,13 +17,13 @@  discard block
 block discarded – undo
17 17
 	<table><tr><td align="left">
18 18
 	<div id="drop">
19 19
 		<input type="file" name="file" id="csvfile" style="display:none;">
20
-		<input type="hidden" name="expfields" value="<?php print implode('|',$expfields); ?>" style="display:none;">
20
+		<input type="hidden" name="expfields" value="<?php print implode ('|', $expfields); ?>" style="display:none;">
21 21
 
22
-		<?php print _('Select file'); ?>: <a class="btn btn-sm btn-default"><i class="fa fa-folder-open"></i> <?php print _("Browse / Drag & Drop"); ?></a>
22
+		<?php print _ ('Select file'); ?>: <a class="btn btn-sm btn-default"><i class="fa fa-folder-open"></i> <?php print _ ("Browse / Drag & Drop"); ?></a>
23 23
 	</div>
24 24
 	</td><td>&nbsp;</td><td align="right">
25 25
 	<!-- Download template -->
26
-	<?php print "<a class=\"csvtemplate btn btn-sm btn-default\" id=\"". $templatetype . "template\">Download template</a>"; ?>
26
+	<?php print "<a class=\"csvtemplate btn btn-sm btn-default\" id=\"".$templatetype."template\">Download template</a>"; ?>
27 27
 	</td></tr></table>
28 28
 	<span class="fname" style="display:none"></span>
29 29
 	<br>
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 			// Append the file name and file size
71 71
 			$('#uploadResult').append(data.files[0].name + ' (<i>' + formatFileSize(data.files[0].size) + '</i>)');
72
-			$('#uploadResult').append(' <span rel="tooltip" data-placement="bottom" title="<?php print _("Cancel upload");?>"> <i class="fa fa-times-circle" ></i></span>');
72
+			$('#uploadResult').append(' <span rel="tooltip" data-placement="bottom" title="<?php print _ ("Cancel upload"); ?>"> <i class="fa fa-times-circle" ></i></span>');
73 73
 
74 74
 			// Listen for clicks on the cancel icon
75 75
 			$('#uploadResult').find('span').click(function(){
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
 
105 105
 					$('#topmsg').empty();
106 106
 					$('#bottommsg').empty();
107
-					$('#topmsg').append('<?php print "<h4>"._("Match fields")."</h4><hr>"._("Please match the DB fields with the uploaded fields:"); ?>');
107
+					$('#topmsg').append('<?php print "<h4>"._ ("Match fields")."</h4><hr>"._ ("Please match the DB fields with the uploaded fields:"); ?>');
108 108
 				    $("#fieldstable > tbody").append('<tr id="fieldsrow"></tr>');
109 109
 
110 110
 					resp.expfields.forEach(function(expfield) {
111 111
 						//console.log(resp.fields);
112 112
 						var td= $('<td></td>').appendTo("#fieldstable > tbody #fieldsrow");
113
-						var s = $('<select name="importFields__' + expfield.replace(/\s/g,"_") + '" class="form-control input-sm input-w-auto" rel="tooltip" data-placement="bottom" title="<?php print _("Pick import colum for"); ?> ' + expfield + ' <?php print _("field"); ?>"/>');
113
+						var s = $('<select name="importFields__' + expfield.replace(/\s/g,"_") + '" class="form-control input-sm input-w-auto" rel="tooltip" data-placement="bottom" title="<?php print _ ("Pick import colum for"); ?> ' + expfield + ' <?php print _ ("field"); ?>"/>');
114 114
 						$('<option />', {value: "-", text: "-"}).appendTo(s);
115 115
 						resp.impfields.forEach(function(impfield) {
116 116
 							if (expfield.toUpperCase() === impfield.toUpperCase()) {
@@ -124,17 +124,17 @@  discard block
 block discarded – undo
124 124
 				    });
125 125
 					if (matches == 0) {
126 126
 						$('#bottommsg').addClass('alert alert-danger');
127
-						$('#bottommsg').append('<i class="fa fa-exclamation-triangle"></i> <?php print _("No fields were automatically matched. The import file needs to have a header row!"); ?><br>');
127
+						$('#bottommsg').append('<i class="fa fa-exclamation-triangle"></i> <?php print _ ("No fields were automatically matched. The import file needs to have a header row!"); ?><br>');
128 128
 					}
129 129
 					if ((matches > 0) && (matches != resp.expfields.length)) {
130 130
 						// console.log(matches + " mismatches vs " + resp.expfields.length);
131 131
 						$('#bottommsg').addClass('alert alert-warning');
132
-						$('#bottommsg').append('<i class="fa fa-exclamation-triangle"></i> <?php print _("Not all the fields were automatically matched. Please check manually."); ?><br>');
132
+						$('#bottommsg').append('<i class="fa fa-exclamation-triangle"></i> <?php print _ ("Not all the fields were automatically matched. Please check manually."); ?><br>');
133 133
 					}
134 134
 					if (matches == resp.expfields.length) {
135 135
 						// console.log(matches + " matches vs " + resp.expfields.length);
136 136
 						$('#bottommsg').addClass('alert alert-success');
137
-						$('#bottommsg').append('<i class="fa fa-info-circle"></i> <?php print _("All the fields were automatically matched. Please check if correct."); ?><br>');
137
+						$('#bottommsg').append('<i class="fa fa-info-circle"></i> <?php print _ ("All the fields were automatically matched. Please check if correct."); ?><br>');
138 138
 					}
139 139
 					// enable preview button
140 140
 				    $('#dataImportPreview').removeAttr('disabled');
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 					$('#filetype').val(resp.filetype);
145 145
 
146 146
 				} else {
147
-					$('#topmsg').append('<?php print _("No header row found in uploaded file. Please check."); ?><br>');
147
+					$('#topmsg').append('<?php print _ ("No header row found in uploaded file. Please check."); ?><br>');
148 148
 				}
149 149
 
150 150
 			}
Please login to merge, or discard this patch.
app/admin/import-export/not-implemented.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,28 +5,28 @@
 block discarded – undo
5 5
  */
6 6
 
7 7
 # include required scripts
8
-require( dirname(__FILE__) . '/../../../functions/functions.php' );
8
+require(dirname (__FILE__).'/../../../functions/functions.php');
9 9
 
10 10
 # initialize user object
11
-$Database 	= new Database_PDO;
12
-$User 		= new User ($Database);
11
+$Database = new Database_PDO;
12
+$User = new User ($Database);
13 13
 
14 14
 # verify that user is logged in
15
-$User->check_user_session();
15
+$User->check_user_session ();
16 16
 
17 17
 ?>
18 18
 
19 19
 <!-- header -->
20
-<div class="pHeader"><?php print _("Not implemented"); ?></div>
20
+<div class="pHeader"><?php print _ ("Not implemented"); ?></div>
21 21
 
22 22
 <!-- content -->
23 23
 <div class="pContent">
24 24
 
25
-<i class="fa fa-exclamation-triangle"></i> <?php print _("Not implemented"); ?>
25
+<i class="fa fa-exclamation-triangle"></i> <?php print _ ("Not implemented"); ?>
26 26
 
27 27
 </div>
28 28
 <br>
29 29
 <!-- footer -->
30 30
 <div class="pFooter">
31
-	<button class="btn btn-sm btn-default hidePopups"><?php print _('Ok'); ?></button>
31
+	<button class="btn btn-sm btn-default hidePopups"><?php print _ ('Ok'); ?></button>
32 32
 </div>
Please login to merge, or discard this patch.
app/admin/import-export/import-l2dom-preview.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -5,15 +5,15 @@  discard block
 block discarded – undo
5 5
  ************************************/
6 6
 
7 7
 # include required scripts
8
-require( dirname(__FILE__) . '/../../../functions/functions.php' );
8
+require(dirname (__FILE__).'/../../../functions/functions.php');
9 9
 
10 10
 # initialize required objects
11
-$Database	= new Database_PDO;
12
-$Result		= new Result;
13
-$User		= new User ($Database);
11
+$Database = new Database_PDO;
12
+$Result = new Result;
13
+$User = new User ($Database);
14 14
 
15 15
 # verify that user is logged in
16
-$User->check_user_session();
16
+$User->check_user_session ();
17 17
 
18 18
 # load data from uploaded file
19 19
 include 'import-load-data.php';
@@ -23,26 +23,26 @@  discard block
 block discarded – undo
23 23
 ?>
24 24
 
25 25
 <!-- header -->
26
-<div class="pHeader"><?php print _("L2 Domain import data preview"); ?></div>
26
+<div class="pHeader"><?php print _ ("L2 Domain import data preview"); ?></div>
27 27
 
28 28
 <!-- content -->
29 29
 <div class="pContent">
30 30
 <?php
31 31
 
32
-print '<h4>'._("Uploaded data").'</h4><hr>';
33
-print _("The entries marked with ")."<i class='fa ".$icons['add']."'></i>, "._("will be added,
34
-	the ones marked with ")."<i class='fa ".$icons['edit']."'></i>, "._("will be updated
35
-	and the ones marked with ")."<i class='fa ".$icons['skip']."'></i> "._("will be skipped.");
32
+print '<h4>'._ ("Uploaded data").'</h4><hr>';
33
+print _ ("The entries marked with ")."<i class='fa ".$icons['add']."'></i>, "._ ("will be added,
34
+	the ones marked with ")."<i class='fa ".$icons['edit']."'></i>, "._ ("will be updated
35
+	and the ones marked with ")."<i class='fa ".$icons['skip']."'></i> "._ ("will be skipped.");
36 36
 
37
-print "<b>"._("Summary: ")."</b>".($counters['add'] > 0 ? $counters['add'] : "no")._(" new entries.
38
-		").($counters['edit'] > 0 ? $counters['edit'] : "no")._(" updated entries.
39
-		").($counters['error'] > 0 ? $counters['error'] : "no")._(" entries skipped due to errors.
40
-		").($counters['skip'] > 0 ? $counters['skip'] : "no")._(" duplicate entries.
41
-		")._("Scroll down for details.");
37
+print "<b>"._ ("Summary: ")."</b>".($counters['add'] > 0 ? $counters['add'] : "no")._ (" new entries.
38
+		").($counters['edit'] > 0 ? $counters['edit'] : "no")._ (" updated entries.
39
+		").($counters['error'] > 0 ? $counters['error'] : "no")._ (" entries skipped due to errors.
40
+		").($counters['skip'] > 0 ? $counters['skip'] : "no")._ (" duplicate entries.
41
+		")._ ("Scroll down for details.");
42 42
 
43 43
 print "<form id='selectImportFields'>";
44
-print "<input name='expfields' type='hidden' value='".implode('|',$expfields)."' style='display:none;'>";
45
-print "<input name='reqfields' type='hidden' value='".implode('|',$reqfields)."' style='display:none;'>";
44
+print "<input name='expfields' type='hidden' value='".implode ('|', $expfields)."' style='display:none;'>";
45
+print "<input name='reqfields' type='hidden' value='".implode ('|', $reqfields)."' style='display:none;'>";
46 46
 print $hiddenfields;
47 47
 print "<input name='filetype' id='filetype' type='hidden' value='".$filetype."' style='display:none;'>";
48 48
 print "</form>";
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 <!-- footer -->
58 58
 <div class="pFooter">
59 59
 	<div class="btn-group">
60
-		<button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button>
61
-		<button class="btn btn-sm btn-default" id="dataImportSubmit" data-type="l2dom" disabled><i class="fa fa-download"></i> <?php print _('Import'); ?></button>
60
+		<button class="btn btn-sm btn-default hidePopups"><?php print _ ('Cancel'); ?></button>
61
+		<button class="btn btn-sm btn-default" id="dataImportSubmit" data-type="l2dom" disabled><i class="fa fa-download"></i> <?php print _ ('Import'); ?></button>
62 62
 	</div>
63 63
 </div>
64 64
 
Please login to merge, or discard this patch.
app/admin/import-export/export-vrf-field-select.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -5,19 +5,19 @@  discard block
 block discarded – undo
5 5
  */
6 6
 
7 7
 # include required scripts
8
-require( dirname(__FILE__) . '/../../../functions/functions.php' );
8
+require(dirname (__FILE__).'/../../../functions/functions.php');
9 9
 
10 10
 # initialize user object
11
-$Database 	= new Database_PDO;
12
-$User 		= new User ($Database);
11
+$Database = new Database_PDO;
12
+$User = new User ($Database);
13 13
 
14 14
 # verify that user is logged in
15
-$User->check_user_session();
15
+$User->check_user_session ();
16 16
 
17 17
 ?>
18 18
 
19 19
 <!-- header -->
20
-<div class="pHeader"><?php print _("Select VRF fields to export"); ?></div>
20
+<div class="pHeader"><?php print _ ("Select VRF fields to export"); ?></div>
21 21
 
22 22
 <!-- content -->
23 23
 <div class="pContent">
@@ -31,13 +31,13 @@  discard block
 block discarded – undo
31 31
 print "	<table class='table table-striped table-condensed'>";
32 32
 
33 33
 print "	<tr>";
34
-print "	<th>"._('Name')."</th>";
35
-print "	<th>"._('RD')."</th>";
36
-print "	<th>"._('Description')."</th>";
34
+print "	<th>"._ ('Name')."</th>";
35
+print "	<th>"._ ('RD')."</th>";
36
+print "	<th>"._ ('Description')."</th>";
37 37
 print "	</tr>";
38 38
 
39 39
 print "	<tr>";
40
-print "	<td><input type='checkbox' name='name' checked title='"._('Mandatory')."'></td>";
40
+print "	<td><input type='checkbox' name='name' checked title='"._ ('Mandatory')."'></td>";
41 41
 print "	<td><input type='checkbox' name='rd' checked> </td>";
42 42
 print "	<td><input type='checkbox' name='description' checked> </td>";
43 43
 print "	</tr>";
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 <!-- footer -->
53 53
 <div class="pFooter">
54 54
 	<div class="btn-group">
55
-		<button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button>
56
-		<button class="btn btn-sm btn-success" id="dataExportSubmit" data-type="vrf"><i class="fa fa-upload"></i> <?php print _('Export'); ?></button>
55
+		<button class="btn btn-sm btn-default hidePopups"><?php print _ ('Cancel'); ?></button>
56
+		<button class="btn btn-sm btn-success" id="dataExportSubmit" data-type="vrf"><i class="fa fa-upload"></i> <?php print _ ('Export'); ?></button>
57 57
 	</div>
58 58
 </div>
Please login to merge, or discard this patch.
app/admin/import-export/import-recompute-select.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -5,37 +5,37 @@  discard block
 block discarded – undo
5 5
  */
6 6
 
7 7
 # include required scripts
8
-require( dirname(__FILE__) . '/../../../functions/functions.php' );
8
+require(dirname (__FILE__).'/../../../functions/functions.php');
9 9
 
10 10
 # initialize user object
11 11
 $Database 	= new Database_PDO;
12
-$User 		= new User ($Database);
13
-$Admin 		= new Admin ($Database);
12
+$User = new User ($Database);
13
+$Admin = new Admin ($Database);
14 14
 $Tools	    = new Tools ($Database);
15
-$Sections	= new Sections ($Database);
15
+$Sections = new Sections ($Database);
16 16
 
17 17
 # verify that user is logged in
18
-$User->check_user_session();
18
+$User->check_user_session ();
19 19
 
20 20
 $mtable = "subnets"; # main table where to check the fields
21 21
 # predefine field list
22
-$expfields = array ("section","subnet","mask","description","vrf");
22
+$expfields = array ("section", "subnet", "mask", "description", "vrf");
23 23
 # required fields without which we will not continue, vrf is optional - if not set we check against default VRF
24
-$reqfields = array("section","subnet");
24
+$reqfields = array ("section", "subnet");
25 25
 # we don't care about custom fields here
26
-$custom_fields = array();
26
+$custom_fields = array ();
27 27
 # fetch all sections
28
-$all_sections = $Sections->fetch_all_sections();
28
+$all_sections = $Sections->fetch_all_sections ();
29 29
 
30 30
 # Lets do some reordering to show slaves!
31
-foreach($all_sections as $s) {
32
-	if($s->masterSection=="0") {
31
+foreach ($all_sections as $s) {
32
+	if ($s->masterSection == "0") {
33 33
 		# it is master
34 34
 		$s->class = "master";
35 35
 		$sectionssorted[] = $s;
36 36
 		# check for slaves
37
-		foreach($all_sections as $ss) {
38
-			if($ss->masterSection==$s->id) {
37
+		foreach ($all_sections as $ss) {
38
+			if ($ss->masterSection == $s->id) {
39 39
 				$ss->class = "slave";
40 40
 				$sectionssorted[] = $ss;
41 41
 			}
@@ -47,25 +47,25 @@  discard block
 block discarded – undo
47 47
 $sections_sorted = @$sectionssorted;
48 48
 
49 49
 # show sections
50
-if(sizeof($all_sections) > 0) {
50
+if (sizeof ($all_sections) > 0) {
51 51
 	$section_rows = ""; $last_master = 0;
52 52
 	# existing sections
53 53
 	foreach ($sections_sorted as $section) {
54 54
 		//cast
55 55
 		$section = (array) $section;
56 56
 		//master Section
57
-		if (($section['masterSection']!=0) && ($section['masterSection']==$last_master)) {
57
+		if (($section['masterSection'] != 0) && ($section['masterSection'] == $last_master)) {
58 58
 			$sect_prefix = " - ";
59 59
 		} else {
60 60
 			$sect_prefix = "";
61 61
 			$last_master = $section['id'];
62 62
 		}
63
-		$section_rows.= "<tr>";
64
-		$section_rows.= "<td><div class='checkbox'><label><input type='checkbox' id='recomputeSectionCheck' name='recomputeSection_".$section['id']."' checked>".$sect_prefix.str_replace('_', ' ', $section['name'])."</label></div></td>";
65
-		$section_rows.= "<td><div class='checkbox'><label><input type='checkbox' id='recomputeIPv4Check' name='recomputeSectionIPv4_".$section['id']."' checked></label></div></td>";
66
-		$section_rows.= "<td><div class='checkbox'><label><input type='checkbox' id='recomputeIPv6Check' name='recomputeSectionIPv6_".$section['id']."' checked></label></div></td>";
67
-		$section_rows.= "<td><div class='checkbox'><label><input type='checkbox' id='recomputeCVRFCheck' name='recomputeSectionCVRF_".$section['id']."' checked></label></div></td>";
68
-		$section_rows.="</tr>\n";
63
+		$section_rows .= "<tr>";
64
+		$section_rows .= "<td><div class='checkbox'><label><input type='checkbox' id='recomputeSectionCheck' name='recomputeSection_".$section['id']."' checked>".$sect_prefix.str_replace ('_', ' ', $section['name'])."</label></div></td>";
65
+		$section_rows .= "<td><div class='checkbox'><label><input type='checkbox' id='recomputeIPv4Check' name='recomputeSectionIPv4_".$section['id']."' checked></label></div></td>";
66
+		$section_rows .= "<td><div class='checkbox'><label><input type='checkbox' id='recomputeIPv6Check' name='recomputeSectionIPv6_".$section['id']."' checked></label></div></td>";
67
+		$section_rows .= "<td><div class='checkbox'><label><input type='checkbox' id='recomputeCVRFCheck' name='recomputeSectionCVRF_".$section['id']."' checked></label></div></td>";
68
+		$section_rows .= "</tr>\n";
69 69
 	}
70 70
 } else {
71 71
 	$section_rows = "<td colspan='3'>No sections found!</td>";
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 ?>
75 75
 
76 76
 <!-- header -->
77
-<div class="pHeader"><?php print _("Select Subnet sections, VRFs and IP version to recompute"); ?></div>
77
+<div class="pHeader"><?php print _ ("Select Subnet sections, VRFs and IP version to recompute"); ?></div>
78 78
 
79 79
 <!-- content -->
80 80
 <div class="pContent">
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
 <?php
83 83
 
84 84
 print "<form id='selectImportFields'><div id='topmsg'>";
85
-print '<h4>'._("Sections and IP versions").'</h4><hr>';
86
-print _("Please choose which section and IP version to recompute:");
85
+print '<h4>'._ ("Sections and IP versions").'</h4><hr>';
86
+print _ ("Please choose which section and IP version to recompute:");
87 87
 print "</div>";
88
-print "<input name='expfields' type='hidden' value='".implode('|',$expfields)."' style='display:none;'>";
89
-print "<input name='reqfields' type='hidden' value='".implode('|',$reqfields)."' style='display:none;'>";
88
+print "<input name='expfields' type='hidden' value='".implode ('|', $expfields)."' style='display:none;'>";
89
+print "<input name='reqfields' type='hidden' value='".implode ('|', $reqfields)."' style='display:none;'>";
90 90
 print "<table class='table table-striped table-condensed' id='fieldstable'><tbody>";
91
-print "<tr>	<th><input type='checkbox' id='recomputeSectionSelectAll' checked> "._("Section")."</th>
91
+print "<tr>	<th><input type='checkbox' id='recomputeSectionSelectAll' checked> "._ ("Section")."</th>
92 92
 			<th><input type='checkbox' id='recomputeIPv4SelectAll' checked> IPv4</th>
93 93
 			<th><input type='checkbox' id='recomputeIPv6SelectAll' checked> IPv6</th>
94 94
 			<th><input type='checkbox' id='recomputeCVRFSelectAll' checked> Cross VRF</th></tr>";
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 <!-- footer -->
102 102
 <div class="pFooter">
103 103
 	<div class="btn-group">
104
-		<button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button>
105
-		<button class="btn btn-sm btn-default btn-success" id="dataImportPreview" data-type="recompute"><i class="fa fa-eye"></i> <?php print _('Preview'); ?></button>
104
+		<button class="btn btn-sm btn-default hidePopups"><?php print _ ('Cancel'); ?></button>
105
+		<button class="btn btn-sm btn-default btn-success" id="dataImportPreview" data-type="recompute"><i class="fa fa-eye"></i> <?php print _ ('Preview'); ?></button>
106 106
 	</div>
107 107
 </div>
Please login to merge, or discard this patch.
app/admin/import-export/export-subnets-field-select.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -5,33 +5,33 @@  discard block
 block discarded – undo
5 5
  */
6 6
 
7 7
 # include required scripts
8
-require( dirname(__FILE__) . '/../../../functions/functions.php' );
8
+require(dirname (__FILE__).'/../../../functions/functions.php');
9 9
 
10 10
 # initialize user object
11 11
 $Database 	= new Database_PDO;
12
-$User 		= new User ($Database);
13
-$Admin 		= new Admin ($Database);
12
+$User = new User ($Database);
13
+$Admin = new Admin ($Database);
14 14
 $Tools	    = new Tools ($Database);
15
-$Sections	= new Sections ($Database);
15
+$Sections = new Sections ($Database);
16 16
 
17 17
 # verify that user is logged in
18
-$User->check_user_session();
18
+$User->check_user_session ();
19 19
 
20 20
 # Won't check per subnet/section rights since this is an admin section, where the admin user has full access
21 21
 
22 22
 # fetch all sections
23
-$all_sections = $Sections->fetch_all_sections();
23
+$all_sections = $Sections->fetch_all_sections ();
24 24
 
25 25
 # Lets do some reordering to show slaves!
26
-if($all_sections!==false) {
27
-	foreach($all_sections as $s) {
28
-		if($s->masterSection=="0") {
26
+if ($all_sections !== false) {
27
+	foreach ($all_sections as $s) {
28
+		if ($s->masterSection == "0") {
29 29
 			# it is master
30 30
 			$s->class = "master";
31 31
 			$sectionssorted[] = $s;
32 32
 			# check for slaves
33
-			foreach($all_sections as $ss) {
34
-				if($ss->masterSection==$s->id) {
33
+			foreach ($all_sections as $ss) {
34
+				if ($ss->masterSection == $s->id) {
35 35
 					$ss->class = "slave";
36 36
 					$sectionssorted[] = $ss;
37 37
 				}
@@ -43,24 +43,24 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 # get all custom fields
46
-$custom_fields = $Tools->fetch_custom_fields('subnets');
46
+$custom_fields = $Tools->fetch_custom_fields ('subnets');
47 47
 # prepare HTML variables
48 48
 $custom_fields_names = "";
49 49
 $custom_fields_boxes = "";
50 50
 
51
-if(sizeof($custom_fields) > 0) {
52
-	foreach($custom_fields as $myField) {
51
+if (sizeof ($custom_fields) > 0) {
52
+	foreach ($custom_fields as $myField) {
53 53
 		//change spaces to "___" so it can be used as element id
54
-		$myField['nameTemp'] = str_replace(" ", "___", $myField['name']);
55
-		$custom_fields_names.= "	<th>$myField[name]</th>";
56
-		$custom_fields_boxes.= "	<td><input type='checkbox' name='$myField[nameTemp]' checked> </td>";
54
+		$myField['nameTemp'] = str_replace (" ", "___", $myField['name']);
55
+		$custom_fields_names .= "	<th>$myField[name]</th>";
56
+		$custom_fields_boxes .= "	<td><input type='checkbox' name='$myField[nameTemp]' checked> </td>";
57 57
 	}
58 58
 }
59 59
 
60 60
 ?>
61 61
 
62 62
 <!-- header -->
63
-<div class="pHeader"><?php print _("Select sections and subnets fields to export"); ?></div>
63
+<div class="pHeader"><?php print _ ("Select sections and subnets fields to export"); ?></div>
64 64
 
65 65
 <!-- content -->
66 66
 <div class="pContent">
@@ -74,21 +74,21 @@  discard block
 block discarded – undo
74 74
 print "	<table class='table table-striped table-condensed'>";
75 75
 
76 76
 print "	<tr>";
77
-print "	<th>"._('Section')."</th>";
78
-print "	<th>"._('Subnet')."</th>";
79
-print "	<th>"._('Description')."</th>";
80
-print "	<th>"._('VLAN')."</th>";
81
-print "	<th>"._('VRF')."</th>";
82
-print "	<th>"._('Master Subnet')."</th>";
83
-print "	<th>"._('Requests')."</th>";
84
-print "	<th>"._('Hosts check')."</th>";
85
-print "	<th>"._('Discover')."</th>";
77
+print "	<th>"._ ('Section')."</th>";
78
+print "	<th>"._ ('Subnet')."</th>";
79
+print "	<th>"._ ('Description')."</th>";
80
+print "	<th>"._ ('VLAN')."</th>";
81
+print "	<th>"._ ('VRF')."</th>";
82
+print "	<th>"._ ('Master Subnet')."</th>";
83
+print "	<th>"._ ('Requests')."</th>";
84
+print "	<th>"._ ('Hosts check')."</th>";
85
+print "	<th>"._ ('Discover')."</th>";
86 86
 print $custom_fields_names;
87 87
 print "	</tr>";
88 88
 
89 89
 print "	<tr>";
90 90
 print "	<td><input type='checkbox' name='section' checked></td>";
91
-print "	<td><input type='checkbox' name='subnet' checked title='"._('Mandatory')."'> </td>";
91
+print "	<td><input type='checkbox' name='subnet' checked title='"._ ('Mandatory')."'> </td>";
92 92
 print "	<td><input type='checkbox' name='description' checked> </td>";
93 93
 print "	<td><input type='checkbox' name='VLAN' checked> </td>";
94 94
 print "	<td><input type='checkbox' name='VRF' checked> </td>";
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
 print '<form id="selectExportSections">';
107 107
 
108 108
 # show sections
109
-if($all_sections!==false) {
109
+if ($all_sections !== false) {
110 110
 	print '<h4>Sections</h4>';
111 111
 	print "	<table class='table table-striped table-condensed'>";
112 112
 	print "	<tr>";
113
-    print '	<th><input type="checkbox" id="exportSelectAll" checked> '._('Name').'</th>';
114
-    print "	<th>"._('Description')."</th>";
115
-    print "	<th>"._('Parent')."</th>";
113
+    print '	<th><input type="checkbox" id="exportSelectAll" checked> '._ ('Name').'</th>';
114
+    print "	<th>"._ ('Description')."</th>";
115
+    print "	<th>"._ ('Parent')."</th>";
116 116
     print "	</tr>\n";
117 117
 
118 118
 	# existing sections
@@ -121,22 +121,22 @@  discard block
 block discarded – undo
121 121
 		$section = (array) $section;
122 122
 
123 123
 		print '<tr>';
124
-		print '	<td><div class="checkbox"><label><input type="checkbox" id="exportCheck" name="exportSection__'.str_replace(" ", "_", $section['name']).'" checked>'.str_replace("_", " ", $section['name']).'</label></div></td>';
125
-		print '	<td>'. $section['description'] .'</td>'. "\n";
124
+		print '	<td><div class="checkbox"><label><input type="checkbox" id="exportCheck" name="exportSection__'.str_replace (" ", "_", $section['name']).'" checked>'.str_replace ("_", " ", $section['name']).'</label></div></td>';
125
+		print '	<td>'.$section['description'].'</td>'."\n";
126 126
 		//master Section
127
-		if($section['masterSection']!=0) {
127
+		if ($section['masterSection'] != 0) {
128 128
 			# get section details
129
-			$ssec = $Admin->fetch_object("sections", "id", $section['masterSection']);
129
+			$ssec = $Admin->fetch_object ("sections", "id", $section['masterSection']);
130 130
 			print "	<td>$ssec->name</td>";
131 131
 		} else {
132 132
 			print "	<td>/</td>";
133 133
 		}
134
-		print '</tr>'. "\n";
134
+		print '</tr>'."\n";
135 135
 	}
136 136
 
137 137
 	print '</table>';
138 138
 
139
-	print '<div class="checkbox"><label><input type="checkbox" name="exportSections" checked>'._("Include the sections in a separate sheet.").'</label></div>';
139
+	print '<div class="checkbox"><label><input type="checkbox" name="exportSections" checked>'._ ("Include the sections in a separate sheet.").'</label></div>';
140 140
 
141 141
 }
142 142
 print '</form>';
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 <!-- footer -->
148 148
 <div class="pFooter">
149 149
 	<div class="btn-group">
150
-		<button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button>
151
-		<button class="btn btn-sm btn-success" id="dataExportSubmit" data-type="subnets"><i class="fa fa-upload"></i> <?php print _('Export'); ?></button>
150
+		<button class="btn btn-sm btn-default hidePopups"><?php print _ ('Cancel'); ?></button>
151
+		<button class="btn btn-sm btn-success" id="dataExportSubmit" data-type="subnets"><i class="fa fa-upload"></i> <?php print _ ('Export'); ?></button>
152 152
 	</div>
153 153
 </div>
Please login to merge, or discard this patch.