Index: /trunk/workflow/inc/class.so_orgchart.inc.php
===================================================================
--- /trunk/workflow/inc/class.so_orgchart.inc.php	(revision 6799)
+++ /trunk/workflow/inc/class.so_orgchart.inc.php	(revision 7013)
@@ -617,5 +617,5 @@
 		$this->_checkAccess($organizationID);
 
-		$query_fields = 'organizacao_id, localidade_id, centro_custo_id, descricao, empresa, endereco, complemento, cep, bairro, cidade, uf';
+		$query_fields = 'organizacao_id, localidade_id, centro_custo_id, descricao, empresa, endereco, complemento, cep, bairro, cidade, uf, externa';
 		$query = "SELECT {$query_fields} FROM localidade WHERE organizacao_id = ? ORDER BY descricao";
 		$result = $this->db->query($query, array($organizationID));
@@ -623,7 +623,9 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); $i++)
+		for ($i = 0; $i < count($output); $i++){
 			for ($j = 0; $j < $result->_numOfFields; $j++)
 				unset($output[$i][$j]);
+			$output[$i]['centro_custo_id'] = empty($output[$i]['centro_custo_id']) ? 'NULL' : $output[$i]['centro_custo_id'];
+		}
 
 		return $output;
@@ -638,10 +640,10 @@
 	 * @access public
 	 */
-	function addLocal($organizationID, $costCenter, $description, $company, $address, $complement, $zipCode, $neighborhood, $city, $state )
-	{
-		$this->_checkAccess($organizationID);
-
-		$query = "INSERT INTO localidade(organizacao_id, centro_custo_id, descricao, empresa, endereco, complemento, cep, bairro, cidade, uf) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
-		$result = $this->db->query($query, array($organizationID, $costCenter, $description, $company, $address, $complement, $zipCode, $neighborhood, $city, $state ));
+	function addLocal($organizationID, $costCenter, $description, $company, $address, $complement, $zipCode, $neighborhood, $city, $state, $external )
+	{
+		$this->_checkAccess($organizationID);
+
+		$query = "INSERT INTO localidade(organizacao_id, centro_custo_id, descricao, empresa, endereco, complemento, cep, bairro, cidade, uf, externa) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+		$result = $this->db->query($query, array($organizationID, $costCenter, $description, $company, $address, $complement, $zipCode, $neighborhood, $city, $state, $external ));
 		$this->_checkError($result);
 
@@ -658,10 +660,10 @@
 	 * @access public
 	 */
-	function updateLocal($organizationID, $costCenter, $description, $localID, $company, $address, $complement, $zipCode, $neighborhood, $city, $state )
-	{
-		$this->_checkAccess($organizationID);
-
-		$query = "UPDATE localidade SET organizacao_id = ?, centro_custo_id = ?, descricao = ?, empresa = ?, endereco = ?, complemento = ?, cep = ?, bairro = ?, cidade = ?, uf = ? WHERE (localidade_id = ?)";
-		$result = $this->db->query($query, array($organizationID, $costCenter, $description, $company, $address, $complement, $zipCode, $neighborhood, $city, $state, $localID) );
+	function updateLocal($organizationID, $costCenter, $description, $localID, $company, $address, $complement, $zipCode, $neighborhood, $city, $state, $external )
+	{
+		$this->_checkAccess($organizationID);
+
+		$query = "UPDATE localidade SET organizacao_id = ?, centro_custo_id = ?, descricao = ?, empresa = ?, endereco = ?, complemento = ?, cep = ?, bairro = ?, cidade = ?, uf = ?, externa = ? WHERE (localidade_id = ?)";
+		$result = $this->db->query($query, array($organizationID, $costCenter, $description, $company, $address, $complement, $zipCode, $neighborhood, $city, $state, $external, $localID) );
 		$this->_checkError($result);
 
Index: /trunk/workflow/inc/class.bo_orgchart.inc.php
===================================================================
--- /trunk/workflow/inc/class.bo_orgchart.inc.php	(revision 6490)
+++ /trunk/workflow/inc/class.bo_orgchart.inc.php	(revision 7013)
@@ -407,5 +407,5 @@
 	{
 		extract( $params );
-		$result = $this->so->addLocal($organizacao_id, $this->_nullReplace($centro_custo_id), $descricao, $empresa, $endereco, $complemento, $cep, $bairro, $cidade, $uf );
+		$result = $this->so->addLocal($organizacao_id, $this->_nullReplace($centro_custo_id), $descricao, $empresa, $endereco, $complemento, $cep, $bairro, $cidade, $uf, $externa );
 		$this->disconnect_all();
 
@@ -422,5 +422,5 @@
 	{
 		extract( $params );
-		$result = $this->so->updateLocal($organizacao_id, $this->_nullReplace($centro_custo_id), $descricao, $localidade_id, $empresa, $endereco, $complemento, $cep, $bairro, $cidade, $uf );
+		$result = $this->so->updateLocal($organizacao_id, $this->_nullReplace($centro_custo_id), $descricao, $localidade_id, $empresa, $endereco, $complemento, $cep, $bairro, $cidade, $uf, $externa );
 		$this->disconnect_all();
 
Index: /trunk/workflow/js/orgchart/organization.js
===================================================================
--- /trunk/workflow/js/orgchart/organization.js	(revision 6798)
+++ /trunk/workflow/js/orgchart/organization.js	(revision 7013)
@@ -659,4 +659,8 @@
 function loadAddLocalUI(organizationID)
 {
+	var valoresSimNao = new Array();
+	valoresSimNao['S'] = 'Sim';
+	valoresSimNao['N'] = 'Não';
+
 	var content;
 	content = '<h2 id="modalTitle">Adicionar Localidade</h2>';
@@ -675,4 +679,5 @@
 
 	content += '<tr><td><label for="centro_custo_id">Centro de Custo</label></td><td id="comboCentroCusto"><i>carregando</i></td></tr>';
+	content += '<tr><td><label for="externa">Externa à organização</label></td><td>' + constructSelectBox('externa', valoresSimNao) + '</td></tr>';
 	content += "</table>";
 	content += '</form>';
