Merge pull request #24 from zeha/remove-priority

Remove priority field. PLEASE NOTE THAT THIS BREAKS COMPATIBILITY WITH VERSION < 3.4.2
This commit is contained in:
Tuxis Internet Engineering V.O.F. 2015-02-18 11:34:02 +01:00
commit 6f3c5f8a20
4 changed files with 3 additions and 32 deletions

View file

@ -155,8 +155,7 @@ tr.jtable-data-row td {
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word;
}
tr.jtable-data-row td.ttl, tr.jtable-data-row td.priority,
.jtable-input input.ttl, .jtable-input input.priority {
tr.jtable-data-row td.ttl, .jtable-input input.ttl {
text-align: right;
}
tr.jtable-data-row td.content {

View file

@ -39,8 +39,7 @@ $templates[] = array(
array(
'name' => '',
'type' => 'MX',
'content' => 'mx2.tuxis.nl',
'priority' => '200')
'content' => '200 mx2.tuxis.nl')
)
);
*/
@ -51,4 +50,3 @@ $defaults['defaulttype'] = 'Master'; # Choose between 'Native
$defaults['primaryns'] = 'unconfigured.primaryns'; # The value of the first NS-record
$defaults['secondaryns'] = 'unconfigured.secondaryns'; # The value of the second NS-record
$defaults['ttl'] = 3600; # Default TTL for records
$defaults['priority'] = 0; # Default for priority in records

View file

@ -189,13 +189,7 @@ function displayExportIcon(zone) {
function displayContent(fieldName) {
return function(data) {
var value = data.record[fieldName];
switch (fieldName) {
case 'priority':
value = (value === 0) ? '' : value;
break;
}
return $('<span>').text(value);
return $('<span>').text(data.record[fieldName]);
}
}
@ -320,12 +314,6 @@ $(document).ready(function () {
display: displayContent('type'),
listClass: 'type'
},
priority: {
title: 'Prio',
width: '1%',
display: displayContent('priority'),
listClass: 'priority'
},
content: {
title: 'Content',
width: '30%',
@ -554,15 +542,6 @@ $(document).ready(function () {
inputClass: 'type',
listClass: 'type'
},
priority: {
title: 'Prio',
width: '1%',
create: true,
display: displayContent('priority'),
defaultValue: '<?php echo $defaults['priority']; ?>',
inputClass: 'priority',
listClass: 'priority'
},
content: {
title: 'Content',
width: '30%',

View file

@ -143,7 +143,6 @@ function make_record($zone, $input) {
}
$ttl = (int) ((isset($input['ttl']) && $input['ttl']) ? $input['ttl'] : $defaults['ttl']);
$priority = (int) ((isset($input['priority']) && $input['priority']) ? $input['priority'] : $defaults['priority']);
$type = isset($input['type']) ? $input['type'] : '';
$disabled = (bool) (isset($input['disabled']) && $input['disabled']);
@ -172,7 +171,6 @@ function make_record($zone, $input) {
'type' => $type,
'name' => $name,
'ttl' => $ttl,
'priority' => $priority,
'content' => $content);
}
@ -242,7 +240,6 @@ function decode_record_id($id) {
|| !isset($record['name'])
|| !isset($record['type'])
|| !isset($record['ttl'])
|| !isset($record['priority'])
|| !isset($record['content'])
|| !isset($record['disabled'])) {
jtable_respond(null, 'error', "Invalid record id");
@ -267,7 +264,6 @@ function get_records_except($zone, $exclude) {
$found = true;
} elseif ($record['content'] != $exclude['content']
or $record['ttl'] != $exclude['ttl']
or $record['priority'] != $exclude['priority']
or $record['disabled'] != $exclude['disabled']) {
array_push($records, $record);
} else {
@ -320,7 +316,6 @@ function rrtype_compare($a, $b) {
function record_compare($a, $b) {
if ($cmp = compareName($a['name'], $b['name'])) return $cmp;
if ($cmp = rrtype_compare($a['type'], $b['type'])) return $cmp;
if ($cmp = ($a['priority'] - $b['priority'])) return $cmp;
if ($cmp = strnatcasecmp($a['content'], $b['content'])) return $cmp;
return 0;
}