Skip to content

Commit 5990627

Browse files
committed
fixed import/export problem phpipam#345
1 parent fad6563 commit 5990627

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

app/subnets/import-subnet/import-file.php

+8-7
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@
6464

6565
$outFile[$m] = $data->val($m,'A').','.$data->val($m,'B').','.$data->val($m,'C').','.$data->val($m,'D').',';
6666
$outFile[$m] .= $data->val($m,'E').','.$data->val($m,'F').','.$data->val($m,'G').','.$data->val($m,'H').',';
67-
$outFile[$m] .= $data->val($m,'I');
67+
$outFile[$m] .= $data->val($m,'I').','.$data->val($m,'J');
6868
//add custom fields
6969
if(sizeof($custom_address_fields) > 0) {
70-
$currLett = "J";
70+
$currLett = "K";
7171
foreach($custom_address_fields as $field) {
7272
$outFile[$m] .= ",".$data->val($m,$currLett++);
7373
}
@@ -121,11 +121,12 @@
121121
"state"=>$Addresses->address_type_type_to_index($lineArr[1]),
122122
"description"=>$lineArr[2],
123123
"dns_name"=>$lineArr[3],
124-
"mac"=>$lineArr[4],
125-
"owner"=>$lineArr[5],
126-
"switch"=>$lineArr[6],
127-
"port"=>$lineArr[7],
128-
"note"=>$lineArr[8]
124+
"firewallAddressObject"=>$lineArr[4],
125+
"mac"=>$lineArr[5],
126+
"owner"=>$lineArr[6],
127+
"switch"=>$lineArr[7],
128+
"port"=>$lineArr[8],
129+
"note"=>$lineArr[9]
129130
);
130131
// add id
131132
if ($action=="edit") { $address_insert["id"] = $id; }

app/subnets/import-subnet/import-template.php

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
$worksheet->write($lineCount, 1, _('ip state'));
3737
$worksheet->write($lineCount, 2, _('description'));
3838
$worksheet->write($lineCount, 3, _('hostname'));
39+
$worksheet->write($lineCount, 3, _('fw_object'));
3940
$worksheet->write($lineCount, 4, _('mac'));
4041
$worksheet->write($lineCount, 5, _('owner'));
4142
$worksheet->write($lineCount, 6, _('device'));

app/subnets/import-subnet/print-file.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252

5353
$outFile[$m] = $data->val($m,'A').','.$data->val($m,'B').','.$data->val($m,'C').','.$data->val($m,'D').',';
5454
$outFile[$m] .= $data->val($m,'E').','.$data->val($m,'F').','.$data->val($m,'G').','.$data->val($m,'H').',';
55-
$outFile[$m] .= $data->val($m,'I');
55+
$outFile[$m] .= $data->val($m,'I').','.$data->val($m,'J');
5656
//add custom fields
5757
if(sizeof($custom_address_fields) > 0) {
58-
$currLett = "J";
58+
$currLett = "K";
5959
foreach($custom_address_fields as $field) {
6060
$outFile[$m] .= ",".$data->val($m,$currLett++);
6161
}
@@ -80,6 +80,7 @@
8080
print ' <th>'._('Status').'</th>';
8181
print ' <th>'._('Description').'</th>';
8282
print ' <th>'._('Hostname').'</th>';
83+
print ' <th>'._('FW object').'</th>';
8384
print ' <th>'._('MAC').'</th>';
8485
print ' <th>'._('Owner').'</th>';
8586
print ' <th>'._('Switch').'</th>';

0 commit comments

Comments
 (0)