source: trunk/workflow/js/orgchart/organization.js @ 2042

Revision 2042, 41.7 KB checked in by pedroerp, 14 years ago (diff)

Ticket #441 - Suporte a cadastro de substituições de chefia por períodos determinados.

  • Property svn:executable set to *
Line 
1String.prototype.repeat = function(l)
2{
3        return new Array(l+1).join(this);
4};
5
6var workflowOrgchartAdminEmployeeInfoTimer = null;
7var workflowOrgchartAdminAreaInfoTimer = null;
8
9var CadastroAjax = Class.create();
10
11CadastroAjax.prototype =
12{
13        initialize: function()
14        {
15                this.name = '';
16                this.required = new Array();
17                this.tableHeader = new Array();
18                this.combo = new Array();
19        },
20
21        add: function()
22        {
23                for (var i = 0; i < this.required.length; i++)
24                {
25                        if ($F(this.required[i]) == '')
26                        {
27                                alert("Campo necessário ausente: " + $(this.required[i]).parentNode.parentNode.childNodes[0].childNodes[0].innerHTML);
28                                $(this.required[i]).focus();
29                                return;
30                        }
31                }
32                var cb = function(data)
33                {
34                        if (!handleError(data))
35                                return;
36
37                        /* update the screen info */
38                        if (this.name.toLowerCase() == "organization")
39                                listOrganizations();
40                        else
41                        {
42                                if ($('organizacao_id'))
43                                {
44                                        var index = $F('organizacao_id');
45                                        if (refreshAreas[index])
46                                                refreshAreas[index]();
47                                }
48                        }
49
50                        valid.deactivate();
51                };
52
53                return this.ajaxAction('add', cb, Form.serialize($('orgchartForm')));
54        },
55
56        update: function()
57        {
58                for (var i = 0; i < this.required.length; i++)
59                {
60                        if ($F(this.required[i]) == '')
61                        {
62                                alert("Campo necessário ausente: " + $(this.required[i]).parentNode.parentNode.childNodes[0].childNodes[0].innerHTML);
63                                $(this.required[i]).focus();
64                                return;
65                        }
66                }
67                var cb = function(data)
68                {
69                        if (!handleError(data))
70                                return;
71
72                        /* update the screen info */
73                        if (this.name.toLowerCase() == "organization")
74                                listOrganizations();
75                        else
76                        {
77                                if ($('organizacao_id'))
78                                {
79                                        var index = $F('organizacao_id');
80                                        if (refreshAreas[index])
81                                                refreshAreas[index]();
82                                }
83                        }
84
85                        valid.deactivate();
86                };
87
88                return this.ajaxAction('update', cb, Form.serialize($('orgchartForm')));
89        },
90
91        remove: function(params, linkRemove)
92        {
93
94                if (linkRemove.addClassName)
95                        linkRemove.addClassName('alerta');
96                if (confirm("Tem certeza que deseja excluir o registro selecionado?"))
97                {
98                        var cb = function(data)
99                        {
100                                if (!handleError(data))
101                                        return;
102
103                                /* update the screen info */
104                                if (this.name.toLowerCase() == "organization")
105                                        listOrganizations();
106                                else
107                                {
108                                        var index = $('organizacao_id') ? $F('organizacao_id') : params['organizacao_id'];
109                                        if (refreshAreas[index])
110                                                refreshAreas[index]();
111                                }
112
113                                if ($('lbContent'))
114                                        valid.deactivate();
115                        };
116                        return this.ajaxAction('remove', cb, $H(params).toQueryString());
117                }
118                else
119                        if (linkRemove.removeClassName)
120                                linkRemove.removeClassName('alerta');
121        },
122
123        list: function(callback, params)
124        {
125                return this.ajaxAction('list', callback, $H(params).toQueryString());
126        },
127
128        generateTable: function(params, displayArea)
129        {
130                tableHeader = this.tableHeader;
131                var tableResult = function(data)
132                {
133                        if (!handleError(data))
134                                return;
135
136                        if (data.length == 0)
137                        {
138                                displayArea.innerHTML += '<br/><br/><center><strong>Nenhum registro encontrado</strong></center>';
139                                return true;
140                        }
141
142                        for (var i = 0; i < data.length; i++)
143                        {
144                                data[i]['tr_attributes'] = new Array();
145                                data[i]['tr_attributes']['class'] = "linha" + i%2;;
146                                data[i]['tr_attributes']['className'] = "linha" + i%2;;
147                        }
148
149                        var tableAtributes = new Array();
150                        tableAtributes['id'] = this.name + 'List';
151                        tableAtributes['class'] = 'organizationList';
152                        tableAtributes['className'] = 'organizationList';
153                        displayArea.appendChild(constructTable(tableHeader, data, tableAtributes));
154                };
155                this.list(tableResult, params);
156        },
157
158        generateUpdateTable: function(params, displayArea)
159        {
160                tableHeader = this.tableHeader;
161                if (!tableHeader['actions'])
162                        tableHeader['actions'] = "Ações";
163                name = this.name.charAt(0).capitalize() + this.name.substr(1);
164                var tableResult = function(data)
165                {
166                        if (!handleError(data))
167                                return;
168
169                        if (data.length == 0)
170                        {
171                                //displayArea.innerHTML += '<br/><br/><center><strong>Nenhum registro encontrado</strong></center>';
172                                elem = document.createElement('div');
173                                elem.id = this.name.capitalize() + 'List';
174                                elem.innerHTML = '<br/><br/><center><strong>Nenhum registro encontrado</strong></center>';
175                                displayArea.appendChild(elem);
176                                return true;
177                        }
178
179                        for (var i = 0; i < data.length; i++)
180                        {
181                                var dataHash = new Hash();
182                                for (j in data[i])
183                                        if (typeof data[i][j] != "function")
184                                        {
185                                                dataHash[j] = data[i][j];
186                                                if ( dataHash[j] == null )
187                                                        dataHash[j] = '';
188                                        }
189
190                                for (j in tableHeader)
191                                        if (typeof tableHeader[j] != "function")
192                                                if (j != 'actions')
193                                                        data[i][j] = '<a href="#" onclick="obj' + name + '.fillForm(' + dataHash.customInspect() + '); return false;">' + data[i][j] + '</a>';
194
195                                data[i]['tr_attributes'] = new Array();
196                                data[i]['tr_attributes']['class'] = "linha" + i%2;
197                                data[i]['tr_attributes']['className'] = "linha" + i%2;
198                                data[i]['actions'] = '<a href="#" onclick="obj' + name + '.remove(' + dataHash.customInspect() + ' , this.parentNode.parentNode); return false;"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/button_cancel.png" /></a>';
199                        }
200
201                        var tableAtributes = new Array();
202                        tableAtributes['id'] = this.name + 'List';
203                        tableAtributes['class'] = 'orgchartUpdateTable';
204                        tableAtributes['className'] = 'orgchartUpdateTable';
205                        displayArea.appendChild(constructTable(tableHeader, data, tableAtributes));
206                };
207                this.list(tableResult, params);
208        },
209
210        fillForm: function(dataHash)
211        {
212                dataHash = $H(dataHash);
213                dataHash.each(function(pair)
214                {
215                        var campo = $(pair.key);
216                        if (campo)
217                        {
218                                if ((campo.nodeName == "SELECT") && (pair.value == null))
219                                        campo.value = campo.firstChild.value;
220                                else
221                                        if (pair.value != null)
222                                                campo.value = pair.value;
223                        }
224                        else
225                                new Insertion.Bottom($('orgchartForm'), '<input type="hidden" name="' + pair.key + '" id="' + pair.key + '" value="' + pair.value + '" />');
226                });
227                if (!$('updateOrgchart'))
228                        new Insertion.Bottom($('orgchartForm'), '<input type="hidden" name="updateOrgchart" id="updateOrgchart" value="true" />');
229                var saveButton = $('inserir');
230                saveButton.innerHTML = "Salvar";
231                var name = this.name;
232                saveButton.onclick = function(){ eval('obj' + name.charAt(0).capitalize() + name.substr(1) + '.update();')};
233                var titleObject = $('modalTitle');
234                var title = titleObject.innerHTML.split(' ');
235                title[0] = "Atualizar";
236                titleObject.innerHTML = title.join(' ');
237                $('lightbox').scrollTop = 0;
238        },
239
240        generateComboBox: function(params, displayArea, includeNull, name, callback)
241        {
242                if (!name)
243                        name = this.combo['id'];
244                combo = this.combo;
245                var comboResult = function(data)
246                {
247                        if (!handleError(data))
248                                return;
249
250                        var newFormat = new Array();
251                        if (includeNull)
252                                newFormat['NULL'] = "Nenhum";
253                        for (var i = 0; i < data.length; i++)
254                                newFormat[data[i][combo['id']]] = data[i][combo['name']];
255                        if ((newFormat.length > 0) || includeNull)
256                                displayArea.innerHTML = constructSelectBox(name, newFormat);
257                        else
258                                displayArea.innerHTML = '<i>nenhum registro encontado</i><input type="hidden" id="' + name + '" value=""/>';
259                        if (callback)
260                                callback();
261                };
262                this.list(comboResult, params);
263        },
264
265        ajaxAction: function(action, callback, params)
266        {
267                if (params == "")
268                        cExecute('$this.bo_orgchart.' + action + this.name.charAt(0).capitalize() + this.name.substr(1), callback);
269                else
270                        cExecute('$this.bo_orgchart.' + action + this.name.charAt(0).capitalize() + this.name.substr(1), callback, params);
271        }
272
273};
274
275var CadastroOrganization =
276{
277        name: 'organization',
278        required: new Array('nome', 'descricao', 'ativa'),
279        tableHeader: {'nome': 'Organização'},
280        combo: {'id': 'organizacao_id', 'name': 'nome'}
281};
282var objOrganization = new CadastroAjax();
283Object.extend(objOrganization, CadastroOrganization);
284
285var CadastroEmployeeStatus =
286{
287        name: 'employeeStatus',
288        required: new Array('descricao', 'exibir'),
289        tableHeader: {'descricao': 'Status de Funcionário'},
290        combo: {'id': 'funcionario_status_id', 'name': 'descricao'}
291};
292var objEmployeeStatus = new CadastroAjax();
293Object.extend(objEmployeeStatus, CadastroEmployeeStatus);
294
295var CadastroEmployeeCategory =
296{
297        name: 'employeeCategory',
298        required: new Array('organizacao_id', 'descricao'),
299        tableHeader: {'descricao': 'Nome'},
300        combo: {'id': 'funcionario_categoria_id', 'name': 'descricao'}
301};
302var objEmployeeCategory = new CadastroAjax();
303Object.extend(objEmployeeCategory, CadastroEmployeeCategory);
304
305var CadastroJobTitle =
306{
307        name: 'jobTitle',
308        required: new Array('organizacao_id', 'descricao'),
309        tableHeader: {'descricao': 'Nome'},
310        combo: {'id': 'cargo_id', 'name': 'descricao'}
311};
312var objJobTitle = new CadastroAjax();
313Object.extend(objJobTitle, CadastroJobTitle);
314
315var CadastroAreaStatus =
316{
317        name: 'areaStatus',
318        required: new Array('organizacao_id', 'descricao', 'nivel'),
319        tableHeader: {'descricao': 'Nome', 'nivel': 'Nível'},
320        combo: {'id': 'area_status_id', 'name': 'descricao'}
321};
322var objAreaStatus = new CadastroAjax();
323Object.extend(objAreaStatus, CadastroAreaStatus);
324
325var CadastroCostCenter =
326{
327        name: 'costCenter',
328        required: new Array('organizacao_id', 'nm_centro_custo', 'descricao', 'grupo'),
329        tableHeader: {'nm_centro_custo': 'Número', 'descricao': 'Nome', 'grupo': 'Grupo'},
330        combo: {'id': 'centro_custo_id', 'name': 'descricao'}
331};
332var objCostCenter = new CadastroAjax();
333Object.extend(objCostCenter, CadastroCostCenter);
334
335var CadastroLocal =
336{
337        name: 'local',
338        required: new Array('organizacao_id', 'descricao'),
339        tableHeader: {'descricao': 'Localidade'},
340        combo: {'id': 'localidade_id', 'name': 'descricao'}
341};
342var objLocal = new CadastroAjax();
343Object.extend(objLocal, CadastroLocal);
344
345var CadastroEmployee =
346{
347        name: 'employee',
348        required: new Array('funcionario_id', 'organizacao_id', 'funcionario_status_id', 'centro_custo_id', 'localidade_id', 'area_id'),
349        tableHeader: {'funcionario_id': 'Funcionário'},
350        combo: {'id': 'funcionario_id', 'name': 'funcionario_id'}
351};
352var objEmployee = new CadastroAjax();
353Object.extend(objEmployee, CadastroEmployee);
354
355var CadastroArea =
356{
357        name: 'area',
358        required: new Array('organizacao_id', 'area_status_id', 'centro_custo_id', 'superior_area_id', 'sigla', 'descricao', 'ativa'),
359        tableHeader: {'sigla': 'Área'},
360        combo: {'id': 'area_id', 'name': 'sigla'}
361};
362var objArea = new CadastroAjax();
363Object.extend(objArea, CadastroArea);
364
365var CadastroTelefone =
366{
367        name: 'telephones',
368        required: new Array('organizacao_id', 'descricao', 'numero'),
369        tableHeader: {'descricao': 'Descrição', 'numero': 'Telefones'},
370        combo: {'id': 'telefone_id', 'name': 'descricao'}
371};
372var objTelephones = new CadastroAjax();
373Object.extend(objTelephones, CadastroTelefone);
374
375var CadastroSubstituto =
376{
377        name: 'substitution',
378        required: new Array('organizacao_id', 'area_id', 'descricao', 'titular_funcionario_id', 'substituto_funcionario_id', 'data_inicio', 'data_fim'),
379        tableHeader: {'substituto_funcionario_id_desc': 'Nome', 'data_inicio': 'Data de início', 'data_fim': 'Data de término'},
380        combo: {}
381};
382var objSubstitution = new CadastroAjax();
383Object.extend(objSubstitution, CadastroSubstituto);
384
385
386function createOrganizationLayout(organizationID, organizationDiv)
387{
388        organizationDiv.innerHTML = '<div id="orgchartMenu_' + organizationID + '"></div>';
389        organizationDiv.innerHTML += '<div class="orgchartAreas" id="orgchartAreas_' + organizationID + '"></div>';
390        organizationDiv.innerHTML += '<div class="orgchartEmployees" id="orgchartEmployees_' + organizationID + '"></div>';
391        organizationDiv.innerHTML += '<div class="orgchartFooter"></div>';
392        organizationDiv.innerHTML += '<div id="employeeInfo" class="employeeInfo" style="display: none;"></div>';
393        organizationDiv.innerHTML += '<div id="areaInfo" class="employeeInfo" style="display: none;"></div>';
394
395        createOrganizationMenu(organizationID, $('orgchartMenu_' + organizationID));
396        loadOrganizationAreas(organizationID, $('orgchartAreas_' + organizationID));
397        lb_initialize();
398}
399
400function createOrganizationMenu(organizationID, div)
401{
402        var content = '<ul class="horizontalMenu">';
403        content += '<li style="margin: 5px 5px 0 5px">Atualizar : <select>'
404        content += '<option></option>'
405        content += '<option onclick="loadAddEmployeeStatusUI(' + organizationID  + ');" class="lbOn">Status de Funcionário</option>'
406        content += '<option onclick="loadAddEmployeeCategoryUI(' + organizationID  + ');" class="lbOn">Categorias</option>'
407        content += '<option onclick="loadAddJobTitleUI(' + organizationID  + ');" class="lbOn">Cargos</option>'
408        content += '<option onclick="loadAddAreaStatusUI(' + organizationID  + ');" class="lbOn">Status de Área</option>'
409        content += '<option onclick="loadAddCostCenterUI(' + organizationID  + ');" class="lbOn">Centros de Custo</option>'
410        content += '<option onclick="loadAddLocalUI(' + organizationID  + ');" class="lbOn">Localidade</option>'
411        content += '<option onclick="loadAddAreaUI(' + organizationID  + ');" class="lbOn">Áreas</option>'
412        content += '<option onclick="loadAddEmployeeUI(' + organizationID  + ');" class="lbOn">Funcionários</option>'
413        content += '<option onclick="loadAddTelephoneUI(' + organizationID  + ');" class="lbOn">Telefones</option>'
414        content += '<option onclick="loadAddSubstitutionUI(' + organizationID  + ');" class="lbOn">Substituições</option>'
415        content += '</select></li>';
416        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>';
417        content += '</ul>';
418        content += '<br/>';
419        content += '<br/>';
420        div.innerHTML = content;
421}
422
423function loadOrganizationAreas(organizationID, div)
424{
425        var loadOrganizationAreasResult = function(data)
426        {
427                function recursivePrint(subdata)
428                {
429                        for (var i = 0; i < subdata.length; i++)
430                        {
431                                div.innerHTML += '<br />' + '&nbsp;&nbsp;&nbsp;&nbsp;'.repeat(subdata[i]['depth']) + '<a href="javascript:void(0)" id="area_' + subdata[i]['area_id'] + '" onmouseover="getAreaInfoTimer(event, ' + subdata[i]['area_id'] + ', ' + organizationID + '); return false;" onmouseout="hideAreaInfo(); return false;" onclick="tmp = $$(\'div#orgchartAreas_' + organizationID + ' a.destaque\'); if (tmp[0]) tmp[0].removeClassName(\'destaque\'); this.addClassName(\'destaque\'); loadAreaEmployees(' + organizationID + ', ' + subdata[i]['area_id'] + ', $(\'orgchartEmployees_' + organizationID + '\'))">' + subdata[i]['sigla'] + '</a>';
432                                if (subdata[i]['children'].length > 0)
433                                        recursivePrint(subdata[i]['children']);
434                        }
435                }
436
437                if (!handleError(data))
438                        return;
439
440                if (data.length == 0)
441                {
442                        div.innerHTML = "<br/><br/><center><strong>Nenhuma área cadastrada.</strong></center><br/><br/>";
443                        return;
444                }
445
446                div.innerHTML = "<center><strong>ÁREAS</strong></center>";
447                recursivePrint(data);
448                if (refreshEmployees[organizationID])
449                        refreshEmployees[organizationID]();
450        };
451
452        objArea.ajaxAction('listHierarchical', loadOrganizationAreasResult, $H({'organizacao_id': organizationID}).toQueryString());
453        refreshAreas[organizationID] = function(){objArea.ajaxAction('listHierarchical', loadOrganizationAreasResult, $H({'organizacao_id': organizationID}).toQueryString());};
454}
455
456function searchEmployee(organizationID, div)
457{
458        var searchEmployeeResult = function(data)
459        {
460                if (!handleError(data))
461                        return;
462
463                div.innerHTML = "";
464                if (data.length == 0)
465                {
466                        div.innerHTML = "<br/><br/><center><strong>Nenhum funcionário encontrado.</strong></center>";
467                        return;
468                }
469
470                var tableHeader = new Array();
471                tableHeader['funcionario_id_desc'] = 'Funcionário';
472                tableHeader['area_sigla'] = 'Área';
473                tableHeader['uid'] = 'UID';
474                tableHeader['actions'] = 'Ações';
475                for (var i = 0; i < data.length; i++)
476                {
477                        var dataHash = new Hash();
478                        for (j in data[i])
479                                if (typeof data[i][j] != "function")
480                                        dataHash[j] = data[i][j];
481
482                        data[i]['tr_attributes'] = new Array();
483                        data[i]['tr_attributes']['class'] = "linha" + i%2;
484                        data[i]['tr_attributes']['className'] = "linha" + i%2;
485                        data[i]['funcionario_id_desc'] = '<a href="javascript:void(0)" class="lbOn" onmouseover="getEmployeeInfoTimer(event, ' + data[i]['funcionario_id'] + ', ' + organizationID + '); return false;" onmouseout="hideEmployeeInfo(); return false;" onclick="loadAddEmployeeUI(' + organizationID + ', function(){objEmployee.fillForm(' + dataHash.customInspect() + ')}); $(\'addEmployeeLink\').parentNode.removeChild($(\'addEmployeeLink\')); return false;">' + data[i]['funcionario_id_desc'] + '</a>' + (data[i]['removed'] ? ' <font color="red">(excluído)</font>' : '');
486                        data[i]['actions'] = '<a href="#" onclick="objEmployee.remove({\'funcionario_id\': ' + data[i]['funcionario_id'] + ', \'organizacao_id\': ' + organizationID + '} , this.parentNode.parentNode); return false;"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/button_cancel.png" /></a>';
487                }
488
489                var tableAtributes = new Array();
490                tableAtributes['class'] = 'employeeList';
491                tableAtributes['className'] = 'employeeList';
492                div.appendChild(constructTable(tableHeader, data, tableAtributes));
493                lb_initialize();
494        };
495
496        objEmployee.ajaxAction('search', searchEmployeeResult, $H({'organizacao_id': organizationID, 'search_term': $F('search_term')}).toQueryString());
497        refreshEmployees[organizationID] = function(){objEmployee.ajaxAction('search', searchEmployeeResult, $H({'organizacao_id': organizationID, 'search_term': $F('search_term')}).toQueryString());};
498}
499
500function loadAreaEmployees(organizationID, areaID, div)
501{
502        var loadAreaEmployeesResult = function(data)
503        {
504                if (!handleError(data))
505                        return;
506
507                var areaLink = $('area_' + areaID);
508                if (!areaLink.hasClassName('destaque'))
509                        areaLink.addClassName('destaque');
510
511                div.innerHTML = "";
512                if (data.length == 0)
513                {
514                        div.innerHTML = "<br/><br/><center><strong>Nenhum funcionário alocado nesta área.</strong></center>";
515                        return;
516                }
517
518                var tableHeader = new Array();
519                tableHeader['funcionario_id_desc'] = 'Funcionário';
520                tableHeader['uid'] = 'UID';
521                tableHeader['actions'] = 'Ações';
522                for (var i = 0; i < data.length; i++)
523                {
524                        var dataHash = new Hash();
525                        for (j in data[i])
526                                if (typeof data[i][j] != "function")
527                                        dataHash[j] = data[i][j];
528
529                        data[i]['tr_attributes'] = new Array();
530                        data[i]['tr_attributes']['class'] = "linha" + i%2;
531                        data[i]['tr_attributes']['className'] = "linha" + i%2;
532                        data[i]['funcionario_id_desc'] = '<a href="javascript:void(0)" class="lbOn" onmouseover="getEmployeeInfoTimer(event, ' + data[i]['funcionario_id'] + ', ' + organizationID + '); return false;" onmouseout="hideEmployeeInfo(); return false;" onclick="loadAddEmployeeUI(' + organizationID + ', function(){objEmployee.fillForm(' + dataHash.customInspect() + ')}); $(\'addEmployeeLink\').parentNode.removeChild($(\'addEmployeeLink\')); return false;">' + data[i]['funcionario_id_desc'] + '</a>' + (data[i]['removed'] ? ' <font color="red">(excluído)</font>' : '');
533                        data[i]['actions'] = '<a href="#" onclick="objEmployee.remove({\'funcionario_id\': ' + data[i]['funcionario_id'] + ', \'organizacao_id\': ' + organizationID + '} , this.parentNode.parentNode); return false;"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/button_cancel.png" /></a>';
534                        window.scrollTo(0,0);
535                }
536
537                var tableAtributes = new Array();
538                tableAtributes['class'] = 'employeeList';
539                tableAtributes['className'] = 'employeeList';
540                div.appendChild(constructTable(tableHeader, data, tableAtributes));
541
542                lb_initialize();
543        };
544
545        objEmployee.ajaxAction('listArea', loadAreaEmployeesResult, $H({'area_id': areaID, 'organizacao_id': organizationID}).toQueryString());
546        refreshEmployees[organizationID] = function(){objEmployee.ajaxAction('listArea', loadAreaEmployeesResult, $H({'area_id': areaID, 'organizacao_id': organizationID}).toQueryString());};
547}
548
549function loadAddEmployeeStatusUI(organizationID)
550{
551        var valoresSimNao = new Array();
552        valoresSimNao['S'] = 'Sim';
553        valoresSimNao['N'] = 'Não';
554
555        var content;
556        content = '<h2 id="modalTitle">Adicionar Status de Funcionário</h2>';
557        content += '<form name="orgchartForm" id="orgchartForm">';
558        content += '<input type="hidden" name="organizacao_id" id="organizacao_id" value="' + organizationID + '" />';
559        content += "<table>";
560        content += '<tr><td><label for="descricao">Nome</label></td><td><input type="text" name="descricao" id="descricao" size="30" /></td></tr>';
561        content += '<tr><td><label for="exibir">Exibir para o usuário</label></td>' + constructSelectBox('exibir', valoresSimNao) + '</td></tr>';
562        content += "</table>";
563        content += '</form>';
564        content += '<button id="inserir" onclick="objEmployeeStatus.add(); return false;">Inserir</button>';
565        content += '<button onclick="valid.deactivate(); return false;">Cancelar</button>';
566
567        var divLB = $('lbContent');
568        divLB.innerHTML = content;
569        $('descricao').focus();
570        objEmployeeStatus.generateUpdateTable({'organizacao_id': organizationID}, divLB);
571}
572
573function loadAddEmployeeCategoryUI(organizationID)
574{
575        var content;
576        content = '<h2 id="modalTitle">Adicionar Categoria</h2>';
577        content += '<form name="orgchartForm" id="orgchartForm">';
578        content += '<input type="hidden" name="organizacao_id" id="organizacao_id" value="' + organizationID + '" />';
579        content += '<table>';
580        content += '<tr><td><label for="descricao">Nome</label></td><td><input type="text" name="descricao" id="descricao" size="30" /></td></tr>';
581        content += "</table>";
582        content += '</form>';
583        content += '<button id="inserir" onclick="objEmployeeCategory.add(); return false;">Inserir</button>';
584        content += '<button onclick="valid.deactivate(); return false;">Cancelar</button>';
585
586        var divLB = $('lbContent');
587        divLB.innerHTML = content;
588        $('descricao').focus();
589        objEmployeeCategory.generateUpdateTable({'organizacao_id': organizationID}, divLB);
590}
591
592function loadAddJobTitleUI(organizationID)
593{
594        var content;
595        content = '<h2 id="modalTitle">Adicionar Cargos</h2>';
596        content += '<form name="orgchartForm" id="orgchartForm">';
597        content += '<input type="hidden" name="organizacao_id" id="organizacao_id" value="' + organizationID + '" />';
598        content += '<table>';
599        content += '<tr><td><label for="descricao">Nome</label></td><td><input type="text" name="descricao" id="descricao" size="30" /></td></tr>';
600        content += "</table>";
601        content += '</form>';
602        content += '<button id="inserir" onclick="objJobTitle.add(); return false;">Inserir</button>';
603        content += '<button onclick="valid.deactivate(); return false;">Cancelar</button>';
604
605        var divLB = $('lbContent');
606        divLB.innerHTML = content;
607        $('descricao').focus();
608        objJobTitle.generateUpdateTable({'organizacao_id': organizationID}, divLB);
609}
610
611function loadAddAreaStatusUI(organizationID)
612{
613        var content;
614        content = '<h2 id="modalTitle">Adicionar Status de Área</h2>';
615        content += '<form name="orgchartForm" id="orgchartForm">';
616        content += '<input type="hidden" name="organizacao_id" id="organizacao_id" value="' + organizationID + '" />';
617        content += '<table>';
618        content += '<tr><td><label for="descricao">Nome</label></td><td><input type="text" name="descricao" id="descricao" size="30" /></td></tr>';
619        content += '<tr><td><label for="nivel">Nível</label></td><td><input type="text" name="nivel" id="nivel" size="3" /></td></tr>';
620        content += "</table>";
621        content += '</form>';
622        content += '<button id="inserir" onclick="objAreaStatus.add(); return false;">Inserir</button>';
623        content += '<button onclick="valid.deactivate(); return false;">Cancelar</button>';
624
625        var divLB = $('lbContent');
626        divLB.innerHTML = content;
627        $('descricao').focus();
628        objAreaStatus.generateUpdateTable({'organizacao_id': organizationID}, divLB);
629}
630
631function loadAddCostCenterUI(organizationID)
632{
633        var content;
634        content = '<h2 id="modalTitle">Adicionar Centro de Custo</h2>';
635        content += '<form name="orgchartForm" id="orgchartForm">';
636        content += '<input type="hidden" name="organizacao_id" id="organizacao_id" value="' + organizationID + '" />';
637        content += "<table>";
638        content += '<tr><td><label for="nm_centro_custo">Número</label></td><td><input type="text" name="nm_centro_custo" id="nm_centro_custo" size="4" /></td></tr>';
639        content += '<tr><td><label for="descricao">Nome</label></td><td><input type="text" name="descricao" id="descricao" size="30" /></td></tr>';
640        content += '<tr><td><label for="grupo">Grupo</label></td><td><input type="text" name="grupo" id="grupo" size="10" /></td></tr>';
641        content += "</table>";
642        content += '</form>';
643        content += '<button id="inserir" onclick="objCostCenter.add(); return false;">Inserir</button>';
644        content += '<button onclick="valid.deactivate(); return false;">Cancelar</button>';
645
646        var divLB = $('lbContent');
647        divLB.innerHTML = content;
648        $('nm_centro_custo').focus();
649        objCostCenter.generateUpdateTable({'organizacao_id': organizationID}, divLB);
650}
651
652function loadAddLocalUI(organizationID)
653{
654        var content;
655        content = '<h2 id="modalTitle">Adicionar Localidade</h2>';
656        content += '<form name="orgchartForm" id="orgchartForm">';
657        content += '<input type="hidden" name="organizacao_id" id="organizacao_id" value="' + organizationID + '" />';
658        content += "<table>";
659        content += '<tr><td><label for="descricao">Nome</label></td><td><input type="text" name="descricao" id="descricao" size="30" /></td></tr>';
660
661        content += '<tr><td><label for="empresa">Empresa</label></td><td><input type="text" name="empresa" id="empresa" size="80" /></td></tr>';
662        content += '<tr><td><label for="endereco">Endereço</label></td><td><input type="text" name="endereco" id="endereco" size="80" /></td></tr>';
663        content += '<tr><td><label for="complemento">Complemento</label></td><td><input type="text" name="complemento" id="complemento" size="50" /></td></tr>';
664        content += '<tr><td><label for="cep">Cep</label></td><td><input type="text" name="cep" id="cep" size="10" /></td></tr>';
665        content += '<tr><td><label for="bairro">Bairro</label></td><td><input type="text" name="bairro" id="bairro" size="30" /></td></tr>';
666        content += '<tr><td><label for="cidade">Cidade</label></td><td><input type="text" name="cidade" id="cidade" size="50" /></td></tr>';
667        content += '<tr><td><label for="uf">UF</label></td><td><input type="text" name="uf" id="uf" size="2" maxlength="2" /></td></tr>';
668
669        content += '<tr><td><label for="centro_custo_id">Centro de Custo</label></td><td id="comboCentroCusto"><i>carregando</i></td></tr>';
670        content += "</table>";
671        content += '</form>';
672        content += '<button id="inserir" onclick="objLocal.add(); return false;">Inserir</button>';
673        content += '<button onclick="valid.deactivate(); return false;">Cancelar</button>';
674
675        var divLB = $('lbContent');
676        divLB.innerHTML = content;
677        $('descricao').focus();
678        objCostCenter.generateComboBox({'organizacao_id': organizationID}, $('comboCentroCusto'), true, null,
679                function()
680                {
681                        objLocal.generateUpdateTable({'organizacao_id': organizationID}, divLB);
682                }
683        );
684}
685
686function loadAddEmployeeUI(organizationID, callback)
687{
688        var content;
689        content = '<h2 id="modalTitle">Adicionar Funcionário</h2>';
690        content += '<form name="orgchartForm" id="orgchartForm">';
691        content += '<input type="hidden" name="organizacao_id" id="organizacao_id" value="' + organizationID + '" />';
692        content += "<table>";
693        content += '<tr><td><label for="funcionario_id_desc">Funcionário</label></td><td>';
694        content += '<input type="hidden" name="funcionario_id" id="funcionario_id" value="" />';
695        content += '<input type="input" name="funcionario_id_desc" id="funcionario_id_desc" value="" readonly="true" size="40" />';
696        content += '<a href="javascript:void(0)" onclick="openParticipants(\'funcionario_id\', \'uid=1&hidegroups=1\');" id="addEmployeeLink"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/add_user.png" /></a>';
697        content += '</td></tr>';
698        content += '<tr><td><label for="funcionario_status_id">Status</label></td><td id="comboStatus"><i>carregando</i></td></tr>';
699        content += '<tr><td><label for="funcionario_categoria_id">Categoria</label></td><td id="comboFuncionarioCategoria"><i>carregando</i></td></tr>';
700        content += '<tr><td><label for="cargo_id">Cargo</label></td><td id="comboCargo"><i>carregando</i></td></tr>';
701
702        content += '<tr><td><label for="titulo">T&iacute;tulo</label></td><td><input type="text" size="30" name="titulo" id="titulo"/></td></tr>';
703
704        content += '<tr><td><label for="nivel">Nível</label></td><td><input type="text" size="3" name="nivel" id="nivel"/></td></tr>';
705        content += '<tr><td><label for="area_id">Área</label></td><td id="comboArea"><i>carregando</i></td></tr>';
706        content += '<tr><td><label for="centro_custo_id">Centro de Custo</label></td><td id="comboCentroCusto"><i>carregando</i></td></tr>';
707        content += '<tr><td><label for="localidade_id">Localidade</label></td><td id="comboLocalidade"><i>carregando</i></td></tr>';
708        content += "</table>";
709        content += '</form>';
710        content += '<button id="inserir" onclick="objEmployee.add(); return false;">Inserir</button>';
711        content += '<button onclick="valid.deactivate(); return false;">Cancelar</button>';
712
713        var divLB = $('lbContent');
714        divLB.innerHTML = content;
715
716        objEmployeeStatus.generateComboBox({'organizacao_id': organizationID}, $('comboStatus'), false, null,
717                function()
718                {
719                        objEmployeeCategory.generateComboBox({'organizacao_id': organizationID}, $('comboFuncionarioCategoria'), true, null,
720                                function()
721                                {
722                                        objJobTitle.generateComboBox({'organizacao_id': organizationID}, $('comboCargo'), true, null,
723                                                function()
724                                                {
725                                                        objArea.generateComboBox({'organizacao_id': organizationID}, $('comboArea'), false, null,
726                                                                function()
727                                                                {
728                                                                        objCostCenter.generateComboBox({'organizacao_id': organizationID}, $('comboCentroCusto'), true, null,
729                                                                                function()
730                                                                                {
731                                                                                        objLocal.generateComboBox({'organizacao_id': organizationID}, $('comboLocalidade'), false, null, callback);
732                                                                                }
733                                                                        )
734                                                                }
735                                                        )
736                                                }
737                                        )
738                                }
739                        )
740                }
741        );
742}
743
744function loadAddAreaUI(organizationID)
745{
746        var valoresSimNao = new Array();
747        valoresSimNao['S'] = 'Sim';
748        valoresSimNao['N'] = 'Não';
749
750        var content;
751        content = '<h2 id="modalTitle">Adicionar Área</h2>';
752        content += '<form name="orgchartForm" id="orgchartForm">';
753        content += '<input type="hidden" name="organizacao_id" id="organizacao_id" value="' + organizationID + '" />';
754        content += "<table>";
755        content += '<tr><td><label for="sigla">Sigla</label></td><td><input type="text" name="sigla" id="sigla" size="15" /></td></tr>';
756        content += '<tr><td><label for="descricao">Nome</label></td><td><input type="text" name="descricao" id="descricao" size="30" /></td></tr>';
757        content += '<tr><td><label for="titular_funcionario_id">Titular</label></td><td>';
758        content += '<input type="hidden" name="titular_funcionario_id" id="titular_funcionario_id" value="" />';
759        content += '<input type="input" name="titular_funcionario_id_desc" id="titular_funcionario_id_desc" value="" readonly="true" size="40" />';
760        content += '<a href="javascript:void(0)" onclick="openParticipants(\'titular_funcionario_id\', \'uid=1&hidegroups=1\');"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/add_user.png" /></a>';
761        content += ' <a href="javascript:void(0)" onclick="$(\'titular_funcionario_id\').value=\'\'; $(\'titular_funcionario_id_desc\').value=\'\'; return false;"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/delete_user.png" /></a>';
762        content += '</td></tr>';
763        content += '<tr><td><label for="auxiliar_funcionario_id">Auxiliar Administrativo</label></td><td>';
764        content += '<input type="hidden" name="auxiliar_funcionario_id" id="auxiliar_funcionario_id" value="" />';
765        content += '<input type="input" name="auxiliar_funcionario_id_desc" id="auxiliar_funcionario_id_desc" value="" readonly="true" size="40" />';
766        content += '<a href="javascript:void(0)" onclick="openParticipants(\'auxiliar_funcionario_id\', \'uid=1&hidegroups=1\');"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/add_user.png" /></a>';
767        content += ' <a href="javascript:void(0)" onclick="$(\'auxiliar_funcionario_id\').value=\'\'; $(\'auxiliar_funcionario_id_desc\').value=\'\'; return false;"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/delete_user.png" /></a>';
768        content += '</td></tr>';
769        content += '<tr><td><label for="area_status_id">Status</label></td><td id="comboStatus"><i>carregando</i></td></tr>';
770        content += '<tr><td><label for="superior_area_id">Área Superior</label></td><td id="comboArea"><i>carregando</i></td></tr>';
771        content += '<tr><td><label for="centro_custo_id">Centro de Custo</label></td><td id="comboCentroCusto"><i>carregando</i></td></tr>';
772        content += '<tr><td><label for="ativa">Ativa</label></td><td>' + constructSelectBox('ativa', valoresSimNao) + '</td></tr>';
773        content += "</table>";
774        content += '</form>';
775        content += '<button id="inserir" onclick="objArea.add(); return false;">Inserir</button>';
776        content += '<button onclick="valid.deactivate(); return false;">Cancelar</button>';
777
778        var divLB = $('lbContent');
779        divLB.innerHTML = content;
780        $('sigla').focus();
781
782        objAreaStatus.generateComboBox({'organizacao_id': organizationID}, $('comboStatus'), false, null,
783                function()
784                {
785                        objArea.generateComboBox({'organizacao_id': organizationID}, $('comboArea'), true, 'superior_area_id',
786                                function()
787                                {
788                                        objCostCenter.generateComboBox({'organizacao_id': organizationID}, $('comboCentroCusto'), false, null,
789                                                function()
790                                                {
791                                                        objArea.generateUpdateTable({'organizacao_id': organizationID}, divLB);
792                                                }
793                                        )
794                                }
795                        )
796                }
797        );
798}
799
800function loadAddTelephoneUI(organizationID)
801{
802        var content;
803        content = '<h2 id="modalTitle">Adicionar Telefones da Organização</h2>';
804        content += '<form name="orgchartForm" id="orgchartForm">';
805        content += '<input type="hidden" name="organizacao_id" id="organizacao_id" value="' + organizationID + '" />';
806        content += '<table>';
807        content += '<tr><td><label for="descricao">Descrição</label></td><td><input type="text" name="descricao" id="descricao" size="50" /></td></tr>';
808        content += '<tr><td><label for="nivel">Telefones</label></td><td><input type="text" name="numero" id="numero" size="50" /></td></tr>';
809        content += "</table>";
810        content += '</form>';
811        content += '<button id="inserir" onclick="objTelephones.add(); return false;">Inserir</button>';
812        content += '<button onclick="valid.deactivate(); return false;">Cancelar</button>';
813
814        var divLB = $( 'lbContent' );
815        divLB.innerHTML = content;
816        $( 'descricao' ).focus( );
817        objTelephones.generateUpdateTable( { 'organizacao_id' : organizationID }, divLB );
818}
819
820
821function loadAddSubstitutionUI(organizationID)
822{
823        var area_id = 'combo_area';
824        var content;
825
826        content  = '<h2 id="modalTitle">Adicionar Substituição</h2>';
827        content += '<form name="orgchartForm" id="orgchartForm">';
828        content += '<input type="hidden" name="organizacao_id" id="organizacao_id" value="' + organizationID + '" />';
829        content += "<table>";
830        content += '<tr><td><label for="area_id">Sigla</label>';
831        content += '<input type="hidden" name="area_id" id="area_id" value="" />';
832        content += '</td><td id="comboArea"><i>carregando</i></td></tr>';
833        content += '<tr><td><label for="descricao">Nome</label></td><td><input type="text" name="descricao" id="descricao" readonly="true" size="40" /></td></tr>';
834        content += '<tr><td><label for="titular_funcionario_id">Titular</label></td><td>';
835        content += '<input type="hidden" name="titular_funcionario_id" id="titular_funcionario_id" value="" readonly="true" />';
836        content += '<input type="input" name="titular_funcionario_id_desc" id="titular_funcionario_id_desc" value="" readonly="true" size="40" />';
837        content += '</td></tr>';
838        content += '<tr><td><label for="substituto_funcionario_id">Substituto</label></td><td>';
839        content += '<input type="hidden" name="substituto_funcionario_id" id="substituto_funcionario_id" value="" />';
840        content += '<input type="input" name="substituto_funcionario_id_desc" id="substituto_funcionario_id_desc" value="" readonly="true" size="40" />';
841        content += '<a href="javascript:void(0)" onclick="openParticipants(\'substituto_funcionario_id\', \'uid=1&hidegroups=1\');"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/add_user.png" /></a>';
842        content += ' <a href="javascript:void(0)" onclick="$(\'substituto_funcionario_id\').value=\'\'; $(\'substituto_funcionario_id_desc\').value=\'\'; return false;"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/delete_user.png" /></a>';
843        content += '</td></tr>';
844        content += '<tr><td><label for="data_inicio">Data de início</label></td><td><input type="text" name="data_inicio" id="data_inicio" size="15" onkeypress="return formatDateField(event, this);" /></td></tr>';
845        content += '<tr><td><label for="data_fim">Data de término</label></td><td><input type="text" name="data_fim" id="data_fim" size="15" onkeypress="return formatDateField(event, this);"/></td></tr>';
846        content += "</table>";
847        content += '</form>';
848        content += '<button id="inserir" onclick="objSubstitution.add(); return false;">Inserir</button>';
849        content += '<button onclick="valid.deactivate(); return false;">Cancelar</button>';
850
851        var divLB = $('lbContent');
852        divLB.innerHTML = content;
853
854        // function that must be called after loading areas on the combobox
855        var areas_callback = function () {
856
857                // every change on the combo box must query for area information
858                $(area_id).onchange = function () {
859                        if ($('SubstitutionList'))
860                                $('SubstitutionList').remove();
861                       
862                        var info_callback = function (data) {
863
864                                // just to be sure
865                                if (!data[0]) {
866                                        alert("Não foi possível encontrar os dados.");
867                                }
868
869                                // we received an empty response. Let's reset the form.
870                                if ((data[0]['area_id'] == '') || (data[0]['area_id'] == null)) {
871                                        alert('RESET');
872                                        $('area_id').value = '';
873                                        $('descricao').value = '';
874                                        $('titular_funcionario_id').value = '';
875                                        $('titular_funcionario_id_desc').value = '';
876                                }
877                                // fill the form
878                                else {
879                                        $('area_id').value = data[0]['area_id'];
880                                        $('descricao').value = data[0]['descricao'];
881                                        $('titular_funcionario_id').value = data[0]['titular_funcionario_id'];
882                                        $('titular_funcionario_id_desc').value = data[0]['titular_funcionario_id_desc'];
883                                }
884
885                                // get the list of substitutions
886                                objSubstitution.generateUpdateTable({'organization_id': organizationID, 'area_id': $(area_id).value}, divLB);
887                        }
888                        objArea.list(info_callback, {'organizacao_id': organizationID, 'area_id': $(area_id).value});
889
890                }
891        }
892        objArea.generateComboBox({'organizacao_id': organizationID}, $('comboArea'), true, area_id, areas_callback);
893}
894
895function getEmployeeInfoTimer(e, employeeID, organizationID)
896{
897        var div = $('employeeInfo');
898        div.style.left = (Event.pointerX(e) + 20) + 'px';
899        div.style.top = (Event.pointerY(e) + 14) + 'px';
900
901        if (workflowOrgchartAdminEmployeeInfoTimer != null)
902        {
903                workflowOrgchartAdminEmployeeInfoTimer = clearTimeout(workflowOrgchartAdminEmployeeInfoTimer);
904                workflowOrgchartAdminEmployeeInfoTimer = null;
905        }
906
907        workflowOrgchartAdminEmployeeInfoTimer = setTimeout('getEmployeeInfo(' + employeeID + ', ' + organizationID + ' )', 500);
908}
909
910function getEmployeeInfo(employeeID, organizationID)
911{
912        function resultGetEmployeeInfo(data)
913        {
914                if (workflowOrgchartAdminEmployeeInfoTimer == null)
915                        return;
916
917                workflowOrgchartAdminEmployeeInfoTimer = clearTimeout(workflowOrgchartAdminEmployeeInfoTimer);
918                workflowOrgchartAdminEmployeeInfoTimer = null;
919
920                var content = '';
921                content += '<table><tr><td valign="top">';
922                content += '<img src="workflow/showUserPicture.php?userID=' + employeeID + '"/>';
923                content += '</td><td valign="top" style="padding-left: 12px;">';
924                for (var i = 0; i < data['info'].length; i++)
925                        content += '<strong>' + data['info'][i]['name'] + '</strong>: ' + data['info'][i]['value'] + '<br/>';
926                content += '</td></tr></table>';
927                var pageYLimit = document.body.scrollTop + document.body.clientHeight;
928                var div = $('employeeInfo');
929                div.innerHTML = content;
930
931                if ((parseInt(div.style.top.replace(/px/g, '')) + div.getHeight()) > pageYLimit)
932                        div.style.top = (parseInt(div.style.top.replace(/px/g, '')) - (div.getHeight())) + 'px';
933
934                div.show();
935        }
936        cExecute('$this.bo_orgchart.getEmployeeInfo', resultGetEmployeeInfo, 'funcionario_id=' + employeeID + '&organizacao_id=' + organizationID);
937}
938
939function hideEmployeeInfo()
940{
941        if (workflowOrgchartAdminEmployeeInfoTimer != null)
942        {
943                workflowOrgchartAdminEmployeeInfoTimer = clearTimeout(workflowOrgchartAdminEmployeeInfoTimer);
944                workflowOrgchartAdminEmployeeInfoTimer = null;
945        }
946        $('employeeInfo').hide();
947}
948
949function getAreaInfoTimer(e, areaID, organizationID)
950{
951        var div = $('areaInfo');
952        div.style.left = (Event.pointerX(e) + 20) + 'px';
953        div.style.top = (Event.pointerY(e) + 14) + 'px';
954
955        if (workflowOrgchartAdminAreaInfoTimer != null)
956        {
957                workflowOrgchartAdminAreaInfoTimer = clearTimeout(workflowOrgchartAdminAreaInfoTimer);
958                workflowOrgchartAdminAreaInfoTimer = null;
959        }
960
961        workflowOrgchartAdminAreaInfoTimer = setTimeout('getAreaInfo(' + areaID + ', ' + organizationID + ' )', 500);
962}
963
964function getAreaInfo(areaID, organizationID)
965{
966        function resultGetAreaInfo(data)
967        {
968                if (workflowOrgchartAdminAreaInfoTimer == null)
969                        return;
970
971                workflowOrgchartAdminAreaInfoTimer = clearTimeout(workflowOrgchartAdminAreaInfoTimer);
972                workflowOrgchartAdminAreaInfoTimer = null;
973
974                var content = '';
975                content += '<table><tr>';
976                content += '<td valign="top" style="padding-left: 12px;">';
977                for (var i = 0; i < data['info'].length; i++)
978                        content += '<strong>' + data['info'][i]['name'] + '</strong>: ' + data['info'][i]['value'] + '<br/>';
979                content += '</td></tr></table>';
980                var pageYLimit = document.body.scrollTop + document.body.clientHeight;
981                var div = $('areaInfo');
982                div.innerHTML = content;
983
984                if ((parseInt(div.style.top.replace(/px/g, '')) + div.getHeight()) > pageYLimit)
985                        div.style.top = (parseInt(div.style.top.replace(/px/g, '')) - (div.getHeight())) + 'px';
986
987                div.show();
988        }
989        cExecute('$this.bo_orgchart.getAreaInfo', resultGetAreaInfo, 'area_id=' + areaID + '&organizacao_id=' + organizationID);
990}
991
992function hideAreaInfo()
993{
994        if (workflowOrgchartAdminAreaInfoTimer != null)
995        {
996                workflowOrgchartAdminAreaInfoTimer = clearTimeout(workflowOrgchartAdminAreaInfoTimer);
997                workflowOrgchartAdminAreaInfoTimer = null;
998        }
999        $('areaInfo').hide();
1000}
Note: See TracBrowser for help on using the repository browser.