From a1cee14ba61e22e373028af187bb14271fb9274f Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 7 Feb 2014 12:26:20 +0000 Subject: [PATCH] Set the keys to numerical order. Add more keys to the key select list. --- app/devices/app_config.php | 2 +- app/devices/device_edit.php | 20 ++++++-------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/app/devices/app_config.php b/app/devices/app_config.php index 142be962ae..bd7c1d0e57 100644 --- a/app/devices/app_config.php +++ b/app/devices/app_config.php @@ -350,7 +350,7 @@ $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'device_uuid'; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'device_key_id'; - $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select the key ID.'; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'device_key_category'; diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index d356c57f58..1aa6de10fa 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -287,7 +287,7 @@ require_once "resources/require.php"; $sql .= "WHEN 'programmable' THEN 3 "; $sql .= "WHEN 'expansion' THEN 4 "; $sql .= "ELSE 100 END, "; - $sql .= "device_key_id asc "; + $sql .= "cast(device_key_id as numeric) asc "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $device_keys = $prep_statement->fetchAll(PDO::FETCH_NAMED); @@ -607,19 +607,11 @@ require_once "resources/require.php"; $selected = "selected='selected'"; echo " \n"; echo "\n";