diff --git a/app/Model/AppModel.php b/app/Model/AppModel.php index ca15de680..2dd91c9d4 100644 --- a/app/Model/AppModel.php +++ b/app/Model/AppModel.php @@ -69,7 +69,8 @@ class AppModel extends Model public $db_changes = array( 1 => false, 2 => false, 3 => false, 4 => true, 5 => false, 6 => false, 7 => false, 8 => false, 9 => false, 10 => false, 11 => false, 12 => false, - 13 => false, 14 => false, 15 => false, 18 => false, 19 => false, 20 => false + 13 => false, 14 => false, 15 => false, 18 => false, 19 => false, 20 => false, + 21 => false ); public function afterSave($created, $options = array()) @@ -1031,9 +1032,14 @@ class AppModel extends Model case 19: $sqlArray[] = 'ALTER TABLE `taxonomies` ADD COLUMN exclusive tinyint(1) DEFAULT 0;'; break; - case 20: - $sqlArray[] = "ALTER TABLE `servers` ADD `skip_proxy` tinyint(1) NOT NULL DEFAULT 0;"; - break; + case 20: + $sqlArray[] = "ALTER TABLE `servers` ADD `skip_proxy` tinyint(1) NOT NULL DEFAULT 0;"; + break; + case 21: + $sqlArray[] = 'ALTER TABLE `tags` ADD COLUMN numerical_value int(11) NULL;'; + $sqlArray[] = 'ALTER TABLE `taxonomy_predicates` ADD COLUMN numerical_value int(11) NULL;'; + $sqlArray[] = 'ALTER TABLE `taxonomy_entries` ADD COLUMN numerical_value int(11) NULL;'; + break; case 'fixNonEmptySharingGroupID': $sqlArray[] = 'UPDATE `events` SET `sharing_group_id` = 0 WHERE `distribution` != 4;'; $sqlArray[] = 'UPDATE `attributes` SET `sharing_group_id` = 0 WHERE `distribution` != 4;'; diff --git a/app/Model/Attribute.php b/app/Model/Attribute.php index b4efa3910..193129216 100644 --- a/app/Model/Attribute.php +++ b/app/Model/Attribute.php @@ -2453,6 +2453,9 @@ class Attribute extends AppModel // array 1 will have all of the non negated terms and array 2 all the negated terms public function dissectArgs($args) { + if (empty($args)) { + return array(0 => array(), 1 => array()); + } if (!is_array($args)) { $args = explode('&&', $args); } diff --git a/app/Model/Module.php b/app/Model/Module.php index 7c1025adb..8bb8297b4 100644 --- a/app/Model/Module.php +++ b/app/Model/Module.php @@ -215,6 +215,7 @@ class Module extends AppModel ); if ($moduleFamily == 'Cortex') { if (!empty(Configure::read('Plugin.' . $moduleFamily . '_authkey'))) { + unset($request['header']['Content-Type']); $request['header']['Authorization'] = 'Bearer ' . Configure::read('Plugin.' . $moduleFamily . '_authkey'); } } diff --git a/app/Model/Taxonomy.php b/app/Model/Taxonomy.php index 24f534a72..50dde6a18 100644 --- a/app/Model/Taxonomy.php +++ b/app/Model/Taxonomy.php @@ -147,6 +147,9 @@ class Taxonomy extends AppModel if (isset($entry['colour']) && !empty($entry['colour'])) { $temp['colour'] = $entry['colour']; } + if (isset($entry['numerical_value']) && $entry['numerical_value'] !== null) { + $temp['numerical_value'] = $entry['numerical_value']; + } $entries[] = $temp; } } else { @@ -155,6 +158,9 @@ class Taxonomy extends AppModel if (isset($predicate['colour']) && !empty($predicate['colour'])) { $temp['colour'] = $predicate['colour']; } + if (isset($predicate['numerical_value']) && $predicate['numerical_value'] !== null) { + $temp['numerical_value'] = $predicate['numerical_value']; + } $entries[] = $temp; } } @@ -267,13 +273,20 @@ class Taxonomy extends AppModel foreach ($taxonomy['entries'] as $k => $entry) { if (isset($tags[strtoupper($entry['tag'])])) { $temp = $tags[strtoupper($entry['tag'])]; - if ((in_array('colour', $skipUpdateFields) && $temp['Tag']['colour'] != $colours[$k]) || (in_array('name', $skipUpdateFields) && $temp['Tag']['name'] !== $entry['tag'])) { + if ( + (!in_array('colour', $skipUpdateFields) && $temp['Tag']['colour'] != $colours[$k]) || + (!in_array('name', $skipUpdateFields) && $temp['Tag']['name'] !== $entry['tag']) || + (!in_array('numerical_value', $skipUpdateFields) && isset($entry['numerical_value']) && isset($temp['Tag']['numerical_value']) && $temp['Tag']['numerical_value'] !== $entry['numerical_value']) + ) { if (!in_array('colour', $skipUpdateFields)) { $temp['Tag']['colour'] = (isset($entry['colour']) && !empty($entry['colour'])) ? $entry['colour'] : $colours[$k]; } if (!in_array('name', $skipUpdateFields)) { $temp['Tag']['name'] = $entry['tag']; } + if (!in_array('numerical_value', $skipUpdateFields)) { + $temp['Tag']['numerical_value'] = $entry['numerical_value']; + } $this->Tag->save($temp['Tag']); } } diff --git a/app/View/Taxonomies/view.ctp b/app/View/Taxonomies/view.ctp index 7bb39836c..e3b9f8cd9 100644 --- a/app/View/Taxonomies/view.ctp +++ b/app/View/Taxonomies/view.ctp @@ -72,6 +72,7 @@ Paginator->sort('tag');?> Paginator->sort('expanded');?> + Paginator->sort('numerical_value');?> Paginator->sort('events');?> Paginator->sort('attributes');?> Paginator->sort('tag');?> @@ -86,6 +87,7 @@   +