Index: trunk/workflow/js/orgchart/organization.js
===================================================================
--- trunk/workflow/js/orgchart/organization.js	(revision 795)
+++ trunk/workflow/js/orgchart/organization.js	(revision 1245)
@@ -178,5 +178,9 @@
 				for (j in data[i])
 					if (typeof data[i][j] != "function")
+					{
 						dataHash[j] = data[i][j];
+						if ( dataHash[j] == null )
+							dataHash[j] = '';
+					}
 
 				for (j in tableHeader)
@@ -355,4 +359,14 @@
 Object.extend(objArea, CadastroArea);
 
+var CadastroTelefone =
+{
+	name: 'telephones',
+	required: new Array('organizacao_id', 'descricao', 'numero'),
+	tableHeader: {'descricao': 'Descrição', 'numero': 'Telefones'},
+	combo: {'id': 'telefone_id', 'name': 'descricao'}
+};
+var objTelephones = new CadastroAjax();
+Object.extend(objTelephones, CadastroTelefone);
+
 function createOrganizationLayout(organizationID, organizationDiv)
 {
@@ -380,4 +394,5 @@
 	content += '<li><a href="#" onclick="loadAddAreaUI(' + organizationID  + '); return false;" class="lbOn">Áreas</a></li>';
 	content += '<li><a href="#" onclick="loadAddEmployeeUI(' + organizationID  + '); return false;" class="lbOn">Funcionários</a></li>';
+	content += '<li><a href="#" onclick="loadAddTelephoneUI(' + organizationID  + '); return false;" class="lbOn">Telefones</a></li>';
 	content += '<li><a><input type="text" name="search_term" id="search_term" onkeypress="if (((window.Event) ? event.which : event.keyCode) == 13) $(\'search_span_' + organizationID  + '\').onclick(); return true;" /> <span id="search_span_' + organizationID + '" onclick="tmp = $$(\'div#orgchartAreas_' + organizationID + ' a.destaque\'); if (tmp[0]) tmp[0].removeClassName(\'destaque\'); searchEmployee(' + organizationID + ', $(\'orgchartEmployees_' + organizationID + '\')); return false;">busca</span></a></li>';
 	content += '</ul>';
@@ -624,4 +639,13 @@
 	content += "<table>";
 	content += '<tr><td><label for="descricao">Nome</label></td><td><input type="text" name="descricao" id="descricao" size="30" /></td></tr>';
+
+	content += '<tr><td><label for="empresa">Empresa</label></td><td><input type="text" name="empresa" id="empresa" size="80" /></td></tr>';
+	content += '<tr><td><label for="endereco">Endereço</label></td><td><input type="text" name="endereco" id="endereco" size="80" /></td></tr>';
+	content += '<tr><td><label for="complemento">Complemento</label></td><td><input type="text" name="complemento" id="complemento" size="50" /></td></tr>';
+	content += '<tr><td><label for="cep">Cep</label></td><td><input type="text" name="cep" id="cep" size="10" /></td></tr>';
+	content += '<tr><td><label for="bairro">Bairro</label></td><td><input type="text" name="bairro" id="bairro" size="30" /></td></tr>';
+	content += '<tr><td><label for="cidade">Cidade</label></td><td><input type="text" name="cidade" id="cidade" size="50" /></td></tr>';
+	content += '<tr><td><label for="uf">UF</label></td><td><input type="text" name="uf" id="uf" size="2" maxlength="2" /></td></tr>';
+
 	content += '<tr><td><label for="centro_custo_id">Centro de Custo</label></td><td id="comboCentroCusto"><i>carregando</i></td></tr>';
 	content += "</table>";
@@ -656,4 +680,7 @@
 	content += '<tr><td><label for="funcionario_categoria_id">Categoria</label></td><td id="comboFuncionarioCategoria"><i>carregando</i></td></tr>';
 	content += '<tr><td><label for="cargo_id">Cargo</label></td><td id="comboCargo"><i>carregando</i></td></tr>';
+
+	content += '<tr><td><label for="titulo">T&iacute;tulo</label></td><td><input type="text" size="30" name="titulo" id="titulo"/></td></tr>';
+
 	content += '<tr><td><label for="nivel">Nível</label></td><td><input type="text" size="3" name="nivel" id="nivel"/></td></tr>';
 	content += '<tr><td><label for="area_id">Área</label></td><td id="comboArea"><i>carregando</i></td></tr>';
@@ -758,4 +785,24 @@
 }
 
+function loadAddTelephoneUI(organizationID)
+{
+	var content;
+	content = '<h2 id="modalTitle">Adicionar Telefones da Organização</h2>';
+	content += '<form name="orgchartForm" id="orgchartForm">';
+	content += '<input type="hidden" name="organizacao_id" id="organizacao_id" value="' + organizationID + '" />';
+	content += '<table>';
+	content += '<tr><td><label for="descricao">Descrição</label></td><td><input type="text" name="descricao" id="descricao" size="50" /></td></tr>';
+	content += '<tr><td><label for="nivel">Telefones</label></td><td><input type="text" name="numero" id="numero" size="50" /></td></tr>';
+	content += "</table>";
+	content += '</form>';
+	content += '<button id="inserir" onclick="objTelephones.add(); return false;">Inserir</button>';
+	content += '<button onclick="valid.deactivate(); return false;">Cancelar</button>';
+
+	var divLB = $( 'lbContent' );
+	divLB.innerHTML = content;
+	$( 'descricao' ).focus( );
+	objTelephones.generateUpdateTable( { 'organizacao_id' : organizationID }, divLB );
+}
+
 function getEmployeeInfoTimer(e, employeeID, organizationID)
 {
