Private GIT

Skip to content
Snippets Groups Projects
Commit 52453ecc authored by Gary Allan's avatar Gary Allan
Browse files

api: Extend Tools API controller with customers subcontroller. #2518

parent 49c026c2
No related branches found
No related tags found
No related merge requests found
...@@ -135,7 +135,8 @@ class Tools_controller extends Common_api_functions { ...@@ -135,7 +135,8 @@ class Tools_controller extends Common_api_functions {
"scanAgents" => "scanagents", "scanAgents" => "scanagents",
"locations" => "locations", "locations" => "locations",
"racks" => "racks", "racks" => "racks",
"nat" => "nat" "nat" => "nat",
"customers" => "customers"
); );
} }
...@@ -156,7 +157,8 @@ class Tools_controller extends Common_api_functions { ...@@ -156,7 +157,8 @@ class Tools_controller extends Common_api_functions {
"scanAgents" => array("id2"), "scanAgents" => array("id2"),
"locations" => array("id2", "id3"), "locations" => array("id2", "id3"),
"racks" => array("id2", "id3"), "racks" => array("id2", "id3"),
"nat" => array("id2", "id3") "nat" => array("id2", "id3"),
"customers" => array("id2")
); );
} }
...@@ -388,8 +390,8 @@ class Tools_controller extends Common_api_functions { ...@@ -388,8 +390,8 @@ class Tools_controller extends Common_api_functions {
# rewrite tool controller _params # rewrite tool controller _params
$table_name = $this->rewrite_tool_input_params (); $table_name = $this->rewrite_tool_input_params ();
# Get coordinates if locations # Get coordinates if address is set
if($table_name=="locations") if(key_exists('address', $this->_params) && in_array('lat', $this->valid_keys))
$this->format_location (); $this->format_location ();
# check for valid keys # check for valid keys
...@@ -439,8 +441,8 @@ class Tools_controller extends Common_api_functions { ...@@ -439,8 +441,8 @@ class Tools_controller extends Common_api_functions {
# rewrite tool controller _params # rewrite tool controller _params
$table_name = $this->rewrite_tool_input_params(); $table_name = $this->rewrite_tool_input_params();
# Get coordinates if locations # Get coordinates if address is changed
if($table_name=="locations") if(key_exists('address', $this->_params) && in_array('lat', $this->valid_keys))
$this->format_location (); $this->format_location ();
# validate and prepare keys # validate and prepare keys
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment