Index: /trunk/reports/setup/phpgw_pt-br.lang
===================================================================
--- /trunk/reports/setup/phpgw_pt-br.lang	(revision 5291)
+++ /trunk/reports/setup/phpgw_pt-br.lang	(revision 5291)
@@ -0,0 +1,58 @@
+uidNumber	reports	pt-br	UID
+user login	reports	pt-br	Login do usuário
+last login	reports	pt-br	Último acesso
+Access Log	reports	pt-br	Log de Acesso
+report	reports	pt-br	Relatório
+report usersgroups	reports	pt-br	Relatório de grupos de usuários
+report maillists	reports	pt-br	Relatório de lista de emails
+report user	reports	pt-br	Relatório de usuários
+name	reports	pt-br	Nome
+loginid	reports	pt-br	ID Login
+report id	reports	pt-br	ID
+report description	reports	pt-br	Descrição
+report email	reports	pt-br	E-Mail
+report phone	reports	pt-br	Telefone
+reports title1	reports	pt-br	Relatório dos usuários do domínio
+reports title2	reports	pt-br	Relatório dos usuários da Organização
+reports title3	reports	pt-br	Relatório de cota dos usuários do domínio
+reports title4	reports	pt-br	Relatório de cota dos usuários da Organização
+reports title5	reports	pt-br	Relatório de registro de acesso do domínio
+reports title6	reports	pt-br	Relatório de registro de acesso da Organização
+reports title7	reports	pt-br	Relatório de lista de emails do domínio
+reports title8	reports	pt-br	Relatório de lista de emails da Organização
+reports title9	reports	pt-br	Relatório de grupos de usuários do domínio
+reports title10	reports	pt-br	Relatório de grupos de usuários da Organização
+report date	reports	pt-br	Data
+reports	common	pt-br	Expresso Reports
+reports	reports	pt-br	Relatórios
+report organization	reports	pt-br	Relatório de usuários por Organização
+report cota organization	reports	pt-br	Relatório de cotas por Organização
+report maillists organization	reports	pt-br	Relatório de lista de emails por Organização
+report usersgroups organization	reports	pt-br	Relatório de grupos de usuários por Organização
+report of time without logging by Organization	reports	pt-br	Relatório de registro de acesso por Organização
+config global	reports	pt-br	Configurações Globais
+warning config global1	reports	pt-br	Atenção: para o Expresso Reports funcionar corretamente, é necessario que mbstring.func_overload = 0.
+total usersgroups	reports	pt-br	Total de Grupos de Usuários:
+total maillists	reports	pt-br	Total de Listas:
+total pages	reports	pt-br	Total de páginas a serem geradas
+total users	reports	pt-br	Total de Usuários:
+page now	reports	pt-br	Página Atual
+No matches found	reports	pt-br	Nenhum item encontrado
+Previous Pages	reports	pt-br	Páginas Anteriores
+Next Page	reports	pt-br	Proximas Páginas
+all	reports	pt-br	Todos
+No usersgroups found	reports	pt-br	Nenhum grupo de usuário encontrado
+No maillists found	reports	pt-br	Nenhuma lista de emails encontrada
+No sector found	reports	pt-br	Nenhum setor encontrado
+No user found	reports	pt-br	Nenhum usuário encontrado
+groups names	reports	pt-br	Nome dos Setores
+domain	reports	pt-br	Domínio
+cota	reports	pt-br	Cota(MB)
+cota used	reports	pt-br	Cota Utilizada(MB)
+percent cota	reports	pt-br	Cota Utilizada(%)
+Generate graphic	reports	pt-br	Gerar gráfico
+Creation Date	reports	pt-br	Data Criaçao
+Last access	reports	pt-br	Último acesso
+Days without login	reports	pt-br	Dias sem logar
+print	reports	pt-br	Imprimir
+ip address	reports	pt-br	Endereço IP
Index: /trunk/reports/setup/setup.inc.php
===================================================================
--- /trunk/reports/setup/setup.inc.php	(revision 5291)
+++ /trunk/reports/setup/setup.inc.php	(revision 5291)
@@ -0,0 +1,45 @@
+<?php
+	/***********************************************************************************\
+	* Expresso relatório                 										   *
+	* by Elvio Rufino da Silva (elviosilva@yahoo.com.br, elviosilva@cepromat.mt.gov.br)  *
+	* ---------------------------------------------------------------------------------*
+	*  This program is free software; you can redistribute it and/or modify it		   *
+	*  under the terms of the GNU General Public License as published by the		   *
+	*  Free Software Foundation; either version 2 of the License, or (at your		   *
+	*  option) any later version.													   *
+	\***********************************************************************************/
+
+	$setup_info['reports']['name']      	= 'reports';
+	$setup_info['reports']['title']     	= 'Expresso Reports';
+	/* Ao incrementar versão, não esquecer de declarar função do tables_update.inc.php*/
+	$setup_info['reports']['version']   	= '2.2.1';
+	$setup_info['reports']['app_order']	= 17;
+	$setup_info['reports']['tables']    = '';
+	$setup_info['reports']['enable']		= 1;
+
+	$setup_info['reports']['author'] = 'Elvio Rufino da Silva (elviosilva@cepromat.mt.gov.br)';
+
+	$setup_info['reports']['maintainer'] = 'Elvio Rufino da Silva (elviosilva@cepromat.mt.gov.br)';
+
+	$setup_info['reports']['license']  = 'GPL';
+	$setup_info['reports']['description'] = 'Modulo de Relatório de Usuários, Grupos e Listas do ExpressoLivre';
+
+	/* The hooks this app includes, needed for hooks registration */
+	$setup_info['reports']['hooks'] = array(
+//		'acl_manager',
+//		'add_def_pref',
+//		'view_user' => 'admin.uiaccounts.edit_view_user_hook'
+//		'after_navbar',
+//		'config',
+//		'deleteaccount',
+//		'edit_user' => 'admin.uiaccounts.edit_view_user_hook',
+//		'sidebox_menu',
+		'admin'
+	);
+
+	/* Dependencies for this app to work */
+	$setup_info['reports']['depends'][] = array(
+		'appname' => 'phpgwapi',
+		'versions' => Array('2.2')
+	);
+?>
Index: /trunk/reports/inc/class.db_functions.inc.php
===================================================================
--- /trunk/reports/inc/class.db_functions.inc.php	(revision 5291)
+++ /trunk/reports/inc/class.db_functions.inc.php	(revision 5291)
@@ -0,0 +1,42 @@
+<?php
+define('PHPGW_INCLUDE_ROOT','../');	
+define('PHPGW_API_INC','../phpgwapi/inc');
+include_once(PHPGW_API_INC.'/class.db.inc.php');
+
+class db_functions
+{	
+	var $db;
+	var $user_id;
+	
+	function db_functions()
+	{
+		if (is_array($_SESSION['phpgw_info']['expresso']['server']))
+			$GLOBALS['phpgw_info']['server'] = $_SESSION['phpgw_info']['expresso']['server'];
+		else
+			$_SESSION['phpgw_info']['expresso']['server'] = $GLOBALS['phpgw_info']['server'];
+		
+		$this->db = new db();
+		$this->db->Halt_On_Error = 'no';
+		
+		$this->db->connect(
+				$_SESSION['phpgw_info']['expresso']['server']['db_name'], 
+				$_SESSION['phpgw_info']['expresso']['server']['db_host'],
+				$_SESSION['phpgw_info']['expresso']['server']['db_port'],
+				$_SESSION['phpgw_info']['expresso']['server']['db_user'],
+				$_SESSION['phpgw_info']['expresso']['server']['db_pass'],
+				$_SESSION['phpgw_info']['expresso']['server']['db_type']
+		);		
+		$this->user_id = $_SESSION['phpgw_info']['expresso']['user']['account_id'];
+	}
+
+	// BEGIN of functions.
+	function read_acl($account_lid)
+	{
+		$query = "SELECT * FROM phpgw_expressoadmin WHERE manager_lid = '" . $account_lid . "'"; 
+		$this->db->query($query);
+		while($this->db->next_record())
+			$result[] = $this->db->row();
+		return $result;
+	}
+}
+?>
Index: /trunk/reports/inc/class.uireports_maillists.inc.php
===================================================================
--- /trunk/reports/inc/class.uireports_maillists.inc.php	(revision 5291)
+++ /trunk/reports/inc/class.uireports_maillists.inc.php	(revision 5291)
@@ -0,0 +1,600 @@
+<?php
+	/*************************************************************************************\
+	* Expresso Relatório                										         *
+	* by Elvio Rufino da Silva (elviosilva@yahoo.com.br, elviosilva@cepromat.mt.gov.br)  *
+	* -----------------------------------------------------------------------------------*
+	*  This program is free software; you can redistribute it and/or modify it			 *
+	*  under the terms of the GNU General Public License as published by the			 *
+	*  Free Software Foundation; either version 2 of the License, or (at your			 *
+	*  option) any later version.														 *
+	*************************************************************************************/
+
+	class uireports_maillists
+	{
+		var $public_functions = array
+		(
+			'report_maillists_group_print_pdf'		=> True,
+			'report_maillists_group'				=> True,
+			'report_maillists_group_print'			=> True,
+			'get_maillists_info'					=> True,
+			'css'									=> True
+		);
+
+		var $nextmatchs;
+		var $user;
+		var $functions;
+		var $current_config;
+		var $ldap_functions;
+		var $db_functions;
+
+		function uireports_maillists()
+		{
+			$this->user			= CreateObject('reports.user');
+			$this->nextmatchs	= CreateObject('phpgwapi.nextmatchs');
+			$this->functions	= CreateObject('reports.functions');
+			$this->ldap_functions = CreateObject('reports.ldap_functions');
+			$this->db_functions = CreateObject('reports.db_functions');
+			$this->fpdf = CreateObject('reports.uireports_fpdf'); // Class para PDF
+									
+			$c = CreateObject('phpgwapi.config','reports'); // cria o objeto relatorio no $c
+			$c->read_repository(); // na classe config do phpgwapi le os dados da tabela phpgw_config where relatorio, como passagem acima
+			$this->current_config = $c->config_data; // carrega os dados em do array no current_config
+
+			if(!@is_object($GLOBALS['phpgw']->js))
+			{
+				$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
+			}
+			$GLOBALS['phpgw']->js->validate_file('jscode','cc','reports');
+		}
+		
+		function report_maillists_group_print_pdf()
+		{
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $acl['contexts'];
+			foreach ($acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$context_display .= $tmp_context;
+			}
+
+
+			if (!$this->functions->check_acl($account_lid,'list_maillists'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			$grouplist = trim($_POST[setor]);
+			$grouplist = trim(ereg_replace("-","",$grouplist));
+
+			$setordn = trim($_POST[setordn]);
+			$subtitulo1 = trim($_POST[subtitulo]);
+
+			define('FPDF_FONTPATH','font/');
+			$data_atual = date("d/m/Y"); 
+			$titulo_system = $GLOBALS['phpgw_info']['apps']['reports']['title'];			
+
+			$pdf=new uireports_fpdf();
+			$pdf->Open();
+			$pdf->AddPage();
+			$pdf->SetTitle('Relatório Gerado pelo Expresso Reports');
+
+			//Set font and colors
+			$pdf->SetFont('Arial','B',14);
+			$pdf->SetFillColor(0,0,0);
+			$pdf->SetTextColor(0,0,200);
+			$pdf->SetDrawColor(0,0,0);
+			$pdf->SetLineWidth(.2);
+
+			//Table header
+			$SubTitulo = lang('reports title8');
+			$SubTituloR = lang('report organization');
+			$SubTitulo1 = $subtitulo1;
+			$GLOBALS['phpgw_info']['apps']['reports']['subtitle'] = $SubTituloR;
+			$pdf->Cell(0,8,$SubTitulo,0,1,'C',0);
+
+
+			//Set font and colors
+			$pdf->SetFont('Arial','B',8);
+			$pdf->SetFillColor(0,0,0);
+			$pdf->SetTextColor(0,0,200);
+			$pdf->SetDrawColor(0,0,0);
+			$pdf->SetLineWidth(.3);
+
+			$pdf->MultiCell(0,3,$SubTitulo1,0,'C',0);
+						
+			$pdf->Cell(0,2,' ',0,1,'C',0);
+			$pdf->Cell(0,5,'Data..: '.$data_atual,0,0,'L',0);
+			$pdf->Cell(0,5,$titulo_system,0,1,'R',0);
+												
+			$account_info = $this->functions->get_list_maillists_sector($setordn,$contexts,0);
+						
+			if (count($account_info))
+			{ 
+				//Restore font and colors
+				$pdf->SetFont('Arial','',8);
+				$pdf->SetFillColor(224,235,255);
+				$pdf->SetTextColor(0);
+
+				$pdf->Cell(40,5,lang('loginid'),1,0,'L',1);
+				$pdf->Cell(75,5,lang('name'),1,0,'L',1);
+				$pdf->Cell(75,5,lang('report email'),1,1,'L',1);
+				
+				while (list($null,$account) = each($account_info))
+				{
+					$row_loginid = $account['uid'];
+					$row_cn = $account['name'];
+					$row_mail = (!$account['email']?'<font color=red>Sem E-mail</font>':$account['email']);
+					$pdf->Cell(40,5,$row_loginid,0,0,'L',0);
+					$pdf->Cell(75,5,$row_cn,0,0,'L',0);
+					$pdf->Cell(75,5,$row_mail,0,1,'L',0);
+				}
+			}
+
+			$pdf->Output();
+
+			return; 
+		}
+
+		function report_maillists_group()
+		{
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$manager_acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $manager_acl['contexts'];
+			$conta_context = count($manager_acl['contexts_display']);
+			foreach ($manager_acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$index = $index +1;
+
+				if ($conta_context == $index)
+				{
+					$context_display .= $tmp_context;
+				}
+				else
+				{
+					$context_display .= $tmp_context.'&nbsp;|&nbsp;';
+				}
+			}
+			
+			// Verifica se tem acesso a este modulo
+			if (!$this->functions->check_acl($account_lid,'list_sectors'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			unset($GLOBALS['phpgw_info']['flags']['noheader']);
+			unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+			
+			$GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['reports']['title'].' - '.lang('report maillists');
+			$GLOBALS['phpgw']->common->phpgw_header();
+
+			$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+			$p->set_file(array('groups'   => 'report_maillists_group.tpl'));
+			$p->set_block('groups','list','list');
+			$p->set_block('groups','row','row');
+			$p->set_block('groups','row_empty','row_empty');
+
+			// Seta as variaveis padroes.
+			$var = Array(
+				'th_bg'					=> $GLOBALS['phpgw_info']['theme']['th_bg'],
+				'back_url'				=> $GLOBALS['phpgw']->link('/reports/index.php'),
+				'context_display'		=> $context_display
+			);
+			$p->set_var($var);
+			$p->set_var($this->functions->make_dinamic_lang($p, 'list'));
+			
+
+			$GLOBALS['organizacaodn'] = $_POST['organizacaodn'];
+
+			$contextsdn = $GLOBALS['organizacaodn'];
+
+			// Save query
+			$varorganizacao = explode(",",$contextsdn);
+			$varorganizacao_nome = trim(strtoupper(ereg_replace("ou=","",$varorganizacao[0])));
+			$varorganizacao_nome = trim(strtoupper(ereg_replace("DC=","",$varorganizacao_nome)));
+			$user_logon = $GLOBALS['phpgw_info']['user'][account_lid];
+
+			// carrega os grupos no listbox
+			/************* DESCOMENTE ESTE PARTE DO CODIGO PARA LISTAR TODOS OS GRUPOS, SEM LISTAR POR USUSARIO LOGADO *********** 
+			$sectors_info = $this->functions->get_groups_list($contexts,"*");
+			$sectors_info_dn = $this->functions->get_groups_list_dn($contexts,"*");
+			/* ************************************* FIM *********************************************************************** */
+
+			$sectors_info = $this->functions->get_list_context_logon($user_logon,$contexts,0);
+			$sectors_info_dn = $this->functions->get_list_groups_dn($user_logon,$contexts,0);
+
+			if (!count($sectors_info))
+			{
+				$p->set_var('notselect',lang('No matches found'));
+			}
+			else
+			{
+				foreach($sectors_info as $context=>$sector)
+				{
+					
+					$sectordn = $sectors_info_dn[$context];
+
+					$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+					
+					if ($context == 0 && $contextsdn <> "")
+					{
+						if (trim(strtoupper($varorganizacao_nome)) ==  trim(strtoupper($sector)))
+						{
+							$sector_options .= "<option selected value='" .$contextsdn. "'>" .$varorganizacao_nome. "</option>";
+						}
+						else
+						{
+							$sector_options .= "<option selected value='" .$contextsdn. "'>" .$varorganizacao_nome. "</option>";
+							$sector_options .= "<option value='" . $sectordn . "'>". $sector . "</option>";
+						}
+
+					}
+					else
+					{
+						if ( trim(strtoupper($varorganizacao_nome)) !=  trim(strtoupper($sector)))
+						{
+							$sectorok = trim(strtoupper(ereg_replace("dc=","",$sector)));
+							$sectorok = trim(strtoupper(ereg_replace("dc=","",$sectorok)));
+							$sector_options .= "<option value='" . $sectordn . "'>". $sectorok . "</option>";
+						}
+					}
+
+					$varselect = Array(
+						'tr_color'    	=> $tr_color,
+						'organizacaodn'	=> $contextsdn,
+						'group_name'  	=> $sector_options
+					);					
+				}
+
+				$p->set_var($varselect);
+			}
+
+			// ************** inicio carregar a sub-lista das organizações ****************
+			//Admin make a search
+			if ($GLOBALS['organizacaodn'] != '')
+			{
+				// Conta a quantidade de Listas do grupo raiz
+				$account_maillists = $this->functions->get_list_maillists_sector($contextsdn,$contexts,0);
+				$total_maillists = "(".count($account_maillists).")";
+
+				$p->set_var('organizacao', $varorganizacao_nome);
+				$p->set_var('all_maillists', lang('all'));
+				$p->set_var('total_maillists', $total_maillists);
+
+				$setorg = $contextsdn;
+
+				$groups_info = $this->functions->get_sectors_list($contexts,$setorg);
+
+				if (!count($groups_info))
+				{
+					$p->set_var('message',lang('No sector found'));
+					$p->parse('rows','row_empty',True);				
+				}
+				else
+				{
+					$ii = 0;
+					foreach($groups_info as $context=>$groups)
+					{
+						$explode_groups = explode("#",$groups);
+						$ii = $ii + 1;
+						$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+						$varsuborg = Array(
+							'tr_color'					=> $tr_color,
+							'formname'					=> "form".$ii,
+							'formsubmit'				=> "document.form".$ii.".submit()",
+							'sector_name'				=> $explode_groups[0],
+							'sector_namedn'				=> $explode_groups[1],
+							'sector_namedn_completo'	=> $explode_groups[2],			
+						);					
+
+						$p->set_var($varsuborg);					
+						$p->parse('rows','row',True);
+					}
+				}
+			}
+
+			$p->pfp('out','list');
+		}
+
+		function report_maillists_group_print()
+		{
+			$grouplist = trim($_POST[setor]);
+			$grouplist = trim(ereg_replace("-","",$grouplist));
+			$organizacao = trim($_POST[organizacao]);
+			$setordn = trim($_POST[setordn]);
+			$organizacaodn = trim($_POST[organizacaodn]);
+			$sectornamedncompleto = trim($_POST[sectornamedncompleto]);
+			$Psectornamedncompleto = trim($_POST[Psectornamedncompleto]);
+
+			if ($sectornamedncompleto=="" && $Psectornamedncompleto=="")
+			{			
+				$sectornamedncompleto = $organizacao;
+			}
+			else if ($sectornamedncompleto=="" && $Psectornamedncompleto <> "")
+			{
+				$sectornamedncompleto = $Psectornamedncompleto;
+			}
+			else
+			{
+				$sectornamedncompleto = $organizacao." | ".$sectornamedncompleto;
+			}
+
+			$data_atual = date("d/m/Y"); 
+			$titulo_system = $GLOBALS['phpgw_info']['apps']['reports']['title'];
+			
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $acl['contexts'];
+			foreach ($acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$context_display .= $tmp_context;
+			}
+			// Verifica se o administrador tem acesso.
+			if (!$this->functions->check_acl($account_lid,'list_maillists'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			unset($GLOBALS['phpgw_info']['flags']['noheader']);
+			unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+			$GLOBALS['phpgw_info']['flags']['app_header'] =  $GLOBALS['phpgw_info']['apps']['reports']['title'].' - '.lang('report maillists');
+			$GLOBALS['phpgw']->common->phpgw_header();
+
+			$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+			$p->set_file(Array('accounts' => 'report_maillists_group_print.tpl'));
+			$p->set_block('accounts','body');
+			$p->set_block('accounts','rowpag');
+			$p->set_block('accounts','row');
+			$p->set_block('accounts','row_empty');
+			
+			$var = Array(
+				'bg_color'					=> $GLOBALS['phpgw_info']['theme']['bg_color'],
+				'th_bg'						=> $GLOBALS['phpgw_info']['theme']['th_bg'],
+				'subtitulo'					=> lang('reports title8'),
+				'subtitulo1'				=> $sectornamedncompleto,
+				'context'					=> $raw_context,
+				'titulo'					=> $titulo_system,
+				'data_atual'				=> $data_atual,				
+				'context_display'			=> $context_display,
+				'organizacaodn'				=> $organizacaodn,
+				'organizacao'				=> $organizacao,
+				'sector_name'				=> $grouplist,
+				'sector_namedn'				=> $setordn,
+				'imapDelimiter'				=> $_SESSION['phpgw_info']['expresso']['email_server']['imapDelimiter']
+			);
+
+			$p->set_var($var);
+			$p->set_var($this->functions->make_dinamic_lang($p, 'body'));
+
+			// ************ PAGINAÇÃO *******************************
+
+			// verifica se exixte listas no LDAP
+			$account_info = $this->functions->get_list_maillists_sector($setordn,$contexts,0);				
+			
+			if (!count($account_info))
+			{
+				$p->set_var('message',lang('No maillists found'));
+				$p->parse('rows','row_empty',True);
+			}
+			else if (count($account_info))
+			{ 
+				//url do paginador 
+				$url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/index.php?menuaction=reports.uireports_maillists.report_maillists_print';
+
+				// **** Grupo de paginas ****
+				$gpag = $_POST[gpage];
+
+				$grupopage = 20;
+				
+				if (!$gpag){
+					$gpag  = 1;
+				}
+
+				// recebe o numero da pagina
+				$npag = $_POST[page];
+
+				// verifica se o get com o numero da pagina é nulo
+				if (!$npag)
+				{
+					$npag = 1;
+				}
+
+				// conta total dos registros
+				$numreg = count($account_info);
+				
+				// numero de registro por paginação
+				$numpage = 53;
+				
+				$tp = ceil($numreg/$numpage);
+				$inicio = $page - 1;
+				$inicio = $inicio * $numpage;
+	
+				// valor maximo de paginação
+				$totalnpag =  (int)($tp/$grupopage);
+				$restonpag = $tp % $grupopage;
+
+				if ($restonpag > 0)
+				{
+					$maxtotalnpag = $totalnpag + 1;
+				}
+				else
+				{
+					$maxtotalnpag = $totalnpag;
+				}
+				// inicio fim para imprimir a paginação
+				if( $tp > $grupopage)
+				{
+					// inicio do for da paginação
+					if ($gpag <= ($totalnpag))
+					{
+						$fimgpg = $gpag * $grupopage;
+						$iniciogpg = (($fimgpg - $grupopage)+1);
+					}
+					else
+					{
+						$iniciogpg = (($gpag - 1) * $grupopage);
+						$fimgpg = $iniciogpg + $restonpag;
+					}
+				}
+				else
+				{
+					// inicio do for da paginação
+					$iniciogpg = 1;
+					$fimgpg =  $tp;
+				}
+
+				// Imprime valores de contagen de registro e pagina
+				$p->set_var('cont_maillists',$numreg);
+				$p->set_var('cont_page',$tp);
+				$p->set_var('page_now',$npag);
+
+				// ********** busca no LDAP as informação paginada e imprime ****************
+				$paginas = $this->functions->paginate_maillists($setordn,$contexts,'cn','asc',$npag,$numpage);
+				
+				$tmpp = array();
+				
+				while (list($null,$accountp) = each($paginas))
+				{
+					$tmpp[$accountp['uid'][0]]['account_id']	 = $accountp['uidNumber'][0]; 
+					$tmpp[$accountp['uid'][0]]['account_lid'] = $accountp['uid'][0];
+					$tmpp[$accountp['uid'][0]]['account_cn']	 = $accountp['cn'][0];
+					$tmpp[$accountp['uid'][0]]['account_mail']= $accountp['mail'][0];
+					$sortp[] = $accountp['uid'][0];
+					if (count($sortp))
+					{
+						natcasesort($sortp);
+						foreach ($sortp as $user_uidp)
+						$returnp[$user_uidp] = $tmpp[$user_uidp];
+					}
+				}
+
+				while (list($null,$accountr) = each($returnp))
+				{
+					$this->nextmatchs->template_alternate_row_color($p);
+
+					$varr = array(
+						'row_loginid'	=> $accountr['account_lid'],
+						'row_cn'		=> $accountr['account_cn'],
+						'row_mail'		=> (!$accountr['account_mail']?'<font color=red>Sem E-mail</font>':$accountr['account_mail'])
+					);
+					
+					$p->set_var($varr);
+	
+					$p->parse('rows','row',True);
+				}
+				// ********************** Fim ****************************
+
+				// grupo de pagina anteriores
+				if ($gpag > 1)
+				{
+					$gpaga = $gpag - 1;
+					$varp = Array(
+						'paginat'	=> 	"<form name='anterior' method='POST' action='$url'>
+						<input type='hidden' name='setor' value='$grouplist'>
+						<input type='hidden' name='organizacao' value='$organizacao'>
+						<input type='hidden' name='setordn' value='$setordn'>
+						<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+						<input type='hidden' name='page' value='$npag'>
+						<input type='hidden' name='gpage' value='$gpaga'>
+						<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+						<div style='float:left;' onClick='document.anterior.submit()'><a href='#'>".lang('Previous Pages')."<<&nbsp;&nbsp;&nbsp;</a></div></form>"
+					);
+					$p->set_var($varp);						
+	
+						$p->parse('pages','rowpag',True);
+				}
+				// **** FIM *******
+
+				// imprime a paginação
+				if ($fimgpg > 1)
+				{
+					for($x = $iniciogpg; $x <= $fimgpg; $x++)
+					{
+						$varp = Array(
+							'paginat'	=>  "<form name='form".$x."' method='POST' action='$url'>
+							<input type='hidden' name='setor' value='$grouplist'>
+							<input type='hidden' name='organizacao' value='$organizacao'>
+							<input type='hidden' name='setordn' value='$setordn'>
+							<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+							<input type='hidden' name='page' value='$x'>
+							<input type='hidden' name='gpage' value='$gpag'>
+							<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+							<div style='float:left;' onClick='document.form".$x.".submit()'><a href='#'>$x&nbsp;</a></div></form>"
+						);
+
+						$p->set_var($varp);						
+	
+						$p->parse('pages','rowpag',True);
+					}
+				}
+		
+				// proximo grupo de pagina
+				if ($gpag < $maxtotalnpag && $maxtotalnpag > 0) 
+				{
+					$gpagp = $gpag + 1;
+					$varp = Array(
+						'paginat'	=>  "<form name='proximo' method='POST' action='$url'>
+						<input type='hidden' name='setor' value='$grouplist'>
+						<input type='hidden' name='organizacao' value='$organizacao'>
+						<input type='hidden' name='setordn' value='$setordn'>
+						<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+						<input type='hidden' name='page' value='$npag'>
+						<input type='hidden' name='gpage' value='$gpagp'>
+						<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+						<div style='float:left;' onClick='document.proximo.submit()'><a href='#'>&nbsp;&nbsp;&nbsp;>>".lang('Next Page')."</a></div></form>"
+					);
+					$p->set_var($varp);						
+
+					$p->parse('pages','rowpag',True);
+				}
+
+			// ************************* FIM PAGINAÇÃO ***********************							
+			}
+
+			$p->pfp('out','body');
+		}
+
+		function css()
+		{
+			$appCSS = 
+			'th.activetab
+			{
+				color:#000000;
+				background-color:#D3DCE3;
+				border-top-width : 1px;
+				border-top-style : solid;
+				border-top-color : Black;
+				border-left-width : 1px;
+				border-left-style : solid;
+				border-left-color : Black;
+				border-right-width : 1px;
+				border-right-style : solid;
+				border-right-color : Black;
+				font-size: 12px;
+				font-family: Tahoma, Arial, Helvetica, sans-serif;
+			}
+			
+			th.inactivetab
+			{
+				color:#000000;
+				background-color:#E8F0F0;
+				border-bottom-width : 1px;
+				border-bottom-style : solid;
+				border-bottom-color : Black;
+				font-size: 12px;
+				font-family: Tahoma, Arial, Helvetica, sans-serif;				
+			}
+			
+			.td_left {border-left:1px solid Gray; border-top:1px solid Gray; border-bottom:1px solid Gray;}
+			.td_right {border-right:1px solid Gray; border-top:1px solid Gray; border-bottom:1px solid Gray;}
+			
+			div.activetab{ display:inline; }
+			div.inactivetab{ display:none; }';
+			
+			return $appCSS;
+		}
+
+	}
+?>
Index: /trunk/reports/inc/class.uireports_users.inc.php
===================================================================
--- /trunk/reports/inc/class.uireports_users.inc.php	(revision 5291)
+++ /trunk/reports/inc/class.uireports_users.inc.php	(revision 5291)
@@ -0,0 +1,630 @@
+<?php
+	/*************************************************************************************\
+	* Expresso Relatório                										         *
+	* by Elvio Rufino da Silva (elviosilva@yahoo.com.br, elviosilva@cepromat.mt.gov.br)  *
+	* -----------------------------------------------------------------------------------*
+	*  This program is free software; you can redistribute it and/or modify it			 *
+	*  under the terms of the GNU General Public License as published by the			 *
+	*  Free Software Foundation; either version 2 of the License, or (at your			 *
+	*  option) any later version.														 *
+	*************************************************************************************/
+
+	class uireports_users
+	{
+		var $public_functions = array
+		(
+			'report_users_print_pdf'			=> True,
+			'report_users_group'				=> True,
+			'report_users_group_setor_print'	=> True,
+			'get_user_info'						=> True,
+			'css'								=> True
+		);
+
+		var $nextmatchs;
+		var $user;
+		var $functions;
+		var $current_config;
+		var $ldap_functions;
+		var $db_functions;
+
+		function uireports_users()
+		{
+			$this->user			= CreateObject('reports.user');
+			$this->nextmatchs	= CreateObject('phpgwapi.nextmatchs');
+			$this->functions	= CreateObject('reports.functions');
+			$this->ldap_functions = CreateObject('reports.ldap_functions');
+			$this->db_functions = CreateObject('reports.db_functions');
+			$this->fpdf = CreateObject('reports.uireports_fpdf'); // Class para PDF
+									
+			$c = CreateObject('phpgwapi.config','reports'); // cria o objeto relatorio no $c
+			$c->read_repository(); // na classe config do phpgwapi le os dados da tabela phpgw_config where relatorio, como passagem acima
+			$this->current_config = $c->config_data; // carrega os dados em do array no current_config
+
+			if(!@is_object($GLOBALS['phpgw']->js))
+			{
+				$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
+			}
+			$GLOBALS['phpgw']->js->validate_file('jscode','cc','reports');
+		}
+		
+		function report_users_print_pdf()
+		{
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $acl['contexts'];
+			foreach ($acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$context_display .= $tmp_context;
+			}
+
+
+			if (!$this->functions->check_acl($account_lid,'list_users'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			$grouplist = trim($_POST[setor]);
+			$grouplist = trim(ereg_replace("-","",$grouplist));
+
+			$setordn = trim($_POST[setordn]);
+			$subtitulo1 = trim($_POST[subtitulo]);
+
+			define('FPDF_FONTPATH','font/');
+			$data_atual = date("d/m/Y"); 
+			$titulo_system = $GLOBALS['phpgw_info']['apps']['reports']['title'];			
+
+			$pdf=new uireports_fpdf("L");
+			$pdf->Open();
+			$pdf->AddPage();
+			$pdf->SetTitle('Relatório Gerado pelo Expresso Reports');
+
+			//Set font and colors
+			$pdf->SetFont('Arial','B',14);
+			$pdf->SetFillColor(0,0,0);
+			$pdf->SetTextColor(0,0,200);
+			$pdf->SetDrawColor(0,0,0);
+			$pdf->SetLineWidth(.2);
+
+			//Table header
+			$SubTitulo = lang('reports title2');
+			$SubTituloR = lang('report organization');
+			$SubTitulo1 = $subtitulo1;
+			$GLOBALS['phpgw_info']['apps']['reports']['subtitle'] = $SubTituloR;
+			$pdf->Cell(0,8,$SubTitulo,0,1,'C',0);
+
+
+			//Set font and colors
+			$pdf->SetFont('Arial','B',8);
+			$pdf->SetFillColor(0,0,0);
+			$pdf->SetTextColor(0,0,200);
+			$pdf->SetDrawColor(0,0,0);
+			$pdf->SetLineWidth(.3);
+
+			$pdf->MultiCell(0,3,$SubTitulo1,0,'C',0);
+						
+			$pdf->Cell(0,2,' ',0,1,'C',0);
+			$pdf->Cell(0,5,'Data..: '.$data_atual,0,0,'L',0);
+			$pdf->Cell(0,5,$titulo_system,0,1,'R',0);
+												
+			$account_info = $this->functions->get_list_user_sector($setordn,$contexts,0);
+						
+			if (count($account_info))
+			{ 
+				//Restore font and colors
+				$pdf->SetFont('Arial','',8);
+				$pdf->SetFillColor(224,235,255);
+				$pdf->SetTextColor(0);
+
+				$pdf->Cell(55,5,lang('loginid'),1,0,'L',1);
+				$pdf->Cell(80,5,lang('name'),1,0,'L',1);
+				$pdf->Cell(80,5,lang('report email'),1,0,'L',1);
+				$pdf->Cell(35,5,lang('report phone'),1,0,'L',1);
+				$pdf->Cell(20,5,lang('status'),1,1,'L',1);
+				
+				while (list($null,$account) = each($account_info))
+				{
+						$row_loginid = $account['account_lid'];
+						$row_cn = $account['account_cn'];
+						$row_mail = (!$account['account_mail'] ? '<font color=red>Sem E-mail</font>' : $account['account_mail']);
+						$row_phone = (!$account['account_phone'] ? '-' : $account['account_phone']);
+						$row_status = $account['account_accountstatus'] == 'active' ? 'Ativado' : 'Desativado';
+						$pdf->Cell(55,5,$row_loginid,0,0,'L',0);
+						$pdf->Cell(80,5,$row_cn,0,0,'L',0);
+						$pdf->Cell(80,5,$row_mail,0,0,'L',0);
+						$pdf->Cell(35,5,$row_phone,0,0,'L',0);
+					if ($row_status == 'Ativado')
+					{
+						//Restaura cor fonte
+						$pdf->SetTextColor(0);
+						$pdf->Cell(20,5,$row_status,0,1,'L',0);
+					}
+					else
+					{
+						//Muda cor fonte
+						$pdf->SetTextColor(256,0,0);
+						$pdf->Cell(20,5,$row_status,0,1,'L',0);					
+						//Restaura cor fonte
+						$pdf->SetTextColor(0);
+					}
+				}
+			}
+
+			$pdf->Output();
+
+			return; 
+		}
+
+		function report_users_group()
+		{
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$manager_acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $manager_acl['contexts'];
+			$conta_context = count($manager_acl['contexts_display']);
+			foreach ($manager_acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$index = $index +1;
+
+				if ($conta_context == $index)
+				{
+					$context_display .= $tmp_context;
+				}
+				else
+				{
+					$context_display .= $tmp_context.'&nbsp;|&nbsp;';
+				}
+			}
+			
+			// Verifica se tem acesso a este modulo
+			if (!$this->functions->check_acl($account_lid,'list_sectors'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			unset($GLOBALS['phpgw_info']['flags']['noheader']);
+			unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+			
+			$GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['reports']['title'].' - '.lang('report organization');
+			$GLOBALS['phpgw']->common->phpgw_header();
+
+			$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+			$p->set_file(array('groups'   => 'report_users_group.tpl'));
+			$p->set_block('groups','list','list');
+			$p->set_block('groups','row','row');
+			$p->set_block('groups','row_empty','row_empty');
+
+			// Seta as variaveis padroes.
+			$var = Array(
+				'th_bg'					=> $GLOBALS['phpgw_info']['theme']['th_bg'],
+				'back_url'				=> $GLOBALS['phpgw']->link('/reports/index.php'),
+				'context_display'		=> $context_display
+			);
+			$p->set_var($var);
+			$p->set_var($this->functions->make_dinamic_lang($p, 'list'));
+			
+
+			$GLOBALS['organizacaodn'] = $_POST['organizacaodn'];
+
+			$contextsdn = $GLOBALS['organizacaodn'];
+
+			// Save query
+			$varorganizacao = explode(",",$contextsdn);
+			$varorganizacao_nome = trim(strtoupper(ereg_replace("ou=","",$varorganizacao[0])));
+			$varorganizacao_nome = trim(strtoupper(ereg_replace("DC=","",$varorganizacao_nome)));
+			$user_logon = $GLOBALS['phpgw_info']['user'][account_lid];
+
+			// carrega os grupos no listbox
+			/************* DESCOMENTE ESTE PARTE DO CODIGO PARA LISTAR TODOS OS GRUPOS, SEM LISTAR POR USUSARIO LOGADO *********** 
+			$sectors_info = $this->functions->get_groups_list($contexts,"*");
+			$sectors_info_dn = $this->functions->get_groups_list_dn($contexts,"*");
+			/* ************************************* FIM *********************************************************************** */
+
+			$sectors_info = $this->functions->get_list_context_logon($user_logon,$contexts,0);
+			$sectors_info_dn = $this->functions->get_list_groups_dn($user_logon,$contexts,0);
+
+			if (!count($sectors_info))
+			{
+				$p->set_var('notselect',lang('No matches found'));
+			}
+			else
+			{
+				foreach($sectors_info as $context=>$sector)
+				{
+					
+					$sectordn = $sectors_info_dn[$context];
+
+					$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+					
+					if ($context == 0 && $contextsdn <> "")
+					{
+						if (trim(strtoupper($varorganizacao_nome)) ==  trim(strtoupper($sector)))
+						{
+							$sector_options .= "<option selected value='" .$contextsdn. "'>" .$varorganizacao_nome. "</option>";
+						}
+						else
+						{
+							$sector_options .= "<option selected value='" .$contextsdn. "'>" .$varorganizacao_nome. "</option>";
+							$sector_options .= "<option value='" . $sectordn . "'>". $sector . "</option>";
+						}
+
+					}
+					else
+					{
+						if ( trim(strtoupper($varorganizacao_nome)) !=  trim(strtoupper($sector)))
+						{
+							$sectorok = trim(strtoupper(ereg_replace("dc=","",$sector)));
+							$sectorok = trim(strtoupper(ereg_replace("dc=","",$sectorok)));
+							$sector_options .= "<option value='" . $sectordn . "'>". $sectorok . "</option>";
+						}
+					}
+
+					$varselect = Array(
+						'tr_color'    	=> $tr_color,
+						'organizacaodn'	=> $contextsdn,
+						'group_name'  	=> $sector_options
+					);					
+				}
+
+				$p->set_var($varselect);
+			}
+
+			// ************** inicio carregar a sub-lista das organizações ****************
+			//Admin make a search
+			if ($GLOBALS['organizacaodn'] != '')
+			{
+				// Conta a quantidade de Usuario do grupo raiz
+				$account_user = $this->functions->get_count_user_sector($contextsdn,$contexts,0);
+				$totaluser = "(".$account_user.")";
+
+				$p->set_var('organizacao', $varorganizacao_nome);
+				$p->set_var('all_user', lang('all'));
+				$p->set_var('total_user', $totaluser);
+
+				$setorg = $contextsdn;
+
+				$groups_info = $this->functions->get_sectors_list($contexts,$setorg);
+
+				if (!count($groups_info))
+				{
+					$p->set_var('message',lang('No sector found'));
+					$p->parse('rows','row_empty',True);				
+				}
+				else
+				{
+					$ii = 0;
+					foreach($groups_info as $context=>$groups)
+					{
+						$explode_groups = explode("#",$groups);
+						$ii = $ii + 1;
+						$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+						$varsuborg = Array(
+							'tr_color'					=> $tr_color,
+							'formname'					=> "form".$ii,
+							'formsubmit'				=> "document.form".$ii.".submit()",
+							'sector_name'				=> $explode_groups[0],
+							'sector_namedn'				=> $explode_groups[1],
+							'sector_namedn_completo'	=> $explode_groups[2],			
+						);					
+
+						$p->set_var($varsuborg);					
+						$p->parse('rows','row',True);
+					}
+				}
+			}
+
+			$p->pfp('out','list');
+		}
+
+		function report_users_group_setor_print()
+		{
+			$grouplist = trim($_POST[setor]);
+			$grouplist = trim(ereg_replace("-","",$grouplist));
+			$organizacao = trim($_POST[organizacao]);
+			$setordn = trim($_POST[setordn]);
+			$organizacaodn = trim($_POST[organizacaodn]);
+			$sectornamedncompleto = trim($_POST[sectornamedncompleto]);
+			$Psectornamedncompleto = trim($_POST[Psectornamedncompleto]);
+
+			if ($sectornamedncompleto=="" && $Psectornamedncompleto=="")
+			{			
+				$sectornamedncompleto = $organizacao;
+			}
+			else if ($sectornamedncompleto=="" && $Psectornamedncompleto <> "")
+			{
+				$sectornamedncompleto = $Psectornamedncompleto;
+			}
+			else
+			{
+				$sectornamedncompleto = $organizacao." | ".$sectornamedncompleto;
+			}
+
+			$data_atual = date("d/m/Y"); 
+			$titulo_system = $GLOBALS['phpgw_info']['apps']['reports']['title'];
+			
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $acl['contexts'];
+			foreach ($acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$context_display .= $tmp_context;
+			}
+			// Verifica se o administrador tem acesso.
+			if (!$this->functions->check_acl($account_lid,'list_users'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			unset($GLOBALS['phpgw_info']['flags']['noheader']);
+			unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+			$GLOBALS['phpgw_info']['flags']['app_header'] =  $GLOBALS['phpgw_info']['apps']['reports']['title'].' - '.lang('report user');
+			$GLOBALS['phpgw']->common->phpgw_header();
+
+			$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+			$p->set_file(Array('accounts' => 'report_users_group_print.tpl'));
+			$p->set_block('accounts','body');
+			$p->set_block('accounts','rowpag');
+			$p->set_block('accounts','row');
+			$p->set_block('accounts','row_empty');
+			
+			$var = Array(
+				'bg_color'					=> $GLOBALS['phpgw_info']['theme']['bg_color'],
+				'th_bg'						=> $GLOBALS['phpgw_info']['theme']['th_bg'],
+				'subtitulo'					=> lang('reports title2'),
+				'subtitulo1'				=> $sectornamedncompleto,
+				'context'					=> $raw_context,
+				'titulo'					=> $titulo_system,
+				'data_atual'				=> $data_atual,				
+				'context_display'			=> $context_display,
+				'organizacaodn'				=> $organizacaodn,
+				'organizacao'				=> $organizacao,
+				'sector_name'				=> $grouplist,
+				'sector_namedn'				=> $setordn,
+				'imapDelimiter'				=> $_SESSION['phpgw_info']['expresso']['email_server']['imapDelimiter']
+			);
+
+			$p->set_var($var);
+			$p->set_var($this->functions->make_dinamic_lang($p, 'body'));
+
+			// ************ PAGINAÇÃO *******************************
+
+			// verifica se exixte usuarios no LDAP
+			$account_info = $this->functions->get_list_user_sector($setordn,$contexts,0);
+
+			if (!count($account_info))
+			{
+				$p->set_var('message',lang('No user found'));
+				$p->parse('rows','row_empty',True);
+			}
+			else if (count($account_info))
+			{ 
+				//url do paginador 
+				$url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/index.php?menuaction=reports.uireports_users.report_users_group_setor_print';
+
+				// **** Grupo de paginas ****
+				$gpag = $_POST[gpage];
+
+				$grupopage = 20;
+				
+				if (!$gpag){
+					$gpag  = 1;
+				}
+
+				// recebe o numero da pagina
+				$npag = $_POST[page];
+
+				// verifica se o get com o numero da pagina é nulo
+				if (!$npag)
+				{
+					$npag = 1;
+				}
+
+				// conta total dos registros
+				$numreg = count($account_info);
+				
+				// numero de registro por paginação
+				$numpage = 53;
+				
+				$tp = ceil($numreg/$numpage);
+				$inicio = $page - 1;
+				$inicio = $inicio * $numpage;
+	
+				// valor maximo de paginação
+				$totalnpag =  (int)($tp/$grupopage);
+				$restonpag = $tp % $grupopage;
+
+				if ($restonpag > 0)
+				{
+					$maxtotalnpag = $totalnpag + 1;
+				}
+				else
+				{
+					$maxtotalnpag = $totalnpag;
+				}
+				// inicio fim para imprimir a paginação
+				if( $tp > $grupopage)
+				{
+					// inicio do for da paginação
+					if ($gpag <= ($totalnpag))
+					{
+						$fimgpg = $gpag * $grupopage;
+						$iniciogpg = (($fimgpg - $grupopage)+1);
+					}
+					else
+					{
+						$iniciogpg = (($gpag - 1) * $grupopage);
+						$fimgpg = $iniciogpg + $restonpag;
+					}
+				}
+				else
+				{
+					// inicio do for da paginação
+					$iniciogpg = 1;
+					$fimgpg =  $tp;
+				}
+
+				// Imprime valores de contagen de registro e pagina
+				$p->set_var('cont_user',$numreg);
+				$p->set_var('cont_page',$tp);
+				$p->set_var('page_now',$npag);
+
+				// ********** busca no LDAP as informação paginada e imprime ****************
+				$paginas = $this->functions->Paginate_user('accounts',$setordn,$contexts,'cn','asc',$npag,$numpage);
+
+				$tmpp = array();
+
+				while (list($null,$accountp) = each($paginas))
+				{
+					$tmpp[$accountp['uid'][0]]['account_id']	 = $accountp['uidNumber'][0]; 
+					$tmpp[$accountp['uid'][0]]['account_lid'] = $accountp['uid'][0];
+					$tmpp[$accountp['uid'][0]]['account_cn']	 = $accountp['cn'][0];
+					$tmpp[$accountp['uid'][0]]['account_phone']	 = $accountp['telephoneNumber'][0];
+					$tmpp[$accountp['uid'][0]]['account_status']= $accountp['accountStatus'][0];
+					$tmpp[$accountp['uid'][0]]['account_mail']= $accountp['mail'][0];
+					$sortp[] = $accountp['uid'][0];
+					if (count($sortp))
+					{
+						natcasesort($sortp);
+						foreach ($sortp as $user_uidp)
+						$returnp[$user_uidp] = $tmpp[$user_uidp];
+					}
+				}
+
+				while (list($null,$accountr) = each($returnp))
+				{
+					$this->nextmatchs->template_alternate_row_color($p);
+
+					$varr = array(
+						'row_loginid'	=> $accountr['account_lid'],
+						'row_cn'		=> $accountr['account_cn'],
+						'row_status'	=> $accountr['account_status'] == 'active' ? '<font color="#0033FF">Ativado</font> ' : '<font color="#FF0000">Desativado</font>',
+						'row_phone'		=> (!$accountr['account_phone'] ? '-' : $accountr['account_phone']),
+						'row_mail'		=> (!$accountr['account_mail'] ? '<font color=red>Sem E-mail</font>' : $accountr['account_mail'])
+					);
+					
+					$p->set_var($varr);
+	
+					$p->parse('rows','row',True);
+				}
+				// ********************** Fim ****************************
+
+				// grupo de pagina anteriores
+				if ($gpag > 1)
+				{
+					$gpaga = $gpag - 1;
+					$varp = Array(
+						'paginat'	=> 	"<form name='anterior' method='POST' action='$url'>
+						<input type='hidden' name='setor' value='$grouplist'>
+						<input type='hidden' name='organizacao' value='$organizacao'>
+						<input type='hidden' name='setordn' value='$setordn'>
+						<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+						<input type='hidden' name='page' value='$npag'>
+						<input type='hidden' name='gpage' value='$gpaga'>
+						<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+						<div style='float:left;' onClick='document.anterior.submit()'><a href='#'>".lang('Previous Pages')."<<&nbsp;&nbsp;&nbsp;</a></div></form>"
+					);
+					$p->set_var($varp);						
+	
+						$p->parse('pages','rowpag',True);
+				}
+				// **** FIM *******
+
+				// imprime a paginação
+				if ($fimgpg > 1)
+				{
+					for($x = $iniciogpg; $x <= $fimgpg; $x++)
+					{
+						$varp = Array(
+							'paginat'	=>  "<form name='form".$x."' method='POST' action='$url'>
+							<input type='hidden' name='setor' value='$grouplist'>
+							<input type='hidden' name='organizacao' value='$organizacao'>
+							<input type='hidden' name='setordn' value='$setordn'>
+							<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+							<input type='hidden' name='page' value='$x'>
+							<input type='hidden' name='gpage' value='$gpag'>
+							<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+							<div style='float:left;' onClick='document.form".$x.".submit()'><a href='#'>$x&nbsp;</a></div></form>"
+						);
+
+						$p->set_var($varp);						
+	
+						$p->parse('pages','rowpag',True);
+					}
+				}
+		
+				// proximo grupo de pagina
+				if ($gpag < $maxtotalnpag && $maxtotalnpag > 0) 
+				{
+					$gpagp = $gpag + 1;
+					$varp = Array(
+						'paginat'	=>  "<form name='proximo' method='POST' action='$url'>
+						<input type='hidden' name='setor' value='$grouplist'>
+						<input type='hidden' name='organizacao' value='$organizacao'>
+						<input type='hidden' name='setordn' value='$setordn'>
+						<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+						<input type='hidden' name='page' value='$npag'>
+						<input type='hidden' name='gpage' value='$gpagp'>
+						<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+						<div style='float:left;' onClick='document.proximo.submit()'><a href='#'>&nbsp;&nbsp;&nbsp;>>".lang('Next Page')."</a></div></form>"
+					);
+					$p->set_var($varp);						
+
+					$p->parse('pages','rowpag',True);
+				}
+
+			// ************************* FIM PAGINAÇÃO ***********************							
+			}
+
+			$p->pfp('out','body');
+		}
+
+		function get_user_info($userdn,$usercontexts,$usersizelimit)
+		{
+			$user_info = $this->functions->Paginate_user('accounts',$setordn,$contexts,'cn','asc',$npag,$numpage);
+
+			return $user_info;
+		}
+
+		function css()
+		{
+			$appCSS = 
+			'th.activetab
+			{
+				color:#000000;
+				background-color:#D3DCE3;
+				border-top-width : 1px;
+				border-top-style : solid;
+				border-top-color : Black;
+				border-left-width : 1px;
+				border-left-style : solid;
+				border-left-color : Black;
+				border-right-width : 1px;
+				border-right-style : solid;
+				border-right-color : Black;
+				font-size: 12px;
+				font-family: Tahoma, Arial, Helvetica, sans-serif;
+			}
+			
+			th.inactivetab
+			{
+				color:#000000;
+				background-color:#E8F0F0;
+				border-bottom-width : 1px;
+				border-bottom-style : solid;
+				border-bottom-color : Black;
+				font-size: 12px;
+				font-family: Tahoma, Arial, Helvetica, sans-serif;				
+			}
+			
+			.td_left {border-left:1px solid Gray; border-top:1px solid Gray; border-bottom:1px solid Gray;}
+			.td_right {border-right:1px solid Gray; border-top:1px solid Gray; border-bottom:1px solid Gray;}
+			
+			div.activetab{ display:inline; }
+			div.inactivetab{ display:none; }';
+			
+			return $appCSS;
+		}
+
+	}
+?>
Index: /trunk/reports/inc/class.uireports_usersgroups.inc.php
===================================================================
--- /trunk/reports/inc/class.uireports_usersgroups.inc.php	(revision 5291)
+++ /trunk/reports/inc/class.uireports_usersgroups.inc.php	(revision 5291)
@@ -0,0 +1,596 @@
+<?php
+	/*************************************************************************************\
+	* Expresso Relatório                										         *
+	* by Elvio Rufino da Silva (elviosilva@yahoo.com.br, elviosilva@cepromat.mt.gov.br)  *
+	* -----------------------------------------------------------------------------------*
+	*  This program is free software; you can redistribute it and/or modify it			 *
+	*  under the terms of the GNU General Public License as published by the			 *
+	*  Free Software Foundation; either version 2 of the License, or (at your			 *
+	*  option) any later version.														 *
+	*************************************************************************************/
+
+	class uireports_usersgroups
+	{
+		var $public_functions = array
+		(
+			'report_usersgroups_group_print_pdf'	=> True,
+			'report_usersgroups_group'				=> True,
+			'report_usersgroups_group_print'		=> True,
+			'get_usersgroups_info'					=> True,
+			'css'									=> True
+		);
+
+		var $nextmatchs;
+		var $user;
+		var $functions;
+		var $current_config;
+		var $ldap_functions;
+		var $db_functions;
+
+		function uireports_usersgroups()
+		{
+			$this->user			= CreateObject('reports.user');
+			$this->nextmatchs	= CreateObject('phpgwapi.nextmatchs');
+			$this->functions	= CreateObject('reports.functions');
+			$this->ldap_functions = CreateObject('reports.ldap_functions');
+			$this->db_functions = CreateObject('reports.db_functions');
+			$this->fpdf = CreateObject('reports.uireports_fpdf'); // Class para PDF
+									
+			$c = CreateObject('phpgwapi.config','reports'); // cria o objeto relatorio no $c
+			$c->read_repository(); // na classe config do phpgwapi le os dados da tabela phpgw_config where relatorio, como passagem acima
+			$this->current_config = $c->config_data; // carrega os dados em do array no current_config
+
+			if(!@is_object($GLOBALS['phpgw']->js))
+			{
+				$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
+			}
+			$GLOBALS['phpgw']->js->validate_file('jscode','cc','reports');
+		}
+		
+		function report_usersgroups_group_print_pdf()
+		{
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $acl['contexts'];
+			foreach ($acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$context_display .= $tmp_context;
+			}
+
+
+			if (!$this->functions->check_acl($account_lid,'list_groups'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			$grouplist = trim($_POST[setor]);
+			$grouplist = trim(ereg_replace("-","",$grouplist));
+
+			$setordn = trim($_POST[setordn]);
+			$subtitulo1 = trim($_POST[subtitulo]);
+
+			define('FPDF_FONTPATH','font/');
+			$data_atual = date("d/m/Y"); 
+			$titulo_system = $GLOBALS['phpgw_info']['apps']['reports']['title'];			
+
+			$pdf=new uireports_fpdf();
+			$pdf->Open();
+			$pdf->AddPage();
+			$pdf->SetTitle('Relatório Gerado pelo Expresso Reports');
+
+			//Set font and colors
+			$pdf->SetFont('Arial','B',14);
+			$pdf->SetFillColor(0,0,0);
+			$pdf->SetTextColor(0,0,200);
+			$pdf->SetDrawColor(0,0,0);
+			$pdf->SetLineWidth(.2);
+
+			//Table header
+			$SubTitulo = lang('reports title10');
+			$SubTituloR = lang('report organization');
+			$SubTitulo1 = $subtitulo1;
+			$GLOBALS['phpgw_info']['apps']['reports']['subtitle'] = $SubTituloR;
+			$pdf->Cell(0,8,$SubTitulo,0,1,'C',0);
+
+
+			//Set font and colors
+			$pdf->SetFont('Arial','B',8);
+			$pdf->SetFillColor(0,0,0);
+			$pdf->SetTextColor(0,0,200);
+			$pdf->SetDrawColor(0,0,0);
+			$pdf->SetLineWidth(.3);
+
+			$pdf->MultiCell(0,3,$SubTitulo1,0,'C',0);
+						
+			$pdf->Cell(0,2,' ',0,1,'C',0);
+			$pdf->Cell(0,5,'Data..: '.$data_atual,0,0,'L',0);
+			$pdf->Cell(0,5,$titulo_system,0,1,'R',0);
+												
+			$account_info = $this->functions->get_list_usersgroups_sector($setordn,$contexts,0);
+						
+			if (count($account_info))
+			{ 
+				//Restore font and colors
+				$pdf->SetFont('Arial','',8);
+				$pdf->SetFillColor(224,235,255);
+				$pdf->SetTextColor(0);
+
+				$pdf->Cell(40,5,lang('report id'),1,0,'L',1);
+				$pdf->Cell(75,5,lang('name'),1,0,'L',1);
+				$pdf->Cell(75,5,lang('report description'),1,1,'L',1);
+				
+				while (list($null,$account) = each($account_info))
+				{
+					$pdf->Cell(40,5,$account['id'],0,0,'L',0);
+					$pdf->Cell(75,5,$account['name'],0,0,'L',0);
+					$pdf->Cell(75,5,$account['description'],0,1,'L',0);
+				}
+			}
+
+			$pdf->Output();
+
+			return; 
+		}
+
+		function report_usersgroups_group()
+		{
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$manager_acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $manager_acl['contexts'];
+			$conta_context = count($manager_acl['contexts_display']);
+			foreach ($manager_acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$index = $index +1;
+
+				if ($conta_context == $index)
+				{
+					$context_display .= $tmp_context;
+				}
+				else
+				{
+					$context_display .= $tmp_context.'&nbsp;|&nbsp;';
+				}
+			}
+			
+			// Verifica se tem acesso a este modulo
+			if (!$this->functions->check_acl($account_lid,'list_sectors'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			unset($GLOBALS['phpgw_info']['flags']['noheader']);
+			unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+			
+			$GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['reports']['title'].' - '.lang('report usersgroups');
+			$GLOBALS['phpgw']->common->phpgw_header();
+
+			$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+			$p->set_file(array('groups'   => 'report_usersgroups_group.tpl'));
+			$p->set_block('groups','list','list');
+			$p->set_block('groups','row','row');
+			$p->set_block('groups','row_empty','row_empty');
+
+			// Seta as variaveis padroes.
+			$var = Array(
+				'th_bg'					=> $GLOBALS['phpgw_info']['theme']['th_bg'],
+				'back_url'				=> $GLOBALS['phpgw']->link('/reports/index.php'),
+				'context_display'		=> $context_display
+			);
+			$p->set_var($var);
+			$p->set_var($this->functions->make_dinamic_lang($p, 'list'));
+			
+
+			$GLOBALS['organizacaodn'] = $_POST['organizacaodn'];
+
+			$contextsdn = $GLOBALS['organizacaodn'];
+
+			// Save query
+			$varorganizacao = explode(",",$contextsdn);
+			$varorganizacao_nome = trim(strtoupper(ereg_replace("ou=","",$varorganizacao[0])));
+			$varorganizacao_nome = trim(strtoupper(ereg_replace("DC=","",$varorganizacao_nome)));
+			$user_logon = $GLOBALS['phpgw_info']['user'][account_lid];
+
+			// carrega os grupos no listbox
+			/************* DESCOMENTE ESTE PARTE DO CODIGO PARA LISTAR TODOS OS GRUPOS, SEM LISTAR POR USUSARIO LOGADO *********** 
+			$sectors_info = $this->functions->get_groups_list($contexts,"*");
+			$sectors_info_dn = $this->functions->get_groups_list_dn($contexts,"*");
+			/* ************************************* FIM *********************************************************************** */
+
+			$sectors_info = $this->functions->get_list_context_logon($user_logon,$contexts,0);
+			$sectors_info_dn = $this->functions->get_list_groups_dn($user_logon,$contexts,0);
+
+			if (!count($sectors_info))
+			{
+				$p->set_var('notselect',lang('No matches found'));
+			}
+			else
+			{
+				foreach($sectors_info as $context=>$sector)
+				{
+					
+					$sectordn = $sectors_info_dn[$context];
+
+					$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+					
+					if ($context == 0 && $contextsdn <> "")
+					{
+						if (trim(strtoupper($varorganizacao_nome)) ==  trim(strtoupper($sector)))
+						{
+							$sector_options .= "<option selected value='" .$contextsdn. "'>" .$varorganizacao_nome. "</option>";
+						}
+						else
+						{
+							$sector_options .= "<option selected value='" .$contextsdn. "'>" .$varorganizacao_nome. "</option>";
+							$sector_options .= "<option value='" . $sectordn . "'>". $sector . "</option>";
+						}
+
+					}
+					else
+					{
+						if ( trim(strtoupper($varorganizacao_nome)) !=  trim(strtoupper($sector)))
+						{
+							$sectorok = trim(strtoupper(ereg_replace("dc=","",$sector)));
+							$sectorok = trim(strtoupper(ereg_replace("dc=","",$sectorok)));
+							$sector_options .= "<option value='" . $sectordn . "'>". $sectorok . "</option>";
+						}
+					}
+
+					$varselect = Array(
+						'tr_color'    	=> $tr_color,
+						'organizacaodn'	=> $contextsdn,
+						'group_name'  	=> $sector_options
+					);					
+				}
+
+				$p->set_var($varselect);
+			}
+
+			// ************** inicio carregar a sub-lista das organizações ****************
+			//Admin make a search
+			if ($GLOBALS['organizacaodn'] != '')
+			{
+				// Conta a quantidade de Listas do grupo raiz
+				$account_usersgroups = $this->functions->get_list_usersgroups_sector($contextsdn,$contexts,0);
+				$total_usersgroups = "(".count($account_usersgroups).")";
+
+				$p->set_var('organizacao', $varorganizacao_nome);
+				$p->set_var('all_usersgroups', lang('all'));
+				$p->set_var('total_usersgroups', $total_usersgroups);
+
+				$setorg = $contextsdn;
+
+				$groups_info = $this->functions->get_sectors_list($contexts,$setorg);
+
+				if (!count($groups_info))
+				{
+					$p->set_var('message',lang('No sector found'));
+					$p->parse('rows','row_empty',True);				
+				}
+				else
+				{
+					$ii = 0;
+					foreach($groups_info as $context=>$groups)
+					{
+						$explode_groups = explode("#",$groups);
+						$ii = $ii + 1;
+						$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+						$varsuborg = Array(
+							'tr_color'					=> $tr_color,
+							'formname'					=> "form".$ii,
+							'formsubmit'				=> "document.form".$ii.".submit()",
+							'sector_name'				=> $explode_groups[0],
+							'sector_namedn'				=> $explode_groups[1],
+							'sector_namedn_completo'	=> $explode_groups[2],			
+						);					
+
+						$p->set_var($varsuborg);					
+						$p->parse('rows','row',True);
+					}
+				}
+			}
+
+			$p->pfp('out','list');
+		}
+
+		function report_usersgroups_group_print()
+		{
+			$grouplist = trim($_POST[setor]);
+			$grouplist = trim(ereg_replace("-","",$grouplist));
+			$organizacao = trim($_POST[organizacao]);
+			$setordn = trim($_POST[setordn]);
+			$organizacaodn = trim($_POST[organizacaodn]);
+			$sectornamedncompleto = trim($_POST[sectornamedncompleto]);
+			$Psectornamedncompleto = trim($_POST[Psectornamedncompleto]);
+
+			if ($sectornamedncompleto=="" && $Psectornamedncompleto=="")
+			{			
+				$sectornamedncompleto = $organizacao;
+			}
+			else if ($sectornamedncompleto=="" && $Psectornamedncompleto <> "")
+			{
+				$sectornamedncompleto = $Psectornamedncompleto;
+			}
+			else
+			{
+				$sectornamedncompleto = $organizacao." | ".$sectornamedncompleto;
+			}
+
+			$data_atual = date("d/m/Y"); 
+			$titulo_system = $GLOBALS['phpgw_info']['apps']['reports']['title'];
+			
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $acl['contexts'];
+			foreach ($acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$context_display .= $tmp_context;
+			}
+			// Verifica se o administrador tem acesso.
+			if (!$this->functions->check_acl($account_lid,'list_groups'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			unset($GLOBALS['phpgw_info']['flags']['noheader']);
+			unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+			$GLOBALS['phpgw_info']['flags']['app_header'] =  $GLOBALS['phpgw_info']['apps']['reports']['title'].' - '.lang('report usersgroups');
+			$GLOBALS['phpgw']->common->phpgw_header();
+
+			$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+			$p->set_file(Array('accounts' => 'report_usersgroups_group_print.tpl'));
+			$p->set_block('accounts','body');
+			$p->set_block('accounts','rowpag');
+			$p->set_block('accounts','row');
+			$p->set_block('accounts','row_empty');
+			
+			$var = Array(
+				'bg_color'					=> $GLOBALS['phpgw_info']['theme']['bg_color'],
+				'th_bg'						=> $GLOBALS['phpgw_info']['theme']['th_bg'],
+				'subtitulo'					=> lang('reports title10'),
+				'subtitulo1'				=> $sectornamedncompleto,
+				'context'					=> $raw_context,
+				'titulo'					=> $titulo_system,
+				'data_atual'				=> $data_atual,				
+				'context_display'			=> $context_display,
+				'organizacaodn'				=> $organizacaodn,
+				'organizacao'				=> $organizacao,
+				'sector_name'				=> $grouplist,
+				'sector_namedn'				=> $setordn,
+				'imapDelimiter'				=> $_SESSION['phpgw_info']['expresso']['email_server']['imapDelimiter']
+			);
+
+			$p->set_var($var);
+			$p->set_var($this->functions->make_dinamic_lang($p, 'body'));
+
+			// ************ PAGINAÇÃO *******************************
+
+			// verifica se exixte listas no LDAP
+			$account_info = $this->functions->get_list_usersgroups_sector($setordn,$contexts,0);				
+			
+			if (!count($account_info))
+			{
+				$p->set_var('message',lang('No usersgroups found'));
+				$p->parse('rows','row_empty',True);
+			}
+			else if (count($account_info))
+			{ 
+				//url do paginador 
+				$url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/index.php?menuaction=reports.uireports_usersgroups.report_usersgroups_print';
+
+				// **** Grupo de paginas ****
+				$gpag = $_POST[gpage];
+
+				$grupopage = 20;
+				
+				if (!$gpag){
+					$gpag  = 1;
+				}
+
+				// recebe o numero da pagina
+				$npag = $_POST[page];
+
+				// verifica se o get com o numero da pagina é nulo
+				if (!$npag)
+				{
+					$npag = 1;
+				}
+
+				// conta total dos registros
+				$numreg = count($account_info);
+				
+				// numero de registro por paginação
+				$numpage = 53;
+				
+				$tp = ceil($numreg/$numpage);
+				$inicio = $page - 1;
+				$inicio = $inicio * $numpage;
+	
+				// valor maximo de paginação
+				$totalnpag =  (int)($tp/$grupopage);
+				$restonpag = $tp % $grupopage;
+
+				if ($restonpag > 0)
+				{
+					$maxtotalnpag = $totalnpag + 1;
+				}
+				else
+				{
+					$maxtotalnpag = $totalnpag;
+				}
+				// inicio fim para imprimir a paginação
+				if( $tp > $grupopage)
+				{
+					// inicio do for da paginação
+					if ($gpag <= ($totalnpag))
+					{
+						$fimgpg = $gpag * $grupopage;
+						$iniciogpg = (($fimgpg - $grupopage)+1);
+					}
+					else
+					{
+						$iniciogpg = (($gpag - 1) * $grupopage);
+						$fimgpg = $iniciogpg + $restonpag;
+					}
+				}
+				else
+				{
+					// inicio do for da paginação
+					$iniciogpg = 1;
+					$fimgpg =  $tp;
+				}
+
+				// Imprime valores de contagen de registro e pagina
+				$p->set_var('cont_usersgroups',$numreg);
+				$p->set_var('cont_page',$tp);
+				$p->set_var('page_now',$npag);
+				
+				// ********** busca no LDAP as informação paginada e imprime ****************
+				$paginas = $this->functions->paginate_usersgroups($setordn,$contexts,'cn','asc',$npag,$numpage);
+				
+				$tmpp = array();
+				
+				while (list($null,$accountp) = each($paginas))
+				{
+					$tmpp[$accountp['cn'][0]]['id']	 			= $accountp['gidNumber'][0]; 
+					$tmpp[$accountp['cn'][0]]['name']	 		= $accountp['cn'][0];
+					$tmpp[$accountp['cn'][0]]['description']	= $accountp['description'][0];
+					$sortp[] = $accountp['cn'][0];
+					if (count($sortp))
+					{
+						natcasesort($sortp);
+						foreach ($sortp as $user_uidp)
+						$returnp[$user_uidp] = $tmpp[$user_uidp];
+					}
+				}
+
+				while (list($null,$accountr) = each($returnp))
+				{
+					$this->nextmatchs->template_alternate_row_color($p);
+
+					$varr = array(
+						'row_id'			=> $accountr['id'],
+						'row_name'			=> $accountr['name'],
+						'row_description'	=> $accountr['description']
+					);
+					
+					$p->set_var($varr);
+	
+					$p->parse('rows','row',True);
+				}
+				// ********************** Fim ****************************
+
+				// grupo de pagina anteriores
+				if ($gpag > 1)
+				{
+					$gpaga = $gpag - 1;
+					$varp = Array(
+						'paginat'	=> 	"<form name='anterior' method='POST' action='$url'>
+						<input type='hidden' name='setor' value='$grouplist'>
+						<input type='hidden' name='organizacao' value='$organizacao'>
+						<input type='hidden' name='setordn' value='$setordn'>
+						<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+						<input type='hidden' name='page' value='$npag'>
+						<input type='hidden' name='gpage' value='$gpaga'>
+						<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+						<div style='float:left;' onClick='document.anterior.submit()'><a href='#'>".lang('Previous Pages')."<<&nbsp;&nbsp;&nbsp;</a></div></form>"
+					);
+					$p->set_var($varp);						
+	
+						$p->parse('pages','rowpag',True);
+				}
+				// **** FIM *******
+
+				// imprime a paginação
+				if ($fimgpg > 1)
+				{
+					for($x = $iniciogpg; $x <= $fimgpg; $x++)
+					{
+						$varp = Array(
+							'paginat'	=>  "<form name='form".$x."' method='POST' action='$url'>
+							<input type='hidden' name='setor' value='$grouplist'>
+							<input type='hidden' name='organizacao' value='$organizacao'>
+							<input type='hidden' name='setordn' value='$setordn'>
+							<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+							<input type='hidden' name='page' value='$x'>
+							<input type='hidden' name='gpage' value='$gpag'>
+							<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+							<div style='float:left;' onClick='document.form".$x.".submit()'><a href='#'>$x&nbsp;</a></div></form>"
+						);
+
+						$p->set_var($varp);						
+	
+						$p->parse('pages','rowpag',True);
+					}
+				}
+		
+				// proximo grupo de pagina
+				if ($gpag < $maxtotalnpag && $maxtotalnpag > 0) 
+				{
+					$gpagp = $gpag + 1;
+					$varp = Array(
+						'paginat'	=>  "<form name='proximo' method='POST' action='$url'>
+						<input type='hidden' name='setor' value='$grouplist'>
+						<input type='hidden' name='organizacao' value='$organizacao'>
+						<input type='hidden' name='setordn' value='$setordn'>
+						<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+						<input type='hidden' name='page' value='$npag'>
+						<input type='hidden' name='gpage' value='$gpagp'>
+						<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+						<div style='float:left;' onClick='document.proximo.submit()'><a href='#'>&nbsp;&nbsp;&nbsp;>>".lang('Next Page')."</a></div></form>"
+					);
+					$p->set_var($varp);						
+
+					$p->parse('pages','rowpag',True);
+				}
+
+			// ************************* FIM PAGINAÇÃO ***********************							
+			}
+
+			$p->pfp('out','body');
+		}
+
+		function css()
+		{
+			$appCSS = 
+			'th.activetab
+			{
+				color:#000000;
+				background-color:#D3DCE3;
+				border-top-width : 1px;
+				border-top-style : solid;
+				border-top-color : Black;
+				border-left-width : 1px;
+				border-left-style : solid;
+				border-left-color : Black;
+				border-right-width : 1px;
+				border-right-style : solid;
+				border-right-color : Black;
+				font-size: 12px;
+				font-family: Tahoma, Arial, Helvetica, sans-serif;
+			}
+			
+			th.inactivetab
+			{
+				color:#000000;
+				background-color:#E8F0F0;
+				border-bottom-width : 1px;
+				border-bottom-style : solid;
+				border-bottom-color : Black;
+				font-size: 12px;
+				font-family: Tahoma, Arial, Helvetica, sans-serif;				
+			}
+			
+			.td_left {border-left:1px solid Gray; border-top:1px solid Gray; border-bottom:1px solid Gray;}
+			.td_right {border-right:1px solid Gray; border-top:1px solid Gray; border-bottom:1px solid Gray;}
+			
+			div.activetab{ display:inline; }
+			div.inactivetab{ display:none; }';
+			
+			return $appCSS;
+		}
+
+	}
+?>
Index: /trunk/reports/inc/class.imap_functions.inc.php
===================================================================
--- /trunk/reports/inc/class.imap_functions.inc.php	(revision 5291)
+++ /trunk/reports/inc/class.imap_functions.inc.php	(revision 5291)
@@ -0,0 +1,41 @@
+<?php
+
+include_once('class.functions.inc.php');
+
+class imap_functions
+{
+	var $functions;
+	var $imap;
+	var $imapDelimiter;
+	var $imap_admin;
+	var $imap_passwd;
+	var $imap_server;
+	var $imap_port;
+	
+	function imap_functions(){
+		$this->functions	= new functions;
+		$this->imap_admin	= $_SESSION['phpgw_info']['expresso']['email_server']['imapAdminUsername'];
+		$this->imap_passwd	= $_SESSION['phpgw_info']['expresso']['email_server']['imapAdminPW'];
+		$this->imap_server	= $_SESSION['phpgw_info']['expresso']['email_server']['imapServer'];
+		$this->imap_port	= $_SESSION['phpgw_info']['expresso']['email_server']['imapPort'];
+		$this->imapDelimiter= $_SESSION['phpgw_info']['expresso']['email_server']['imapDelimiter'];
+		$this->imap 		= imap_open('{'.$this->imap_server.':'.$this->imap_port.'/novalidate-cert}', $this->imap_admin, $this->imap_passwd, OP_HALFOPEN);
+	}
+	
+	function get_user_info($uid)
+	{
+		$get_quota = @imap_get_quotaroot($this->imap,"user" . $this->imapDelimiter . $uid);
+		
+		if (count($get_quota) == 0)
+		{
+			$quota['mailquota'] = '-1';
+			$quota['mailquota_used'] = '-1';
+		}	
+		else
+		{
+			$quota['mailquota'] = round (($get_quota['limit'] / 1024), 2);
+			$quota['mailquota_used'] = round (($get_quota['usage'] / 1024), 2);
+		}
+		return $quota;
+	}
+}
Index: /trunk/reports/inc/class.fpdf.inc.php
===================================================================
--- /trunk/reports/inc/class.fpdf.inc.php	(revision 5291)
+++ /trunk/reports/inc/class.fpdf.inc.php	(revision 5291)
@@ -0,0 +1,1734 @@
+<?php
+/*******************************************************************************
+* FPDF                                                                         *
+*                                                                              *
+* Version: 1.6                                                                 *
+* Date:    2008-08-03                                                          *
+* Author:  Olivier PLATHEY                                                     *
+*******************************************************************************/
+
+define('FPDF_VERSION','1.6');
+
+class FPDF
+{
+var $page;               //current page number
+var $n;                  //current object number
+var $offsets;            //array of object offsets
+var $buffer;             //buffer holding in-memory PDF
+var $pages;              //array containing pages
+var $state;              //current document state
+var $compress;           //compression flag
+var $k;                  //scale factor (number of points in user unit)
+var $DefOrientation;     //default orientation
+var $CurOrientation;     //current orientation
+var $PageFormats;        //available page formats
+var $DefPageFormat;      //default page format
+var $CurPageFormat;      //current page format
+var $PageSizes;          //array storing non-default page sizes
+var $wPt,$hPt;           //dimensions of current page in points
+var $w,$h;               //dimensions of current page in user unit
+var $lMargin;            //left margin
+var $tMargin;            //top margin
+var $rMargin;            //right margin
+var $bMargin;            //page break margin
+var $cMargin;            //cell margin
+var $x,$y;               //current position in user unit
+var $lasth;              //height of last printed cell
+var $LineWidth;          //line width in user unit
+var $CoreFonts;          //array of standard font names
+var $fonts;              //array of used fonts
+var $FontFiles;          //array of font files
+var $diffs;              //array of encoding differences
+var $FontFamily;         //current font family
+var $FontStyle;          //current font style
+var $underline;          //underlining flag
+var $CurrentFont;        //current font info
+var $FontSizePt;         //current font size in points
+var $FontSize;           //current font size in user unit
+var $DrawColor;          //commands for drawing color
+var $FillColor;          //commands for filling color
+var $TextColor;          //commands for text color
+var $ColorFlag;          //indicates whether fill and text colors are different
+var $ws;                 //word spacing
+var $images;             //array of used images
+var $PageLinks;          //array of links in pages
+var $links;              //array of internal links
+var $AutoPageBreak;      //automatic page breaking
+var $PageBreakTrigger;   //threshold used to trigger page breaks
+var $InHeader;           //flag set when processing header
+var $InFooter;           //flag set when processing footer
+var $ZoomMode;           //zoom display mode
+var $LayoutMode;         //layout display mode
+var $title;              //title
+var $subject;            //subject
+var $author;             //author
+var $keywords;           //keywords
+var $creator;            //creator
+var $AliasNbPages;       //alias for total number of pages
+var $PDFVersion;         //PDF version number
+
+/*******************************************************************************
+*                                                                              *
+*                               Public methods                                 *
+*                                                                              *
+*******************************************************************************/
+function FPDF($orientation='P', $unit='mm', $format='A4')
+{
+	//Some checks
+	$this->_dochecks();
+	//Initialization of properties
+	$this->page=0;
+	$this->n=2;
+	$this->buffer='';
+	$this->pages=array();
+	$this->PageSizes=array();
+	$this->state=0;
+	$this->fonts=array();
+	$this->FontFiles=array();
+	$this->diffs=array();
+	$this->images=array();
+	$this->links=array();
+	$this->InHeader=false;
+	$this->InFooter=false;
+	$this->lasth=0;
+	$this->FontFamily='';
+	$this->FontStyle='';
+	$this->FontSizePt=12;
+	$this->underline=false;
+	$this->DrawColor='0 G';
+	$this->FillColor='0 g';
+	$this->TextColor='0 g';
+	$this->ColorFlag=false;
+	$this->ws=0;
+	//Standard fonts
+	$this->CoreFonts=array('courier'=>'Courier', 'courierB'=>'Courier-Bold', 'courierI'=>'Courier-Oblique', 'courierBI'=>'Courier-BoldOblique',
+		'helvetica'=>'Helvetica', 'helveticaB'=>'Helvetica-Bold', 'helveticaI'=>'Helvetica-Oblique', 'helveticaBI'=>'Helvetica-BoldOblique',
+		'times'=>'Times-Roman', 'timesB'=>'Times-Bold', 'timesI'=>'Times-Italic', 'timesBI'=>'Times-BoldItalic',
+		'symbol'=>'Symbol', 'zapfdingbats'=>'ZapfDingbats');
+	//Scale factor
+	if($unit=='pt')
+		$this->k=1;
+	elseif($unit=='mm')
+		$this->k=72/25.4;
+	elseif($unit=='cm')
+		$this->k=72/2.54;
+	elseif($unit=='in')
+		$this->k=72;
+	else
+		$this->Error('Incorrect unit: '.$unit);
+	//Page format
+	$this->PageFormats=array('a3'=>array(841.89,1190.55), 'a4'=>array(595.28,841.89), 'a5'=>array(420.94,595.28),
+		'letter'=>array(612,792), 'legal'=>array(612,1008));
+	if(is_string($format))
+		$format=$this->_getpageformat($format);
+	$this->DefPageFormat=$format;
+	$this->CurPageFormat=$format;
+	//Page orientation
+	$orientation=strtolower($orientation);
+	if($orientation=='p' || $orientation=='portrait')
+	{
+		$this->DefOrientation='P';
+		$this->w=$this->DefPageFormat[0];
+		$this->h=$this->DefPageFormat[1];
+	}
+	elseif($orientation=='l' || $orientation=='landscape')
+	{
+		$this->DefOrientation='L';
+		$this->w=$this->DefPageFormat[1];
+		$this->h=$this->DefPageFormat[0];
+	}
+	else
+		$this->Error('Incorrect orientation: '.$orientation);
+	$this->CurOrientation=$this->DefOrientation;
+	$this->wPt=$this->w*$this->k;
+	$this->hPt=$this->h*$this->k;
+	//Page margins (1 cm)
+	$margin=28.35/$this->k;
+	$this->SetMargins($margin,$margin);
+	//Interior cell margin (1 mm)
+	$this->cMargin=$margin/10;
+	//Line width (0.2 mm)
+	$this->LineWidth=.567/$this->k;
+	//Automatic page break
+	$this->SetAutoPageBreak(true,2*$margin);
+	//Full width display mode
+	$this->SetDisplayMode('fullwidth');
+	//Enable compression
+	$this->SetCompression(true);
+	//Set default PDF version number
+	$this->PDFVersion='1.3';
+}
+
+function SetMargins($left, $top, $right=null)
+{
+	//Set left, top and right margins
+	$this->lMargin=$left;
+	$this->tMargin=$top;
+	if($right===null)
+		$right=$left;
+	$this->rMargin=$right;
+}
+
+function SetLeftMargin($margin)
+{
+	//Set left margin
+	$this->lMargin=$margin;
+	if($this->page>0 && $this->x<$margin)
+		$this->x=$margin;
+}
+
+function SetTopMargin($margin)
+{
+	//Set top margin
+	$this->tMargin=$margin;
+}
+
+function SetRightMargin($margin)
+{
+	//Set right margin
+	$this->rMargin=$margin;
+}
+
+function SetAutoPageBreak($auto, $margin=0)
+{
+	//Set auto page break mode and triggering margin
+	$this->AutoPageBreak=$auto;
+	$this->bMargin=$margin;
+	$this->PageBreakTrigger=$this->h-$margin;
+}
+
+function SetDisplayMode($zoom, $layout='continuous')
+{
+	//Set display mode in viewer
+	if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom))
+		$this->ZoomMode=$zoom;
+	else
+		$this->Error('Incorrect zoom display mode: '.$zoom);
+	if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default')
+		$this->LayoutMode=$layout;
+	else
+		$this->Error('Incorrect layout display mode: '.$layout);
+}
+
+function SetCompression($compress)
+{
+	//Set page compression
+	if(function_exists('gzcompress'))
+		$this->compress=$compress;
+	else
+		$this->compress=false;
+}
+
+function SetTitle($title, $isUTF8=false)
+{
+	//Title of document
+	if($isUTF8)
+		$title=$this->_UTF8toUTF16($title);
+	$this->title=$title;
+}
+
+function SetSubject($subject, $isUTF8=false)
+{
+	//Subject of document
+	if($isUTF8)
+		$subject=$this->_UTF8toUTF16($subject);
+	$this->subject=$subject;
+}
+
+function SetAuthor($author, $isUTF8=false)
+{
+	//Author of document
+	if($isUTF8)
+		$author=$this->_UTF8toUTF16($author);
+	$this->author=$author;
+}
+
+function SetKeywords($keywords, $isUTF8=false)
+{
+	//Keywords of document
+	if($isUTF8)
+		$keywords=$this->_UTF8toUTF16($keywords);
+	$this->keywords=$keywords;
+}
+
+function SetCreator($creator, $isUTF8=false)
+{
+	//Creator of document
+	if($isUTF8)
+		$creator=$this->_UTF8toUTF16($creator);
+	$this->creator=$creator;
+}
+
+function AliasNbPages($alias='{nb}')
+{
+	//Define an alias for total number of pages
+	$this->AliasNbPages=$alias;
+}
+
+function Error($msg)
+{
+	//Fatal error
+	die('<b>FPDF error:</b> '.$msg);
+}
+
+function Open()
+{
+	//Begin document
+	$this->state=1;
+}
+
+function Close()
+{
+	//Terminate document
+	if($this->state==3)
+		return;
+	if($this->page==0)
+		$this->AddPage();
+	//Page footer
+	$this->InFooter=true;
+	$this->Footer();
+	$this->InFooter=false;
+	//Close page
+	$this->_endpage();
+	//Close document
+	$this->_enddoc();
+}
+
+function AddPage($orientation='', $format='')
+{
+	//Start a new page
+	if($this->state==0)
+		$this->Open();
+	$family=$this->FontFamily;
+	$style=$this->FontStyle.($this->underline ? 'U' : '');
+	$size=$this->FontSizePt;
+	$lw=$this->LineWidth;
+	$dc=$this->DrawColor;
+	$fc=$this->FillColor;
+	$tc=$this->TextColor;
+	$cf=$this->ColorFlag;
+	if($this->page>0)
+	{
+		//Page footer
+		$this->InFooter=true;
+		$this->Footer();
+		$this->InFooter=false;
+		//Close page
+		$this->_endpage();
+	}
+	//Start new page
+	$this->_beginpage($orientation,$format);
+	//Set line cap style to square
+	$this->_out('2 J');
+	//Set line width
+	$this->LineWidth=$lw;
+	$this->_out(sprintf('%.2F w',$lw*$this->k));
+	//Set font
+	if($family)
+		$this->SetFont($family,$style,$size);
+	//Set colors
+	$this->DrawColor=$dc;
+	if($dc!='0 G')
+		$this->_out($dc);
+	$this->FillColor=$fc;
+	if($fc!='0 g')
+		$this->_out($fc);
+	$this->TextColor=$tc;
+	$this->ColorFlag=$cf;
+	//Page header
+	$this->InHeader=true;
+	$this->Header();
+	$this->InHeader=false;
+	//Restore line width
+	if($this->LineWidth!=$lw)
+	{
+		$this->LineWidth=$lw;
+		$this->_out(sprintf('%.2F w',$lw*$this->k));
+	}
+	//Restore font
+	if($family)
+		$this->SetFont($family,$style,$size);
+	//Restore colors
+	if($this->DrawColor!=$dc)
+	{
+		$this->DrawColor=$dc;
+		$this->_out($dc);
+	}
+	if($this->FillColor!=$fc)
+	{
+		$this->FillColor=$fc;
+		$this->_out($fc);
+	}
+	$this->TextColor=$tc;
+	$this->ColorFlag=$cf;
+}
+
+function Header()
+{
+	//To be implemented in your own inherited class
+}
+
+function Footer()
+{
+	//To be implemented in your own inherited class
+	// Esta função foi implemantada para realizar o rodapé dos relatórios
+}
+
+function PageNo()
+{
+	//Get current page number
+	return $this->page;
+}
+
+function SetDrawColor($r, $g=null, $b=null)
+{
+	//Set color for all stroking operations
+	if(($r==0 && $g==0 && $b==0) || $g===null)
+		$this->DrawColor=sprintf('%.3F G',$r/255);
+	else
+		$this->DrawColor=sprintf('%.3F %.3F %.3F RG',$r/255,$g/255,$b/255);
+	if($this->page>0)
+		$this->_out($this->DrawColor);
+}
+
+function SetFillColor($r, $g=null, $b=null)
+{
+	//Set color for all filling operations
+	if(($r==0 && $g==0 && $b==0) || $g===null)
+		$this->FillColor=sprintf('%.3F g',$r/255);
+	else
+		$this->FillColor=sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255);
+	$this->ColorFlag=($this->FillColor!=$this->TextColor);
+	if($this->page>0)
+		$this->_out($this->FillColor);
+}
+
+function SetTextColor($r, $g=null, $b=null)
+{
+	//Set color for text
+	if(($r==0 && $g==0 && $b==0) || $g===null)
+		$this->TextColor=sprintf('%.3F g',$r/255);
+	else
+		$this->TextColor=sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255);
+	$this->ColorFlag=($this->FillColor!=$this->TextColor);
+}
+
+function GetStringWidth($s)
+{
+	//Get width of a string in the current font
+	$s=(string)$s;
+	$cw=&$this->CurrentFont['cw'];
+	$w=0;
+	$l=strlen($s);
+	for($i=0;$i<$l;$i++)
+		$w+=$cw[$s[$i]];
+	return $w*$this->FontSize/1000;
+}
+
+function SetLineWidth($width)
+{
+	//Set line width
+	$this->LineWidth=$width;
+	if($this->page>0)
+		$this->_out(sprintf('%.2F w',$width*$this->k));
+}
+
+function Line($x1, $y1, $x2, $y2)
+{
+	//Draw a line
+	$this->_out(sprintf('%.2F %.2F m %.2F %.2F l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k));
+}
+
+function Rect($x, $y, $w, $h, $style='')
+{
+	//Draw a rectangle
+	if($style=='F')
+		$op='f';
+	elseif($style=='FD' || $style=='DF')
+		$op='B';
+	else
+		$op='S';
+	$this->_out(sprintf('%.2F %.2F %.2F %.2F re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op));
+}
+
+function AddFont($family, $style='', $file='')
+{
+	//Add a TrueType or Type1 font
+	$family=strtolower($family);
+	if($file=='')
+		$file=str_replace(' ','',$family).strtolower($style).'.php';
+	if($family=='arial')
+		$family='helvetica';
+	$style=strtoupper($style);
+	if($style=='IB')
+		$style='BI';
+	$fontkey=$family.$style;
+	if(isset($this->fonts[$fontkey]))
+		return;
+	include($this->_getfontpath().$file);
+	if(!isset($name))
+		$this->Error('Could not include font definition file');
+	$i=count($this->fonts)+1;
+	$this->fonts[$fontkey]=array('i'=>$i, 'type'=>$type, 'name'=>$name, 'desc'=>$desc, 'up'=>$up, 'ut'=>$ut, 'cw'=>$cw, 'enc'=>$enc, 'file'=>$file);
+	if($diff)
+	{
+		//Search existing encodings
+		$d=0;
+		$nb=count($this->diffs);
+		for($i=1;$i<=$nb;$i++)
+		{
+			if($this->diffs[$i]==$diff)
+			{
+				$d=$i;
+				break;
+			}
+		}
+		if($d==0)
+		{
+			$d=$nb+1;
+			$this->diffs[$d]=$diff;
+		}
+		$this->fonts[$fontkey]['diff']=$d;
+	}
+	if($file)
+	{
+		if($type=='TrueType')
+			$this->FontFiles[$file]=array('length1'=>$originalsize);
+		else
+			$this->FontFiles[$file]=array('length1'=>$size1, 'length2'=>$size2);
+	}
+}
+
+function SetFont($family, $style='', $size=0)
+{
+	//Select a font; size given in points
+	global $fpdf_charwidths;
+
+	$family=strtolower($family);
+	if($family=='')
+		$family=$this->FontFamily;
+	if($family=='arial')
+		$family='helvetica';
+	elseif($family=='symbol' || $family=='zapfdingbats')
+		$style='';
+	$style=strtoupper($style);
+	if(strpos($style,'U')!==false)
+	{
+		$this->underline=true;
+		$style=str_replace('U','',$style);
+	}
+	else
+		$this->underline=false;
+	if($style=='IB')
+		$style='BI';
+	if($size==0)
+		$size=$this->FontSizePt;
+	//Test if font is already selected
+	if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size)
+		return;
+	//Test if used for the first time
+	$fontkey=$family.$style;
+	if(!isset($this->fonts[$fontkey]))
+	{
+		//Check if one of the standard fonts
+		if(isset($this->CoreFonts[$fontkey]))
+		{
+			if(!isset($fpdf_charwidths[$fontkey]))
+			{
+				//Load metric file
+				$file=$family;
+
+				if($family=='times' || $family=='helvetica')
+					$file.=strtolower($style);
+				include($this->_getfontpath().$file.'.php');
+				if(!isset($fpdf_charwidths[$fontkey]))
+					$this->Error('Could not include font metric file');
+			}
+			$i=count($this->fonts)+1;
+			$name=$this->CoreFonts[$fontkey];
+			$cw=$fpdf_charwidths[$fontkey];
+			$this->fonts[$fontkey]=array('i'=>$i, 'type'=>'core', 'name'=>$name, 'up'=>-100, 'ut'=>50, 'cw'=>$cw);
+		}
+		else
+			$this->Error('Undefined font: '.$family.' '.$style);
+	}
+	//Select it
+	$this->FontFamily=$family;
+	$this->FontStyle=$style;
+	$this->FontSizePt=$size;
+	$this->FontSize=$size/$this->k;
+	$this->CurrentFont=&$this->fonts[$fontkey];
+	if($this->page>0)
+		$this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
+}
+
+function SetFontSize($size)
+{
+	//Set font size in points
+	if($this->FontSizePt==$size)
+		return;
+	$this->FontSizePt=$size;
+	$this->FontSize=$size/$this->k;
+	if($this->page>0)
+		$this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
+}
+
+function AddLink()
+{
+	//Create a new internal link
+	$n=count($this->links)+1;
+	$this->links[$n]=array(0, 0);
+	return $n;
+}
+
+function SetLink($link, $y=0, $page=-1)
+{
+	//Set destination of internal link
+	if($y==-1)
+		$y=$this->y;
+	if($page==-1)
+		$page=$this->page;
+	$this->links[$link]=array($page, $y);
+}
+
+function Link($x, $y, $w, $h, $link)
+{
+	//Put a link on the page
+	$this->PageLinks[$this->page][]=array($x*$this->k, $this->hPt-$y*$this->k, $w*$this->k, $h*$this->k, $link);
+}
+
+function Text($x, $y, $txt)
+{
+	//Output a string
+	$s=sprintf('BT %.2F %.2F Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));
+	if($this->underline && $txt!='')
+		$s.=' '.$this->_dounderline($x,$y,$txt);
+	if($this->ColorFlag)
+		$s='q '.$this->TextColor.' '.$s.' Q';
+	$this->_out($s);
+}
+
+function AcceptPageBreak()
+{
+	//Accept automatic page break or not
+	return $this->AutoPageBreak;
+}
+
+function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
+{
+	//Output a cell
+	$k=$this->k;
+	if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
+	{
+		//Automatic page break
+		$x=$this->x;
+		$ws=$this->ws;
+		if($ws>0)
+		{
+			$this->ws=0;
+			$this->_out('0 Tw');
+		}
+		$this->AddPage($this->CurOrientation,$this->CurPageFormat);
+		$this->x=$x;
+		if($ws>0)
+		{
+			$this->ws=$ws;
+			$this->_out(sprintf('%.3F Tw',$ws*$k));
+		}
+	}
+	if($w==0)
+		$w=$this->w-$this->rMargin-$this->x;
+	$s='';
+	if($fill || $border==1)
+	{
+		if($fill)
+			$op=($border==1) ? 'B' : 'f';
+		else
+			$op='S';
+		$s=sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
+	}
+	if(is_string($border))
+	{
+		$x=$this->x;
+		$y=$this->y;
+		if(strpos($border,'L')!==false)
+			$s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
+		if(strpos($border,'T')!==false)
+			$s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
+		if(strpos($border,'R')!==false)
+			$s.=sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+		if(strpos($border,'B')!==false)
+			$s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+	}
+	if($txt!=='')
+	{
+		if($align=='R')
+			$dx=$w-$this->cMargin-$this->GetStringWidth($txt);
+		elseif($align=='C')
+			$dx=($w-$this->GetStringWidth($txt))/2;
+		else
+			$dx=$this->cMargin;
+		if($this->ColorFlag)
+			$s.='q '.$this->TextColor.' ';
+		$txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
+		$s.=sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
+		if($this->underline)
+			$s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
+		if($this->ColorFlag)
+			$s.=' Q';
+		if($link)
+			$this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);
+	}
+	if($s)
+		$this->_out($s);
+	$this->lasth=$h;
+	if($ln>0)
+	{
+		//Go to next line
+		$this->y+=$h;
+		if($ln==1)
+			$this->x=$this->lMargin;
+	}
+	else
+		$this->x+=$w;
+}
+
+function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false)
+{
+	//Output text with automatic or explicit line breaks
+	$cw=&$this->CurrentFont['cw'];
+	if($w==0)
+		$w=$this->w-$this->rMargin-$this->x;
+	$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+	$s=str_replace("\r",'',$txt);
+	$nb=strlen($s);
+	if($nb>0 && $s[$nb-1]=="\n")
+		$nb--;
+	$b=0;
+	if($border)
+	{
+		if($border==1)
+		{
+			$border='LTRB';
+			$b='LRT';
+			$b2='LR';
+		}
+		else
+		{
+			$b2='';
+			if(strpos($border,'L')!==false)
+				$b2.='L';
+			if(strpos($border,'R')!==false)
+				$b2.='R';
+			$b=(strpos($border,'T')!==false) ? $b2.'T' : $b2;
+		}
+	}
+	$sep=-1;
+	$i=0;
+	$j=0;
+	$l=0;
+	$ns=0;
+	$nl=1;
+	while($i<$nb)
+	{
+		//Get next character
+		$c=$s[$i];
+		if($c=="\n")
+		{
+			//Explicit line break
+			if($this->ws>0)
+			{
+				$this->ws=0;
+				$this->_out('0 Tw');
+			}
+			$this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
+			$i++;
+			$sep=-1;
+			$j=$i;
+			$l=0;
+			$ns=0;
+			$nl++;
+			if($border && $nl==2)
+				$b=$b2;
+			continue;
+		}
+		if($c==' ')
+		{
+			$sep=$i;
+			$ls=$l;
+			$ns++;
+		}
+		$l+=$cw[$c];
+		if($l>$wmax)
+		{
+			//Automatic line break
+			if($sep==-1)
+			{
+				if($i==$j)
+					$i++;
+				if($this->ws>0)
+				{
+					$this->ws=0;
+					$this->_out('0 Tw');
+				}
+				$this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
+			}
+			else
+			{
+				if($align=='J')
+				{
+					$this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;
+					$this->_out(sprintf('%.3F Tw',$this->ws*$this->k));
+				}
+				$this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill);
+				$i=$sep+1;
+			}
+			$sep=-1;
+			$j=$i;
+			$l=0;
+			$ns=0;
+			$nl++;
+			if($border && $nl==2)
+				$b=$b2;
+		}
+		else
+			$i++;
+	}
+	//Last chunk
+	if($this->ws>0)
+	{
+		$this->ws=0;
+		$this->_out('0 Tw');
+	}
+	if($border && strpos($border,'B')!==false)
+		$b.='B';
+	$this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
+	$this->x=$this->lMargin;
+}
+
+function Write($h, $txt, $link='')
+{
+	//Output text in flowing mode
+	$cw=&$this->CurrentFont['cw'];
+	$w=$this->w-$this->rMargin-$this->x;
+	$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+	$s=str_replace("\r",'',$txt);
+	$nb=strlen($s);
+	$sep=-1;
+	$i=0;
+	$j=0;
+	$l=0;
+	$nl=1;
+	while($i<$nb)
+	{
+		//Get next character
+		$c=$s[$i];
+		if($c=="\n")
+		{
+			//Explicit line break
+			$this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
+			$i++;
+			$sep=-1;
+			$j=$i;
+			$l=0;
+			if($nl==1)
+			{
+				$this->x=$this->lMargin;
+				$w=$this->w-$this->rMargin-$this->x;
+				$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+			}
+			$nl++;
+			continue;
+		}
+		if($c==' ')
+			$sep=$i;
+		$l+=$cw[$c];
+		if($l>$wmax)
+		{
+			//Automatic line break
+			if($sep==-1)
+			{
+				if($this->x>$this->lMargin)
+				{
+					//Move to next line
+					$this->x=$this->lMargin;
+					$this->y+=$h;
+					$w=$this->w-$this->rMargin-$this->x;
+					$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+					$i++;
+					$nl++;
+					continue;
+				}
+				if($i==$j)
+					$i++;
+				$this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
+			}
+			else
+			{
+				$this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link);
+				$i=$sep+1;
+			}
+			$sep=-1;
+			$j=$i;
+			$l=0;
+			if($nl==1)
+			{
+				$this->x=$this->lMargin;
+				$w=$this->w-$this->rMargin-$this->x;
+				$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+			}
+			$nl++;
+		}
+		else
+			$i++;
+	}
+	//Last chunk
+	if($i!=$j)
+		$this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link);
+}
+
+function Ln($h=null)
+{
+	//Line feed; default value is last cell height
+	$this->x=$this->lMargin;
+	if($h===null)
+		$this->y+=$this->lasth;
+	else
+		$this->y+=$h;
+}
+
+function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='')
+{
+	//Put an image on the page
+	if(!isset($this->images[$file]))
+	{
+		//First use of this image, get info
+		if($type=='')
+		{
+			$pos=strrpos($file,'.');
+			if(!$pos)
+				$this->Error('Image file has no extension and no type was specified: '.$file);
+			$type=substr($file,$pos+1);
+		}
+		$type=strtolower($type);
+		if($type=='jpeg')
+			$type='jpg';
+		$mtd='_parse'.$type;
+		if(!method_exists($this,$mtd))
+			$this->Error('Unsupported image type: '.$type);
+		$info=$this->$mtd($file);
+		$info['i']=count($this->images)+1;
+		$this->images[$file]=$info;
+	}
+	else
+		$info=$this->images[$file];
+	//Automatic width and height calculation if needed
+	if($w==0 && $h==0)
+	{
+		//Put image at 72 dpi
+		$w=$info['w']/$this->k;
+		$h=$info['h']/$this->k;
+	}
+	elseif($w==0)
+		$w=$h*$info['w']/$info['h'];
+	elseif($h==0)
+		$h=$w*$info['h']/$info['w'];
+	//Flowing mode
+	if($y===null)
+	{
+		if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
+		{
+			//Automatic page break
+			$x2=$this->x;
+			$this->AddPage($this->CurOrientation,$this->CurPageFormat);
+			$this->x=$x2;
+		}
+		$y=$this->y;
+		$this->y+=$h;
+	}
+	if($x===null)
+		$x=$this->x;
+	$this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i']));
+	if($link)
+		$this->Link($x,$y,$w,$h,$link);
+}
+
+function GetX()
+{
+	//Get x position
+	return $this->x;
+}
+
+function SetX($x)
+{
+	//Set x position
+	if($x>=0)
+		$this->x=$x;
+	else
+		$this->x=$this->w+$x;
+}
+
+function GetY()
+{
+	//Get y position
+	return $this->y;
+}
+
+function SetY($y)
+{
+	//Set y position and reset x
+	$this->x=$this->lMargin;
+	if($y>=0)
+		$this->y=$y;
+	else
+		$this->y=$this->h+$y;
+}
+
+function SetXY($x, $y)
+{
+	//Set x and y positions
+	$this->SetY($y);
+	$this->SetX($x);
+}
+
+function Output($name='', $dest='')
+{
+	//Output PDF to some destination
+	if($this->state<3)
+		$this->Close();
+	$dest=strtoupper($dest);
+	if($dest=='')
+	{
+		if($name=='')
+		{
+			$name='doc.pdf';
+			$dest='I';
+		}
+		else
+			$dest='F';
+	}
+	switch($dest)
+	{
+		case 'I':
+			//Send to standard output
+			if(ob_get_length())
+				$this->Error('Some data has already been output, can\'t send PDF file');
+			if(php_sapi_name()!='cli')
+			{
+				//We send to a browser
+				header('Content-Type: application/pdf');
+				if(headers_sent())
+					$this->Error('Some data has already been output, can\'t send PDF file');
+				header('Content-Length: '.strlen($this->buffer));
+				header('Content-Disposition: inline; filename="'.$name.'"');
+				header('Cache-Control: private, max-age=0, must-revalidate');
+				header('Pragma: public');
+				ini_set('zlib.output_compression','0');
+			}
+			echo $this->buffer;
+			break;
+		case 'D':
+			//Download file
+			if(ob_get_length())
+				$this->Error('Some data has already been output, can\'t send PDF file');
+			header('Content-Type: application/x-download');
+			if(headers_sent())
+				$this->Error('Some data has already been output, can\'t send PDF file');
+			header('Content-Length: '.strlen($this->buffer));
+			header('Content-Disposition: attachment; filename="'.$name.'"');
+			header('Cache-Control: private, max-age=0, must-revalidate');
+			header('Pragma: public');
+			ini_set('zlib.output_compression','0');
+			echo $this->buffer;
+			break;
+		case 'F':
+			//Save to local file
+			$f=fopen($name,'wb');
+			if(!$f)
+				$this->Error('Unable to create output file: '.$name);
+			fwrite($f,$this->buffer,strlen($this->buffer));
+			fclose($f);
+			break;
+		case 'S':
+			//Return as a string
+			return $this->buffer;
+		default:
+			$this->Error('Incorrect output destination: '.$dest);
+	}
+	return '';
+}
+
+/*******************************************************************************
+*                                                                              *
+*                              Protected methods                               *
+*                                                                              *
+*******************************************************************************/
+function _dochecks()
+{
+	//Check availability of %F
+	if(sprintf('%.1F',1.0)!='1.0')
+		$this->Error('This version of PHP is not supported');
+	//Check mbstring overloading
+	if(ini_get('mbstring.func_overload') & 2)
+		$this->Error('mbstring overloading must be disabled');
+	//Disable runtime magic quotes
+	if(get_magic_quotes_runtime())
+		@set_magic_quotes_runtime(0);
+}
+
+function _getpageformat($format)
+{
+	$format=strtolower($format);
+	if(!isset($this->PageFormats[$format]))
+		$this->Error('Unknown page format: '.$format);
+	$a=$this->PageFormats[$format];
+	return array($a[0]/$this->k, $a[1]/$this->k);
+}
+
+function _getfontpath()
+{
+	if(!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font'))
+		define('FPDF_FONTPATH',dirname(__FILE__).'/font/');
+	return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : '';
+}
+
+function _beginpage($orientation, $format)
+{
+	$this->page++;
+	$this->pages[$this->page]='';
+	$this->state=2;
+	$this->x=$this->lMargin;
+	$this->y=$this->tMargin;
+	$this->FontFamily='';
+	//Check page size
+	if($orientation=='')
+		$orientation=$this->DefOrientation;
+	else
+		$orientation=strtoupper($orientation[0]);
+	if($format=='')
+		$format=$this->DefPageFormat;
+	else
+	{
+		if(is_string($format))
+			$format=$this->_getpageformat($format);
+	}
+	if($orientation!=$this->CurOrientation || $format[0]!=$this->CurPageFormat[0] || $format[1]!=$this->CurPageFormat[1])
+	{
+		//New size
+		if($orientation=='P')
+		{
+			$this->w=$format[0];
+			$this->h=$format[1];
+		}
+		else
+		{
+			$this->w=$format[1];
+			$this->h=$format[0];
+		}
+		$this->wPt=$this->w*$this->k;
+		$this->hPt=$this->h*$this->k;
+		$this->PageBreakTrigger=$this->h-$this->bMargin;
+		$this->CurOrientation=$orientation;
+		$this->CurPageFormat=$format;
+	}
+	if($orientation!=$this->DefOrientation || $format[0]!=$this->DefPageFormat[0] || $format[1]!=$this->DefPageFormat[1])
+		$this->PageSizes[$this->page]=array($this->wPt, $this->hPt);
+}
+
+function _endpage()
+{
+	$this->state=1;
+}
+
+function _escape($s)
+{
+	//Escape special characters in strings
+	$s=str_replace('\\','\\\\',$s);
+	$s=str_replace('(','\\(',$s);
+	$s=str_replace(')','\\)',$s);
+	$s=str_replace("\r",'\\r',$s);
+	return $s;
+}
+
+function _textstring($s)
+{
+	//Format a text string
+	return '('.$this->_escape($s).')';
+}
+
+function _UTF8toUTF16($s)
+{
+	//Convert UTF-8 to UTF-16BE with BOM
+	$res="\xFE\xFF";
+	$nb=strlen($s);
+	$i=0;
+	while($i<$nb)
+	{
+		$c1=ord($s[$i++]);
+		if($c1>=224)
+		{
+			//3-byte character
+			$c2=ord($s[$i++]);
+			$c3=ord($s[$i++]);
+			$res.=chr((($c1 & 0x0F)<<4) + (($c2 & 0x3C)>>2));
+			$res.=chr((($c2 & 0x03)<<6) + ($c3 & 0x3F));
+		}
+		elseif($c1>=192)
+		{
+			//2-byte character
+			$c2=ord($s[$i++]);
+			$res.=chr(($c1 & 0x1C)>>2);
+			$res.=chr((($c1 & 0x03)<<6) + ($c2 & 0x3F));
+		}
+		else
+		{
+			//Single-byte character
+			$res.="\0".chr($c1);
+		}
+	}
+	return $res;
+}
+
+function _dounderline($x, $y, $txt)
+{
+	//Underline text
+	$up=$this->CurrentFont['up'];
+	$ut=$this->CurrentFont['ut'];
+	$w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' ');
+	return sprintf('%.2F %.2F %.2F %.2F re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);
+}
+
+function _parsejpg($file)
+{
+	//Extract info from a JPEG file
+	$a=GetImageSize($file);
+	if(!$a)
+		$this->Error('Missing or incorrect image file: '.$file);
+	if($a[2]!=2)
+		$this->Error('Not a JPEG file: '.$file);
+	if(!isset($a['channels']) || $a['channels']==3)
+		$colspace='DeviceRGB';
+	elseif($a['channels']==4)
+		$colspace='DeviceCMYK';
+	else
+		$colspace='DeviceGray';
+	$bpc=isset($a['bits']) ? $a['bits'] : 8;
+	//Read whole file
+	$f=fopen($file,'rb');
+	$data='';
+	while(!feof($f))
+		$data.=fread($f,8192);
+	fclose($f);
+	return array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data);
+}
+
+function _parsepng($file)
+{
+	//Extract info from a PNG file
+	$f=fopen($file,'rb');
+	if(!$f)
+		$this->Error('Can\'t open image file: '.$file);
+	//Check signature
+	if($this->_readstream($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))
+		$this->Error('Not a PNG file: '.$file);
+	//Read header chunk
+	$this->_readstream($f,4);
+	if($this->_readstream($f,4)!='IHDR')
+		$this->Error('Incorrect PNG file: '.$file);
+	$w=$this->_readint($f);
+	$h=$this->_readint($f);
+	$bpc=ord($this->_readstream($f,1));
+	if($bpc>8)
+		$this->Error('16-bit depth not supported: '.$file);
+	$ct=ord($this->_readstream($f,1));
+	if($ct==0)
+		$colspace='DeviceGray';
+	elseif($ct==2)
+		$colspace='DeviceRGB';
+	elseif($ct==3)
+		$colspace='Indexed';
+	else
+		$this->Error('Alpha channel not supported: '.$file);
+	if(ord($this->_readstream($f,1))!=0)
+		$this->Error('Unknown compression method: '.$file);
+	if(ord($this->_readstream($f,1))!=0)
+		$this->Error('Unknown filter method: '.$file);
+	if(ord($this->_readstream($f,1))!=0)
+		$this->Error('Interlacing not supported: '.$file);
+	$this->_readstream($f,4);
+	$parms='/DecodeParms <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';
+	//Scan chunks looking for palette, transparency and image data
+	$pal='';
+	$trns='';
+	$data='';
+	do
+	{
+		$n=$this->_readint($f);
+		$type=$this->_readstream($f,4);
+		if($type=='PLTE')
+		{
+			//Read palette
+			$pal=$this->_readstream($f,$n);
+			$this->_readstream($f,4);
+		}
+		elseif($type=='tRNS')
+		{
+			//Read transparency info
+			$t=$this->_readstream($f,$n);
+			if($ct==0)
+				$trns=array(ord(substr($t,1,1)));
+			elseif($ct==2)
+				$trns=array(ord(substr($t,1,1)), ord(substr($t,3,1)), ord(substr($t,5,1)));
+			else
+			{
+				$pos=strpos($t,chr(0));
+				if($pos!==false)
+					$trns=array($pos);
+			}
+			$this->_readstream($f,4);
+		}
+		elseif($type=='IDAT')
+		{
+			//Read image data block
+			$data.=$this->_readstream($f,$n);
+			$this->_readstream($f,4);
+		}
+		elseif($type=='IEND')
+			break;
+		else
+			$this->_readstream($f,$n+4);
+	}
+	while($n);
+	if($colspace=='Indexed' && empty($pal))
+		$this->Error('Missing palette in '.$file);
+	fclose($f);
+	return array('w'=>$w, 'h'=>$h, 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'FlateDecode', 'parms'=>$parms, 'pal'=>$pal, 'trns'=>$trns, 'data'=>$data);
+}
+
+function _readstream($f, $n)
+{
+	//Read n bytes from stream
+	$res='';
+	while($n>0 && !feof($f))
+	{
+		$s=fread($f,$n);
+		if($s===false)
+			$this->Error('Error while reading stream');
+		$n-=strlen($s);
+		$res.=$s;
+	}
+	if($n>0)
+		$this->Error('Unexpected end of stream');
+	return $res;
+}
+
+function _readint($f)
+{
+	//Read a 4-byte integer from stream
+	$a=unpack('Ni',$this->_readstream($f,4));
+	return $a['i'];
+}
+
+function _parsegif($file)
+{
+	//Extract info from a GIF file (via PNG conversion)
+	if(!function_exists('imagepng'))
+		$this->Error('GD extension is required for GIF support');
+	if(!function_exists('imagecreatefromgif'))
+		$this->Error('GD has no GIF read support');
+	$im=imagecreatefromgif($file);
+	if(!$im)
+		$this->Error('Missing or incorrect image file: '.$file);
+	imageinterlace($im,0);
+	$tmp=tempnam('.','gif');
+	if(!$tmp)
+		$this->Error('Unable to create a temporary file');
+	if(!imagepng($im,$tmp))
+		$this->Error('Error while saving to temporary file');
+	imagedestroy($im);
+	$info=$this->_parsepng($tmp);
+	unlink($tmp);
+	return $info;
+}
+
+function _newobj()
+{
+	//Begin a new object
+	$this->n++;
+	$this->offsets[$this->n]=strlen($this->buffer);
+	$this->_out($this->n.' 0 obj');
+}
+
+function _putstream($s)
+{
+	$this->_out('stream');
+	$this->_out($s);
+	$this->_out('endstream');
+}
+
+function _out($s)
+{
+	//Add a line to the document
+	if($this->state==2)
+		$this->pages[$this->page].=$s."\n";
+	else
+		$this->buffer.=$s."\n";
+}
+
+function _putpages()
+{
+	$nb=$this->page;
+	if(!empty($this->AliasNbPages))
+	{
+		//Replace number of pages
+		for($n=1;$n<=$nb;$n++)
+			$this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]);
+	}
+	if($this->DefOrientation=='P')
+	{
+		$wPt=$this->DefPageFormat[0]*$this->k;
+		$hPt=$this->DefPageFormat[1]*$this->k;
+	}
+	else
+	{
+		$wPt=$this->DefPageFormat[1]*$this->k;
+		$hPt=$this->DefPageFormat[0]*$this->k;
+	}
+	$filter=($this->compress) ? '/Filter /FlateDecode ' : '';
+	for($n=1;$n<=$nb;$n++)
+	{
+		//Page
+		$this->_newobj();
+		$this->_out('<</Type /Page');
+		$this->_out('/Parent 1 0 R');
+		if(isset($this->PageSizes[$n]))
+			$this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$this->PageSizes[$n][0],$this->PageSizes[$n][1]));
+		$this->_out('/Resources 2 0 R');
+		if(isset($this->PageLinks[$n]))
+		{
+			//Links
+			$annots='/Annots [';
+			foreach($this->PageLinks[$n] as $pl)
+			{
+				$rect=sprintf('%.2F %.2F %.2F %.2F',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);
+				$annots.='<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';
+				if(is_string($pl[4]))
+					$annots.='/A <</S /URI /URI '.$this->_textstring($pl[4]).'>>>>';
+				else
+				{
+					$l=$this->links[$pl[4]];
+					$h=isset($this->PageSizes[$l[0]]) ? $this->PageSizes[$l[0]][1] : $hPt;
+					$annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>',1+2*$l[0],$h-$l[1]*$this->k);
+				}
+			}
+			$this->_out($annots.']');
+		}
+		$this->_out('/Contents '.($this->n+1).' 0 R>>');
+		$this->_out('endobj');
+		//Page content
+		$p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n];
+		$this->_newobj();
+		$this->_out('<<'.$filter.'/Length '.strlen($p).'>>');
+		$this->_putstream($p);
+		$this->_out('endobj');
+	}
+	//Pages root
+	$this->offsets[1]=strlen($this->buffer);
+	$this->_out('1 0 obj');
+	$this->_out('<</Type /Pages');
+	$kids='/Kids [';
+	for($i=0;$i<$nb;$i++)
+		$kids.=(3+2*$i).' 0 R ';
+	$this->_out($kids.']');
+	$this->_out('/Count '.$nb);
+	$this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$wPt,$hPt));
+	$this->_out('>>');
+	$this->_out('endobj');
+}
+
+function _putfonts()
+{
+	$nf=$this->n;
+	foreach($this->diffs as $diff)
+	{
+		//Encodings
+		$this->_newobj();
+		$this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>');
+		$this->_out('endobj');
+	}
+	foreach($this->FontFiles as $file=>$info)
+	{
+		//Font file embedding
+		$this->_newobj();
+		$this->FontFiles[$file]['n']=$this->n;
+		$font='';
+		$f=fopen($this->_getfontpath().$file,'rb',1);
+		if(!$f)
+			$this->Error('Font file not found');
+		while(!feof($f))
+			$font.=fread($f,8192);
+		fclose($f);
+		$compressed=(substr($file,-2)=='.z');
+		if(!$compressed && isset($info['length2']))
+		{
+			$header=(ord($font[0])==128);
+			if($header)
+			{
+				//Strip first binary header
+				$font=substr($font,6);
+			}
+			if($header && ord($font[$info['length1']])==128)
+			{
+				//Strip second binary header
+				$font=substr($font,0,$info['length1']).substr($font,$info['length1']+6);
+			}
+		}
+		$this->_out('<</Length '.strlen($font));
+		if($compressed)
+			$this->_out('/Filter /FlateDecode');
+		$this->_out('/Length1 '.$info['length1']);
+		if(isset($info['length2']))
+			$this->_out('/Length2 '.$info['length2'].' /Length3 0');
+		$this->_out('>>');
+		$this->_putstream($font);
+		$this->_out('endobj');
+	}
+	foreach($this->fonts as $k=>$font)
+	{
+		//Font objects
+		$this->fonts[$k]['n']=$this->n+1;
+		$type=$font['type'];
+		$name=$font['name'];
+		if($type=='core')
+		{
+			//Standard font
+			$this->_newobj();
+			$this->_out('<</Type /Font');
+			$this->_out('/BaseFont /'.$name);
+			$this->_out('/Subtype /Type1');
+			if($name!='Symbol' && $name!='ZapfDingbats')
+				$this->_out('/Encoding /WinAnsiEncoding');
+			$this->_out('>>');
+			$this->_out('endobj');
+		}
+		elseif($type=='Type1' || $type=='TrueType')
+		{
+			//Additional Type1 or TrueType font
+			$this->_newobj();
+			$this->_out('<</Type /Font');
+			$this->_out('/BaseFont /'.$name);
+			$this->_out('/Subtype /'.$type);
+			$this->_out('/FirstChar 32 /LastChar 255');
+			$this->_out('/Widths '.($this->n+1).' 0 R');
+			$this->_out('/FontDescriptor '.($this->n+2).' 0 R');
+			if($font['enc'])
+			{
+				if(isset($font['diff']))
+					$this->_out('/Encoding '.($nf+$font['diff']).' 0 R');
+				else
+					$this->_out('/Encoding /WinAnsiEncoding');
+			}
+			$this->_out('>>');
+			$this->_out('endobj');
+			//Widths
+			$this->_newobj();
+			$cw=&$font['cw'];
+			$s='[';
+			for($i=32;$i<=255;$i++)
+				$s.=$cw[chr($i)].' ';
+			$this->_out($s.']');
+			$this->_out('endobj');
+			//Descriptor
+			$this->_newobj();
+			$s='<</Type /FontDescriptor /FontName /'.$name;
+			foreach($font['desc'] as $k=>$v)
+				$s.=' /'.$k.' '.$v;
+			$file=$font['file'];
+			if($file)
+				$s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R';
+			$this->_out($s.'>>');
+			$this->_out('endobj');
+		}
+		else
+		{
+			//Allow for additional types
+			$mtd='_put'.strtolower($type);
+			if(!method_exists($this,$mtd))
+				$this->Error('Unsupported font type: '.$type);
+			$this->$mtd($font);
+		}
+	}
+}
+
+function _putimages()
+{
+	$filter=($this->compress) ? '/Filter /FlateDecode ' : '';
+	reset($this->images);
+	while(list($file,$info)=each($this->images))
+	{
+		$this->_newobj();
+		$this->images[$file]['n']=$this->n;
+		$this->_out('<</Type /XObject');
+		$this->_out('/Subtype /Image');
+		$this->_out('/Width '.$info['w']);
+		$this->_out('/Height '.$info['h']);
+		if($info['cs']=='Indexed')
+			$this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
+		else
+		{
+			$this->_out('/ColorSpace /'.$info['cs']);
+			if($info['cs']=='DeviceCMYK')
+				$this->_out('/Decode [1 0 1 0 1 0 1 0]');
+		}
+		$this->_out('/BitsPerComponent '.$info['bpc']);
+		if(isset($info['f']))
+			$this->_out('/Filter /'.$info['f']);
+		if(isset($info['parms']))
+			$this->_out($info['parms']);
+		if(isset($info['trns']) && is_array($info['trns']))
+		{
+			$trns='';
+			for($i=0;$i<count($info['trns']);$i++)
+				$trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';
+			$this->_out('/Mask ['.$trns.']');
+		}
+		$this->_out('/Length '.strlen($info['data']).'>>');
+		$this->_putstream($info['data']);
+		unset($this->images[$file]['data']);
+		$this->_out('endobj');
+		//Palette
+		if($info['cs']=='Indexed')
+		{
+			$this->_newobj();
+			$pal=($this->compress) ? gzcompress($info['pal']) : $info['pal'];
+			$this->_out('<<'.$filter.'/Length '.strlen($pal).'>>');
+			$this->_putstream($pal);
+			$this->_out('endobj');
+		}
+	}
+}
+
+function _putxobjectdict()
+{
+	foreach($this->images as $image)
+		$this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
+}
+
+function _putresourcedict()
+{
+	$this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
+	$this->_out('/Font <<');
+	foreach($this->fonts as $font)
+		$this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
+	$this->_out('>>');
+	$this->_out('/XObject <<');
+	$this->_putxobjectdict();
+	$this->_out('>>');
+}
+
+function _putresources()
+{
+	$this->_putfonts();
+	$this->_putimages();
+	//Resource dictionary
+	$this->offsets[2]=strlen($this->buffer);
+	$this->_out('2 0 obj');
+	$this->_out('<<');
+	$this->_putresourcedict();
+	$this->_out('>>');
+	$this->_out('endobj');
+}
+
+function _putinfo()
+{
+	$this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION));
+	if(!empty($this->title))
+		$this->_out('/Title '.$this->_textstring($this->title));
+	if(!empty($this->subject))
+		$this->_out('/Subject '.$this->_textstring($this->subject));
+	if(!empty($this->author))
+		$this->_out('/Author '.$this->_textstring($this->author));
+	if(!empty($this->keywords))
+		$this->_out('/Keywords '.$this->_textstring($this->keywords));
+	if(!empty($this->creator))
+		$this->_out('/Creator '.$this->_textstring($this->creator));
+	$this->_out('/CreationDate '.$this->_textstring('D:'.@date('YmdHis')));
+}
+
+function _putcatalog()
+{
+	$this->_out('/Type /Catalog');
+	$this->_out('/Pages 1 0 R');
+	if($this->ZoomMode=='fullpage')
+		$this->_out('/OpenAction [3 0 R /Fit]');
+	elseif($this->ZoomMode=='fullwidth')
+		$this->_out('/OpenAction [3 0 R /FitH null]');
+	elseif($this->ZoomMode=='real')
+		$this->_out('/OpenAction [3 0 R /XYZ null null 1]');
+	elseif(!is_string($this->ZoomMode))
+		$this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']');
+	if($this->LayoutMode=='single')
+		$this->_out('/PageLayout /SinglePage');
+	elseif($this->LayoutMode=='continuous')
+		$this->_out('/PageLayout /OneColumn');
+	elseif($this->LayoutMode=='two')
+		$this->_out('/PageLayout /TwoColumnLeft');
+}
+
+function _putheader()
+{
+	$this->_out('%PDF-'.$this->PDFVersion);
+}
+
+function _puttrailer()
+{
+	$this->_out('/Size '.($this->n+1));
+	$this->_out('/Root '.$this->n.' 0 R');
+	$this->_out('/Info '.($this->n-1).' 0 R');
+}
+
+function _enddoc()
+{
+	$this->_putheader();
+	$this->_putpages();
+	$this->_putresources();
+	//Info
+	$this->_newobj();
+	$this->_out('<<');
+	$this->_putinfo();
+	$this->_out('>>');
+	$this->_out('endobj');
+	//Catalog
+	$this->_newobj();
+	$this->_out('<<');
+	$this->_putcatalog();
+	$this->_out('>>');
+	$this->_out('endobj');
+	//Cross-ref
+	$o=strlen($this->buffer);
+	$this->_out('xref');
+	$this->_out('0 '.($this->n+1));
+	$this->_out('0000000000 65535 f ');
+	for($i=1;$i<=$this->n;$i++)
+		$this->_out(sprintf('%010d 00000 n ',$this->offsets[$i]));
+	//Trailer
+	$this->_out('trailer');
+	$this->_out('<<');
+	$this->_puttrailer();
+	$this->_out('>>');
+	$this->_out('startxref');
+	$this->_out($o);
+	$this->_out('%%EOF');
+	$this->state=3;
+}
+//End of class
+}
+
+//Handle special IE contype request
+if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype')
+{
+	header('Content-Type: application/pdf');
+	exit;
+}
+
+?>
Index: /trunk/reports/inc/class.uireports_cota.inc.php
===================================================================
--- /trunk/reports/inc/class.uireports_cota.inc.php	(revision 5291)
+++ /trunk/reports/inc/class.uireports_cota.inc.php	(revision 5291)
@@ -0,0 +1,705 @@
+<?php
+	/*************************************************************************************\
+	* Expresso Relatório                										         *
+	* by Elvio Rufino da Silva (elviosilva@yahoo.com.br, elviosilva@cepromat.mt.gov.br)  *
+	* -----------------------------------------------------------------------------------*
+	*  This program is free software; you can redistribute it and/or modify it			 *
+	*  under the terms of the GNU General Public License as published by the			 *
+	*  Free Software Foundation; either version 2 of the License, or (at your			 *
+	*  option) any later version.														 *
+	*************************************************************************************/
+
+	class uireports_cota
+	{
+		var $public_functions = array
+		(
+			'report_cota_group'					=> True,
+			'report_cota_group_setor_print'		=> True,			
+			'report_users_cota_print_pdf'		=> True,
+			'get_user_info'						=> True,
+			'css'								=> True
+		);
+
+		var $nextmatchs;
+		var $user;
+		var $functions;
+		var $current_config;
+		var $ldap_functions;
+		var $db_functions;
+		var $imap_functions;
+		
+		function uireports_cota()
+		{
+			$this->user			= CreateObject('reports.user');
+			$this->nextmatchs	= CreateObject('phpgwapi.nextmatchs');
+			$this->functions	= CreateObject('reports.functions');
+			$this->ldap_functions = CreateObject('reports.ldap_functions');
+			$this->db_functions = CreateObject('reports.db_functions');
+			$this->imap_functions = CreateObject('reports.imap_functions');
+			$this->fpdf = CreateObject('reports.uireports_fpdf'); // Class para PDF
+//			$this->fpdf = CreateObject('reports.fpdf'); // Class para PDF
+						
+			$c = CreateObject('phpgwapi.config','reports'); // cria o objeto relatorio no $c
+			$c->read_repository(); // na classe config do phpgwapi le os dados da tabela phpgw_config where relatorio, como passagem acima
+			$this->current_config = $c->config_data; // carrega os dados em do array no current_config
+
+			if(!@is_object($GLOBALS['phpgw']->js))
+			{
+				$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
+			}
+			$GLOBALS['phpgw']->js->validate_file('jscode','cc','reports');
+		}
+
+		function report_cota_group()
+		{
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$manager_acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $manager_acl['contexts'];
+			$conta_context = count($manager_acl['contexts_display']);
+			
+			foreach ($manager_acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$index = $index +1;
+
+				if ($conta_context == $index)
+				{
+					$context_display .= $tmp_context;
+				}
+				else
+				{
+					$context_display .= $tmp_context.'&nbsp;|&nbsp;';
+				}
+			}
+			
+			unset($GLOBALS['phpgw_info']['flags']['noheader']);
+			unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+			
+			$GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['reports']['title'].' - '.lang('report cota organization');
+			$GLOBALS['phpgw']->common->phpgw_header();
+
+			$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+			$p->set_file(array('groups'   => 'report_cota_group.tpl'));
+			$p->set_block('groups','list','list');
+			$p->set_block('groups','row','row');
+			$p->set_block('groups','row_empty','row_empty');
+
+			// Seta as variaveis padroes.
+			$var = Array(
+				'th_bg'					=> $GLOBALS['phpgw_info']['theme']['th_bg'],
+				'back_url'				=> $GLOBALS['phpgw']->link('/reports/index.php'),
+				'context_display'		=> $context_display
+			);
+			$p->set_var($var);
+			$p->set_var($this->functions->make_dinamic_lang($p, 'list'));
+			
+
+			$GLOBALS['organizacaodn'] = $_POST['organizacaodn'];
+
+			$contextsdn = $GLOBALS['organizacaodn'];
+
+			// Save query
+			$varorganizacao = explode(",",$contextsdn);
+			$varorganizacao_nome = trim(strtoupper(ereg_replace("ou=","",$varorganizacao[0])));
+			$varorganizacao_nome = trim(strtoupper(ereg_replace("DC=","",$varorganizacao_nome)));
+			$user_logon = $GLOBALS['phpgw_info']['user'][account_lid];
+
+			$sectors_info = $this->functions->get_list_context_logon($user_logon,$contexts,0);
+			$sectors_info_dn = $this->functions->get_list_groups_dn($user_logon,$contexts,0);
+
+			if (!count($sectors_info))
+			{
+				$p->set_var('notselect',lang('No matches found'));
+			}
+			else
+			{
+				foreach($sectors_info as $context=>$sector)
+				{
+					$sectordn = $sectors_info_dn[$context];
+
+					$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+					
+					if ($context == 0 && $contextsdn <> "")
+					{
+						if ( trim(strtoupper($varorganizacao_nome)) ==  trim(strtoupper($sector)))
+						{
+							$sector_options .= "<option selected value='" .$contextsdn. "'>" .$varorganizacao_nome. "</option>";
+						}
+						else
+						{
+							$sector_options .= "<option selected value='" .$contextsdn. "'>" .$varorganizacao_nome. "</option>";
+							$sector_options .= "<option value='" . $sectordn . "'>". $sector . "</option>";
+						}
+
+					}
+					else
+					{
+						if ( trim(strtoupper($varorganizacao_nome)) !=  trim(strtoupper($sector)))
+						{
+							$sectorok = trim(strtoupper(ereg_replace("dc=","",$sector)));
+							$sectorok = trim(strtoupper(ereg_replace("DC=","",$sectorok)));
+							$sector_options .= "<option value='" . $sectordn . "'>". $sectorok . "</option>";
+						}
+					}
+
+					$varselect = Array(
+						'tr_color'    	=> $tr_color,
+						'organizacaodn'	=> $contextsdn,
+						'group_name'  	=> $sector_options
+					);					
+				}
+				$p->set_var($varselect);
+			}
+			
+			// ************** inicio carregar a sub-lista das organizações ****************
+			//Admin make a search
+			if ($GLOBALS['organizacaodn'] != '')
+			{
+				// Conta a quantidade de Usuario do grupo raiz
+				$account_user = $this->functions->get_count_user_sector($contextsdn,$contexts,0);
+				$totaluser = "(".$account_user.")";
+
+				$p->set_var('organizacao', $varorganizacao_nome);
+				$p->set_var('all_user', lang('all'));
+				$p->set_var('total_user', $totaluser);
+
+				$setorg = $contextsdn;
+
+				$groups_info = $this->functions->get_sectors_list($contexts,$setorg);
+
+				if (!count($groups_info))
+				{
+					$p->set_var('message',lang('No sector found'));
+					$p->parse('rows','row_empty',True);				
+				}
+				else
+				{
+					$ii = 0;
+					foreach($groups_info as $context=>$groups)
+					{
+						$explode_groups = explode("#",$groups);
+
+						$ii = $ii + 1;
+
+						$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+						
+						$varsuborg = Array(
+							'tr_color'					=> $tr_color,
+							'formname'					=> "form".$ii,
+							'formsubmit'				=> "document.form".$ii.".submit()",
+							'sector_name'				=> $explode_groups[0],
+							'sector_namedn'				=> $explode_groups[1],
+							'sector_namedn_completo'	=> $explode_groups[2],														
+						);					
+
+						$p->set_var($varsuborg);					
+						$p->parse('rows','row',True);
+					}
+				}
+			}
+
+			$p->pfp('out','list');
+		}
+
+		function report_cota_group_setor_print()
+		{
+			$grouplist = trim($_POST[setor]);
+			$grouplist = trim(ereg_replace("-","",$grouplist));
+			$organizacao = trim($_POST[organizacao]);
+			$setordn = trim($_POST[setordn]);
+			$organizacaodn = trim($_POST[organizacaodn]);
+			$sectornamedncompleto = trim($_POST[sectornamedncompleto]);
+			$Psectornamedncompleto = trim($_POST[Psectornamedncompleto]);			
+
+			if ($sectornamedncompleto=="" && $Psectornamedncompleto=="")
+			{			
+				$sectornamedncompleto = $organizacao;
+			}
+			else if ($sectornamedncompleto=="" && $Psectornamedncompleto <> "")
+			{
+				$sectornamedncompleto = $Psectornamedncompleto;
+			}
+			else
+			{
+				$sectornamedncompleto = $organizacao." | ".$sectornamedncompleto;
+			}
+
+			$data_atual = date("d/m/Y"); 
+			$titulo_system = $GLOBALS['phpgw_info']['apps']['reports']['title'];
+			
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $acl['contexts'];
+			foreach ($acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$context_display .= $tmp_context;
+			}
+			// Verifica se o administrador tem acesso.
+			if (!$this->functions->check_acl($account_lid,'list_users'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			unset($GLOBALS['phpgw_info']['flags']['noheader']);
+			unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+			$GLOBALS['phpgw_info']['flags']['app_header'] =  $GLOBALS['phpgw_info']['apps']['reports']['title'].' - '.lang('report user');
+			$GLOBALS['phpgw']->common->phpgw_header();
+
+			$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+			$p->set_file(Array('accounts' => 'report_cota_group_print.tpl'));
+			$p->set_block('accounts','body');
+			$p->set_block('accounts','rowpag');
+			$p->set_block('accounts','row');
+			$p->set_block('accounts','row_empty');
+			
+			$var = Array(
+				'bg_color'					=> $GLOBALS['phpgw_info']['theme']['bg_color'],
+				'th_bg'						=> $GLOBALS['phpgw_info']['theme']['th_bg'],
+				'subtitulo'					=> lang('reports title4'),
+				'subtitulo1'				=> $sectornamedncompleto,
+				'context'					=> $raw_context,
+				'titulo'					=> $titulo_system,
+				'data_atual'				=> $data_atual,				
+				'context_display'			=> $context_display,
+				'organizacaodn'				=> $organizacaodn,
+				'organizacao'				=> $organizacao,
+				'sector_name'				=> $grouplist,
+				'sector_namedn'				=> $setordn,
+				'graphic'					=> lang('Generate graphic'),
+				'imapDelimiter'				=> $_SESSION['phpgw_info']['expresso']['email_server']['imapDelimiter']
+			);
+
+			$p->set_var($var);
+			$p->set_var($this->functions->make_dinamic_lang($p, 'body'));
+
+			// ************ PAGINAÇÃO *******************************
+
+			// verifica se exixte usuarios no LDAP
+			$account_info = $this->functions->get_list_user_sector ($setordn,$contexts,0);
+
+			if (!count($account_info))
+			{
+				$p->set_var('message',lang('No user found'));
+				$p->parse('rows','row_empty',True);
+			}
+			else if (count($account_info))
+			{ 
+				//url do paginador 
+				$url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/index.php?menuaction=reports.uireports_cota.report_cota_group_setor_print';
+
+				// **** Grupo de paginas ****
+				$gpag = $_POST[gpage];
+
+				$grupopage = 20;
+				
+				if (!$gpag){
+					$gpag  = 1;
+				}
+
+				// recebe o numero da pagina
+				$npag = $_POST[page];
+
+				// verifica se o get com o numero da pagina é nulo
+				if (!$npag)
+				{
+					$npag = 1;
+				}
+
+				// conta total dos registros
+				$numreg = count($account_info);
+				
+				// numero de registro por paginação
+				$numpage = 53;
+				
+				$tp = ceil($numreg/$numpage);
+				$inicio = $page - 1;
+				$inicio = $inicio * $numpage;
+	
+				// valor maximo de paginação
+				$totalnpag =  (int)($tp/$grupopage);
+				$restonpag = $tp % $grupopage;
+
+				if ($restonpag > 0)
+				{
+					$maxtotalnpag = $totalnpag + 1;
+				}
+				else
+				{
+					$maxtotalnpag = $totalnpag;
+				}
+				// inicio fim para imprimir a paginação
+				if( $tp > $grupopage)
+				{
+					// inicio do for da paginação
+					if ($gpag <= ($totalnpag))
+					{
+						$fimgpg = $gpag * $grupopage;
+						$iniciogpg = (($fimgpg - $grupopage)+1);
+					}
+					else
+					{
+						$iniciogpg = (($gpag - 1) * $grupopage);
+						$fimgpg = $iniciogpg + $restonpag;
+					}
+				}
+				else
+				{
+					// inicio do for da paginação
+					$iniciogpg = 1;
+					$fimgpg =  $tp;
+				}
+
+				// Imprime valores de contagen de registro e pagina
+				$p->set_var('cont_user',$numreg);
+				$p->set_var('cont_page',$tp);
+				$p->set_var('page_now',$npag);
+
+				// ********** busca no LDAP as informação paginada e imprime ****************
+				$paginas =  $this->functions->Paginate_user('accounts',$setordn,$contexts,'cn','asc',$npag,$numpage);
+
+				$tmpp = array();
+
+				while (list($null,$accountp) = each($paginas))
+				{
+					$tmpp[$accountp['uid'][0]]['account_id']	 = $accountp['uidNumber'][0]; 
+					$tmpp[$accountp['uid'][0]]['account_lid'] = $accountp['uid'][0];
+					$tmpp[$accountp['uid'][0]]['account_cn']	 = $accountp['cn'][0];
+					$tmpp[$accountp['uid'][0]]['account_status']= $accountp['accountStatus'][0];
+					$tmpp[$accountp['uid'][0]]['account_mail']= $accountp['mail'][0];
+					$sortp[] = $accountp['uid'][0];
+					if (count($sortp))
+					{
+						natcasesort($sortp);
+						foreach ($sortp as $user_uidp)
+						$returnp[$user_uidp] = $tmpp[$user_uidp];
+					}
+				}
+
+				while (list($null,$accountr) = each($returnp))
+				{
+					$this->nextmatchs->template_alternate_row_color($p);
+
+					$user_info_cota = $this->imap_functions->get_user_info($accountr['account_lid']);
+					$user_mailquota = $user_info_cota['mailquota'] == '-1' ? 0 : $user_info_cota['mailquota'];
+					$user_mailquota_used = $user_info_cota['mailquota_used'] == '-1' ? 0 : $user_info_cota['mailquota_used'];
+
+					$user_mailquota = number_format(round($user_mailquota,2), 2, '.', ',');
+					$user_mailquota_used = number_format(round($user_mailquota_used,2), 2, '.', ',');
+
+
+					if ($user_mailquota > 0)
+					{
+						$percent_cota = number_format(round((($user_mailquota_used * 100)/$user_mailquota),2), 2, '.', ',');
+					}
+					else
+					{
+						$percent_cota = number_format(0, 2, '.', ',');
+					}
+					
+
+					if ($percent_cota < 91)
+					{
+						$percent_cota_c = '<font color="#0033FF">'.$percent_cota.'%</font>';
+					}
+					elseif ($percent_cota < 97)
+					{
+						$percent_cota_c = '<font color="#CC3300">'.$percent_cota.'%</font>';
+					}
+					else
+					{
+						 $percent_cota_c = '<font color="#FF0000"><b>'.$percent_cota.'%</b></font>';
+					}
+
+					$varr = array(
+						'mailquota'			=> $user_mailquota,
+						'mailquota_used'	=> $user_mailquota_used,
+						'row_loginid'		=> $accountr['account_lid'],
+						'row_cn'			=> $accountr['account_cn'],
+						'percent_cota'		=> $percent_cota_c,
+						'row_status'		=> $accountr['account_status'] == 'active' ? '<font color="#0033FF">Ativado</font> ' : '<font color="#FF0000">Desativado</font>',
+						'row_mail'			=> (!$accountr['account_mail']?'<font color=red>Sem E-mail</font>':$accountr['account_mail'])
+					);
+					
+					$p->set_var($varr);
+	
+					$p->parse('rows','row',True);
+				}
+				// ********************** Fim ****************************
+
+				// grupo de pagina anteriores
+				if ($gpag > 1)
+				{
+					$gpaga = $gpag - 1;
+					$varp = Array(
+						'paginat'	=> 	"<form name='anterior' method='POST' action='$url'>
+						<input type='hidden' name='setor' value='$grouplist'>
+						<input type='hidden' name='organizacao' value='$organizacao'>
+						<input type='hidden' name='setordn' value='$setordn'>
+						<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+						<input type='hidden' name='page' value='$npag'>
+						<input type='hidden' name='gpage' value='$gpaga'>
+						<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+						<div style='float:left;' onClick='document.anterior.submit()'><a href='#'>".lang('Previous Pages')."<<&nbsp;&nbsp;&nbsp;</a></div></form>"
+					);
+					$p->set_var($varp);						
+	
+						$p->parse('pages','rowpag',True);
+				}
+				// **** FIM *******
+
+				// imprime a paginação
+				if ($fimgpg > 1)
+				{
+					for($x = $iniciogpg; $x <= $fimgpg; $x++)
+					{
+						$varp = Array(
+							'paginat'	=>  "<form name='form".$x."' method='POST' action='$url'>
+							<input type='hidden' name='setor' value='$grouplist'>
+							<input type='hidden' name='organizacao' value='$organizacao'>
+							<input type='hidden' name='setordn' value='$setordn'>
+							<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+							<input type='hidden' name='page' value='$x'>
+							<input type='hidden' name='gpage' value='$gpag'>
+							<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>							
+							<div style='float:left;' onClick='document.form".$x.".submit()'><a href='#'>$x&nbsp;</a></div></form>"
+						);
+						$p->set_var($varp);						
+	
+						$p->parse('pages','rowpag',True);
+					}
+				}
+		
+				// proximo grupo de pagina
+				if ($gpag < $maxtotalnpag && $maxtotalnpag > 0) 
+				{
+					$gpagp = $gpag + 1;
+					$varp = Array(
+						'paginat'	=>  "<form name='proximo' method='POST' action='$url'>
+						<input type='hidden' name='setor' value='$grouplist'>
+						<input type='hidden' name='organizacao' value='$organizacao'>
+						<input type='hidden' name='setordn' value='$setordn'>
+						<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+						<input type='hidden' name='page' value='$npag'>
+						<input type='hidden' name='gpage' value='$gpagp'>
+						<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+						<div style='float:left;' onClick='document.proximo.submit()'><a href='#'>&nbsp;&nbsp;&nbsp;>>".lang('Next Page')."</a></div></form>"
+					);
+					$p->set_var($varp);						
+
+					$p->parse('pages','rowpag',True);
+				}
+
+			// ************************* FIM PAGINAÇÃO ***********************							
+			}
+			$p->pfp('out','body');
+		}
+
+		function report_users_cota_print_pdf()
+		{
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $acl['contexts'];
+			foreach ($acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$context_display .= $tmp_context;
+			}
+
+
+			if (!$this->functions->check_acl($account_lid,'list_users'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			$grouplist = trim($_POST[setor]);
+			$grouplist = trim(ereg_replace("-","",$grouplist));
+
+			$setordn = trim($_POST[setordn]);
+			$subtitulo1 = trim($_POST[subtitulo]);
+			
+			define('FPDF_FONTPATH','font/');
+			$data_atual = date("d/m/Y"); 
+			$titulo_system = $GLOBALS['phpgw_info']['apps']['reports']['title'];			
+
+			$pdf=new uireports_fpdf("L");
+			$pdf->Open();
+			$pdf->AddPage();
+			$pdf->SetTitle('Relatório Gerado pelo Expresso Reports');
+
+			//Set font and colors
+			$pdf->SetFont('Arial','B',14);
+			$pdf->SetFillColor(0,0,0);
+			$pdf->SetTextColor(0,0,200);
+			$pdf->SetDrawColor(0,0,0);
+			$pdf->SetLineWidth(.2);
+
+			//Table header
+			$SubTitulo = lang('reports title4');
+			$SubTituloR = lang('report cota organization');
+			$SubTitulo1 = $subtitulo1;
+			$GLOBALS['phpgw_info']['apps']['reports']['subtitle'] = $SubTituloR;
+			$pdf->Cell(0,8,$SubTitulo,0,1,'C',0);
+
+
+			//Set font and colors
+			$pdf->SetFont('Arial','B',8);
+			$pdf->SetFillColor(0,0,0);
+			$pdf->SetTextColor(0,0,200);
+			$pdf->SetDrawColor(0,0,0);
+			$pdf->SetLineWidth(.3);
+
+//			$pdf->Cell(0,10,$SubTitulo1,0,1,'C',0);
+			$pdf->MultiCell(0,3,$SubTitulo1,0,'C',0);
+
+			
+			$pdf->Cell(0,2,' ',0,1,'C',0);
+			$pdf->Cell(0,5,'Data..: '.$data_atual,0,0,'L',0);
+			$pdf->Cell(0,5,$titulo_system,0,1,'R',0);
+												
+			$account_info = $this->functions->get_list_user_sector($setordn,$contexts,0);
+
+			if (count($account_info))
+			{ 
+				//Restore font and colors
+				$pdf->SetFont('Arial','',8);
+				$pdf->SetFillColor(224,235,255);
+				$pdf->SetTextColor(0);
+
+				$pdf->Cell(55,5,lang('loginid'),1,0,'L',1);
+				$pdf->Cell(55,5,lang('name'),1,0,'L',1);
+				$pdf->Cell(70,5,lang('report email'),1,0,'L',1);
+				$pdf->Cell(17,5,lang('cota'),1,0,'C',1);
+				$pdf->Cell(31,5,lang('cota used'),1,0,'C',1);
+				$pdf->Cell(29,5,lang('percent cota'),1,0,'C',1);				
+				$pdf->Cell(20,5,lang('status'),1,1,'C',1);
+
+				while (list($null,$account) = each($account_info))
+				{
+					$user_info_cota = $this->imap_functions->get_user_info($account['account_lid']);
+					$user_mailquota = $user_info_cota['mailquota'] == '-1' ? 0 : $user_info_cota['mailquota'];
+					$user_mailquota_used = $user_info_cota['mailquota_used'] == '-1' ? 0 : $user_info_cota['mailquota_used'];
+
+					$user_mailquota = number_format(round($user_mailquota,2), 2, '.', ',');
+					$user_mailquota_used = number_format(round($user_mailquota_used,2), 2, '.', ',');
+
+
+					if ($user_mailquota > 0)
+					{
+						$percent_cota = number_format(round((($user_mailquota_used * 100)/$user_mailquota),2), 2, '.', ',');
+					}
+					else
+					{
+						$percent_cota = number_format(0, 2, '.', ',');
+					}
+
+					$account_lid = $account['account_lid'];
+					$row_cn = $account['account_cn'];
+					$row_mail = (!$account['account_mail']?'<font color=red>Sem E-mail</font>':$account['account_mail']);
+					$row_mailquota = $user_mailquota;
+					$row_mailquota_used = $user_mailquota_used;
+					$row_percent_cota = $percent_cota;
+					$row_status = $account['account_accountstatus'] == 'active' ? 'Ativado' : 'Desativado';
+
+					
+					$pdf->Cell(55,5,$account_lid,0,0,'L',0);
+					$pdf->Cell(55,5,$row_cn,0,0,'L',0);
+					$pdf->Cell(70,5,$row_mail,0,0,'L',0);
+					$pdf->Cell(17,5,$row_mailquota,0,0,'R',0);
+					$pdf->Cell(31,5,$row_mailquota_used,0,0,'R',0);
+
+					if ($percent_cota < 91)
+					{
+						//Restaura cor fonte
+						$pdf->SetTextColor(0);
+						$pdf->Cell(29,5,$row_percent_cota,0,0,'R',0);												
+					}
+					elseif ($percent_cota < 97)
+					{
+						//Muda cor fonte
+						$pdf->SetTextColor(0,256,0);
+						$pdf->Cell(29,5,$row_percent_cota,0,0,'R',0);												
+						//Restaura cor fonte
+						$pdf->SetTextColor(0);
+					}
+					else
+					{
+						//Muda cor fonte
+						$pdf->SetTextColor(256,0,0);
+						$pdf->Cell(29,5,$row_percent_cota,0,0,'R',0);												
+						//Restaura cor fonte
+						$pdf->SetTextColor(0);
+					}
+
+					if ($row_status == 'Ativado')
+					{
+						//Restaura cor fonte
+						$pdf->SetTextColor(0);
+						$pdf->Cell(20,5,$row_status,0,1,'C',0);
+					}
+					else
+					{
+						//Muda cor fonte
+						$pdf->SetTextColor(256,0,0);
+						$pdf->Cell(20,5,$row_status,0,1,'C',0);					
+						//Restaura cor fonte
+						$pdf->SetTextColor(0);
+					}
+				}
+			}
+
+			$pdf->Output();
+
+			return; 
+		}
+
+		function get_user_info($userdn,$usercontexts,$usersizelimit)
+		{
+//			$user_info = $this->functions->Paginate_user('accounts',$setordn,$contexts,'cn','asc',$npag,$numpage);
+			$user_info_imap = $this->imap_functions->get_user_info($user_info_ldap['uid']);
+
+			return $user_info;
+		}
+
+		function css()
+		{
+			$appCSS = 
+			'th.activetab
+			{
+				color:#000000;
+				background-color:#D3DCE3;
+				border-top-width : 1px;
+				border-top-style : solid;
+				border-top-color : Black;
+				border-left-width : 1px;
+				border-left-style : solid;
+				border-left-color : Black;
+				border-right-width : 1px;
+				border-right-style : solid;
+				border-right-color : Black;
+				font-size: 12px;
+				font-family: Tahoma, Arial, Helvetica, sans-serif;
+			}
+			
+			th.inactivetab
+			{
+				color:#000000;
+				background-color:#E8F0F0;
+				border-bottom-width : 1px;
+				border-bottom-style : solid;
+				border-bottom-color : Black;
+				font-size: 12px;
+				font-family: Tahoma, Arial, Helvetica, sans-serif;				
+			}
+			
+			.td_left {border-left:1px solid Gray; border-top:1px solid Gray; border-bottom:1px solid Gray;}
+			.td_right {border-right:1px solid Gray; border-top:1px solid Gray; border-bottom:1px solid Gray;}
+			
+			div.activetab{ display:inline; }
+			div.inactivetab{ display:none; }';
+			
+			return $appCSS;
+		}
+
+	}
+?>
Index: /trunk/reports/inc/font/timesi.php
===================================================================
--- /trunk/reports/inc/font/timesi.php	(revision 5291)
+++ /trunk/reports/inc/font/timesi.php	(revision 5291)
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['timesI']=array(
+	chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+	chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675,
+	','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611,
+	'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833,
+	'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722,
+	'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
+	chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980,
+	chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333,
+	chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611,
+	chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
+	chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444);
+?>
Index: /trunk/reports/inc/font/timesbi.php
===================================================================
--- /trunk/reports/inc/font/timesbi.php	(revision 5291)
+++ /trunk/reports/inc/font/timesbi.php	(revision 5291)
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['timesBI']=array(
+	chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+	chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
+	','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667,
+	'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889,
+	'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
+	'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
+	chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+	chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333,
+	chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
+	chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
+	chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444);
+?>
Index: /trunk/reports/inc/font/zapfdingbats.php
===================================================================
--- /trunk/reports/inc/font/zapfdingbats.php	(revision 5291)
+++ /trunk/reports/inc/font/zapfdingbats.php	(revision 5291)
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['zapfdingbats']=array(
+	chr(0)=>0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0,
+	chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939,
+	','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692,
+	'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776,
+	'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873,
+	'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317,
+	chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
+	chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788,
+	chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788,
+	chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918,
+	chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874,
+	chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0);
+?>
Index: /trunk/reports/inc/font/helveticai.php
===================================================================
--- /trunk/reports/inc/font/helveticai.php	(revision 5291)
+++ /trunk/reports/inc/font/helveticai.php	(revision 5291)
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['helveticaI']=array(
+	chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
+	chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
+	','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
+	'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
+	'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
+	'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
+	chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+	chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
+	chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
+	chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
+	chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
+?>
Index: /trunk/reports/inc/font/makefont/iso-8859-1.map
===================================================================
--- /trunk/reports/inc/font/makefont/iso-8859-1.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/iso-8859-1.map	(revision 5291)
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+00AA ordfeminine
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00B8 cedilla
+!B9 U+00B9 onesuperior
+!BA U+00BA ordmasculine
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00BF questiondown
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+00C3 Atilde
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+00CC Igrave
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+00D0 Eth
+!D1 U+00D1 Ntilde
+!D2 U+00D2 Ograve
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+00DD Yacute
+!DE U+00DE Thorn
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+00E3 atilde
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+00EC igrave
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+00F0 eth
+!F1 U+00F1 ntilde
+!F2 U+00F2 ograve
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+00FD yacute
+!FE U+00FE thorn
+!FF U+00FF ydieresis
Index: /trunk/reports/inc/font/makefont/iso-8859-2.map
===================================================================
--- /trunk/reports/inc/font/makefont/iso-8859-2.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/iso-8859-2.map	(revision 5291)
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+0104 Aogonek
+!A2 U+02D8 breve
+!A3 U+0141 Lslash
+!A4 U+00A4 currency
+!A5 U+013D Lcaron
+!A6 U+015A Sacute
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+0160 Scaron
+!AA U+015E Scedilla
+!AB U+0164 Tcaron
+!AC U+0179 Zacute
+!AD U+00AD hyphen
+!AE U+017D Zcaron
+!AF U+017B Zdotaccent
+!B0 U+00B0 degree
+!B1 U+0105 aogonek
+!B2 U+02DB ogonek
+!B3 U+0142 lslash
+!B4 U+00B4 acute
+!B5 U+013E lcaron
+!B6 U+015B sacute
+!B7 U+02C7 caron
+!B8 U+00B8 cedilla
+!B9 U+0161 scaron
+!BA U+015F scedilla
+!BB U+0165 tcaron
+!BC U+017A zacute
+!BD U+02DD hungarumlaut
+!BE U+017E zcaron
+!BF U+017C zdotaccent
+!C0 U+0154 Racute
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+0102 Abreve
+!C4 U+00C4 Adieresis
+!C5 U+0139 Lacute
+!C6 U+0106 Cacute
+!C7 U+00C7 Ccedilla
+!C8 U+010C Ccaron
+!C9 U+00C9 Eacute
+!CA U+0118 Eogonek
+!CB U+00CB Edieresis
+!CC U+011A Ecaron
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+010E Dcaron
+!D0 U+0110 Dcroat
+!D1 U+0143 Nacute
+!D2 U+0147 Ncaron
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+0150 Ohungarumlaut
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+0158 Rcaron
+!D9 U+016E Uring
+!DA U+00DA Uacute
+!DB U+0170 Uhungarumlaut
+!DC U+00DC Udieresis
+!DD U+00DD Yacute
+!DE U+0162 Tcommaaccent
+!DF U+00DF germandbls
+!E0 U+0155 racute
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+0103 abreve
+!E4 U+00E4 adieresis
+!E5 U+013A lacute
+!E6 U+0107 cacute
+!E7 U+00E7 ccedilla
+!E8 U+010D ccaron
+!E9 U+00E9 eacute
+!EA U+0119 eogonek
+!EB U+00EB edieresis
+!EC U+011B ecaron
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+010F dcaron
+!F0 U+0111 dcroat
+!F1 U+0144 nacute
+!F2 U+0148 ncaron
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+0151 ohungarumlaut
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+0159 rcaron
+!F9 U+016F uring
+!FA U+00FA uacute
+!FB U+0171 uhungarumlaut
+!FC U+00FC udieresis
+!FD U+00FD yacute
+!FE U+0163 tcommaaccent
+!FF U+02D9 dotaccent
Index: /trunk/reports/inc/font/makefont/cp874.map
===================================================================
--- /trunk/reports/inc/font/makefont/cp874.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/cp874.map	(revision 5291)
@@ -0,0 +1,225 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!85 U+2026 ellipsis
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!A0 U+00A0 space
+!A1 U+0E01 kokaithai
+!A2 U+0E02 khokhaithai
+!A3 U+0E03 khokhuatthai
+!A4 U+0E04 khokhwaithai
+!A5 U+0E05 khokhonthai
+!A6 U+0E06 khorakhangthai
+!A7 U+0E07 ngonguthai
+!A8 U+0E08 chochanthai
+!A9 U+0E09 chochingthai
+!AA U+0E0A chochangthai
+!AB U+0E0B sosothai
+!AC U+0E0C chochoethai
+!AD U+0E0D yoyingthai
+!AE U+0E0E dochadathai
+!AF U+0E0F topatakthai
+!B0 U+0E10 thothanthai
+!B1 U+0E11 thonangmonthothai
+!B2 U+0E12 thophuthaothai
+!B3 U+0E13 nonenthai
+!B4 U+0E14 dodekthai
+!B5 U+0E15 totaothai
+!B6 U+0E16 thothungthai
+!B7 U+0E17 thothahanthai
+!B8 U+0E18 thothongthai
+!B9 U+0E19 nonuthai
+!BA U+0E1A bobaimaithai
+!BB U+0E1B poplathai
+!BC U+0E1C phophungthai
+!BD U+0E1D fofathai
+!BE U+0E1E phophanthai
+!BF U+0E1F fofanthai
+!C0 U+0E20 phosamphaothai
+!C1 U+0E21 momathai
+!C2 U+0E22 yoyakthai
+!C3 U+0E23 roruathai
+!C4 U+0E24 ruthai
+!C5 U+0E25 lolingthai
+!C6 U+0E26 luthai
+!C7 U+0E27 wowaenthai
+!C8 U+0E28 sosalathai
+!C9 U+0E29 sorusithai
+!CA U+0E2A sosuathai
+!CB U+0E2B hohipthai
+!CC U+0E2C lochulathai
+!CD U+0E2D oangthai
+!CE U+0E2E honokhukthai
+!CF U+0E2F paiyannoithai
+!D0 U+0E30 saraathai
+!D1 U+0E31 maihanakatthai
+!D2 U+0E32 saraaathai
+!D3 U+0E33 saraamthai
+!D4 U+0E34 saraithai
+!D5 U+0E35 saraiithai
+!D6 U+0E36 sarauethai
+!D7 U+0E37 saraueethai
+!D8 U+0E38 sarauthai
+!D9 U+0E39 sarauuthai
+!DA U+0E3A phinthuthai
+!DF U+0E3F bahtthai
+!E0 U+0E40 saraethai
+!E1 U+0E41 saraaethai
+!E2 U+0E42 saraothai
+!E3 U+0E43 saraaimaimuanthai
+!E4 U+0E44 saraaimaimalaithai
+!E5 U+0E45 lakkhangyaothai
+!E6 U+0E46 maiyamokthai
+!E7 U+0E47 maitaikhuthai
+!E8 U+0E48 maiekthai
+!E9 U+0E49 maithothai
+!EA U+0E4A maitrithai
+!EB U+0E4B maichattawathai
+!EC U+0E4C thanthakhatthai
+!ED U+0E4D nikhahitthai
+!EE U+0E4E yamakkanthai
+!EF U+0E4F fongmanthai
+!F0 U+0E50 zerothai
+!F1 U+0E51 onethai
+!F2 U+0E52 twothai
+!F3 U+0E53 threethai
+!F4 U+0E54 fourthai
+!F5 U+0E55 fivethai
+!F6 U+0E56 sixthai
+!F7 U+0E57 seventhai
+!F8 U+0E58 eightthai
+!F9 U+0E59 ninethai
+!FA U+0E5A angkhankhuthai
+!FB U+0E5B khomutthai
Index: /trunk/reports/inc/font/makefont/iso-8859-4.map
===================================================================
--- /trunk/reports/inc/font/makefont/iso-8859-4.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/iso-8859-4.map	(revision 5291)
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+0104 Aogonek
+!A2 U+0138 kgreenlandic
+!A3 U+0156 Rcommaaccent
+!A4 U+00A4 currency
+!A5 U+0128 Itilde
+!A6 U+013B Lcommaaccent
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+0160 Scaron
+!AA U+0112 Emacron
+!AB U+0122 Gcommaaccent
+!AC U+0166 Tbar
+!AD U+00AD hyphen
+!AE U+017D Zcaron
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+0105 aogonek
+!B2 U+02DB ogonek
+!B3 U+0157 rcommaaccent
+!B4 U+00B4 acute
+!B5 U+0129 itilde
+!B6 U+013C lcommaaccent
+!B7 U+02C7 caron
+!B8 U+00B8 cedilla
+!B9 U+0161 scaron
+!BA U+0113 emacron
+!BB U+0123 gcommaaccent
+!BC U+0167 tbar
+!BD U+014A Eng
+!BE U+017E zcaron
+!BF U+014B eng
+!C0 U+0100 Amacron
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+00C3 Atilde
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+012E Iogonek
+!C8 U+010C Ccaron
+!C9 U+00C9 Eacute
+!CA U+0118 Eogonek
+!CB U+00CB Edieresis
+!CC U+0116 Edotaccent
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+012A Imacron
+!D0 U+0110 Dcroat
+!D1 U+0145 Ncommaaccent
+!D2 U+014C Omacron
+!D3 U+0136 Kcommaaccent
+!D4 U+00D4 Ocircumflex
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+0172 Uogonek
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+0168 Utilde
+!DE U+016A Umacron
+!DF U+00DF germandbls
+!E0 U+0101 amacron
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+00E3 atilde
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+012F iogonek
+!E8 U+010D ccaron
+!E9 U+00E9 eacute
+!EA U+0119 eogonek
+!EB U+00EB edieresis
+!EC U+0117 edotaccent
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+012B imacron
+!F0 U+0111 dcroat
+!F1 U+0146 ncommaaccent
+!F2 U+014D omacron
+!F3 U+0137 kcommaaccent
+!F4 U+00F4 ocircumflex
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+0173 uogonek
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+0169 utilde
+!FE U+016B umacron
+!FF U+02D9 dotaccent
Index: /trunk/reports/inc/font/makefont/iso-8859-5.map
===================================================================
--- /trunk/reports/inc/font/makefont/iso-8859-5.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/iso-8859-5.map	(revision 5291)
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+0401 afii10023
+!A2 U+0402 afii10051
+!A3 U+0403 afii10052
+!A4 U+0404 afii10053
+!A5 U+0405 afii10054
+!A6 U+0406 afii10055
+!A7 U+0407 afii10056
+!A8 U+0408 afii10057
+!A9 U+0409 afii10058
+!AA U+040A afii10059
+!AB U+040B afii10060
+!AC U+040C afii10061
+!AD U+00AD hyphen
+!AE U+040E afii10062
+!AF U+040F afii10145
+!B0 U+0410 afii10017
+!B1 U+0411 afii10018
+!B2 U+0412 afii10019
+!B3 U+0413 afii10020
+!B4 U+0414 afii10021
+!B5 U+0415 afii10022
+!B6 U+0416 afii10024
+!B7 U+0417 afii10025
+!B8 U+0418 afii10026
+!B9 U+0419 afii10027
+!BA U+041A afii10028
+!BB U+041B afii10029
+!BC U+041C afii10030
+!BD U+041D afii10031
+!BE U+041E afii10032
+!BF U+041F afii10033
+!C0 U+0420 afii10034
+!C1 U+0421 afii10035
+!C2 U+0422 afii10036
+!C3 U+0423 afii10037
+!C4 U+0424 afii10038
+!C5 U+0425 afii10039
+!C6 U+0426 afii10040
+!C7 U+0427 afii10041
+!C8 U+0428 afii10042
+!C9 U+0429 afii10043
+!CA U+042A afii10044
+!CB U+042B afii10045
+!CC U+042C afii10046
+!CD U+042D afii10047
+!CE U+042E afii10048
+!CF U+042F afii10049
+!D0 U+0430 afii10065
+!D1 U+0431 afii10066
+!D2 U+0432 afii10067
+!D3 U+0433 afii10068
+!D4 U+0434 afii10069
+!D5 U+0435 afii10070
+!D6 U+0436 afii10072
+!D7 U+0437 afii10073
+!D8 U+0438 afii10074
+!D9 U+0439 afii10075
+!DA U+043A afii10076
+!DB U+043B afii10077
+!DC U+043C afii10078
+!DD U+043D afii10079
+!DE U+043E afii10080
+!DF U+043F afii10081
+!E0 U+0440 afii10082
+!E1 U+0441 afii10083
+!E2 U+0442 afii10084
+!E3 U+0443 afii10085
+!E4 U+0444 afii10086
+!E5 U+0445 afii10087
+!E6 U+0446 afii10088
+!E7 U+0447 afii10089
+!E8 U+0448 afii10090
+!E9 U+0449 afii10091
+!EA U+044A afii10092
+!EB U+044B afii10093
+!EC U+044C afii10094
+!ED U+044D afii10095
+!EE U+044E afii10096
+!EF U+044F afii10097
+!F0 U+2116 afii61352
+!F1 U+0451 afii10071
+!F2 U+0452 afii10099
+!F3 U+0453 afii10100
+!F4 U+0454 afii10101
+!F5 U+0455 afii10102
+!F6 U+0456 afii10103
+!F7 U+0457 afii10104
+!F8 U+0458 afii10105
+!F9 U+0459 afii10106
+!FA U+045A afii10107
+!FB U+045B afii10108
+!FC U+045C afii10109
+!FD U+00A7 section
+!FE U+045E afii10110
+!FF U+045F afii10193
Index: /trunk/reports/inc/font/makefont/koi8-r.map
===================================================================
--- /trunk/reports/inc/font/makefont/koi8-r.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/koi8-r.map	(revision 5291)
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+2500 SF100000
+!81 U+2502 SF110000
+!82 U+250C SF010000
+!83 U+2510 SF030000
+!84 U+2514 SF020000
+!85 U+2518 SF040000
+!86 U+251C SF080000
+!87 U+2524 SF090000
+!88 U+252C SF060000
+!89 U+2534 SF070000
+!8A U+253C SF050000
+!8B U+2580 upblock
+!8C U+2584 dnblock
+!8D U+2588 block
+!8E U+258C lfblock
+!8F U+2590 rtblock
+!90 U+2591 ltshade
+!91 U+2592 shade
+!92 U+2593 dkshade
+!93 U+2320 integraltp
+!94 U+25A0 filledbox
+!95 U+2219 periodcentered
+!96 U+221A radical
+!97 U+2248 approxequal
+!98 U+2264 lessequal
+!99 U+2265 greaterequal
+!9A U+00A0 space
+!9B U+2321 integralbt
+!9C U+00B0 degree
+!9D U+00B2 twosuperior
+!9E U+00B7 periodcentered
+!9F U+00F7 divide
+!A0 U+2550 SF430000
+!A1 U+2551 SF240000
+!A2 U+2552 SF510000
+!A3 U+0451 afii10071
+!A4 U+2553 SF520000
+!A5 U+2554 SF390000
+!A6 U+2555 SF220000
+!A7 U+2556 SF210000
+!A8 U+2557 SF250000
+!A9 U+2558 SF500000
+!AA U+2559 SF490000
+!AB U+255A SF380000
+!AC U+255B SF280000
+!AD U+255C SF270000
+!AE U+255D SF260000
+!AF U+255E SF360000
+!B0 U+255F SF370000
+!B1 U+2560 SF420000
+!B2 U+2561 SF190000
+!B3 U+0401 afii10023
+!B4 U+2562 SF200000
+!B5 U+2563 SF230000
+!B6 U+2564 SF470000
+!B7 U+2565 SF480000
+!B8 U+2566 SF410000
+!B9 U+2567 SF450000
+!BA U+2568 SF460000
+!BB U+2569 SF400000
+!BC U+256A SF540000
+!BD U+256B SF530000
+!BE U+256C SF440000
+!BF U+00A9 copyright
+!C0 U+044E afii10096
+!C1 U+0430 afii10065
+!C2 U+0431 afii10066
+!C3 U+0446 afii10088
+!C4 U+0434 afii10069
+!C5 U+0435 afii10070
+!C6 U+0444 afii10086
+!C7 U+0433 afii10068
+!C8 U+0445 afii10087
+!C9 U+0438 afii10074
+!CA U+0439 afii10075
+!CB U+043A afii10076
+!CC U+043B afii10077
+!CD U+043C afii10078
+!CE U+043D afii10079
+!CF U+043E afii10080
+!D0 U+043F afii10081
+!D1 U+044F afii10097
+!D2 U+0440 afii10082
+!D3 U+0441 afii10083
+!D4 U+0442 afii10084
+!D5 U+0443 afii10085
+!D6 U+0436 afii10072
+!D7 U+0432 afii10067
+!D8 U+044C afii10094
+!D9 U+044B afii10093
+!DA U+0437 afii10073
+!DB U+0448 afii10090
+!DC U+044D afii10095
+!DD U+0449 afii10091
+!DE U+0447 afii10089
+!DF U+044A afii10092
+!E0 U+042E afii10048
+!E1 U+0410 afii10017
+!E2 U+0411 afii10018
+!E3 U+0426 afii10040
+!E4 U+0414 afii10021
+!E5 U+0415 afii10022
+!E6 U+0424 afii10038
+!E7 U+0413 afii10020
+!E8 U+0425 afii10039
+!E9 U+0418 afii10026
+!EA U+0419 afii10027
+!EB U+041A afii10028
+!EC U+041B afii10029
+!ED U+041C afii10030
+!EE U+041D afii10031
+!EF U+041E afii10032
+!F0 U+041F afii10033
+!F1 U+042F afii10049
+!F2 U+0420 afii10034
+!F3 U+0421 afii10035
+!F4 U+0422 afii10036
+!F5 U+0423 afii10037
+!F6 U+0416 afii10024
+!F7 U+0412 afii10019
+!F8 U+042C afii10046
+!F9 U+042B afii10045
+!FA U+0417 afii10025
+!FB U+0428 afii10042
+!FC U+042D afii10047
+!FD U+0429 afii10043
+!FE U+0427 afii10041
+!FF U+042A afii10044
Index: /trunk/reports/inc/font/makefont/iso-8859-7.map
===================================================================
--- /trunk/reports/inc/font/makefont/iso-8859-7.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/iso-8859-7.map	(revision 5291)
@@ -0,0 +1,250 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+2018 quoteleft
+!A2 U+2019 quoteright
+!A3 U+00A3 sterling
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AF U+2015 afii00208
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+0384 tonos
+!B5 U+0385 dieresistonos
+!B6 U+0386 Alphatonos
+!B7 U+00B7 periodcentered
+!B8 U+0388 Epsilontonos
+!B9 U+0389 Etatonos
+!BA U+038A Iotatonos
+!BB U+00BB guillemotright
+!BC U+038C Omicrontonos
+!BD U+00BD onehalf
+!BE U+038E Upsilontonos
+!BF U+038F Omegatonos
+!C0 U+0390 iotadieresistonos
+!C1 U+0391 Alpha
+!C2 U+0392 Beta
+!C3 U+0393 Gamma
+!C4 U+0394 Delta
+!C5 U+0395 Epsilon
+!C6 U+0396 Zeta
+!C7 U+0397 Eta
+!C8 U+0398 Theta
+!C9 U+0399 Iota
+!CA U+039A Kappa
+!CB U+039B Lambda
+!CC U+039C Mu
+!CD U+039D Nu
+!CE U+039E Xi
+!CF U+039F Omicron
+!D0 U+03A0 Pi
+!D1 U+03A1 Rho
+!D3 U+03A3 Sigma
+!D4 U+03A4 Tau
+!D5 U+03A5 Upsilon
+!D6 U+03A6 Phi
+!D7 U+03A7 Chi
+!D8 U+03A8 Psi
+!D9 U+03A9 Omega
+!DA U+03AA Iotadieresis
+!DB U+03AB Upsilondieresis
+!DC U+03AC alphatonos
+!DD U+03AD epsilontonos
+!DE U+03AE etatonos
+!DF U+03AF iotatonos
+!E0 U+03B0 upsilondieresistonos
+!E1 U+03B1 alpha
+!E2 U+03B2 beta
+!E3 U+03B3 gamma
+!E4 U+03B4 delta
+!E5 U+03B5 epsilon
+!E6 U+03B6 zeta
+!E7 U+03B7 eta
+!E8 U+03B8 theta
+!E9 U+03B9 iota
+!EA U+03BA kappa
+!EB U+03BB lambda
+!EC U+03BC mu
+!ED U+03BD nu
+!EE U+03BE xi
+!EF U+03BF omicron
+!F0 U+03C0 pi
+!F1 U+03C1 rho
+!F2 U+03C2 sigma1
+!F3 U+03C3 sigma
+!F4 U+03C4 tau
+!F5 U+03C5 upsilon
+!F6 U+03C6 phi
+!F7 U+03C7 chi
+!F8 U+03C8 psi
+!F9 U+03C9 omega
+!FA U+03CA iotadieresis
+!FB U+03CB upsilondieresis
+!FC U+03CC omicrontonos
+!FD U+03CD upsilontonos
+!FE U+03CE omegatonos
Index: /trunk/reports/inc/font/makefont/cp1250.map
===================================================================
--- /trunk/reports/inc/font/makefont/cp1250.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/cp1250.map	(revision 5291)
@@ -0,0 +1,251 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!89 U+2030 perthousand
+!8A U+0160 Scaron
+!8B U+2039 guilsinglleft
+!8C U+015A Sacute
+!8D U+0164 Tcaron
+!8E U+017D Zcaron
+!8F U+0179 Zacute
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!99 U+2122 trademark
+!9A U+0161 scaron
+!9B U+203A guilsinglright
+!9C U+015B sacute
+!9D U+0165 tcaron
+!9E U+017E zcaron
+!9F U+017A zacute
+!A0 U+00A0 space
+!A1 U+02C7 caron
+!A2 U+02D8 breve
+!A3 U+0141 Lslash
+!A4 U+00A4 currency
+!A5 U+0104 Aogonek
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+015E Scedilla
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+017B Zdotaccent
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+02DB ogonek
+!B3 U+0142 lslash
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00B8 cedilla
+!B9 U+0105 aogonek
+!BA U+015F scedilla
+!BB U+00BB guillemotright
+!BC U+013D Lcaron
+!BD U+02DD hungarumlaut
+!BE U+013E lcaron
+!BF U+017C zdotaccent
+!C0 U+0154 Racute
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+0102 Abreve
+!C4 U+00C4 Adieresis
+!C5 U+0139 Lacute
+!C6 U+0106 Cacute
+!C7 U+00C7 Ccedilla
+!C8 U+010C Ccaron
+!C9 U+00C9 Eacute
+!CA U+0118 Eogonek
+!CB U+00CB Edieresis
+!CC U+011A Ecaron
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+010E Dcaron
+!D0 U+0110 Dcroat
+!D1 U+0143 Nacute
+!D2 U+0147 Ncaron
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+0150 Ohungarumlaut
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+0158 Rcaron
+!D9 U+016E Uring
+!DA U+00DA Uacute
+!DB U+0170 Uhungarumlaut
+!DC U+00DC Udieresis
+!DD U+00DD Yacute
+!DE U+0162 Tcommaaccent
+!DF U+00DF germandbls
+!E0 U+0155 racute
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+0103 abreve
+!E4 U+00E4 adieresis
+!E5 U+013A lacute
+!E6 U+0107 cacute
+!E7 U+00E7 ccedilla
+!E8 U+010D ccaron
+!E9 U+00E9 eacute
+!EA U+0119 eogonek
+!EB U+00EB edieresis
+!EC U+011B ecaron
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+010F dcaron
+!F0 U+0111 dcroat
+!F1 U+0144 nacute
+!F2 U+0148 ncaron
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+0151 ohungarumlaut
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+0159 rcaron
+!F9 U+016F uring
+!FA U+00FA uacute
+!FB U+0171 uhungarumlaut
+!FC U+00FC udieresis
+!FD U+00FD yacute
+!FE U+0163 tcommaaccent
+!FF U+02D9 dotaccent
Index: /trunk/reports/inc/font/makefont/iso-8859-9.map
===================================================================
--- /trunk/reports/inc/font/makefont/iso-8859-9.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/iso-8859-9.map	(revision 5291)
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+00AA ordfeminine
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00B8 cedilla
+!B9 U+00B9 onesuperior
+!BA U+00BA ordmasculine
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00BF questiondown
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+00C3 Atilde
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+00CC Igrave
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+011E Gbreve
+!D1 U+00D1 Ntilde
+!D2 U+00D2 Ograve
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+0130 Idotaccent
+!DE U+015E Scedilla
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+00E3 atilde
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+00EC igrave
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+011F gbreve
+!F1 U+00F1 ntilde
+!F2 U+00F2 ograve
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+0131 dotlessi
+!FE U+015F scedilla
+!FF U+00FF ydieresis
Index: /trunk/reports/inc/font/makefont/cp1251.map
===================================================================
--- /trunk/reports/inc/font/makefont/cp1251.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/cp1251.map	(revision 5291)
@@ -0,0 +1,255 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0402 afii10051
+!81 U+0403 afii10052
+!82 U+201A quotesinglbase
+!83 U+0453 afii10100
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!88 U+20AC Euro
+!89 U+2030 perthousand
+!8A U+0409 afii10058
+!8B U+2039 guilsinglleft
+!8C U+040A afii10059
+!8D U+040C afii10061
+!8E U+040B afii10060
+!8F U+040F afii10145
+!90 U+0452 afii10099
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!99 U+2122 trademark
+!9A U+0459 afii10106
+!9B U+203A guilsinglright
+!9C U+045A afii10107
+!9D U+045C afii10109
+!9E U+045B afii10108
+!9F U+045F afii10193
+!A0 U+00A0 space
+!A1 U+040E afii10062
+!A2 U+045E afii10110
+!A3 U+0408 afii10057
+!A4 U+00A4 currency
+!A5 U+0490 afii10050
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+0401 afii10023
+!A9 U+00A9 copyright
+!AA U+0404 afii10053
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+0407 afii10056
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+0406 afii10055
+!B3 U+0456 afii10103
+!B4 U+0491 afii10098
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+0451 afii10071
+!B9 U+2116 afii61352
+!BA U+0454 afii10101
+!BB U+00BB guillemotright
+!BC U+0458 afii10105
+!BD U+0405 afii10054
+!BE U+0455 afii10102
+!BF U+0457 afii10104
+!C0 U+0410 afii10017
+!C1 U+0411 afii10018
+!C2 U+0412 afii10019
+!C3 U+0413 afii10020
+!C4 U+0414 afii10021
+!C5 U+0415 afii10022
+!C6 U+0416 afii10024
+!C7 U+0417 afii10025
+!C8 U+0418 afii10026
+!C9 U+0419 afii10027
+!CA U+041A afii10028
+!CB U+041B afii10029
+!CC U+041C afii10030
+!CD U+041D afii10031
+!CE U+041E afii10032
+!CF U+041F afii10033
+!D0 U+0420 afii10034
+!D1 U+0421 afii10035
+!D2 U+0422 afii10036
+!D3 U+0423 afii10037
+!D4 U+0424 afii10038
+!D5 U+0425 afii10039
+!D6 U+0426 afii10040
+!D7 U+0427 afii10041
+!D8 U+0428 afii10042
+!D9 U+0429 afii10043
+!DA U+042A afii10044
+!DB U+042B afii10045
+!DC U+042C afii10046
+!DD U+042D afii10047
+!DE U+042E afii10048
+!DF U+042F afii10049
+!E0 U+0430 afii10065
+!E1 U+0431 afii10066
+!E2 U+0432 afii10067
+!E3 U+0433 afii10068
+!E4 U+0434 afii10069
+!E5 U+0435 afii10070
+!E6 U+0436 afii10072
+!E7 U+0437 afii10073
+!E8 U+0438 afii10074
+!E9 U+0439 afii10075
+!EA U+043A afii10076
+!EB U+043B afii10077
+!EC U+043C afii10078
+!ED U+043D afii10079
+!EE U+043E afii10080
+!EF U+043F afii10081
+!F0 U+0440 afii10082
+!F1 U+0441 afii10083
+!F2 U+0442 afii10084
+!F3 U+0443 afii10085
+!F4 U+0444 afii10086
+!F5 U+0445 afii10087
+!F6 U+0446 afii10088
+!F7 U+0447 afii10089
+!F8 U+0448 afii10090
+!F9 U+0449 afii10091
+!FA U+044A afii10092
+!FB U+044B afii10093
+!FC U+044C afii10094
+!FD U+044D afii10095
+!FE U+044E afii10096
+!FF U+044F afii10097
Index: /trunk/reports/inc/font/makefont/koi8-u.map
===================================================================
--- /trunk/reports/inc/font/makefont/koi8-u.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/koi8-u.map	(revision 5291)
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+2500 SF100000
+!81 U+2502 SF110000
+!82 U+250C SF010000
+!83 U+2510 SF030000
+!84 U+2514 SF020000
+!85 U+2518 SF040000
+!86 U+251C SF080000
+!87 U+2524 SF090000
+!88 U+252C SF060000
+!89 U+2534 SF070000
+!8A U+253C SF050000
+!8B U+2580 upblock
+!8C U+2584 dnblock
+!8D U+2588 block
+!8E U+258C lfblock
+!8F U+2590 rtblock
+!90 U+2591 ltshade
+!91 U+2592 shade
+!92 U+2593 dkshade
+!93 U+2320 integraltp
+!94 U+25A0 filledbox
+!95 U+2022 bullet
+!96 U+221A radical
+!97 U+2248 approxequal
+!98 U+2264 lessequal
+!99 U+2265 greaterequal
+!9A U+00A0 space
+!9B U+2321 integralbt
+!9C U+00B0 degree
+!9D U+00B2 twosuperior
+!9E U+00B7 periodcentered
+!9F U+00F7 divide
+!A0 U+2550 SF430000
+!A1 U+2551 SF240000
+!A2 U+2552 SF510000
+!A3 U+0451 afii10071
+!A4 U+0454 afii10101
+!A5 U+2554 SF390000
+!A6 U+0456 afii10103
+!A7 U+0457 afii10104
+!A8 U+2557 SF250000
+!A9 U+2558 SF500000
+!AA U+2559 SF490000
+!AB U+255A SF380000
+!AC U+255B SF280000
+!AD U+0491 afii10098
+!AE U+255D SF260000
+!AF U+255E SF360000
+!B0 U+255F SF370000
+!B1 U+2560 SF420000
+!B2 U+2561 SF190000
+!B3 U+0401 afii10023
+!B4 U+0404 afii10053
+!B5 U+2563 SF230000
+!B6 U+0406 afii10055
+!B7 U+0407 afii10056
+!B8 U+2566 SF410000
+!B9 U+2567 SF450000
+!BA U+2568 SF460000
+!BB U+2569 SF400000
+!BC U+256A SF540000
+!BD U+0490 afii10050
+!BE U+256C SF440000
+!BF U+00A9 copyright
+!C0 U+044E afii10096
+!C1 U+0430 afii10065
+!C2 U+0431 afii10066
+!C3 U+0446 afii10088
+!C4 U+0434 afii10069
+!C5 U+0435 afii10070
+!C6 U+0444 afii10086
+!C7 U+0433 afii10068
+!C8 U+0445 afii10087
+!C9 U+0438 afii10074
+!CA U+0439 afii10075
+!CB U+043A afii10076
+!CC U+043B afii10077
+!CD U+043C afii10078
+!CE U+043D afii10079
+!CF U+043E afii10080
+!D0 U+043F afii10081
+!D1 U+044F afii10097
+!D2 U+0440 afii10082
+!D3 U+0441 afii10083
+!D4 U+0442 afii10084
+!D5 U+0443 afii10085
+!D6 U+0436 afii10072
+!D7 U+0432 afii10067
+!D8 U+044C afii10094
+!D9 U+044B afii10093
+!DA U+0437 afii10073
+!DB U+0448 afii10090
+!DC U+044D afii10095
+!DD U+0449 afii10091
+!DE U+0447 afii10089
+!DF U+044A afii10092
+!E0 U+042E afii10048
+!E1 U+0410 afii10017
+!E2 U+0411 afii10018
+!E3 U+0426 afii10040
+!E4 U+0414 afii10021
+!E5 U+0415 afii10022
+!E6 U+0424 afii10038
+!E7 U+0413 afii10020
+!E8 U+0425 afii10039
+!E9 U+0418 afii10026
+!EA U+0419 afii10027
+!EB U+041A afii10028
+!EC U+041B afii10029
+!ED U+041C afii10030
+!EE U+041D afii10031
+!EF U+041E afii10032
+!F0 U+041F afii10033
+!F1 U+042F afii10049
+!F2 U+0420 afii10034
+!F3 U+0421 afii10035
+!F4 U+0422 afii10036
+!F5 U+0423 afii10037
+!F6 U+0416 afii10024
+!F7 U+0412 afii10019
+!F8 U+042C afii10046
+!F9 U+042B afii10045
+!FA U+0417 afii10025
+!FB U+0428 afii10042
+!FC U+042D afii10047
+!FD U+0429 afii10043
+!FE U+0427 afii10041
+!FF U+042A afii10044
Index: /trunk/reports/inc/font/makefont/cp1252.map
===================================================================
--- /trunk/reports/inc/font/makefont/cp1252.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/cp1252.map	(revision 5291)
@@ -0,0 +1,251 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!83 U+0192 florin
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!88 U+02C6 circumflex
+!89 U+2030 perthousand
+!8A U+0160 Scaron
+!8B U+2039 guilsinglleft
+!8C U+0152 OE
+!8E U+017D Zcaron
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!98 U+02DC tilde
+!99 U+2122 trademark
+!9A U+0161 scaron
+!9B U+203A guilsinglright
+!9C U+0153 oe
+!9E U+017E zcaron
+!9F U+0178 Ydieresis
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+00AA ordfeminine
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00B8 cedilla
+!B9 U+00B9 onesuperior
+!BA U+00BA ordmasculine
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00BF questiondown
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+00C3 Atilde
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+00CC Igrave
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+00D0 Eth
+!D1 U+00D1 Ntilde
+!D2 U+00D2 Ograve
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+00DD Yacute
+!DE U+00DE Thorn
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+00E3 atilde
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+00EC igrave
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+00F0 eth
+!F1 U+00F1 ntilde
+!F2 U+00F2 ograve
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+00FD yacute
+!FE U+00FE thorn
+!FF U+00FF ydieresis
Index: /trunk/reports/inc/font/makefont/cp1253.map
===================================================================
--- /trunk/reports/inc/font/makefont/cp1253.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/cp1253.map	(revision 5291)
@@ -0,0 +1,239 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!83 U+0192 florin
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!89 U+2030 perthousand
+!8B U+2039 guilsinglleft
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!99 U+2122 trademark
+!9B U+203A guilsinglright
+!A0 U+00A0 space
+!A1 U+0385 dieresistonos
+!A2 U+0386 Alphatonos
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+2015 afii00208
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+0384 tonos
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+0388 Epsilontonos
+!B9 U+0389 Etatonos
+!BA U+038A Iotatonos
+!BB U+00BB guillemotright
+!BC U+038C Omicrontonos
+!BD U+00BD onehalf
+!BE U+038E Upsilontonos
+!BF U+038F Omegatonos
+!C0 U+0390 iotadieresistonos
+!C1 U+0391 Alpha
+!C2 U+0392 Beta
+!C3 U+0393 Gamma
+!C4 U+0394 Delta
+!C5 U+0395 Epsilon
+!C6 U+0396 Zeta
+!C7 U+0397 Eta
+!C8 U+0398 Theta
+!C9 U+0399 Iota
+!CA U+039A Kappa
+!CB U+039B Lambda
+!CC U+039C Mu
+!CD U+039D Nu
+!CE U+039E Xi
+!CF U+039F Omicron
+!D0 U+03A0 Pi
+!D1 U+03A1 Rho
+!D3 U+03A3 Sigma
+!D4 U+03A4 Tau
+!D5 U+03A5 Upsilon
+!D6 U+03A6 Phi
+!D7 U+03A7 Chi
+!D8 U+03A8 Psi
+!D9 U+03A9 Omega
+!DA U+03AA Iotadieresis
+!DB U+03AB Upsilondieresis
+!DC U+03AC alphatonos
+!DD U+03AD epsilontonos
+!DE U+03AE etatonos
+!DF U+03AF iotatonos
+!E0 U+03B0 upsilondieresistonos
+!E1 U+03B1 alpha
+!E2 U+03B2 beta
+!E3 U+03B3 gamma
+!E4 U+03B4 delta
+!E5 U+03B5 epsilon
+!E6 U+03B6 zeta
+!E7 U+03B7 eta
+!E8 U+03B8 theta
+!E9 U+03B9 iota
+!EA U+03BA kappa
+!EB U+03BB lambda
+!EC U+03BC mu
+!ED U+03BD nu
+!EE U+03BE xi
+!EF U+03BF omicron
+!F0 U+03C0 pi
+!F1 U+03C1 rho
+!F2 U+03C2 sigma1
+!F3 U+03C3 sigma
+!F4 U+03C4 tau
+!F5 U+03C5 upsilon
+!F6 U+03C6 phi
+!F7 U+03C7 chi
+!F8 U+03C8 psi
+!F9 U+03C9 omega
+!FA U+03CA iotadieresis
+!FB U+03CB upsilondieresis
+!FC U+03CC omicrontonos
+!FD U+03CD upsilontonos
+!FE U+03CE omegatonos
Index: /trunk/reports/inc/font/makefont/makefont.php
===================================================================
--- /trunk/reports/inc/font/makefont/makefont.php	(revision 5291)
+++ /trunk/reports/inc/font/makefont/makefont.php	(revision 5291)
@@ -0,0 +1,419 @@
+<?php
+/*******************************************************************************
+* Utility to generate font definition files                                    *
+*                                                                              *
+* Version: 1.14                                                                *
+* Date:    2008-08-03                                                          *
+* Author:  Olivier PLATHEY                                                     *
+*******************************************************************************/
+
+function ReadMap($enc)
+{
+	//Read a map file
+	$file=dirname(__FILE__).'/'.strtolower($enc).'.map';
+	$a=file($file);
+	if(empty($a))
+		die('<b>Error:</b> encoding not found: '.$enc);
+	$cc2gn=array();
+	foreach($a as $l)
+	{
+		if($l[0]=='!')
+		{
+			$e=preg_split('/[ \\t]+/',rtrim($l));
+			$cc=hexdec(substr($e[0],1));
+			$gn=$e[2];
+			$cc2gn[$cc]=$gn;
+		}
+	}
+	for($i=0;$i<=255;$i++)
+	{
+		if(!isset($cc2gn[$i]))
+			$cc2gn[$i]='.notdef';
+	}
+	return $cc2gn;
+}
+
+function ReadAFM($file, &$map)
+{
+	//Read a font metric file
+	$a=file($file);
+	if(empty($a))
+		die('File not found');
+	$widths=array();
+	$fm=array();
+	$fix=array('Edot'=>'Edotaccent','edot'=>'edotaccent','Idot'=>'Idotaccent','Zdot'=>'Zdotaccent','zdot'=>'zdotaccent',
+		'Odblacute'=>'Ohungarumlaut','odblacute'=>'ohungarumlaut','Udblacute'=>'Uhungarumlaut','udblacute'=>'uhungarumlaut',
+		'Gcedilla'=>'Gcommaaccent','gcedilla'=>'gcommaaccent','Kcedilla'=>'Kcommaaccent','kcedilla'=>'kcommaaccent',
+		'Lcedilla'=>'Lcommaaccent','lcedilla'=>'lcommaaccent','Ncedilla'=>'Ncommaaccent','ncedilla'=>'ncommaaccent',
+		'Rcedilla'=>'Rcommaaccent','rcedilla'=>'rcommaaccent','Scedilla'=>'Scommaaccent','scedilla'=>'scommaaccent',
+		'Tcedilla'=>'Tcommaaccent','tcedilla'=>'tcommaaccent','Dslash'=>'Dcroat','dslash'=>'dcroat','Dmacron'=>'Dcroat','dmacron'=>'dcroat',
+		'combininggraveaccent'=>'gravecomb','combininghookabove'=>'hookabovecomb','combiningtildeaccent'=>'tildecomb',
+		'combiningacuteaccent'=>'acutecomb','combiningdotbelow'=>'dotbelowcomb','dongsign'=>'dong');
+	foreach($a as $l)
+	{
+		$e=explode(' ',rtrim($l));
+		if(count($e)<2)
+			continue;
+		$code=$e[0];
+		$param=$e[1];
+		if($code=='C')
+		{
+			//Character metrics
+			$cc=(int)$e[1];
+			$w=$e[4];
+			$gn=$e[7];
+			if(substr($gn,-4)=='20AC')
+				$gn='Euro';
+			if(isset($fix[$gn]))
+			{
+				//Fix incorrect glyph name
+				foreach($map as $c=>$n)
+				{
+					if($n==$fix[$gn])
+						$map[$c]=$gn;
+				}
+			}
+			if(empty($map))
+			{
+				//Symbolic font: use built-in encoding
+				$widths[$cc]=$w;
+			}
+			else
+			{
+				$widths[$gn]=$w;
+				if($gn=='X')
+					$fm['CapXHeight']=$e[13];
+			}
+			if($gn=='.notdef')
+				$fm['MissingWidth']=$w;
+		}
+		elseif($code=='FontName')
+			$fm['FontName']=$param;
+		elseif($code=='Weight')
+			$fm['Weight']=$param;
+		elseif($code=='ItalicAngle')
+			$fm['ItalicAngle']=(double)$param;
+		elseif($code=='Ascender')
+			$fm['Ascender']=(int)$param;
+		elseif($code=='Descender')
+			$fm['Descender']=(int)$param;
+		elseif($code=='UnderlineThickness')
+			$fm['UnderlineThickness']=(int)$param;
+		elseif($code=='UnderlinePosition')
+			$fm['UnderlinePosition']=(int)$param;
+		elseif($code=='IsFixedPitch')
+			$fm['IsFixedPitch']=($param=='true');
+		elseif($code=='FontBBox')
+			$fm['FontBBox']=array($e[1],$e[2],$e[3],$e[4]);
+		elseif($code=='CapHeight')
+			$fm['CapHeight']=(int)$param;
+		elseif($code=='StdVW')
+			$fm['StdVW']=(int)$param;
+	}
+	if(!isset($fm['FontName']))
+		die('FontName not found');
+	if(!empty($map))
+	{
+		if(!isset($widths['.notdef']))
+			$widths['.notdef']=600;
+		if(!isset($widths['Delta']) && isset($widths['increment']))
+			$widths['Delta']=$widths['increment'];
+		//Order widths according to map
+		for($i=0;$i<=255;$i++)
+		{
+			if(!isset($widths[$map[$i]]))
+			{
+				echo '<b>Warning:</b> character '.$map[$i].' is missing<br>';
+				$widths[$i]=$widths['.notdef'];
+			}
+			else
+				$widths[$i]=$widths[$map[$i]];
+		}
+	}
+	$fm['Widths']=$widths;
+	return $fm;
+}
+
+function MakeFontDescriptor($fm, $symbolic)
+{
+	//Ascent
+	$asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000);
+	$fd="array('Ascent'=>".$asc;
+	//Descent
+	$desc=(isset($fm['Descender']) ? $fm['Descender'] : -200);
+	$fd.=",'Descent'=>".$desc;
+	//CapHeight
+	if(isset($fm['CapHeight']))
+		$ch=$fm['CapHeight'];
+	elseif(isset($fm['CapXHeight']))
+		$ch=$fm['CapXHeight'];
+	else
+		$ch=$asc;
+	$fd.=",'CapHeight'=>".$ch;
+	//Flags
+	$flags=0;
+	if(isset($fm['IsFixedPitch']) && $fm['IsFixedPitch'])
+		$flags+=1<<0;
+	if($symbolic)
+		$flags+=1<<2;
+	if(!$symbolic)
+		$flags+=1<<5;
+	if(isset($fm['ItalicAngle']) && $fm['ItalicAngle']!=0)
+		$flags+=1<<6;
+	$fd.=",'Flags'=>".$flags;
+	//FontBBox
+	if(isset($fm['FontBBox']))
+		$fbb=$fm['FontBBox'];
+	else
+		$fbb=array(0,$desc-100,1000,$asc+100);
+	$fd.=",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'";
+	//ItalicAngle
+	$ia=(isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0);
+	$fd.=",'ItalicAngle'=>".$ia;
+	//StemV
+	if(isset($fm['StdVW']))
+		$stemv=$fm['StdVW'];
+	elseif(isset($fm['Weight']) && preg_match('/bold|black/i',$fm['Weight']))
+		$stemv=120;
+	else
+		$stemv=70;
+	$fd.=",'StemV'=>".$stemv;
+	//MissingWidth
+	if(isset($fm['MissingWidth']))
+		$fd.=",'MissingWidth'=>".$fm['MissingWidth'];
+	$fd.=')';
+	return $fd;
+}
+
+function MakeWidthArray($fm)
+{
+	//Make character width array
+	$s="array(\n\t";
+	$cw=$fm['Widths'];
+	for($i=0;$i<=255;$i++)
+	{
+		if(chr($i)=="'")
+			$s.="'\\''";
+		elseif(chr($i)=="\\")
+			$s.="'\\\\'";
+		elseif($i>=32 && $i<=126)
+			$s.="'".chr($i)."'";
+		else
+			$s.="chr($i)";
+		$s.='=>'.$fm['Widths'][$i];
+		if($i<255)
+			$s.=',';
+		if(($i+1)%22==0)
+			$s.="\n\t";
+	}
+	$s.=')';
+	return $s;
+}
+
+function MakeFontEncoding($map)
+{
+	//Build differences from reference encoding
+	$ref=ReadMap('cp1252');
+	$s='';
+	$last=0;
+	for($i=32;$i<=255;$i++)
+	{
+		if($map[$i]!=$ref[$i])
+		{
+			if($i!=$last+1)
+				$s.=$i.' ';
+			$last=$i;
+			$s.='/'.$map[$i].' ';
+		}
+	}
+	return rtrim($s);
+}
+
+function SaveToFile($file, $s, $mode)
+{
+	$f=fopen($file,'w'.$mode);
+	if(!$f)
+		die('Can\'t write to file '.$file);
+	fwrite($f,$s,strlen($s));
+	fclose($f);
+}
+
+function ReadShort($f)
+{
+	$a=unpack('n1n',fread($f,2));
+	return $a['n'];
+}
+
+function ReadLong($f)
+{
+	$a=unpack('N1N',fread($f,4));
+	return $a['N'];
+}
+
+function CheckTTF($file)
+{
+	//Check if font license allows embedding
+	$f=fopen($file,'rb');
+	if(!$f)
+		die('<b>Error:</b> Can\'t open '.$file);
+	//Extract number of tables
+	fseek($f,4,SEEK_CUR);
+	$nb=ReadShort($f);
+	fseek($f,6,SEEK_CUR);
+	//Seek OS/2 table
+	$found=false;
+	for($i=0;$i<$nb;$i++)
+	{
+		if(fread($f,4)=='OS/2')
+		{
+			$found=true;
+			break;
+		}
+		fseek($f,12,SEEK_CUR);
+	}
+	if(!$found)
+	{
+		fclose($f);
+		return;
+	}
+	fseek($f,4,SEEK_CUR);
+	$offset=ReadLong($f);
+	fseek($f,$offset,SEEK_SET);
+	//Extract fsType flags
+	fseek($f,8,SEEK_CUR);
+	$fsType=ReadShort($f);
+	$rl=($fsType & 0x02)!=0;
+	$pp=($fsType & 0x04)!=0;
+	$e=($fsType & 0x08)!=0;
+	fclose($f);
+	if($rl && !$pp && !$e)
+		echo '<b>Warning:</b> font license does not allow embedding';
+}
+
+/*******************************************************************************
+* fontfile: path to TTF file (or empty string if not to be embedded)           *
+* afmfile:  path to AFM file                                                   *
+* enc:      font encoding (or empty string for symbolic fonts)                 *
+* patch:    optional patch for encoding                                        *
+* type:     font type if fontfile is empty                                     *
+*******************************************************************************/
+function MakeFont($fontfile, $afmfile, $enc='cp1252', $patch=array(), $type='TrueType')
+{
+	//Generate a font definition file
+	if(get_magic_quotes_runtime())
+		@set_magic_quotes_runtime(0);
+	ini_set('auto_detect_line_endings','1');
+	if($enc)
+	{
+		$map=ReadMap($enc);
+		foreach($patch as $cc=>$gn)
+			$map[$cc]=$gn;
+	}
+	else
+		$map=array();
+	if(!file_exists($afmfile))
+		die('<b>Error:</b> AFM file not found: '.$afmfile);
+	$fm=ReadAFM($afmfile,$map);
+	if($enc)
+		$diff=MakeFontEncoding($map);
+	else
+		$diff='';
+	$fd=MakeFontDescriptor($fm,empty($map));
+	//Find font type
+	if($fontfile)
+	{
+		$ext=strtolower(substr($fontfile,-3));
+		if($ext=='ttf')
+			$type='TrueType';
+		elseif($ext=='pfb')
+			$type='Type1';
+		else
+			die('<b>Error:</b> unrecognized font file extension: '.$ext);
+	}
+	else
+	{
+		if($type!='TrueType' && $type!='Type1')
+			die('<b>Error:</b> incorrect font type: '.$type);
+	}
+	//Start generation
+	$s='<?php'."\n";
+	$s.='$type=\''.$type."';\n";
+	$s.='$name=\''.$fm['FontName']."';\n";
+	$s.='$desc='.$fd.";\n";
+	if(!isset($fm['UnderlinePosition']))
+		$fm['UnderlinePosition']=-100;
+	if(!isset($fm['UnderlineThickness']))
+		$fm['UnderlineThickness']=50;
+	$s.='$up='.$fm['UnderlinePosition'].";\n";
+	$s.='$ut='.$fm['UnderlineThickness'].";\n";
+	$w=MakeWidthArray($fm);
+	$s.='$cw='.$w.";\n";
+	$s.='$enc=\''.$enc."';\n";
+	$s.='$diff=\''.$diff."';\n";
+	$basename=substr(basename($afmfile),0,-4);
+	if($fontfile)
+	{
+		//Embedded font
+		if(!file_exists($fontfile))
+			die('<b>Error:</b> font file not found: '.$fontfile);
+		if($type=='TrueType')
+			CheckTTF($fontfile);
+		$f=fopen($fontfile,'rb');
+		if(!$f)
+			die('<b>Error:</b> Can\'t open '.$fontfile);
+		$file=fread($f,filesize($fontfile));
+		fclose($f);
+		if($type=='Type1')
+		{
+			//Find first two sections and discard third one
+			$header=(ord($file[0])==128);
+			if($header)
+			{
+				//Strip first binary header
+				$file=substr($file,6);
+			}
+			$pos=strpos($file,'eexec');
+			if(!$pos)
+				die('<b>Error:</b> font file does not seem to be valid Type1');
+			$size1=$pos+6;
+			if($header && ord($file[$size1])==128)
+			{
+				//Strip second binary header
+				$file=substr($file,0,$size1).substr($file,$size1+6);
+			}
+			$pos=strpos($file,'00000000');
+			if(!$pos)
+				die('<b>Error:</b> font file does not seem to be valid Type1');
+			$size2=$pos-$size1;
+			$file=substr($file,0,$size1+$size2);
+		}
+		if(function_exists('gzcompress'))
+		{
+			$cmp=$basename.'.z';
+			SaveToFile($cmp,gzcompress($file),'b');
+			$s.='$file=\''.$cmp."';\n";
+			echo 'Font file compressed ('.$cmp.')<br>';
+		}
+		else
+		{
+			$s.='$file=\''.basename($fontfile)."';\n";
+			echo '<b>Notice:</b> font file could not be compressed (zlib extension not available)<br>';
+		}
+		if($type=='Type1')
+		{
+			$s.='$size1='.$size1.";\n";
+			$s.='$size2='.$size2.";\n";
+		}
+		else
+			$s.='$originalsize='.filesize($fontfile).";\n";
+	}
+	else
+	{
+		//Not embedded font
+		$s.='$file='."'';\n";
+	}
+	$s.="?>\n";
+	SaveToFile($basename.'.php',$s,'t');
+	echo 'Font definition file generated ('.$basename.'.php'.')<br>';
+}
+?>
Index: /trunk/reports/inc/font/makefont/cp1254.map
===================================================================
--- /trunk/reports/inc/font/makefont/cp1254.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/cp1254.map	(revision 5291)
@@ -0,0 +1,249 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!83 U+0192 florin
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!88 U+02C6 circumflex
+!89 U+2030 perthousand
+!8A U+0160 Scaron
+!8B U+2039 guilsinglleft
+!8C U+0152 OE
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!98 U+02DC tilde
+!99 U+2122 trademark
+!9A U+0161 scaron
+!9B U+203A guilsinglright
+!9C U+0153 oe
+!9F U+0178 Ydieresis
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+00AA ordfeminine
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00B8 cedilla
+!B9 U+00B9 onesuperior
+!BA U+00BA ordmasculine
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00BF questiondown
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+00C3 Atilde
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+00CC Igrave
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+011E Gbreve
+!D1 U+00D1 Ntilde
+!D2 U+00D2 Ograve
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+0130 Idotaccent
+!DE U+015E Scedilla
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+00E3 atilde
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+00EC igrave
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+011F gbreve
+!F1 U+00F1 ntilde
+!F2 U+00F2 ograve
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+0131 dotlessi
+!FE U+015F scedilla
+!FF U+00FF ydieresis
Index: /trunk/reports/inc/font/makefont/cp1255.map
===================================================================
--- /trunk/reports/inc/font/makefont/cp1255.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/cp1255.map	(revision 5291)
@@ -0,0 +1,233 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!83 U+0192 florin
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!88 U+02C6 circumflex
+!89 U+2030 perthousand
+!8B U+2039 guilsinglleft
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!98 U+02DC tilde
+!99 U+2122 trademark
+!9B U+203A guilsinglright
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+20AA afii57636
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+00D7 multiply
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD sfthyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 middot
+!B8 U+00B8 cedilla
+!B9 U+00B9 onesuperior
+!BA U+00F7 divide
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00BF questiondown
+!C0 U+05B0 afii57799
+!C1 U+05B1 afii57801
+!C2 U+05B2 afii57800
+!C3 U+05B3 afii57802
+!C4 U+05B4 afii57793
+!C5 U+05B5 afii57794
+!C6 U+05B6 afii57795
+!C7 U+05B7 afii57798
+!C8 U+05B8 afii57797
+!C9 U+05B9 afii57806
+!CB U+05BB afii57796
+!CC U+05BC afii57807
+!CD U+05BD afii57839
+!CE U+05BE afii57645
+!CF U+05BF afii57841
+!D0 U+05C0 afii57842
+!D1 U+05C1 afii57804
+!D2 U+05C2 afii57803
+!D3 U+05C3 afii57658
+!D4 U+05F0 afii57716
+!D5 U+05F1 afii57717
+!D6 U+05F2 afii57718
+!D7 U+05F3 gereshhebrew
+!D8 U+05F4 gershayimhebrew
+!E0 U+05D0 afii57664
+!E1 U+05D1 afii57665
+!E2 U+05D2 afii57666
+!E3 U+05D3 afii57667
+!E4 U+05D4 afii57668
+!E5 U+05D5 afii57669
+!E6 U+05D6 afii57670
+!E7 U+05D7 afii57671
+!E8 U+05D8 afii57672
+!E9 U+05D9 afii57673
+!EA U+05DA afii57674
+!EB U+05DB afii57675
+!EC U+05DC afii57676
+!ED U+05DD afii57677
+!EE U+05DE afii57678
+!EF U+05DF afii57679
+!F0 U+05E0 afii57680
+!F1 U+05E1 afii57681
+!F2 U+05E2 afii57682
+!F3 U+05E3 afii57683
+!F4 U+05E4 afii57684
+!F5 U+05E5 afii57685
+!F6 U+05E6 afii57686
+!F7 U+05E7 afii57687
+!F8 U+05E8 afii57688
+!F9 U+05E9 afii57689
+!FA U+05EA afii57690
+!FD U+200E afii299
+!FE U+200F afii300
Index: /trunk/reports/inc/font/makefont/cp1257.map
===================================================================
--- /trunk/reports/inc/font/makefont/cp1257.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/cp1257.map	(revision 5291)
@@ -0,0 +1,244 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!89 U+2030 perthousand
+!8B U+2039 guilsinglleft
+!8D U+00A8 dieresis
+!8E U+02C7 caron
+!8F U+00B8 cedilla
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!99 U+2122 trademark
+!9B U+203A guilsinglright
+!9D U+00AF macron
+!9E U+02DB ogonek
+!A0 U+00A0 space
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00D8 Oslash
+!A9 U+00A9 copyright
+!AA U+0156 Rcommaaccent
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00C6 AE
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00F8 oslash
+!B9 U+00B9 onesuperior
+!BA U+0157 rcommaaccent
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00E6 ae
+!C0 U+0104 Aogonek
+!C1 U+012E Iogonek
+!C2 U+0100 Amacron
+!C3 U+0106 Cacute
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+0118 Eogonek
+!C7 U+0112 Emacron
+!C8 U+010C Ccaron
+!C9 U+00C9 Eacute
+!CA U+0179 Zacute
+!CB U+0116 Edotaccent
+!CC U+0122 Gcommaaccent
+!CD U+0136 Kcommaaccent
+!CE U+012A Imacron
+!CF U+013B Lcommaaccent
+!D0 U+0160 Scaron
+!D1 U+0143 Nacute
+!D2 U+0145 Ncommaaccent
+!D3 U+00D3 Oacute
+!D4 U+014C Omacron
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+0172 Uogonek
+!D9 U+0141 Lslash
+!DA U+015A Sacute
+!DB U+016A Umacron
+!DC U+00DC Udieresis
+!DD U+017B Zdotaccent
+!DE U+017D Zcaron
+!DF U+00DF germandbls
+!E0 U+0105 aogonek
+!E1 U+012F iogonek
+!E2 U+0101 amacron
+!E3 U+0107 cacute
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+0119 eogonek
+!E7 U+0113 emacron
+!E8 U+010D ccaron
+!E9 U+00E9 eacute
+!EA U+017A zacute
+!EB U+0117 edotaccent
+!EC U+0123 gcommaaccent
+!ED U+0137 kcommaaccent
+!EE U+012B imacron
+!EF U+013C lcommaaccent
+!F0 U+0161 scaron
+!F1 U+0144 nacute
+!F2 U+0146 ncommaaccent
+!F3 U+00F3 oacute
+!F4 U+014D omacron
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+0173 uogonek
+!F9 U+0142 lslash
+!FA U+015B sacute
+!FB U+016B umacron
+!FC U+00FC udieresis
+!FD U+017C zdotaccent
+!FE U+017E zcaron
+!FF U+02D9 dotaccent
Index: /trunk/reports/inc/font/makefont/cp1258.map
===================================================================
--- /trunk/reports/inc/font/makefont/cp1258.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/cp1258.map	(revision 5291)
@@ -0,0 +1,247 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!83 U+0192 florin
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!88 U+02C6 circumflex
+!89 U+2030 perthousand
+!8B U+2039 guilsinglleft
+!8C U+0152 OE
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!98 U+02DC tilde
+!99 U+2122 trademark
+!9B U+203A guilsinglright
+!9C U+0153 oe
+!9F U+0178 Ydieresis
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+00AA ordfeminine
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00B8 cedilla
+!B9 U+00B9 onesuperior
+!BA U+00BA ordmasculine
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00BF questiondown
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+0102 Abreve
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+0300 gravecomb
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+0110 Dcroat
+!D1 U+00D1 Ntilde
+!D2 U+0309 hookabovecomb
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+01A0 Ohorn
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+01AF Uhorn
+!DE U+0303 tildecomb
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+0103 abreve
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+0301 acutecomb
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+0111 dcroat
+!F1 U+00F1 ntilde
+!F2 U+0323 dotbelowcomb
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+01A1 ohorn
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+01B0 uhorn
+!FE U+20AB dong
+!FF U+00FF ydieresis
Index: /trunk/reports/inc/font/makefont/iso-8859-11.map
===================================================================
--- /trunk/reports/inc/font/makefont/iso-8859-11.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/iso-8859-11.map	(revision 5291)
@@ -0,0 +1,248 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+0E01 kokaithai
+!A2 U+0E02 khokhaithai
+!A3 U+0E03 khokhuatthai
+!A4 U+0E04 khokhwaithai
+!A5 U+0E05 khokhonthai
+!A6 U+0E06 khorakhangthai
+!A7 U+0E07 ngonguthai
+!A8 U+0E08 chochanthai
+!A9 U+0E09 chochingthai
+!AA U+0E0A chochangthai
+!AB U+0E0B sosothai
+!AC U+0E0C chochoethai
+!AD U+0E0D yoyingthai
+!AE U+0E0E dochadathai
+!AF U+0E0F topatakthai
+!B0 U+0E10 thothanthai
+!B1 U+0E11 thonangmonthothai
+!B2 U+0E12 thophuthaothai
+!B3 U+0E13 nonenthai
+!B4 U+0E14 dodekthai
+!B5 U+0E15 totaothai
+!B6 U+0E16 thothungthai
+!B7 U+0E17 thothahanthai
+!B8 U+0E18 thothongthai
+!B9 U+0E19 nonuthai
+!BA U+0E1A bobaimaithai
+!BB U+0E1B poplathai
+!BC U+0E1C phophungthai
+!BD U+0E1D fofathai
+!BE U+0E1E phophanthai
+!BF U+0E1F fofanthai
+!C0 U+0E20 phosamphaothai
+!C1 U+0E21 momathai
+!C2 U+0E22 yoyakthai
+!C3 U+0E23 roruathai
+!C4 U+0E24 ruthai
+!C5 U+0E25 lolingthai
+!C6 U+0E26 luthai
+!C7 U+0E27 wowaenthai
+!C8 U+0E28 sosalathai
+!C9 U+0E29 sorusithai
+!CA U+0E2A sosuathai
+!CB U+0E2B hohipthai
+!CC U+0E2C lochulathai
+!CD U+0E2D oangthai
+!CE U+0E2E honokhukthai
+!CF U+0E2F paiyannoithai
+!D0 U+0E30 saraathai
+!D1 U+0E31 maihanakatthai
+!D2 U+0E32 saraaathai
+!D3 U+0E33 saraamthai
+!D4 U+0E34 saraithai
+!D5 U+0E35 saraiithai
+!D6 U+0E36 sarauethai
+!D7 U+0E37 saraueethai
+!D8 U+0E38 sarauthai
+!D9 U+0E39 sarauuthai
+!DA U+0E3A phinthuthai
+!DF U+0E3F bahtthai
+!E0 U+0E40 saraethai
+!E1 U+0E41 saraaethai
+!E2 U+0E42 saraothai
+!E3 U+0E43 saraaimaimuanthai
+!E4 U+0E44 saraaimaimalaithai
+!E5 U+0E45 lakkhangyaothai
+!E6 U+0E46 maiyamokthai
+!E7 U+0E47 maitaikhuthai
+!E8 U+0E48 maiekthai
+!E9 U+0E49 maithothai
+!EA U+0E4A maitrithai
+!EB U+0E4B maichattawathai
+!EC U+0E4C thanthakhatthai
+!ED U+0E4D nikhahitthai
+!EE U+0E4E yamakkanthai
+!EF U+0E4F fongmanthai
+!F0 U+0E50 zerothai
+!F1 U+0E51 onethai
+!F2 U+0E52 twothai
+!F3 U+0E53 threethai
+!F4 U+0E54 fourthai
+!F5 U+0E55 fivethai
+!F6 U+0E56 sixthai
+!F7 U+0E57 seventhai
+!F8 U+0E58 eightthai
+!F9 U+0E59 ninethai
+!FA U+0E5A angkhankhuthai
+!FB U+0E5B khomutthai
Index: /trunk/reports/inc/font/makefont/iso-8859-15.map
===================================================================
--- /trunk/reports/inc/font/makefont/iso-8859-15.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/iso-8859-15.map	(revision 5291)
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+20AC Euro
+!A5 U+00A5 yen
+!A6 U+0160 Scaron
+!A7 U+00A7 section
+!A8 U+0161 scaron
+!A9 U+00A9 copyright
+!AA U+00AA ordfeminine
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+017D Zcaron
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+017E zcaron
+!B9 U+00B9 onesuperior
+!BA U+00BA ordmasculine
+!BB U+00BB guillemotright
+!BC U+0152 OE
+!BD U+0153 oe
+!BE U+0178 Ydieresis
+!BF U+00BF questiondown
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+00C3 Atilde
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+00CC Igrave
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+00D0 Eth
+!D1 U+00D1 Ntilde
+!D2 U+00D2 Ograve
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+00DD Yacute
+!DE U+00DE Thorn
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+00E3 atilde
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+00EC igrave
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+00F0 eth
+!F1 U+00F1 ntilde
+!F2 U+00F2 ograve
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+00FD yacute
+!FE U+00FE thorn
+!FF U+00FF ydieresis
Index: /trunk/reports/inc/font/makefont/iso-8859-16.map
===================================================================
--- /trunk/reports/inc/font/makefont/iso-8859-16.map	(revision 5291)
+++ /trunk/reports/inc/font/makefont/iso-8859-16.map	(revision 5291)
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+0104 Aogonek
+!A2 U+0105 aogonek
+!A3 U+0141 Lslash
+!A4 U+20AC Euro
+!A5 U+201E quotedblbase
+!A6 U+0160 Scaron
+!A7 U+00A7 section
+!A8 U+0161 scaron
+!A9 U+00A9 copyright
+!AA U+0218 Scommaaccent
+!AB U+00AB guillemotleft
+!AC U+0179 Zacute
+!AD U+00AD hyphen
+!AE U+017A zacute
+!AF U+017B Zdotaccent
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+010C Ccaron
+!B3 U+0142 lslash
+!B4 U+017D Zcaron
+!B5 U+201D quotedblright
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+017E zcaron
+!B9 U+010D ccaron
+!BA U+0219 scommaaccent
+!BB U+00BB guillemotright
+!BC U+0152 OE
+!BD U+0153 oe
+!BE U+0178 Ydieresis
+!BF U+017C zdotaccent
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+0102 Abreve
+!C4 U+00C4 Adieresis
+!C5 U+0106 Cacute
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+00CC Igrave
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+0110 Dcroat
+!D1 U+0143 Nacute
+!D2 U+00D2 Ograve
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+0150 Ohungarumlaut
+!D6 U+00D6 Odieresis
+!D7 U+015A Sacute
+!D8 U+0170 Uhungarumlaut
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+0118 Eogonek
+!DE U+021A Tcommaaccent
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+0103 abreve
+!E4 U+00E4 adieresis
+!E5 U+0107 cacute
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+00EC igrave
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+0111 dcroat
+!F1 U+0144 nacute
+!F2 U+00F2 ograve
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+0151 ohungarumlaut
+!F6 U+00F6 odieresis
+!F7 U+015B sacute
+!F8 U+0171 uhungarumlaut
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+0119 eogonek
+!FE U+021B tcommaaccent
+!FF U+00FF ydieresis
Index: /trunk/reports/inc/font/helveticabi.php
===================================================================
--- /trunk/reports/inc/font/helveticabi.php	(revision 5291)
+++ /trunk/reports/inc/font/helveticabi.php	(revision 5291)
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['helveticaBI']=array(
+	chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
+	chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
+	','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
+	'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
+	'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
+	'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
+	chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+	chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
+	chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
+	chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
+	chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
+?>
Index: /trunk/reports/inc/font/desktop.ini
===================================================================
--- /trunk/reports/inc/font/desktop.ini	(revision 5291)
+++ /trunk/reports/inc/font/desktop.ini	(revision 5291)
@@ -0,0 +1,4 @@
+[ViewState]
+Mode=
+Vid=
+FolderType=NotSpecified
Index: /trunk/reports/inc/font/times.php
===================================================================
--- /trunk/reports/inc/font/times.php	(revision 5291)
+++ /trunk/reports/inc/font/times.php	(revision 5291)
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['times']=array(
+	chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+	chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564,
+	','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722,
+	'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944,
+	'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
+	'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
+	chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980,
+	chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333,
+	chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
+	chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
+	chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500);
+?>
Index: /trunk/reports/inc/font/timesb.php
===================================================================
--- /trunk/reports/inc/font/timesb.php	(revision 5291)
+++ /trunk/reports/inc/font/timesb.php	(revision 5291)
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['timesB']=array(
+	chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+	chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
+	','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722,
+	'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000,
+	'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833,
+	'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
+	chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+	chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333,
+	chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
+	chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
+	chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
+?>
Index: /trunk/reports/inc/font/helvetica.php
===================================================================
--- /trunk/reports/inc/font/helvetica.php	(revision 5291)
+++ /trunk/reports/inc/font/helvetica.php	(revision 5291)
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['helvetica']=array(
+	chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
+	chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
+	','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
+	'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
+	'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
+	'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
+	chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+	chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
+	chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
+	chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
+	chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
+?>
Index: /trunk/reports/inc/font/symbol.php
===================================================================
--- /trunk/reports/inc/font/symbol.php	(revision 5291)
+++ /trunk/reports/inc/font/symbol.php	(revision 5291)
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['symbol']=array(
+	chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+	chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549,
+	','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722,
+	'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768,
+	'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576,
+	'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0,
+	chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
+	chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603,
+	chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768,
+	chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042,
+	chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329,
+	chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0);
+?>
Index: /trunk/reports/inc/font/helveticab.php
===================================================================
--- /trunk/reports/inc/font/helveticab.php	(revision 5291)
+++ /trunk/reports/inc/font/helveticab.php	(revision 5291)
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['helveticaB']=array(
+	chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
+	chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
+	','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
+	'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
+	'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
+	'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
+	chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+	chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
+	chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
+	chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
+	chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
+?>
Index: /trunk/reports/inc/font/courier.php
===================================================================
--- /trunk/reports/inc/font/courier.php	(revision 5291)
+++ /trunk/reports/inc/font/courier.php	(revision 5291)
@@ -0,0 +1,7 @@
+<?php
+for($i=0;$i<=255;$i++)
+	$fpdf_charwidths['courier'][chr($i)]=600;
+$fpdf_charwidths['courierB']=$fpdf_charwidths['courier'];
+$fpdf_charwidths['courierI']=$fpdf_charwidths['courier'];
+$fpdf_charwidths['courierBI']=$fpdf_charwidths['courier'];
+?>
Index: /trunk/reports/inc/hook_admin.inc.php
===================================================================
--- /trunk/reports/inc/hook_admin.inc.php	(revision 5291)
+++ /trunk/reports/inc/hook_admin.inc.php	(revision 5291)
@@ -0,0 +1,21 @@
+<?php
+	/************************************************************************************\
+	* Expresso relatório                 										        *
+	* by Elvio Rufino da Silva (elviosilva@yahoo.com.br, elviosilva@cepromat.mt.gov.br) *
+	* ----------------------------------------------------------------------------------*
+	*  This program is free software; you can redistribute it and/or modify it			*
+	*  under the terms of the GNU General Public License as published by the			*
+	*  Free Software Foundation; either version 2 of the License, or (at your			*
+	*  option) any later version.														*
+	\************************************************************************************/
+
+	if (! $GLOBALS['phpgw']->acl->check('site_config_access',1,'admin'))
+	{
+		$file = Array(
+			'Global Configuration' => $GLOBALS['phpgw']->link('/index.php','menuaction=reports.uireports.report_config_global')
+		);
+	}
+	/* Do not modify below this line */
+	display_section($appname,$file);
+
+?>
Index: /trunk/reports/inc/class.functions.inc.php
===================================================================
--- /trunk/reports/inc/class.functions.inc.php	(revision 5291)
+++ /trunk/reports/inc/class.functions.inc.php	(revision 5291)
@@ -0,0 +1,1623 @@
+<?php
+	/**********************************************************************************\
+	*Expresso Relatório                  									      *
+	*by Elvio Rufino da Silva (elviosilva@yahoo.com.br, elviosilva@cepromat.mt.gov.br) *
+	* --------------------------------------------------------------------------------*
+	*  This program is free software; you can redistribute it and/or modify it		  *
+	*  under the terms of the GNU General Public License as published by the		  *
+	*  Free Software Foundation; either version 2 of the License, or (at your		  *
+	*  option) any later version.													 *
+	**********************************************************************************/
+	
+	include_once('class.db_functions.inc.php');
+	include_once(PHPGW_API_INC.'/class.config.inc.php');
+
+	class functions
+	{
+		var $public_functions = array
+		(
+			'make_array_acl' 			=> True,
+			'check_acl'					=> True,
+			'read_acl'					=> True,
+			'exist_account_lid'			=> True,
+			'exist_email'				=> True,
+			'array_invert'				=> True,
+			'Paginate_user'				=> True,
+			'Paginate_user_logon'		=> True,
+			'get_list_all'				=> True,
+			'get_groups_list'			=> True,
+			'get_list_ou_user_logon'	=> True,
+			'show_access_log'			=> True,
+			'get_sectors_list'			=> True
+		);
+		
+		var $nextmatchs;
+		var $sectors_list = array();
+		var $current_config;
+		
+		function functions()
+		{
+			$this->db_functions = new db_functions;
+			$GLOBALS['phpgw']->db = $this->db_functions->db;
+
+			$c = new config;
+			$c->read_repository();
+			$this->current_config = $c->config_data;
+		}
+
+		// Account and type of access. Return: Have access ? (true/false)
+		function check_acl($account_lid, $access)
+		{
+			$acl = $this->read_acl($account_lid);
+			$array_acl = $this->make_array_acl($acl['acl']);
+			
+			switch($access)
+			{
+				case list_users:
+					if ($array_acl[acl_add_users] || $array_acl[acl_edit_users] || $array_acl[acl_delete_users] || $array_acl[acl_change_users_password] || $array_acl[acl_change_users_quote] || $array_acl[acl_edit_sambausers_attributes] || $array_acl[acl_view_users] || $array_acl[acl_manipulate_corporative_information] || $array_acl[acl_edit_users_phonenumber] )
+						return true;
+					break;
+				case report_users:
+					if ($array_acl[acl_change_users_quote] || $array_acl[acl_view_users])
+						return true;
+					break;
+				case list_groups:
+					if ($array_acl[acl_add_groups] || $array_acl[acl_edit_groups] || $array_acl[acl_delete_groups])
+						return true;
+					break;
+				case list_maillists:
+					if ($array_acl[acl_add_maillists] || $array_acl[acl_edit_maillists] || $array_acl[acl_delete_maillists])
+						return true;
+					break;
+				case list_sectors:
+//					if ($array_acl[acl_create_sectors] || $array_acl[acl_edit_sectors] || $array_acl[acl_delete_sectors])
+					if ($array_acl[acl_view_users])
+						return true;
+					break;
+				case list_computers:
+					if ($array_acl[acl_create_computers] || $array_acl[acl_edit_computers] || $array_acl[acl_delete_computers])
+						return true;
+					break;
+
+				case display_groups:
+					if ( $array_acl[acl_edit_users] || $array_acl[acl_view_users] || ($array_acl[acl_edit_sambausers_attributes] && ($this->current_config['expressoAdmin_samba_support'] == 'true')) )
+						return true;
+					break;
+				case display_emailconfig:
+					if ($array_acl[acl_edit_users] || $array_acl[acl_view_users])
+						return true;
+					break;
+				case display_applications:
+					if ($array_acl[acl_edit_users] || $array_acl[acl_view_users])
+						return true;
+					break;
+				case display_emaillists:
+					if ($array_acl[acl_edit_users] || $array_acl[acl_view_users])
+						return true;
+					break;
+
+				case list_institutional_accounts:
+					if ($array_acl[acl_add_institutional_accounts] || $array_acl[acl_edit_institutional_accounts] || $array_acl[acl_delete_institutional_accounts])
+						return true;
+					break;
+
+
+				default:
+					return $array_acl["acl_$access"];
+			}
+			return false;
+		}
+
+		
+		// Read acl from db
+		function read_acl($account_lid)
+		{ 
+			$acl = $this->db_functions->read_acl($account_lid);
+			
+			$result['acl'] = $acl[0]['acl'];
+			$result['manager_lid'] = $acl[0]['manager_lid'];
+			$result['raw_context'] = $acl[0]['context'];
+			
+			$all_contexts = split("%", $acl[0]['context']);
+			foreach ($all_contexts as $index=>$context)
+			{
+				$result['contexts'][] = $context;
+				$result['contexts_display'][] = str_replace(", ", ".", ldap_dn2ufn( $context ));
+			}
+			
+			return $result;
+		}
+		
+		function make_array_acl($acl)
+		{
+			$array_acl_tmp = array();
+			$tmp = array(		"acl_add_users",
+							 	"acl_edit_users",
+							 	"acl_delete_users",
+							 	"acl_EMPTY1",
+							 	"acl_add_groups",
+							 	"acl_edit_groups",
+							 	"acl_delete_groups",
+							 	"acl_change_users_password",
+							 	"acl_add_maillists",
+							 	"acl_edit_maillists",
+							 	"acl_delete_maillists",
+							 	"acl_EMPTY2",
+							 	"acl_create_sectors",
+							 	"acl_edit_sectors",
+							 	"acl_delete_sectors",
+							 	"acl_edit_sambausers_attributes",
+							 	"acl_view_global_sessions",
+							 	"acl_view_logs",
+							 	"acl_change_users_quote",
+							 	"acl_set_user_default_password",
+							 	"acl_create_computers",
+							 	"acl_edit_computers",
+							 	"acl_delete_computers",
+							 	"acl_rename_users",
+							 	"acl_edit_sambadomains",
+							 	"acl_view_users",
+							 	"acl_edit_email_groups",
+							 	"acl_empty_user_inbox",
+							 	"acl_manipulate_corporative_information",
+							 	"acl_edit_users_picture",
+							 	"acl_edit_scl_email_lists",
+							 	"acl_edit_users_phonenumber",
+							 	"acl_add_institutional_accounts",
+							 	"acl_edit_institutional_accounts",
+							 	"acl_remove_institutional_accounts"
+							 	);
+			
+			foreach ($tmp as $index => $right)
+			{
+				$bin = '';
+				for ($i=0; $i<$index; $i++)
+				{
+					$bin .= '0';
+				}
+				$bin = '1' . $bin;
+				
+				$array_acl[$right] = $this->safeBitCheck(bindec($bin), $acl);
+			}
+			return $array_acl;
+		}
+		
+		function get_inactive_users($contexts)
+		{
+			$retorno = array();
+			$tempUsers = array();
+			//Pego no LDAP todos os usuários dos contextos em questão.
+			$usuariosLdap = $this->get_list('accounts','',$contexts);
+			foreach($usuariosLdap as $usuarioLdap) 
+			{
+				$tempUsers[$usuarioLdap["account_id"]] = $usuarioLdap["account_lid"];
+			}
+			$ids = implode(",",array_keys($tempUsers)); //Consigo a lista de uids daquele contexto para mandar na query para o banco.
+			
+			//Pego nas configurações do expresso o número de dias necessários para inatividade.
+			$timeToExpire = $GLOBALS['phpgw_info']['server']['time_to_account_expires'];
+			
+			
+			$ultimoTsValido = time() - ($timeToExpire * 86400); //O último timestamp válido é dado pelo de agora menos o número de dias para expirar vezes a quantidade de segundos existente em 1 dia.
+			$query = "select account_id,max(li) as last_login from phpgw_access_log where account_id in (".$ids.") group by account_id having max(li) < ".$ultimoTsValido." order by max(li)";
+
+			$GLOBALS['phpgw']->db->query($query);
+			while($GLOBALS['phpgw']->db->next_record())
+			{
+				$result = $GLOBALS['phpgw']->db->row();
+				array_push($retorno,array("uidNumber"=>$result["account_id"],"login"=> $tempUsers[$result["account_id"]],"li"=>$result["last_login"]));
+			}
+			
+			return $retorno;
+		}
+
+		function safeBitCheck($number,$comparison)
+		{
+        	$binNumber = base_convert($number,10,2);
+	        $binComparison = strrev(base_convert($comparison,10,2));
+			$str = strlen($binNumber);
+	        
+	        if ( ($str <= strlen($binComparison)) && ($binComparison{$str-1}==="1") )
+        	{
+				return '1';
+	        }
+			else
+	        {
+				return '0';
+			}
+		}
+		
+		function get_list_all($type, $query, $contexts,$sizelimit)
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+			
+			if ($type == 'accounts')
+			{
+				$justthese = array("uidnumber", "uid", "cn", "mail");
+				$filter="(&(phpgwAccountType=u)(|(ou=*".$query."*)(uid=*".$query."*)(sn=*".$query."*)(cn=*".$query."*)(givenName=*".$query."*)(mail=$query*)(mailAlternateAddress=$query*)))";
+								
+				$tmp = array();
+				foreach ($contexts as $index=>$context)
+				{
+					$search=ldap_search($ldap_conn, $context, $filter, $justthese, 0, $sizelimit);
+					$info = ldap_get_entries($ldap_conn, $search);
+					
+					for ($i=0; $i < $info['count']; $i++)
+					{
+						$tmp[$info[$i]['uid'][0]]['account_id']	 = $info[$i]['uidnumber'][0]; 
+						$tmp[$info[$i]['uid'][0]]['account_lid'] = $info[$i]['uid'][0];
+						$tmp[$info[$i]['uid'][0]]['account_cn']	 = $info[$i]['cn'][0];
+						$tmp[$info[$i]['uid'][0]]['account_mail']= $info[$i]['mail'][0];
+						$sort[] = $info[$i]['uid'][0];
+					}
+				}
+				ldap_close($ldap_conn);
+				
+				if (count($sort))
+				{
+					natcasesort($sort);
+					foreach ($sort as $user_uid)
+						$return[$user_uid] = $tmp[$user_uid];
+				}
+				
+				return $return;
+			}
+			elseif($type == 'groups')
+			{
+				$filter="(&(phpgwAccountType=g)(cn=*$query*))";
+				$justthese = array("gidnumber", "cn", "description");
+				
+				$tmp = array();
+				foreach ($contexts as $index=>$context)
+				{
+					$search=ldap_search($ldap_conn, $context, $filter, $justthese);
+					$info = ldap_get_entries($ldap_conn, $search);
+					for ($i=0; $i < $info['count']; $i++)
+					{
+						$tmp[$info[$i]['cn'][0]]['cn']= $info[$i]['cn'][0];
+						$tmp[$info[$i]['cn'][0]]['description']= $info[$i]['description'][0];
+						$tmp[$info[$i]['cn'][0]]['gidnumber']= $info[$i]['gidnumber'][0];
+						$sort[] = $info[$i]['cn'][0];
+					}
+				}
+				ldap_close($ldap_conn);
+				
+				natcasesort($sort);
+				foreach ($sort as $group_cn)
+					$return[$group_cn] = $tmp[$group_cn];
+				
+				return $return;
+			}
+			elseif($type == 'maillists')
+			{
+				$filter="(&(phpgwAccountType=l)(|(cn=*".$query."*)(uid=*".$query."*)(mail=*".$query."*)))";
+				$justthese = array("uidnumber", "cn", "uid", "mail");
+
+				$tmp = array();
+				foreach ($contexts as $index=>$context)
+				{
+					$search=ldap_search($ldap_conn, $context, $filter, $justthese);
+					$info = ldap_get_entries($ldap_conn, $search);
+					
+					for ($i=0; $i < $info['count']; $i++)
+					{
+						$tmp[$info[$i]['uid'][0]]['uid']		= $info[$i]['uid'][0];
+						$tmp[$info[$i]['uid'][0]]['name']		= $info[$i]['cn'][0];
+						$tmp[$info[$i]['uid'][0]]['uidnumber']	= $info[$i]['uidnumber'][0];
+						$tmp[$info[$i]['uid'][0]]['email']		= $info[$i]['mail'][0];
+						$sort[] = $info[$i]['uid'][0];
+					}
+				}
+				ldap_close($ldap_conn);
+				
+				natcasesort($sort);
+				foreach ($sort as $maillist_uid)
+					$return[$maillist_uid] = $tmp[$maillist_uid];
+				
+				return $return;
+			}
+			elseif($type == 'computers')
+			{
+				$filter="(&(objectClass=sambaSAMAccount)(|(sambaAcctFlags=[W          ])(sambaAcctFlags=[DW         ])(sambaAcctFlags=[I          ])(sambaAcctFlags=[S          ]))(cn=*".$query."*))";
+				$justthese = array("cn","uidNumber","description");
+
+				$tmp = array();
+				foreach ($contexts as $index=>$context)
+				{
+					$search=ldap_search($ldap_conn, $context, $filter, $justthese);
+					$info = ldap_get_entries($ldap_conn, $search);
+					for ($i=0; $i < $info['count']; $i++)
+					{
+						$tmp[$info[$i]['cn'][0]]['cn']			= $info[$i]['cn'][0];
+						$tmp[$info[$i]['cn'][0]]['uidNumber']	= $info[$i]['uidnumber'][0];
+						$tmp[$info[$i]['cn'][0]]['description']	= utf8_decode($info[$i]['description'][0]);
+						$sort[] = $info[$i]['cn'][0];
+					}
+
+				}
+				ldap_close($ldap_conn);
+				
+				if (!empty($sort))
+				{
+					natcasesort($sort);
+					foreach ($sort as $computer_cn)
+						$return[$computer_cn] = $tmp[$computer_cn];
+				}
+				
+				return $return;
+			}
+		}
+
+		function get_list($type, $query, $contexts)
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+			
+			if ($type == 'accounts')
+			{
+				$justthese = array("uidnumber", "uid", "cn", "mail");
+				$filter="(&(phpgwAccountType=u)(|(uid=*".$query."*)(sn=*".$query."*)(cn=*".$query."*)(givenName=*".$query."*)(mail=$query*)(mailAlternateAddress=$query*)))";
+
+				$tmp = array();
+				foreach ($contexts as $index=>$context)
+				{
+					$search=ldap_search($ldap_conn, $context, $filter, $justthese);
+					$info = ldap_get_entries($ldap_conn, $search);
+					
+					for ($i=0; $i < $info['count']; $i++)
+					{
+						$tmp[$info[$i]['uid'][0]]['account_id']	 = $info[$i]['uidnumber'][0]; 
+						$tmp[$info[$i]['uid'][0]]['account_lid'] = $info[$i]['uid'][0];
+						$tmp[$info[$i]['uid'][0]]['account_cn']	 = $info[$i]['cn'][0];
+						$tmp[$info[$i]['uid'][0]]['account_mail']= $info[$i]['mail'][0];
+						$sort[] = $info[$i]['uid'][0];
+					}
+				}
+				ldap_close($ldap_conn);
+				
+				if (count($sort))
+				{
+					natcasesort($sort);
+					foreach ($sort as $user_uid)
+						$return[$user_uid] = $tmp[$user_uid];
+				}
+				
+				return $return;
+			}
+			elseif($type == 'groups')
+			{
+				$filter="(&(phpgwAccountType=g)(cn=*$query*))";
+				$justthese = array("gidnumber", "cn", "description");
+				
+				$tmp = array();
+				foreach ($contexts as $index=>$context)
+				{
+					$search=ldap_search($ldap_conn, $context, $filter, $justthese);
+					$info = ldap_get_entries($ldap_conn, $search);
+					for ($i=0; $i < $info['count']; $i++)
+					{
+						$tmp[$info[$i]['cn'][0]]['cn']= $info[$i]['cn'][0];
+						$tmp[$info[$i]['cn'][0]]['description']= $info[$i]['description'][0];
+						$tmp[$info[$i]['cn'][0]]['gidnumber']= $info[$i]['gidnumber'][0];
+						$sort[] = $info[$i]['cn'][0];
+					}
+				}
+				ldap_close($ldap_conn);
+				
+				natcasesort($sort);
+				foreach ($sort as $group_cn)
+					$return[$group_cn] = $tmp[$group_cn];
+				
+				return $return;
+			}
+			elseif($type == 'maillists')
+			{
+				$filter="(&(phpgwAccountType=l)(|(cn=*".$query."*)(uid=*".$query."*)(mail=*".$query."*)))";
+				$justthese = array("uidnumber", "cn", "uid", "mail");
+
+				$tmp = array();
+				foreach ($contexts as $index=>$context)
+				{
+					$search=ldap_search($ldap_conn, $context, $filter, $justthese);
+					$info = ldap_get_entries($ldap_conn, $search);
+					
+					for ($i=0; $i < $info['count']; $i++)
+					{
+						$tmp[$info[$i]['uid'][0]]['uid']		= $info[$i]['uid'][0];
+						$tmp[$info[$i]['uid'][0]]['name']		= $info[$i]['cn'][0];
+						$tmp[$info[$i]['uid'][0]]['uidnumber']	= $info[$i]['uidnumber'][0];
+						$tmp[$info[$i]['uid'][0]]['email']		= $info[$i]['mail'][0];
+						$sort[] = $info[$i]['uid'][0];
+					}
+				}
+				ldap_close($ldap_conn);
+				
+				natcasesort($sort);
+				foreach ($sort as $maillist_uid)
+					$return[$maillist_uid] = $tmp[$maillist_uid];
+				
+				return $return;
+			}
+			elseif($type == 'computers')
+			{
+				$filter="(&(objectClass=sambaSAMAccount)(|(sambaAcctFlags=[W          ])(sambaAcctFlags=[DW         ])(sambaAcctFlags=[I          ])(sambaAcctFlags=[S          ]))(cn=*".$query."*))";
+				$justthese = array("cn","uidNumber","description");
+
+				$tmp = array();
+				foreach ($contexts as $index=>$context)
+				{
+					$search=ldap_search($ldap_conn, $context, $filter, $justthese);
+					$info = ldap_get_entries($ldap_conn, $search);
+					for ($i=0; $i < $info['count']; $i++)
+					{
+						$tmp[$info[$i]['cn'][0]]['cn']			= $info[$i]['cn'][0];
+						$tmp[$info[$i]['cn'][0]]['uidNumber']	= $info[$i]['uidnumber'][0];
+						$tmp[$info[$i]['cn'][0]]['description']	= utf8_decode($info[$i]['description'][0]);
+						$sort[] = $info[$i]['cn'][0];
+					}
+
+				}
+
+				ldap_close($ldap_conn);
+				
+				if (!empty($sort))
+				{
+					natcasesort($sort);
+					foreach ($sort as $computer_cn)
+						$return[$computer_cn] = $tmp[$computer_cn];
+				}
+				
+				return $return;
+			}
+		}
+
+		function get_organizations($context, $selected='', $referral=false, $show_invisible_ou=true, $master=false)
+		{
+			$s = CreateObject('phpgwapi.sector_search_ldap');
+			$sectors_info = $s->get_organizations($context, $selected, $referral, $show_invisible_ou, $master);
+			return $sectors_info;
+		}		
+				
+		function get_sectors($selected='', $referral=false, $show_invisible_ou=true)
+		{
+			$s = CreateObject('phpgwapi.sector_search_ldap');
+			$sectors_info = $s->get_sectors($selected, $referral, $show_invisible_ou);
+			return $sectors_info;
+		}		
+ 
+		// Get list of levels (0). 
+		function get_groups_list($contexts,$filtro)
+		{
+			$a_sectors = array();
+			
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+			
+			$justthese = array("dn");
+			$filter = "(ou=".$filtro.")";
+			
+			$systemName = strtolower($GLOBALS['phpgw_info']['server']['system_name']);
+			if ($systemName != '')
+				$filter = "(&$filter(phpgwSystem=$systemName))";
+			
+			foreach ($contexts as $context)
+			{
+				$search=ldap_search($ldap_conn, $context, $filter, $justthese);
+        		$info = ldap_get_entries($ldap_conn, $search);
+
+		        for ($i=0; $i<$info["count"]; $i++)
+    		    {
+    		    	$a_sectors[] = $info[$i]['dn'];	
+    		    }
+			}
+        	
+			ldap_close($ldap_conn);
+
+			// Retiro o count do array info e inverto o array para ordenação.
+	        foreach ($a_sectors as $context)
+    	    {
+				$array_dn = ldap_explode_dn ( $context, 1 );
+
+                $array_dn_reverse  = array_reverse ( $array_dn, true );
+
+				// Retirar o indice count do array.
+				array_pop ( $array_dn_reverse );
+
+				$inverted_dn[$context] = implode ( "#", $array_dn_reverse );
+			}
+
+			// Ordenação
+			natcasesort($inverted_dn);
+			
+			// Construção do select
+			$level = 0;
+			$options = array();
+			foreach ($inverted_dn as $dn=>$invert_ufn)
+			{
+                $display = '';
+
+                $array_dn_reverse = explode ( "#", $invert_ufn );
+                $array_dn  = array_reverse ( $array_dn_reverse, true );
+                $level = count( $array_dn ) - (int)(count(explode(",", $GLOBALS['phpgw_info']['server']['ldap_context'])) + 1);
+
+                if ($level == 0)
+				{
+                    $display.= ' ';
+	                reset ( $array_dn );
+    	            $display .= ' ' . (current ( $array_dn ) );
+					$dn = trim(strtolower($dn));
+					$options[$dn] = $display;
+                }
+        	}
+    	    return $options;
+		}
+		
+		// Get list of levels (0), value DN
+		function get_groups_list_dn($contexts,$filtro)
+		{
+			$a_sectors = array();
+			
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+			
+			$justthese = array("dn");
+			$filter = "(ou=".$filtro.")";
+			
+			$systemName = strtolower($GLOBALS['phpgw_info']['server']['system_name']);
+			if ($systemName != '')
+				$filter = "(&$filter(phpgwSystem=$systemName))";
+			
+			foreach ($contexts as $context)
+			{
+				$search=ldap_search($ldap_conn, $context, $filter, $justthese);
+        		$info = ldap_get_entries($ldap_conn, $search);
+		        for ($i=0; $i<$info["count"]; $i++)
+    		    {
+    		    	$a_sectors[] = $info[$i]['dn'];	
+    		    }
+			}
+        	
+			ldap_close($ldap_conn);
+
+			// Retiro o count do array info e inverto o array para ordenação.
+	        foreach ($a_sectors as $context)
+    	    {
+				$array_dn = ldap_explode_dn ( $context, 1 );
+
+                $array_dn_reverse  = array_reverse ( $array_dn, true );
+
+				// Retirar o indice count do array.
+				array_pop ( $array_dn_reverse );
+
+				$inverted_dn[$context] = implode ( "#", $array_dn_reverse );
+			}
+
+			// Ordenação
+			natcasesort($inverted_dn);
+			
+			// Construção do select
+			$level = 0;
+			$options = array();
+			foreach ($inverted_dn as $dn=>$invert_ufn)
+			{
+                $display = '';
+
+                $array_dn_reverse = explode ( "#", $invert_ufn );
+                $array_dn  = array_reverse ( $array_dn_reverse, true );
+                $level = count( $array_dn ) - (int)(count(explode(",", $GLOBALS['phpgw_info']['server']['ldap_context'])) + 1);
+
+                if ($level == 0)
+				{
+                    $display.= ' ';
+	                reset ( $array_dn );
+    	            $display .= ' ' . trim(strtolower($dn));
+					$dn = trim(strtolower($dn));
+					$options[] = $display;
+                }
+        	}
+    	    return $options;
+		}
+
+		// Get list of all levels.
+		function get_sectors_list($contexts,$contextdn)
+		{
+			$a_sectors = array();
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+			
+			$justthese = array("ou", "dn");
+			$filter = "(&(objectClass=organizationalUnit)(|(objectClass=organizationalUnit)))";
+			
+			foreach ($contexts as $context)
+			{
+				$search=ldap_search($ldap_conn, $contextdn, $filter, $justthese);
+        		$info = ldap_get_entries($ldap_conn, $search);
+		        for ($i=0; $i<$info["count"]; $i++)
+    		    {
+    		    	$a_sectors[] = trim(strtoupper($info[$i]['dn']));
+    		    }
+			}
+
+			ldap_close($ldap_conn);
+
+			// Retiro o count do array info e inverto o array para ordenação.
+	        foreach ($a_sectors as $context)
+    	    {
+
+				$array_dn = ldap_explode_dn ( $context, 1 );
+
+                $array_dn_reverse  = array_reverse ( $array_dn, true );
+
+				// Retirar o indice count do array.
+				array_pop ( $array_dn_reverse );
+				$inverted_dn[$context] = implode ( "#", $array_dn_reverse );
+
+			}
+
+			// Ordenação
+			natcasesort($inverted_dn);
+
+			// seleciona os setores do grupo escolhido
+			$level = 0;
+			$options = array();
+
+			foreach ($inverted_dn as $dn=>$invert_ufn)
+			{
+				$display = '';
+				$array_dn_completo = '';
+				$ii = 0;			
+				
+				$array_dn_reverse = explode ( "#", $invert_ufn );
+				$array_dn  = array_reverse ( $array_dn_reverse, true );
+
+				$valorgrupo = (int)(count(explode(",", $GLOBALS['phpgw_info']['server']['ldap_context'])));
+				$valorsubgrupo = (count($array_dn)-1);
+				$level = count( $array_dn ) - (int)(count(explode(",", $GLOBALS['phpgw_info']['server']['ldap_context'])) + 1);
+
+				reset ( $array_dn );
+				
+				if ($level > 0)
+				{
+					for ($i=0; $i<$level; $i++)
+					{
+						$ii = $ii +1;
+						$display .= ' --';
+
+						if ($ii==1)
+						{
+							$array_dn_completo .= $array_dn[$valorgrupo + $ii]; 						
+						}
+						else
+						{
+							$array_dn_completo .= " | ".$array_dn[$valorgrupo + $ii]; 
+						}
+
+					}
+				}
+				else
+				{
+//					$array_dn_completo .= (current($array_dn)); 											
+					$array_dn_completo .= ' '; 											
+				}
+
+				$display .= ' '. (current($array_dn)).'#'.trim(strtolower($dn)).'#'.$array_dn_completo;
+				$options[] = $display;
+
+        	}
+    	    return $options;
+		}
+
+		function get_list_usersgroups_sector($query, $contexts,$sizelimit)
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+
+			$filter = "(&(phpgwAccountType=g)(cn=*))";
+			$justthese = array("gidnumber", "cn", "description");
+
+			$tmp = array();
+			foreach ($contexts as $index=>$context)
+			{				
+				$search = ldap_search($ldap_conn, $query, $filter, $justthese, 0, $sizelimit);
+				$info = ldap_get_entries($ldap_conn, $search);				
+				
+				for ($i=0; $i < $info['count']; $i++)
+				{
+					$tmp[$info[$i]['cn'][0]]['id']				= $info[$i]['gidnumber'][0];
+					$tmp[$info[$i]['cn'][0]]['name']			= $info[$i]['cn'][0];
+					$tmp[$info[$i]['cn'][0]]['description']		= $info[$i]['description'][0];
+					$sort[] = $info[$i]['cn'][0];
+				}
+			}
+			ldap_close($ldap_conn);
+			
+			if (count($sort))
+			{			
+				natcasesort($sort);
+				foreach ($sort as $usersgroups_gid)
+					$return[$usersgroups_gid] = $tmp[$usersgroups_gid];
+			}
+			
+			return $return;
+		}		
+		
+		function get_list_maillists_sector($query, $contexts,$sizelimit)
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+
+			$filter="(&(phpgwAccountType=l)(|(uid=*)))";
+			$justthese = array("uidnumber", "cn", "uid", "mail");
+
+			$tmp = array();
+			foreach ($contexts as $index=>$context)
+			{
+				$search = ldap_search($ldap_conn, $query, $filter, $justthese, 0, $sizelimit);
+				$info = ldap_get_entries($ldap_conn, $search);				
+				
+				for ($i=0; $i < $info['count']; $i++)
+				{
+					$tmp[$info[$i]['uid'][0]]['uid']		= $info[$i]['uid'][0];
+					$tmp[$info[$i]['uid'][0]]['name']		= $info[$i]['cn'][0];
+					$tmp[$info[$i]['uid'][0]]['uidnumber']	= $info[$i]['uidnumber'][0];
+					$tmp[$info[$i]['uid'][0]]['email']		= $info[$i]['mail'][0];
+					$sort[] = $info[$i]['uid'][0];
+				}
+			}
+			ldap_close($ldap_conn);
+			
+			if (count($sort))
+			{			
+				natcasesort($sort);
+				foreach ($sort as $maillist_uid)
+					$return[$maillist_uid] = $tmp[$maillist_uid];
+			}
+			
+			return $return;
+		}		
+		
+		function get_list_user_sector($query, $contexts,$sizelimit)
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+
+			$filter="(&(phpgwAccountType=u)(|(uid=*)))";
+			$justthese = array("uidnumber", "uid", "cn", "mail","accountstatus","dn","createtimestamp","telephoneNumber");
+			
+			$tmp = array();
+		
+			foreach ($contexts as $index=>$context)
+			{
+
+				$search = ldap_search($ldap_conn, $query, $filter, $justthese, 0, $sizelimit);
+				$info = ldap_get_entries($ldap_conn, $search);
+
+				for ($i=0; $i < $info['count']; $i++)
+				{
+					$tmp[$info[$i]['uid'][0]]['account_id']	 = $info[$i]['uidnumber'][0]; 
+					$tmp[$info[$i]['uid'][0]]['account_lid'] = $info[$i]['uid'][0];
+					$tmp[$info[$i]['uid'][0]]['account_cn']	 = $info[$i]['cn'][0];
+					$tmp[$info[$i]['uid'][0]]['account_mail']= $info[$i]['mail'][0];
+					$tmp[$info[$i]['uid'][0]]['account_phone']= $info[$i]['telephonenumber'][0];
+					$tmp[$info[$i]['uid'][0]]['account_accountstatus']= $info[$i]['accountstatus'][0];
+					$tmp[$info[$i]['uid'][0]]['createtimestamp']= $info[$i]['createtimestamp'][0];					
+					$sort[] = $info[$i]['uid'][0];
+				}
+			}
+			
+			ldap_close($ldap_conn);
+				
+			if (count($sort))
+			{
+				natcasesort($sort);
+				foreach ($sort as $user_uid)
+					$return[$user_uid] = $tmp[$user_uid];
+			}
+				
+			return $return;
+		}
+
+		function get_count_user_sector($query, $contexts,$sizelimit)
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);			
+			// counting users by sector.
+			foreach ($contexts as $index=>$context)	{
+				if($context == $GLOBALS['phpgw_info']['server'] ["ldap_context"]) {
+					$contexts[$index] = null;
+					$justthese = array("dn");
+					$filter="(objectClass=OrganizationalUnit)";
+					$search = ldap_list($ldap_conn, $context, $filter, $justthese);
+					$entries = ldap_get_entries($ldap_conn, $search);
+					$contexts = array();
+					for ($i=0; $i< $entries['count']; $i++){
+						$contexts[] = $entries[$i]['dn'];
+					}
+				}
+			}	
+			$filter="(&(phpgwAccountType=u)(|(uid=*)))";
+			$justthese = array("uidnumber");
+			$total_count = 0;
+			
+			foreach ($contexts as $index=>$context)	{				
+				$search = ldap_search($ldap_conn, $context, $filter, $justthese, 0, $sizelimit);
+				$total_count += ldap_count_entries($ldap_conn, $search);							
+			}
+			ldap_close($ldap_conn);
+			return $total_count;
+		}
+
+		function get_list_user_sector_logon($query, $contexts,$sizelimit,$numacesso)
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+
+			$filter="(&(phpgwAccountType=u)(|(uid=*)))";
+			$justthese = array("uidnumber", "uid", "cn", "mail","accountstatus","dn","createtimestamp");
+			
+			$tmp = array();
+		
+			foreach ($contexts as $index=>$context)
+			{
+
+				$field = 'cn';
+				$search = ldap_search($ldap_conn, $query, $filter, $justthese, 0, $sizelimit);
+				$info = ldap_get_entries($ldap_conn, $search);
+
+				for ($i=0; $i < $info['count']; $i++)
+				{
+					$access_log =  $this->show_access_log($info[$i]['uidnumber'][0]);
+
+					$access_log_array = explode("#",$access_log);
+
+					if ($access_log_array[1] >= $numacesso or $numacesso == $access_log_array[0]) {
+
+						$tmp[$info[$i]['uid'][0]]['account_id']	 = $info[$i]['uidnumber'][0]; 
+						$tmp[$info[$i]['uid'][0]]['account_lid'] = $info[$i]['uid'][0];
+						$tmp[$info[$i]['uid'][0]]['account_cn']	 = $info[$i]['cn'][0];
+						$tmp[$info[$i]['uid'][0]]['account_mail']= $info[$i]['mail'][0];
+						$tmp[$info[$i]['uid'][0]]['account_accountstatus']= $info[$i]['accountstatus'][0];
+						$tmp[$info[$i]['uid'][0]]['createtimestamp']= $info[$i]['createtimestamp'][0];					
+						$sort[] = $info[$i]['uid'][0];
+					}
+				}
+			}
+
+			ldap_close($ldap_conn);
+				
+			if (count($sort))
+			{
+				natcasesort($sort);
+				foreach ($sort as $user_uid)
+					$return[$user_uid] = $tmp[$user_uid];
+			}
+				
+			return $return;
+		}
+		
+		function exist_account_lid($account_lid)
+		{
+			$conection = $GLOBALS['phpgw']->common->ldapConnect();
+			$sri = ldap_search($conection, $GLOBALS['phpgw_info']['server']['ldap_context'], "uid=" . $account_lid);
+			$result = ldap_get_entries($conection, $sri);
+			return $result['count'];
+		}
+		
+		function exist_email($mail)
+		{
+			$conection = $GLOBALS['phpgw']->common->ldapConnect();
+			$sri = ldap_search($conection, $GLOBALS['phpgw_info']['server']['ldap_context'], "mail=" . $mail);
+			$result = ldap_get_entries($conection, $sri);
+			ldap_close($conection);
+			
+			if ($result['count'] == 0)
+				return false;
+			else
+				return true;
+		}
+		
+		function array_invert($array)
+		{
+			$result[] = end($array);
+			while ($item = prev($array))
+				$result[] = $item;
+			return $result; 
+		}
+
+		function make_list_app($account_lid, $user_applications='', $disabled='')
+		{
+			// create list of ALL available apps
+			$availableAppsGLOBALS = $GLOBALS['phpgw_info']['apps'];
+			
+			// create list of available apps for the user
+			$query = "SELECT * FROM phpgw_expressoadmin_apps WHERE manager_lid = '".$account_lid."'";
+			$GLOBALS['phpgw']->db->query($query);
+			while($GLOBALS['phpgw']->db->next_record())
+			{
+				$availableApps[] = $GLOBALS['phpgw']->db->row();
+			}
+			
+			// Retira alguns modulos
+			if (count($availableApps))
+			{
+				foreach ($availableApps as $key => $value)
+				{
+					if ($value['app'] != 'phpgwapi')
+						$tmp[] = $availableApps[$key];
+				}
+			}
+			$availableApps = $tmp;
+			
+			// Cria um array com as aplicacoes disponiveis para o manager, com as atributos das aplicacoes.
+			$availableAppsUser = array();
+			if (count($availableApps))
+			{
+				foreach($availableApps as $app => $title)
+				{
+					if ($availableAppsGLOBALS[$title['app']])
+						$availableAppsUser[$title['app']] = $availableAppsGLOBALS[$title['app']];
+				}
+			}
+			
+			// Loop para criar dinamicamente uma tabela com 3 colunas, cada coluna com um aplicativo e um check box.
+			$applications_list = '';
+			$app_col1 = '';
+			$app_col2 = '';
+			$app_col3 = '';
+			$total_apps = count($availableAppsUser);
+			$i = 0;
+			foreach($availableAppsUser as $app => $data)
+			{
+				// 1 coluna 
+				if (($i +1) % 3 == 1)
+				{
+					$checked = $user_applications[$app] ? 'CHECKED' : '';
+					$app_col1 = sprintf("<td>%s</td><td width='10'><input type='checkbox' name='apps[%s]' value='1' %s %s></td>\n",
+					$data['title'],$app,$checked, $disabled);
+					if ($i == ($total_apps-1))
+						$applications_list .= sprintf('<tr bgcolor="%s">%s</tr>','#DDDDDD', $app_col1);
+				}
+				
+				// 2 coluna
+				if (($i +1) % 3 == 2)
+				{
+					$checked = $user_applications[$app] ? 'CHECKED' : '';
+					$app_col2 = sprintf("<td>%s</td><td width='10'><input type='checkbox' name='apps[%s]' value='1' %s %s></td>\n",
+					$data['title'],$app,$checked, $disabled);
+					
+					if ($i == ($total_apps-1))
+						$applications_list .= sprintf('<tr bgcolor="%s">%s%s</tr>','#DDDDDD', $app_col1,$app_col2);
+				}
+				// 3 coluna 
+				if (($i +1) % 3 == 0)
+				{
+					$checked = $user_applications[$app] ? 'CHECKED' : '';
+					$app_col3 = sprintf("<td>%s</td><td width='10'><input type='checkbox' name='apps[%s]' value='1' %s %s></td>\n",
+					$data['title'],$app,$checked, $disabled);
+					
+					// Cria nova linha
+					$applications_list .= sprintf('<tr bgcolor="%s">%s%s%s</tr>','#DDDDDD', $app_col1, $app_col2, $app_col3);					
+				}
+				$i++;
+			}
+			return $applications_list;
+		}
+		
+		function exist_attribute_in_ldap($dn, $attribute, $value)
+		{
+			$connection = $GLOBALS['phpgw']->common->ldapConnect();
+			$search = ldap_search($connection, $dn, $attribute. "=" . $value);
+			$result = ldap_get_entries($connection, $search);
+			ldap_close($connection);
+			//_debug_array($result);
+			if ($result['count'] == 0)
+				return false;
+			else
+				return true;	
+		}
+		
+		function lang($key)
+		{
+			if ($_SESSION['phpgw_info']['expressoAdmin']['lang'][$key])
+				return $_SESSION['phpgw_info']['expressoAdmin']['lang'][$key];
+			else
+				return $key . '*';
+		}
+		
+		function make_lang($ram_lang)
+		{
+			$a_lang = split("_", $ram_lang);
+			$a_lang_reverse  = array_reverse ( $a_lang, true );
+			array_pop ( $a_lang_reverse );
+			$a_lang  = array_reverse ( $a_lang_reverse, true );
+			$a_new_lang = implode ( " ", $a_lang );
+			return lang($a_new_lang);
+		}
+
+		function make_dinamic_lang($template_obj, $block)
+		{
+			$tpl_vars = $template_obj->get_undefined($block);
+			$array_langs = array();
+			
+			foreach ($tpl_vars as $atribute)
+			{
+				$lang = strstr($atribute, 'lang_');
+				if($lang !== false)
+				{
+					//$template_obj->set_var($atribute, $this->make_lang($atribute));
+					$array_langs[$atribute] = $this->make_lang($atribute);
+				}
+			}
+			return $array_langs;
+		}
+
+		function paginate_usersgroups($query, $contexts, $field, $order = 'asc', $page = null, $perPage = null )
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+			
+			$filter="(&(phpgwAccountType=g)(cn=*))";
+			$justthese = array("gidnumber", "cn", "description");										
+							
+			foreach ($contexts as $index=>$context)
+			{				
+				$search=ldap_search($ldap_conn, $query, $filter, $justthese);
+	
+				$rConnection = $ldap_conn;
+				$rSearch = $search;
+				$sOrder = $order;
+				$iPage = $page;
+				$iPerPage = $perPage;
+				$sField = $field;
+						
+				$iTotalEntries = ldap_count_entries( $rConnection, $rSearch );
+				
+				if ( $iPage === null || $iPerPage === null )
+				{
+					# fetch all in one page
+					$iStart = 0;
+					$iEnd = $iTotalEntries - 1;
+				}
+				else
+				{
+					# calculate range of page
+					$iFimPage = ( ceil( $iTotalEntries / $iPerPage ) - 1 ) * $iPage;
+					
+					$iStart = ( ceil( ($iPage -1) * $iPerPage ));
+					$iEnd = $iPage * $iPerPage;
+
+					if ( $sOrder === "desc" )
+					{
+						# revert range
+						$iStart = $iTotalEntries - 1 - $iEnd;
+						$iEnd = $iStart + $iPerPage - 1;
+					}
+				}
+				
+				/********* Importante Mostra o resultado da paginação **********
+				var_dump( $iStart . " " . $iEnd );
+				****************** Só descomentar ******************************/
+				
+				 # fetch entries
+			    ldap_sort( $rConnection, $rSearch, $sField );
+
+				$aList = array();
+				for (
+					$iCurrent = 0, $rEntry = ldap_first_entry( $rConnection, $rSearch );
+					$iCurrent <= $iEnd && is_resource( $rEntry );
+					$iCurrent++, $rEntry = ldap_next_entry( $rConnection, $rEntry )
+					)
+				{
+					if ( $iCurrent >= $iStart )
+					{
+						array_push( $aList, ldap_get_attributes( $rConnection, $rEntry ));
+					}
+				}
+			}
+
+			ldap_close($ldap_conn);
+
+			# if order is desc revert page's entries
+			return $sOrder === "desc" ? array_reverse( $aList ) : $aList;
+		}		
+		
+		function paginate_maillists($query, $contexts, $field, $order = 'asc', $page = null, $perPage = null )
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+			
+			$filter="(&(phpgwAccountType=l)(|(uid=*)))";
+			$justthese = array("uidnumber", "cn", "uid", "mail");											
+							
+			foreach ($contexts as $index=>$context)
+			{
+				$search=ldap_search($ldap_conn, $query, $filter, $justthese);
+	
+				$rConnection = $ldap_conn;
+				$rSearch = $search;
+				$sOrder = $order;
+				$iPage = $page;
+				$iPerPage = $perPage;
+				$sField = $field;
+						
+				$iTotalEntries = ldap_count_entries( $rConnection, $rSearch );
+				
+				if ( $iPage === null || $iPerPage === null )
+				{
+					# fetch all in one page
+					$iStart = 0;
+					$iEnd = $iTotalEntries - 1;
+				}
+				else
+				{
+					# calculate range of page
+					$iFimPage = ( ceil( $iTotalEntries / $iPerPage ) - 1 ) * $iPage;
+					
+					$iStart = ( ceil( ($iPage -1) * $iPerPage ));
+					$iEnd = $iPage * $iPerPage;
+
+					if ( $sOrder === "desc" )
+					{
+						# revert range
+						$iStart = $iTotalEntries - 1 - $iEnd;
+						$iEnd = $iStart + $iPerPage - 1;
+					}
+				}
+				
+				/********* Importante Mostra o resultado da paginação **********
+				var_dump( $iStart . " " . $iEnd );
+				****************** Só descomentar ******************************/
+				
+				 # fetch entries
+			    ldap_sort( $rConnection, $rSearch, $sField );
+
+				$aList = array();
+				for (
+					$iCurrent = 0, $rEntry = ldap_first_entry( $rConnection, $rSearch );
+					$iCurrent <= $iEnd && is_resource( $rEntry );
+					$iCurrent++, $rEntry = ldap_next_entry( $rConnection, $rEntry )
+					)
+				{
+					if ( $iCurrent >= $iStart )
+					{
+						array_push( $aList, ldap_get_attributes( $rConnection, $rEntry ));
+					}
+				}
+			}
+
+			ldap_close($ldap_conn);
+
+			# if order is desc revert page's entries
+			return $sOrder === "desc" ? array_reverse( $aList ) : $aList;
+		}		
+		
+		function Paginate_user($type, $query, $contexts, $Field, $Order = 'asc', $Page = null, $PerPage = null )
+
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+			
+			$filter="(&(phpgwAccountType=u)(|(uid=*)))";
+			$justthese = array("uidnumber", "uid", "cn", "mail","accountstatus","dn","createtimestamp","telephoneNumber");											
+							
+			foreach ($contexts as $index=>$context)
+			{
+				$search=ldap_search($ldap_conn, $query, $filter, $justthese);
+	
+				$rConnection = $ldap_conn;
+				$rSearch = $search;
+				$sOrder = $Order;
+				$iPage = $Page;
+				$iPerPage = $PerPage;
+				$sField = $Field;
+						
+				$iTotalEntries = ldap_count_entries( $rConnection, $rSearch );
+
+				if ( $iPage === null || $iPerPage === null )
+				{
+					# fetch all in one page
+					$iStart = 0;
+					$iEnd = $iTotalEntries - 1;
+				}
+				else
+				{
+					# calculate range of page
+					$iFimPage = ( ceil( $iTotalEntries / $iPerPage ) - 1 ) * $iPage;
+					
+					$iStart = ( ceil( ($iPage -1) * $iPerPage ));
+					$iEnd = $iPage * $iPerPage;
+
+					if ( $sOrder === "desc" )
+					{
+						# revert range
+						$iStart = $iTotalEntries - 1 - $iEnd;
+						$iEnd = $iStart + $iPerPage - 1;
+					}
+				}
+				
+				/********* Importante Mostra o resultado da paginação **********
+				var_dump( $iStart . " " . $iEnd );
+				****************** Só descomentar ******************************/
+				
+				 # fetch entries
+			    ldap_sort( $rConnection, $rSearch, $sField );
+
+				$aList = array();
+				for (
+					$iCurrent = 0, $rEntry = ldap_first_entry( $rConnection, $rSearch );
+					$iCurrent <= $iEnd && is_resource( $rEntry );
+					$iCurrent++, $rEntry = ldap_next_entry( $rConnection, $rEntry )
+					)
+				{
+					if ( $iCurrent >= $iStart )
+					{
+						array_push( $aList, ldap_get_attributes( $rConnection, $rEntry ));
+					}
+				}
+			}
+
+			ldap_close($ldap_conn);
+
+			# if order is desc revert page's entries
+			return $sOrder === "desc" ? array_reverse( $aList ) : $aList;
+		}
+
+		function get_list_ou_user_logon($query,$contexts,$sizelimit)
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+
+			$filter="(&(phpgwAccountType=u)(|(uid=*".$query."*)))";
+			$justthese = array("ou");											
+			$tmp = array();
+		
+			foreach ($contexts as $index=>$context)
+			{
+
+				$field = 'cn';
+				$search=ldap_search($ldap_conn, $context, $filter, $justthese, 0, $sizelimit);
+				$info = ldap_get_entries($ldap_conn, $search);
+
+				for ($i=0; $i < $info['count']; $i++)
+				{
+					$a_sectors[] = $info[$i]['dn'];
+				}
+			}
+			
+			ldap_close($ldap_conn);
+				
+			// Retiro o count do array info e inverto o array para ordenação.
+	        foreach ($a_sectors as $context)
+    	    {
+				$array_dn = ldap_explode_dn ( $context, 1 );
+
+                $array_dn_reverse  = array_reverse ( $array_dn, true );
+
+				// Retirar o indice count do array.
+				array_pop ( $array_dn_reverse );
+
+				$inverted_dn[$context] = implode ( "#", $array_dn_reverse );
+			}
+
+			// Ordenação
+			natcasesort($inverted_dn);
+
+			// Construção do select
+			$level = 0;
+			$options = array();
+			foreach ($inverted_dn as $dn=>$invert_ufn)
+			{
+                $display = '';
+
+                $array_dn_reverse = explode ( "#", $invert_ufn );
+                $array_dn  = array_reverse ( $array_dn_reverse, true );
+
+                $level = count( $array_dn ) - (int)(count(explode(",", $GLOBALS['phpgw_info']['server']['ldap_context'])) + 1);
+
+				$display.= ' ';
+				reset ( $array_dn );
+				$display .= ' ' . ($array_dn[$level]);
+				$dn = trim(strtolower($dn));
+				$options[$dn] = $display;
+        	}
+
+    	    return $options;
+		}
+
+		function get_list_context_logon($query_user,$contexts,$sizelimit)
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+
+			// Le BD para pegar os administradors.
+			$query = "SELECT manager_lid,context FROM phpgw_expressoadmin WHERE manager_lid='".$query_user."' ORDER by manager_lid";
+			$GLOBALS['phpgw']->db->query($query);
+			while($GLOBALS['phpgw']->db->next_record())
+			{
+				$managers[] = $GLOBALS['phpgw']->db->row();
+			}
+
+			// Loop para listar as dn
+			if (count($managers))
+			{
+				foreach($managers as $array_managers)
+				{
+					$display = '';
+					$managers_context = "";
+					$a_managers_context = explode("%", $array_managers['context']);
+
+					// Ordenação
+					natcasesort($a_managers_context);
+
+					$options = array();
+					$level = 0;
+												
+					foreach ($a_managers_context as $dn=>$invert_ufn)
+					{
+						$dn_explode = explode (",",$invert_ufn);
+
+						// Construção do select
+						$array_dn  = array_reverse ( $dn_explode, true );
+
+						$level = count( $dn_explode ) - (int)(count(explode(",", $GLOBALS['phpgw_info']['server']['ldap_context'])) + 1);
+						$display = ' ';
+						reset ( $array_dn );
+//						$display = str_replace("ou=", "",($array_dn[$level]));
+						$display = str_replace("ou=", "",($array_dn[0]));
+						$display = str_replace("dc=", "",($display));
+						$dn = trim(strtolower($dn));
+						$options[$dn] = trim(strtoupper($display));
+					}
+				}
+			}
+
+   	    	return $options;
+		}
+
+		function get_list_groups_dn($query_user,$contexts,$sizelimit)
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+
+			// Le BD para pegar os administradors.
+			$query = "SELECT manager_lid,context FROM phpgw_expressoadmin WHERE manager_lid='".$query_user."' ORDER by manager_lid";
+			$GLOBALS['phpgw']->db->query($query);
+			while($GLOBALS['phpgw']->db->next_record())
+			{
+				$managers[] = $GLOBALS['phpgw']->db->row();
+			}
+
+			// Loop para listar as dn
+			if (count($managers))
+			{
+				foreach($managers as $array_managers)
+				{
+					$display = '';
+					$managers_context = "";
+					$options = explode("%", $array_managers['context']);
+
+					// Ordenação
+					natcasesort($options);
+				}
+			}
+
+   	    	return $options;
+		}
+
+		function sort_by($field, &$arr, $sorting=SORT_ASC, $case_insensitive=true){
+			if(is_array($arr) && (count($arr)>0) && ( ( is_array($arr[0]) && isset($arr[0][$field]) ) || ( is_object($arr[0]) && isset($arr[0]->$field) ) ) ){
+				if($case_insensitive==true) $strcmp_fn = "strnatcasecmp";
+				else $strcmp_fn = "strnatcmp";
+		
+				if($sorting==SORT_ASC){
+					$fn = create_function('$a,$b', '
+						if(is_object($a) && is_object($b)){
+							return '.$strcmp_fn.'($a->'.$field.', $b->'.$field.');
+						}else if(is_array($a) && is_array($b)){
+							return '.$strcmp_fn.'($a["'.$field.'"], $b["'.$field.'"]);
+						}else return 0;
+					');
+				}else{
+					$fn = create_function('$a,$b', '
+						if(is_object($a) && is_object($b)){
+							return '.$strcmp_fn.'($b->'.$field.', $a->'.$field.');
+						}else if(is_array($a) && is_array($b)){
+							return '.$strcmp_fn.'($b["'.$field.'"], $a["'.$field.'"]);
+						}else return 0;
+					');
+				}
+				usort($arr, $fn);
+				return true;
+			}else{
+				return false;
+			}
+		}	
+
+		function show_access_log($account_id)
+		{	
+			$manager_account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$tmp = $this->read_acl($manager_account_lid);
+			$manager_context = $tmp[0]['context'];
+			
+			// Verifica se tem acesso a este modulo
+			if ((!$this->check_acl($manager_account_lid,'edit_users')) && (!$this->check_acl($manager_account_lid,'change_users_password')))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			// Le BD para pegar os [li].
+			$query = "select li from phpgw_access_log WHERE account_id=".$account_id." order by li desc LIMIT 1 OFFSET 0";
+			$GLOBALS['phpgw']->db->query($query);
+			while($GLOBALS['phpgw']->db->next_record())
+			{
+				$managers[] = $GLOBALS['phpgw']->db->row();
+			}
+
+			if (count($managers))
+			{
+				// contar intervalo
+				 $data_atual = date("Y/m/d", time());
+
+				 $data_antes = date("Y/m/d",$managers['0']['li']);
+				
+				 $datainicio=strtotime("$data_antes"); // Data de Hoje
+				 $datafim =strtotime("$data_atual"); // Data no próximo ano
+				
+				 $rdata =($datafim-$datainicio)/86400; //transformação do timestamp em dias 
+
+				$access_li = date("d/m/Y",$managers['0']['li'])."#".$rdata;
+
+				return $access_li;
+
+			}else{
+
+				$access_li = "Nunca logou#0"; 
+
+				return $access_li;
+			}
+		}
+
+		function Paginate_user_logon($type, $query, $contexts, $Field, $Order = 'asc', $Page = null, $PerPage = null, $numacesso)
+		{
+			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
+			$passwd		= $GLOBALS['phpgw_info']['server']['ldap_root_pw'];
+			$ldap_conn	= ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']);
+			ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
+			ldap_bind($ldap_conn,$dn,$passwd);
+			
+			$filter="(&(phpgwAccountType=u)(|(uid=*)))";
+			$justthese = array("uidnumber", "uid", "cn", "mail","accountstatus","dn","createtimestamp");											
+							
+			foreach ($contexts as $index=>$context)
+			{
+				$search=ldap_search($ldap_conn, $query, $filter, $justthese);
+	
+				$rConnection = $ldap_conn;
+				$rSearch = $search;
+				$sOrder = $Order;
+				$iPage = $Page;
+				$iPerPage = $PerPage;
+				$sField = $Field;
+						
+				$iTotalEntries = ldap_count_entries( $rConnection, $rSearch );
+
+				if ( $iPage === null || $iPerPage === null )
+				{
+					# fetch all in one page
+					$iStart = 0;
+					$iEnd = $iTotalEntries - 1;
+				}
+				else
+				{
+					# calculate range of page
+					$iFimPage = ( ceil( $iTotalEntries / $iPerPage ) - 1 ) * $iPage;
+					
+					$iStart = ( ceil( ($iPage -1) * $iPerPage ));
+					$iEnd = $iPage * $iPerPage;
+
+					if ( $sOrder === "desc" )
+					{
+						# revert range
+						$iStart = $iTotalEntries - 1 - $iEnd;
+						$iEnd = $iStart + $iPerPage - 1;
+					}
+				}
+				
+				/********* Importante Mostra o resultado da paginação **********
+				var_dump( $iStart . " " . $iEnd );
+				****************** Só descomentar ******************************/
+				
+				 # fetch entries
+			    ldap_sort( $rConnection, $rSearch, $sField );
+
+				$aList = array();
+				for (
+					$iCurrent = 0, $rEntry = ldap_first_entry( $rConnection, $rSearch );
+					$iCurrent <= $iEnd && is_resource( $rEntry );
+					$iCurrent++, $rEntry = ldap_next_entry( $rConnection, $rEntry )
+					)
+				{
+					if ( $iCurrent >= $iStart )
+					{
+						array_push( $aList, ldap_get_attributes( $rConnection, $rEntry ));
+					}
+				}
+			}
+
+			ldap_close($ldap_conn);
+
+			# if order is desc revert page's entries
+			return $sOrder === "desc" ? array_reverse( $aList ) : $aList;
+		}
+	}
+// ****************** fim classe Functions ***********************
+?>
Index: /trunk/reports/inc/class.ldap_functions.inc.php
===================================================================
--- /trunk/reports/inc/class.ldap_functions.inc.php	(revision 5291)
+++ /trunk/reports/inc/class.ldap_functions.inc.php	(revision 5291)
@@ -0,0 +1,523 @@
+<?php
+define('PHPGW_INCLUDE_ROOT','../');
+define('PHPGW_API_INC','../phpgwapi/inc');	
+include_once(PHPGW_API_INC.'/class.common.inc.php');
+include_once('class.functions.inc.php');
+
+function ldapRebind($ldap_connection, $ldap_url)
+{
+	// Enquanto estivermos utilizando referral na arvore ldap, teremos que continuar a utilizar o usuário sistemas:expresso.
+	// Depois, quando não existir mais referral, não existirá a necessidade de ldapRebind.
+	//ldap_bind($ldap_connection, $GLOBALS['phpgw_info']['server']['ldap_master_root_dn'], $GLOBALS['phpgw_info']['server']['ldap_master_root_pw']);
+	if ( ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'] != '') && ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw'] != '') )
+	{
+		@ldap_bind($ldap_connection, $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'], $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw']);
+	}
+}
+
+class ldap_functions
+{
+	var $ldap;
+	var $current_config;
+	var $functions;
+	var $manager_contexts;
+	
+	function ldap_functions(){		
+		$GLOBALS['phpgw_info']['server'] = $_SESSION['phpgw_info']['expresso']['server'];
+		$this->current_config = $_SESSION['phpgw_info']['expresso']['expressoAdmin'];
+		$common = new common();
+		
+		if ( (!empty($GLOBALS['phpgw_info']['server']['ldap_master_host'])) &&
+			 (!empty($GLOBALS['phpgw_info']['server']['ldap_master_root_dn'])) &&
+			 (!empty($GLOBALS['phpgw_info']['server']['ldap_master_root_pw'])) )
+		{
+			$this->ldap = $common->ldapConnect($GLOBALS['phpgw_info']['server']['ldap_master_host'],
+											   $GLOBALS['phpgw_info']['server']['ldap_master_root_dn'],
+											   $GLOBALS['phpgw_info']['server']['ldap_master_root_pw']);
+		}
+		else
+		{
+			$this->ldap = $common->ldapConnect();
+		}
+		
+		$this->functions = new functions;
+		$manager_acl = $this->functions->read_acl($_SESSION['phpgw_info']['expresso']['user']['account_lid']);
+		$this->manager_contexts = $manager_acl['contexts'];
+	}
+
+	//Busca usuários de um contexto e já retorna as options do select;
+	function get_available_users($params)
+	{
+		$context = $params['context'];
+		$recursive = $params['recursive'];
+		$justthese = array("cn", "uidNumber");
+		$filter="(phpgwAccountType=u)";
+		
+		if ($recursive == 'true')
+			$groups_list=ldap_search($this->ldap, $context, $filter, $justthese);
+		else
+    		$groups_list=ldap_list($this->ldap, $context, $filter, $justthese);
+    	
+    	$entries = ldap_get_entries($this->ldap, $groups_list);
+    	
+		for ($i=0; $i<$entries["count"]; $i++){
+			$u_tmp[$entries[$i]["uidnumber"][0]] = $entries[$i]["cn"][0];
+		}
+			
+		if (count($u_tmp))
+			natcasesort($u_tmp);
+
+		$i = 0;
+		$users = array();
+			
+		if (count($u_tmp))
+		{
+			foreach ($u_tmp as $uidnumber => $cn)
+			{
+				$options .= "<option value=$uidnumber>$cn</option>";
+			}
+			unset($u_tmp);
+		}
+
+    	return $options;
+	}
+
+	function get_available_groups($params)
+	{
+		$context = $params['context'];
+		$justthese = array("cn", "gidNumber");
+    	$groups_list=ldap_list($this->ldap, $context, ("(phpgwAccountType=g)"), $justthese);
+    	ldap_sort($this->ldap, $groups_list, "cn");
+    	
+    	$entries = ldap_get_entries($this->ldap, $groups_list);
+    	    	
+		$options = '';
+		for ($i=0; $i<$entries['count']; $i++)
+		{
+			$options .= "<option value=" . $entries[$i]['gidnumber'][0] . ">" . $entries[$i]['cn'][0] . "</option>";
+		}
+    	
+    	return $options;		
+	}
+	
+	function get_available_maillists($params)
+	{
+		if ( !$ldapMasterConnect = $this->ldapMasterConnect() )
+			return false;
+		
+		$context = $params['context'];
+		$justthese = array("uid","mail","uidNumber");
+    	$maillists=ldap_list($ldapMasterConnect, $context, ("(phpgwAccountType=l)"), $justthese);
+    	ldap_sort($ldapMasterConnect, $maillists, "uid");
+    	
+    	$entries = ldap_get_entries($ldapMasterConnect, $maillists);
+    	
+		$options = '';			
+		for ($i=0; $i<$entries['count']; $i++)
+		{
+			$options .= "<option value=" . $entries[$i]['uid'][0] . ">" . $entries[$i]['uid'][0] . " (" . $entries[$i]['mail'][0] . ")" . "</option>";
+		}
+    	
+    	ldap_close($ldapMasterConnect);
+    	return $options;
+	}
+	
+	function get_user_info($uidnumber)
+	{
+		foreach ($this->manager_contexts as $index=>$context)
+		{
+			$filter="(&(phpgwAccountType=u)(uidNumber=".$uidnumber."))";
+			$search = ldap_search($this->ldap, $context, $filter);
+			$entry = ldap_get_entries($this->ldap, $search);
+			
+			if ($entry['count'])
+			{
+				//Pega o dn do setor do usuario.
+				$entry[0]['dn'] = strtolower($entry[0]['dn']);
+				$sector_dn_array = explode(",", $entry[0]['dn']);
+				for($i=1; $i<count($sector_dn_array); $i++)
+					$sector_dn .= $sector_dn_array[$i] . ',';
+				//Retira ultimo pipe.
+				$sector_dn = substr($sector_dn,0,(strlen($sector_dn) - 1));
+		
+				$result['context']				= $sector_dn;
+				$result['uid']					= $entry[0]['uid'][0];
+				$result['uidnumber']			= $entry[0]['uidnumber'][0];
+				$result['gidnumber']			= $entry[0]['gidnumber'][0];
+				$result['departmentnumber']		= $entry[0]['departmentnumber'][0];
+				$result['givenname']			= $entry[0]['givenname'][0];
+				$result['sn']					= $entry[0]['sn'][0];
+				$result['telephonenumber']		= $entry[0]['telephonenumber'][0];
+				$result['passwd_expired']		= $entry[0]['phpgwlastpasswdchange'][0];
+				$result['phpgwaccountstatus']	= $entry[0]['phpgwaccountstatus'][0];
+				$result['phpgwaccountvisible']	= $entry[0]['phpgwaccountvisible'][0];
+				$result['accountstatus']		= $entry[0]['accountstatus'][0];
+				$result['mail']					= $entry[0]['mail'][0];
+				$result['mailalternateaddress']	= $entry[0]['mailalternateaddress'];
+				$result['mailforwardingaddress']= $entry[0]['mailforwardingaddress'];
+				$result['deliverymode']			= $entry[0]['deliverymode'][0];
+				$result['userPasswordRFC2617']	= $entry[0]['userpasswordrfc2617'][0];
+
+				//Photo
+				if ($entry[0]['jpegphoto']['count'] == 1)
+					$result['photo_exist'] = 'true';
+		
+				// Samba
+				for ($i=0; $i<$entry[0]['objectclass']['count']; $i++)
+				{
+					if ($entry[0]['objectclass'][$i] == 'sambaSamAccount')
+						$result['sambaUser'] = true;
+				}
+				if (($this->current_config['expressoAdmin_samba_support'] == 'true') && ($result['sambaUser']))
+				{
+					$result['sambaaccflags'] = $entry[0]['sambaacctflags'][0];
+					$result['sambalogonscript'] = $entry[0]['sambalogonscript'][0];
+					$result['homedirectory'] = $entry[0]['homedirectory'][0];
+					$a_tmp = explode("-", $entry[0]['sambasid'][0]);
+					array_pop($a_tmp);
+					$result['sambasid'] = implode("-", $a_tmp);
+				}
+
+				// Verifica o acesso do gerente aos atributos corporativos
+				if ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'manipulate_corporative_information'))
+				{
+					$result['corporative_information_employeenumber']= $entry[0]['employeenumber'][0];
+					$result['corporative_information_cpf']			= $entry[0]['cpf'][0];
+					$result['corporative_information_rg']			= $entry[0]['rg'][0];
+					$result['corporative_information_rguf']			= $entry[0]['rguf'][0];
+					$result['corporative_information_description']	= utf8_decode($entry[0]['description'][0]);
+				}
+				
+				// MailLists
+				$result['maillists_info'] = $this->get_user_maillists($result['mail']);
+				if($result['maillists_info'])
+				{
+					foreach ($result['maillists_info'] as $maillist)
+					{
+						$result['maillists'][] = $maillist['uid'];
+					}
+				}
+				
+				// Groups
+				$justthese = array("gidnumber","cn");
+				$filter="(&(phpgwAccountType=g)(memberuid=".$result['uid']."))";
+				$search = ldap_search($this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);
+    			ldap_sort($this->ldap, $search, "cn");
+    			$entries = ldap_get_entries($this->ldap, $search);
+    			for ($i=0; $i<$entries['count']; $i++)
+	    		{
+    				$result['groups_ldap'][ $entries[$i]['gidnumber'][0] ] = $entries[$i]['cn'][0];
+    			}
+			}
+		}
+		if (is_array($result))
+			return $result;
+		else
+			return false;
+	}
+		
+	function get_user_maillists($mail)
+	{
+		if ( !$ldapMasterConnect = $this->ldapMasterConnect() )
+			return false;
+		
+		$result = array();
+		
+		//Mostra somente os mailists dos contextos do gerente
+		$justthese = array("uid","mail","uidnumber");
+		$filter="(&(phpgwAccountType=l)(mailforwardingaddress=$mail))";
+		
+		foreach ($this->manager_contexts as $index=>$context)
+		{
+			$search = ldap_search($ldapMasterConnect, $context, $filter, $justthese);
+    		$entries = ldap_get_entries($ldapMasterConnect, $search);
+    		
+	    	for ($i=0; $i<$entries['count']; $i++)
+    		{
+				$result[ $entries[$i]['uid'][0] ]['uid']		= $entries[$i]['uid'][0];
+				$result[ $entries[$i]['uid'][0] ]['mail']		= $entries[$i]['mail'][0];
+				
+				$a_tmp[] = $entries[$i]['uid'][0];
+    		}
+		}
+    	
+    	if($a_tmp) {
+    		natcasesort($a_tmp);
+    	
+    		foreach ($a_tmp as $uid)
+    		{
+				$return[$uid]['uid']		= $result[$uid]['uid'];
+				$return[$uid]['mail']		= $result[$uid]['mail'];
+    		}
+    	}
+    	ldap_close($ldapMasterConnect);
+		return $return;
+	}
+	
+	function get_group_info($gidnumber)
+	{
+		foreach ($this->manager_contexts as $index=>$context)
+		{
+			$filter="(&(phpgwAccountType=g)(gidNumber=".$gidnumber."))";
+			$search = ldap_search($this->ldap, $context, $filter);
+			$entry = ldap_get_entries($this->ldap, $search);
+			
+			if ($entry['count'])
+			{
+				//Pega o dn do setor do grupo.
+				$entry[0]['dn'] = strtolower($entry[0]['dn']);
+				$sector_dn_array = explode(",", $entry[0]['dn']);
+				for($i=1; $i<count($sector_dn_array); $i++)
+					$sector_dn .= $sector_dn_array[$i] . ',';
+				//Retira ultimo pipe.
+				$sector_dn = substr($sector_dn,0,(strlen($sector_dn) - 1));
+		
+				$result['context']				= $sector_dn;
+				$result['cn']					= $entry[0]['cn'][0];
+				$result['description']			= $entry[0]['description'][0];
+				$result['gidnumber']			= $entry[0]['gidnumber'][0];
+				$result['phpgwaccountvisible']	= $entry[0]['phpgwaccountvisible'][0];
+				$result['email']				= $entry[0]['mail'][0];
+		
+				//MemberUid
+				for ($i=0; $i<$entry[0]['memberuid']['count']; $i++)
+				{
+					$justthese = array("cn","uid","uidnumber");
+			
+					// Montagem dinamica do filtro
+					$filter="(&(phpgwAccountType=u)(|";
+					for ($k=0; (($k<10) && ($i<$entry[0]['memberuid']['count'])); $k++)
+					{
+						$filter .= "(uid=".$entry[0]['memberuid'][$i].")";
+						$i++;
+					}
+					$i--;
+					$filter .= "))";
+			
+					$search = ldap_search($this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);
+					$user_entry = ldap_get_entries($this->ldap, $search);
+
+					for ($j=0; $j<$user_entry['count']; $j++)
+					{
+						$result['memberuid_info'][$user_entry[$j]['uid'][0]]['cn'] = $user_entry[$j]['cn'][0];
+						$result['memberuid_info'][$user_entry[$j]['uid'][0]]['uidnumber'] = $user_entry[$j]['uidnumber'][0];
+						$result['memberuid_info'][$user_entry[$j]['uid'][0]]['type'] = 'u';
+					}
+				}
+		
+				// Checamos e-mails que não fazem parte do expresso.
+				// Criamos um array temporario
+				$tmp_array = array();
+				if($result['memberuid_info'])
+					foreach ($result['memberuid_info'] as $uid => $user_data)
+					{
+						$tmp_array[] = $uid;
+					}
+		
+				if($entry[0]['memberuid']) {
+					// Retira o count do array
+					array_shift($entry[0]['memberuid']);
+					// Vemos a diferença
+					$array_diff = array_diff($entry[0]['memberuid'], $tmp_array);
+					// Incluimos no resultado			
+					foreach ($array_diff as $index=>$uid)
+					{
+						$result['memberuid_info'][$uid]['cn'] = $uid;
+					}
+				}
+		
+				// Samba
+				for ($i=0; $i<$entry[0]['objectclass']['count']; $i++)
+				{
+					if ($entry[0]['objectclass'][$i] == 'sambaGroupMapping')
+						$result['sambaGroup'] = true;
+
+					$a_tmp = explode("-", $entry[0]['sambasid'][0]);
+					array_pop($a_tmp);
+					$result['sambasid'] = implode("-", $a_tmp);
+				}
+				return $result;
+			}
+		}
+	}	
+	
+	function get_maillist_info($uidnumber)
+	{
+		/* folling referral connection */
+		$ldap_conn_following_ref = ldap_connect($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['host']);
+		if ($ldap_conn_following_ref)
+		{
+			ldap_set_option($ldap_conn_following_ref, LDAP_OPT_PROTOCOL_VERSION, 3);
+			ldap_set_option($ldap_conn_following_ref, LDAP_OPT_REFERRALS, 1);
+
+			if ( ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'] != '') && ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw'] != '') )
+				ldap_bind($ldap_conn_following_ref, $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'], $_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw']);
+		}
+		
+		foreach ($this->manager_contexts as $index=>$context)
+		{
+			$filter="(&(phpgwAccountType=l)(uidNumber=".$uidnumber."))";
+			$search = ldap_search($this->ldap, $context, $filter);
+			$entry = ldap_get_entries($this->ldap, $search);
+			
+			if ($entry['count'])
+			{
+				//Pega o dn do setor do usuario.
+				$entry[0]['dn'] = strtolower($entry[0]['dn']);
+				$sector_dn_array = explode(",", $entry[0]['dn']);
+				for($i=1; $i<count($sector_dn_array); $i++)
+					$sector_dn .= $sector_dn_array[$i] . ',';
+				//Retira ultimo pipe.
+				$sector_dn = substr($sector_dn,0,(strlen($sector_dn) - 1));
+			
+				$result['context']				= $sector_dn;
+				$result['uidnumber']			= $entry[0]['uidnumber'][0];
+				$result['uid']					= strtolower($entry[0]['uid'][0]);
+				$result['cn']					= $entry[0]['cn'][0];
+				$result['mail']					= $entry[0]['mail'][0];
+				$result['description']			= utf8_decode($entry[0]['description'][0]);
+				$result['accountStatus']		= $entry[0]['accountstatus'][0];
+				$result['phpgwAccountVisible']	= $entry[0]['phpgwaccountvisible'][0];
+			
+				//Members
+				for ($i=0; $i<$entry[0]['mailforwardingaddress']['count']; $i++)
+				{
+					$justthese = array("cn", "uidnumber", "uid", "phpgwaccounttype", "mail");
+				
+					// Montagem dinamica do filtro, para nao ter muitas conexoes com o ldap
+					$filter="(&(|(phpgwAccountType=u)(phpgwAccountType=l))(|";
+					for ($k=0; (($k<10) && ($i<$entry[0]['mailforwardingaddress']['count'])); $k++)
+					{
+						$filter .= "(mail=".$entry[0]['mailforwardingaddress'][$i].")";
+						$i++;
+					}
+					$i--;
+					$filter .= "))";
+				
+					$search = ldap_search($ldap_conn_following_ref, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);
+					$user_entry = ldap_get_entries($ldap_conn_following_ref, $search);
+									
+					for ($j=0; $j<$user_entry['count']; $j++)
+					{
+						$result['mailForwardingAddress_info'][$user_entry[$j]['mail'][0]]['uid'] = $user_entry[$j]['uid'][0];
+						$result['mailForwardingAddress_info'][$user_entry[$j]['mail'][0]]['cn'] = $user_entry[$j]['cn'][0];
+						$result['mailForwardingAddress_info'][$user_entry[$j]['mail'][0]]['type'] = $user_entry[$j]['phpgwaccounttype'][0];
+						$result['mailForwardingAddress'][] = $user_entry[$j]['mail'][0];
+					}
+				}
+
+				// Emails não encontrados no ldap
+				array_shift($entry[0]['mailforwardingaddress']); //Retira o count do array
+				$missing_emails = array_diff($entry[0]['mailforwardingaddress'], $result['mailForwardingAddress']);
+				
+				// Incluimos estes no resultado
+				foreach ($missing_emails as $index=>$mailforwardingaddress)
+				{
+					$result['mailForwardingAddress_info'][$mailforwardingaddress]['uid'] = $mailforwardingaddress;
+					$result['mailForwardingAddress_info'][$mailforwardingaddress]['cn'] = 'E-Mail nao encontrado';
+					$result['mailForwardingAddress'][] = $mailforwardingaddress;
+				}
+				
+				ldap_close($ldap_conn_following_ref);
+				return $result;
+			}
+		}
+	}	
+
+		
+
+	function group_exist($gidnumber)
+	{
+		$justthese = array("cn");
+		$filter="(&(phpgwAccountType=g)(gidNumber=".$gidnumber."))";
+		$search = ldap_search($this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);
+				
+		$entry = ldap_get_entries($this->ldap, $search);
+		if ($entry['count'] == 0)
+			return false;
+		else
+			return true;
+	}
+
+	function gidnumbers2cn($gidnumbers)
+	{
+		$result = array();
+		if (count($gidnumbers))
+		{
+			$justthese = array("cn");
+			$i = 0;
+			foreach ($gidnumbers as $gidnumber)
+			{
+				$filter="(&(phpgwAccountType=g)(gidNumber=".$gidnumber."))";
+				$search = ldap_search($this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);
+				
+				$entry = ldap_get_entries($this->ldap, $search);
+				if ($entry['count'] == 0)
+					$result['groups_info'][$i]['cn'] = '_' . $this->functions->lang('group only exist on DB, but does not exist on ldap');
+					
+				else
+					$result['groups_info'][$i]['cn'] = $entry[0]['cn'][0];
+				$result['groups_info'][$i]['gidnumber'] = $gidnumber;
+			
+				/* o gerente pode excluir um grupo de um usuario onde este grupo esta em outra OU ? */
+				/* é o mesmo que o manager editar um grupo de outra OU */
+				$result['groups_info'][$i]['group_disabled'] = 'true';
+				foreach ($this->manager_contexts as $index=>$context)
+				{
+					if (strpos(strtolower($entry[0]['dn']), strtolower($context)))
+					{
+						$result['groups_info'][$i]['group_disabled'] = 'false';
+					}
+				}
+
+				$i++;
+			}
+		}
+		return $result;
+	}
+
+	function uidnumber2uid($uidnumber)
+	{
+		$justthese = array("uid");
+		$filter="(&(|(phpgwAccountType=u)(phpgwAccountType=l))(uidNumber=".$uidnumber."))";
+		$search = ldap_search($this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);
+		$entry = ldap_get_entries($this->ldap, $search);
+		return $entry[0]['uid'][0];
+	}
+
+	function uidnumber2mail($uidnumber)
+	{
+		$justthese = array("mail");
+		$filter="(&(|(phpgwAccountType=u)(phpgwAccountType=l))(uidNumber=".$uidnumber."))";
+		$search = ldap_search($this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese);
+		$entry = ldap_get_entries($this->ldap, $search);
+		return $entry[0]['mail'][0];
+	}
+	
+	function search_user($params)
+	{
+		$search = $params['search'];
+		$justthese = array("cn","uid", "mail");
+    	$users_list=ldap_search($this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], "(&(phpgwAccountType=u) (|(cn=*$search*)(mail=$search*)) )", $justthese);
+    	
+    	if (ldap_count_entries($this->ldap, $users_list) == 0)
+    	{
+    		$return['status'] = 'false';
+    		$result['msg'] = $this->functions->lang('Any result was found') . '.';
+    		return $return;
+    	}
+    	
+    	ldap_sort($this->ldap, $users_list, "cn");
+    	
+    	$entries = ldap_get_entries($this->ldap, $users_list);
+    	    	
+		$options = '';
+		for ($i=0; $i<$entries['count']; $i++)
+		{
+			$options .= "<option value=" . $entries[$i]['uid'][0] . ">" . $entries[$i]['cn'][0] . " (".$entries[$i]['mail'][0].")" . "</option>";
+		}
+    	
+    	return $options;		
+	}
+}
+?>
Index: /trunk/reports/inc/class.uireports_logon.inc.php
===================================================================
--- /trunk/reports/inc/class.uireports_logon.inc.php	(revision 5291)
+++ /trunk/reports/inc/class.uireports_logon.inc.php	(revision 5291)
@@ -0,0 +1,928 @@
+<?php
+	/*************************************************************************************\
+	* Expresso Relatório                										         *
+	* by Elvio Rufino da Silva (elviosilva@yahoo.com.br, elviosilva@cepromat.mt.gov.br)  *
+	* -----------------------------------------------------------------------------------*
+	*  This program is free software; you can redistribute it and/or modify it			 *
+	*  under the terms of the GNU General Public License as published by the			 *
+	*  Free Software Foundation; either version 2 of the License, or (at your			 *
+	*  option) any later version.														 *
+	*************************************************************************************/
+
+	class uireports_logon
+	{
+		var $public_functions = array
+		(
+			'report_logon_print_pdf'			=> True,
+			'report_logon_group'				=> True,
+			'report_logon_group_setor_print'	=> True,
+			'show_access'						=> True,
+			'get_user_info'						=> True,
+			'css'								=> True
+		);
+
+		var $nextmatchs;
+		var $user;
+		var $functions;
+		var $current_config;
+		var $ldap_functions;
+		var $db_functions;
+
+		function uireports_logon()
+		{
+			$this->user			= CreateObject('reports.user');
+			$this->nextmatchs	= CreateObject('phpgwapi.nextmatchs');
+			$this->functions	= CreateObject('reports.functions');
+			$this->ldap_functions = CreateObject('reports.ldap_functions');
+			$this->db_functions = CreateObject('reports.db_functions');
+			$this->fpdf = CreateObject('reports.uireports_fpdf'); // Class para PDF
+									
+			$c = CreateObject('phpgwapi.config','reports'); // cria o objeto relatorio no $c
+			$c->read_repository(); // na classe config do phpgwapi le os dados da tabela phpgw_config where relatorio, como passagem acima
+			$this->current_config = $c->config_data; // carrega os dados em do array no current_config
+
+			if(!@is_object($GLOBALS['phpgw']->js))
+			{
+				$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
+			}
+			$GLOBALS['phpgw']->js->validate_file('jscode','cc','reports');
+		}
+		
+		function report_logon_print_pdf()
+		{
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $acl['contexts'];
+			foreach ($acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$context_display .= $tmp_context;
+			}
+
+
+			if (!$this->functions->check_acl($account_lid,'list_users'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			$grouplist = trim($_POST[setor]);
+			$grouplist = trim(ereg_replace("-","",$grouplist));
+
+			$setordn = trim($_POST[setordn]);
+			$subtitulo1 = trim($_POST[subtitulo]);
+			
+			$vnumacesso = trim($_POST[nacesso]);
+			$numacesso = abs(round($vnumacesso));
+
+			if ($vnumacesso==999){
+				$numacesso = "Nunca logou";
+			}
+
+
+			define('FPDF_FONTPATH','font/');
+			$data_atual = date("d/m/Y"); 
+			$titulo_system = $GLOBALS['phpgw_info']['apps']['reports']['title'];			
+
+			$pdf=new uireports_fpdf("L");
+			$pdf->Open();
+			$pdf->AddPage();
+			$pdf->SetTitle('Relatório Gerado pelo Expresso Reports');
+
+			//Set font and colors
+			$pdf->SetFont('Arial','B',14);
+			$pdf->SetFillColor(0,0,0);
+			$pdf->SetTextColor(0,0,200);
+			$pdf->SetDrawColor(0,0,0);
+			$pdf->SetLineWidth(.2);
+
+			//Table header
+			$SubTitulo = lang('reports title6');
+			$SubTituloR = lang('report of time without logging by Organization');
+			$SubTitulo1 = $subtitulo1;
+			$GLOBALS['phpgw_info']['apps']['reports']['subtitle'] = $SubTituloR;
+			$pdf->Cell(0,8,$SubTitulo,0,1,'C',0);
+
+
+			//Set font and colors
+			$pdf->SetFont('Arial','B',8);
+			$pdf->SetFillColor(0,0,0);
+			$pdf->SetTextColor(0,0,200);
+			$pdf->SetDrawColor(0,0,0);
+			$pdf->SetLineWidth(.3);
+
+//			$pdf->Cell(0,10,$SubTitulo1,0,1,'C',0);
+			$pdf->MultiCell(0,3,$SubTitulo1,0,'C',0);
+						
+			$pdf->Cell(0,2,' ',0,1,'C',0);
+			$pdf->Cell(0,5,'Data..: '.$data_atual,0,0,'L',0);
+			$pdf->Cell(0,5,$titulo_system,0,1,'R',0);
+												
+			$account_info = $this->functions->get_list_user_sector_logon($setordn,$contexts,0,$numacesso);
+
+			if (count($account_info))
+			{ 
+				//Restore font and colors
+				$pdf->SetFont('Arial','',8);
+				$pdf->SetFillColor(224,235,255);
+				$pdf->SetTextColor(0);
+
+				$pdf->Cell(60,5,lang('loginid'),1,0,'L',1);
+				$pdf->Cell(60,5,lang('name'),1,0,'L',1);
+				$pdf->Cell(70,5,lang('report email'),1,0,'L',1);
+				$pdf->Cell(25,5,lang('Creation Date'),1,0,'C',1);
+				$pdf->Cell(25,5,lang('Last access'),1,0,'C',1);
+				$pdf->Cell(22,5,lang('Days without login'),1,0,'L',1);				
+				$pdf->Cell(18,5,lang('status'),1,1,'L',1);
+
+				
+				while (list($null,$accountp) = each($account_info))
+				{
+
+					$access_log = $this->functions->show_access_log($accountp['account_id']);
+
+					$access_log_array = explode("#",$access_log);
+					
+					$accountp['li_dias'] = $access_log_array[1];
+					$accountp['li_date'] = $access_log_array[0];
+
+					$tmpp[$contap]['account_id'] = $accountp['account_id']; 
+					$tmpp[$contap]['account_lid'] = $accountp['account_lid'];
+					$tmpp[$contap]['account_cn'] = $accountp['account_cn'];
+					$tmpp[$contap]['account_status'] = $accountp['account_accountstatus'];
+					$tmpp[$contap]['account_mail'] = $accountp['account_mail'];
+					$tmpp[$contap]['createTimestamp'] = $accountp['createtimestamp'];
+					$tmpp[$contap]['li_dias']= $accountp['li_dias'];
+					$tmpp[$contap]['li_date']= $accountp['li_date'];
+
+					$sortp[] = $accountp['li_dias'];
+
+					if (count($sortp))
+					{
+						natcasesort($sortp);
+					}
+
+					$contap = $contap + 1;
+				}
+
+				while (list($key,$accountr1) = each($sortp))
+				{
+					if ($key == 0){
+						$key = '';
+						$returnp[] = $tmpp[$key];
+					}else{
+						$returnp[] = $tmpp[$key];
+					}
+				}
+
+				$returnp = array_reverse($returnp); 
+
+				while (list($null,$accountr) = each($returnp))
+				{
+						$row_cn = $accountr['account_cn'];
+						$account_lid = $accountr['account_lid'];
+						$row_mail = (!$accountr['account_mail'] ? 'Sem E-mail' : $accountr['account_mail']);
+						$row_timestamp = substr($accountr['createTimestamp'], 6, 2)."/".substr($accountr['createTimestamp'], 4, 2)."/".substr($accountr['createTimestamp'], 0, 4);
+						$row_li_date = $accountr['li_date'] == 'Nunca logou' ? 'Nunca logou' : $accountr['li_date'];
+						$row_li_dias = $accountr['li_dias'];
+						$row_status = $accountr['account_status'] == 'active' ? 'Ativado' : 'Desativado';
+						
+						$pdf->Cell(60,5,$account_lid,0,0,'L',0);
+						$pdf->Cell(60,5,$row_cn,0,0,'L',0);
+						$pdf->Cell(70,5,$row_mail,0,0,'L',0);
+						$pdf->Cell(25,5,$row_timestamp,0,0,'C',0);
+
+						if ($row_li_date == 'Nunca logou')
+						{
+							//Muda cor fonte
+							$pdf->SetTextColor(256,0,0);
+							$pdf->Cell(25,5,$row_li_date,0,0,'C',0);
+							//Restaura cor fonte
+							$pdf->SetTextColor(0);
+						}
+						else
+						{
+							//Restaura cor fonte
+							$pdf->SetTextColor(0);
+							$pdf->Cell(25,5,$row_li_date,0,0,'C',0);
+						}
+
+						$pdf->Cell(22,5,$row_li_dias,0,0,'C',0);																		
+
+						if ($row_status == 'Ativado')
+						{
+							//Restaura cor fonte
+							$pdf->SetTextColor(0);
+							$pdf->Cell(18,5,$row_status,0,1,'L',0);
+						}
+						else
+						{
+							//Muda cor fonte
+							$pdf->SetTextColor(256,0,0);
+							$pdf->Cell(18,5,$row_status,0,1,'L',0);					
+							//Restaura cor fonte
+							$pdf->SetTextColor(0);
+						}
+				}
+			}
+
+			$pdf->Output();
+
+			return; 
+		}
+
+		function report_logon_group()
+		{
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$manager_acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $manager_acl['contexts'];
+			$conta_context = count($manager_acl['contexts_display']);
+			foreach ($manager_acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$index = $index +1;
+
+				if ($conta_context == $index)
+				{
+					$context_display .= $tmp_context;
+				}
+				else
+				{
+					$context_display .= $tmp_context.'&nbsp;|&nbsp;';
+				}
+			}
+			
+			// Verifica se tem acesso a este modulo
+			if (!$this->functions->check_acl($account_lid,'list_sectors'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			unset($GLOBALS['phpgw_info']['flags']['noheader']);
+			unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+			
+			$GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['reports']['title'].' - '.lang('report of time without logging by Organization');
+			$GLOBALS['phpgw']->common->phpgw_header();
+
+			$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+			$p->set_file(array('groups'   => 'report_logon_group.tpl'));
+			$p->set_block('groups','list','list');
+			$p->set_block('groups','row','row');
+			$p->set_block('groups','row_empty','row_empty');
+
+			// Seta as variaveis padroes.
+			$var = Array(
+				'th_bg'					=> $GLOBALS['phpgw_info']['theme']['th_bg'],
+				'back_url'				=> $GLOBALS['phpgw']->link('/reports/index.php'),
+				'context_display'		=> $context_display
+			);
+			$p->set_var($var);
+			$p->set_var($this->functions->make_dinamic_lang($p, 'list'));
+			
+
+			$GLOBALS['organizacaodn'] = $_POST['organizacaodn'];
+
+			$contextsdn = $GLOBALS['organizacaodn'];
+
+			// Save query
+			$varorganizacao = explode(",",$contextsdn);
+			$varorganizacao_nome = trim(strtoupper(ereg_replace("ou=","",$varorganizacao[0])));
+			$varorganizacao_nome = trim(strtoupper(ereg_replace("DC=","",$varorganizacao_nome)));
+			$user_logon = $GLOBALS['phpgw_info']['user'][account_lid];
+
+			// carrega os grupos no listbox
+			/************* DESCOMENTE ESTE PARTE DO CODIGO PARA LISTAR TODOS OS GRUPOS, SEM LISTAR POR USUSARIO LOGADO *********** 
+			$sectors_info = $this->functions->get_groups_list($contexts,"*");
+			$sectors_info_dn = $this->functions->get_groups_list_dn($contexts,"*");
+			/* ************************************* FIM *********************************************************************** */
+
+			$sectors_info = $this->functions->get_list_context_logon($user_logon,$contexts,0);
+			$sectors_info_dn = $this->functions->get_list_groups_dn($user_logon,$contexts,0);
+
+			if (!count($sectors_info))
+			{
+				$p->set_var('notselect',lang('No matches found'));
+			}
+			else
+			{
+				foreach($sectors_info as $context=>$sector)
+				{
+					
+					$sectordn = $sectors_info_dn[$context];
+
+					$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+					
+					if ($context == 0 && $contextsdn <> "")
+					{
+						if (trim(strtoupper($varorganizacao_nome)) ==  trim(strtoupper($sector)))
+						{
+							$sector_options .= "<option selected value='" .$contextsdn. "'>" .$varorganizacao_nome. "</option>";
+						}
+						else
+						{
+							$sector_options .= "<option selected value='" .$contextsdn. "'>" .$varorganizacao_nome. "</option>";
+							$sector_options .= "<option value='" . $sectordn . "'>". $sector . "</option>";
+						}
+
+					}
+					else
+					{
+						if ( trim(strtoupper($varorganizacao_nome)) !=  trim(strtoupper($sector)))
+						{
+							$sectorok = trim(strtoupper(ereg_replace("dc=","",$sector)));
+							$sectorok = trim(strtoupper(ereg_replace("dc=","",$sectorok)));
+							$sector_options .= "<option value='" . $sectordn . "'>". $sectorok . "</option>";
+						}
+					}
+
+					$varselect = Array(
+						'tr_color'    	=> $tr_color,
+						'organizacaodn'	=> $contextsdn,
+						'group_name'  	=> $sector_options
+					);					
+				}
+
+				$p->set_var($varselect);
+			}
+
+			// ************** inicio carregar a sub-lista das organizações ****************
+			//Admin make a search
+			if ($GLOBALS['organizacaodn'] != '')
+			{
+				// Conta a quantidade de Usuario do grupo raiz
+				$account_user = $this->functions->get_count_user_sector($contextsdn,$contexts,0);
+				$totaluser = "(".$account_user.")";
+
+				$p->set_var('organizacao', $varorganizacao_nome);
+				$p->set_var('all_user', lang('all'));
+				$p->set_var('total_user', $totaluser);
+
+				$setorg = $contextsdn;
+
+				$groups_info = $this->functions->get_sectors_list($contexts,$setorg);
+
+				if (!count($groups_info))
+				{
+					$p->set_var('message',lang('No sector found'));
+					$p->parse('rows','row_empty',True);				
+				}
+				else
+				{
+					$ii = 0;
+					foreach($groups_info as $context=>$groups)
+					{
+						$explode_groups = explode("#",$groups);
+						$ii = $ii + 1;
+						$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+						$varsuborg = Array(
+							'tr_color'					=> $tr_color,
+							'div_nacesso' 				=> "div_nacesso".$ii,
+							'formname'					=> "form".$ii,
+							'formsubmit'				=> "document.form".$ii.".submit()",
+							'sector_name'				=> $explode_groups[0],
+							'sector_namedn'				=> $explode_groups[1],
+							'sector_namedn_completo'	=> $explode_groups[2],			
+						);					
+
+						$p->set_var($varsuborg);					
+						$p->parse('rows','row',True);
+					}
+				}
+			}
+
+			$p->pfp('out','list');
+		}
+
+		function report_logon_group_setor_print()
+		{
+			$vnumacesso = trim($_POST[nacesso]);
+			$numacesso = abs(round($vnumacesso));
+
+			if ($vnumacesso==999){
+				$numacesso = "Nunca logou";
+			}
+
+			$grouplist = trim($_POST[setor]);
+			$grouplist = trim(ereg_replace("-","",$grouplist));
+			$organizacao = trim($_POST[organizacao]);
+			$setordn = trim($_POST[setordn]);
+			$organizacaodn = trim($_POST[organizacaodn]);
+			$sectornamedncompleto = trim($_POST[sectornamedncompleto]);
+			$Psectornamedncompleto = trim($_POST[Psectornamedncompleto]);
+
+			if ($sectornamedncompleto=="" && $Psectornamedncompleto=="")
+			{			
+				$sectornamedncompleto = $organizacao;
+			}
+			else if ($sectornamedncompleto=="" && $Psectornamedncompleto <> "")
+			{
+				$sectornamedncompleto = $Psectornamedncompleto;
+			}
+			else
+			{
+				$sectornamedncompleto = $organizacao." | ".$sectornamedncompleto;
+			}
+
+			$data_atual = date("d/m/Y"); 
+			$titulo_system = $GLOBALS['phpgw_info']['apps']['reports']['title'];
+			
+			$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$acl = $this->functions->read_acl($account_lid);
+			$raw_context = $acl['raw_context'];
+			$contexts = $acl['contexts'];
+			foreach ($acl['contexts_display'] as $index=>$tmp_context)
+			{
+				$context_display .= $tmp_context;
+			}
+			// Verifica se o administrador tem acesso.
+			if (!$this->functions->check_acl($account_lid,'list_users'))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			unset($GLOBALS['phpgw_info']['flags']['noheader']);
+			unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+			$GLOBALS['phpgw_info']['flags']['app_header'] =  $GLOBALS['phpgw_info']['apps']['reports']['title'].' - '.lang('report user');
+			$GLOBALS['phpgw']->common->phpgw_header();
+
+			$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+			$p->set_file(Array('accounts' => 'report_logon_group_print.tpl'));
+			$p->set_block('accounts','body');
+			$p->set_block('accounts','rowpag');
+			$p->set_block('accounts','row');
+			$p->set_block('accounts','row_empty');
+			
+			$var = Array(
+				'bg_color'					=> $GLOBALS['phpgw_info']['theme']['bg_color'],
+				'th_bg'						=> $GLOBALS['phpgw_info']['theme']['th_bg'],
+				'subtitulo'					=> lang('reports title6'),
+				'subtitulo1'				=> $sectornamedncompleto,
+				'context'					=> $raw_context,
+				'titulo'					=> $titulo_system,
+				'data_atual'				=> $data_atual,				
+				'context_display'			=> $context_display,
+				'organizacaodn'				=> $organizacaodn,
+				'organizacao'				=> $organizacao,
+				'sector_name'				=> $grouplist,
+				'sector_namedn'				=> $setordn,
+				'nacesso' 					=> $vnumacesso,
+				'imapDelimiter'				=> $_SESSION['phpgw_info']['expresso']['email_server']['imapDelimiter']
+			);
+
+			$p->set_var($var);
+			$p->set_var($this->functions->make_dinamic_lang($p, 'body'));
+
+			// ************ PAGINAÇÃO *******************************
+
+			// verifica se exixte usuarios no LDAP
+			$account_info = $this->functions->get_list_user_sector_logon($setordn,$contexts,0,$numacesso);
+
+			if (!count($account_info))
+			{
+				$p->set_var('message',lang('No user found'));
+				$p->parse('rows','row_empty',True);
+			}
+			else if (count($account_info))
+			{ 
+				if ($vnumacesso==0){
+					//url do paginador 
+					$url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/index.php?menuaction=reports.uireports_logon.report_logon_group_setor_print';
+	
+					// **** Grupo de paginas ****
+					$gpag = $_POST[gpage];
+	
+					$grupopage = 20;
+					
+					if (!$gpag){
+						$gpag  = 1;
+					}
+	
+					// recebe o numero da pagina
+					$npag = $_POST[page];
+	
+					// verifica se o get com o numero da pagina é nulo
+					if (!$npag)
+					{
+						$npag = 1;
+					}
+	
+					// conta total dos registros
+					$numreg = count($account_info);
+					
+					// numero de registro por paginação
+					$numpage = 53;
+					
+					$tp = ceil($numreg/$numpage);
+					$inicio = $page - 1;
+					$inicio = $inicio * $numpage;
+		
+					// valor maximo de paginação
+					$totalnpag =  (int)($tp/$grupopage);
+					$restonpag = $tp % $grupopage;
+	
+					if ($restonpag > 0)
+					{
+						$maxtotalnpag = $totalnpag + 1;
+					}
+					else
+					{
+						$maxtotalnpag = $totalnpag;
+					}
+					// inicio fim para imprimir a paginação
+					if( $tp > $grupopage)
+					{
+						// inicio do for da paginação
+						if ($gpag <= ($totalnpag))
+						{
+							$fimgpg = $gpag * $grupopage;
+							$iniciogpg = (($fimgpg - $grupopage)+1);
+						}
+						else
+						{
+							$iniciogpg = (($gpag - 1) * $grupopage);
+							$fimgpg = $iniciogpg + $restonpag;
+						}
+					}
+					else
+					{
+						// inicio do for da paginação
+						$iniciogpg = 1;
+						$fimgpg =  $tp;
+					}
+	
+
+					// Imprime valores de contagen de registro e pagina
+					$p->set_var('cont_user',$numreg);
+					$p->set_var('cont_page',$tp);
+					$p->set_var('page_now',$npag);
+	
+					// ********** busca no LDAP as informação paginada e imprime ****************
+					$paginas = $this->functions->Paginate_user_logon('accounts',$setordn,$contexts,'cn','asc',$npag,$numpage,$numacesso);
+
+					$tmpp = array();
+					$contap = 0;
+					while (list($null,$accountp) = each($paginas))
+					{
+						$access_log =  $this->functions->show_access_log($accountp['uidNumber'][0]);
+	
+						$access_log_array = explode("#",$access_log);
+						
+						$accountp['li_dias'][0] = $access_log_array[1];
+						$accountp['li_date'][0] = $access_log_array[0];
+	
+						$tmpp[$contap]['account_id']	 = $accountp['uidNumber'][0]; 
+						$tmpp[$contap]['account_lid'] = $accountp['uid'][0];
+						$tmpp[$contap]['account_cn'] = $accountp['cn'][0];
+						$tmpp[$contap]['account_status'] = $accountp['accountStatus'][0];
+						$tmpp[$contap]['account_mail'] = $accountp['mail'][0];
+						$tmpp[$contap]['createTimestamp'] = $accountp['createTimestamp'][0];
+						$tmpp[$contap]['li_dias']= $accountp['li_dias'][0];
+						$tmpp[$contap]['li_date']= $accountp['li_date'][0];
+	
+						$sortp[] = $accountp['li_dias'][0];
+	
+						if (count($sortp))
+						{
+							natcasesort($sortp);
+						}
+	
+						$contap = $contap + 1;
+					}
+	
+					while (list($key,$accountr1) = each($sortp))
+					{
+						$returnp[] = $tmpp[$key];
+					}
+	
+					$returnp = array_reverse($returnp); 
+					
+					$ii = 0;
+					
+					while (list($null,$accountr) = each($returnp))
+					{
+						$this->nextmatchs->template_alternate_row_color($p);
+						$ii = $ii + 1;
+						
+						$varr = array(
+							'formname'		=> "formlog".$ii,
+							'formsubmit'	=> "document.formlog".$ii.".submit()",
+							'row_idnumber'	=> $accountr['account_id'],
+							'row_loginid'	=> $accountr['account_lid'],
+							'row_cn'		=> $accountr['account_cn'],
+							'row_status'	=> $accountr['account_status'] == 'active' ? '<font color="#0033FF">Ativado</font> ' : '<font color="#FF0000">Desativado</font>',
+							'row_mail'		=> (!$accountr['account_mail']?'<font color=red>Sem E-mail</font>':$accountr['account_mail']),
+							'row_timestamp'		=> substr($accountr['createTimestamp'], 6, 2)."/".substr($accountr['createTimestamp'], 4, 2)."/".substr($accountr['createTimestamp'], 0, 4),
+							'row_li_date'		=> $accountr['li_date'] =='Nunca logou' ? '<font color="#FF0000">'.$accountr['li_date'].'</font>' : $accountr['li_date'],
+							'row_li_dias'		=> $accountr['li_dias']
+						);
+						
+						$p->set_var($varr);
+		
+						$p->parse('rows','row',True);
+					}
+					// ********************** Fim ****************************
+	
+					// grupo de pagina anteriores
+					if ($gpag > 1)
+					{
+						$gpaga = $gpag - 1;
+						$varp = Array(
+							'paginat'	=> 	"<form name='anterior' method='POST' action='$url'>
+							<input type='hidden' name='setor' value='$grouplist'>
+							<input type='hidden' name='organizacao' value='$organizacao'>
+							<input type='hidden' name='setordn' value='$setordn'>
+							<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+							<input type='hidden' name='page' value='$npag'>
+							<input type='hidden' name='gpage' value='$gpaga'>
+							<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+							<div style='float:left;' onClick='document.anterior.submit()'><a href='#'>".lang('Previous Pages')."<<&nbsp;&nbsp;&nbsp;</a></div></form>"
+						);
+						$p->set_var($varp);						
+		
+							$p->parse('pages','rowpag',True);
+					}
+					// **** FIM *******
+	
+					// imprime a paginação
+					if ($fimgpg > 1)
+					{
+						for($x = $iniciogpg; $x <= $fimgpg; $x++)
+						{
+							$varp = Array(
+								'paginat'	=>  "<form name='form".$x."' method='POST' action='$url'>
+								<input type='hidden' name='setor' value='$grouplist'>
+								<input type='hidden' name='organizacao' value='$organizacao'>
+								<input type='hidden' name='setordn' value='$setordn'>
+								<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+								<input type='hidden' name='page' value='$x'>
+								<input type='hidden' name='gpage' value='$gpag'>
+								<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+								<div style='float:left;' onClick='document.form".$x.".submit()'><a href='#'>$x&nbsp;</a></div></form>"
+							);
+	
+							$p->set_var($varp);						
+		
+							$p->parse('pages','rowpag',True);
+						}
+					}
+			
+					// proximo grupo de pagina
+					if ($gpag < $maxtotalnpag && $maxtotalnpag > 0) 
+					{
+						$gpagp = $gpag + 1;
+						$varp = Array(
+							'paginat'	=>  "<form name='proximo' method='POST' action='$url'>
+							<input type='hidden' name='setor' value='$grouplist'>
+							<input type='hidden' name='organizacao' value='$organizacao'>
+							<input type='hidden' name='setordn' value='$setordn'>
+							<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+							<input type='hidden' name='page' value='$npag'>
+							<input type='hidden' name='gpage' value='$gpagp'>
+							<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+							<div style='float:left;' onClick='document.proximo.submit()'><a href='#'>&nbsp;&nbsp;&nbsp;>>".lang('Next Page')."</a></div></form>"
+						);
+						$p->set_var($varp);						
+	
+						$p->parse('pages','rowpag',True);
+					}
+	
+					$vart = Array(
+						'page'	=> $npag,
+						'gpage'	=> $gpag
+					);
+		
+					$p->set_var($vart);
+					// ************************* FIM PAGINAÇÃO ***********************							
+
+				}else{
+				// ******** caso não for zero não vai paginar *****************
+					//url do paginador 
+					$url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/index.php?menuaction=reports.uireports_logon.report_logon_group_setor_print';
+
+					// conta total dos registros
+					$numreg = count($account_info);
+
+					// Imprime valores de contagen de registro e pagina
+					$p->set_var('cont_user',$numreg);
+					$p->set_var('cont_page',"1");
+					$p->set_var('page_now',"1");
+
+					// ********** busca no LDAP as informação paginada e imprime ****************
+					$paginas =$this->functions->get_list_user_sector_logon($setordn,$contexts,0,$numacesso);
+
+					$tmpp = array();
+					$contap = 0;
+					while (list($null,$accountp) = each($paginas))
+					{
+						$access_log =  $this->functions->show_access_log($accountp['account_id']);
+	
+						$access_log_array = explode("#",$access_log);
+						
+						if ($numacesso<>"Nunca logou"){
+							$accountp['li_dias'] = $access_log_array[1];
+							$accountp['li_date'] = $access_log_array[0];
+		
+							$tmpp[$contap]['account_id']	 = $accountp['account_id']; 
+							$tmpp[$contap]['account_lid'] = $accountp['account_lid'];
+							$tmpp[$contap]['account_cn'] = $accountp['account_cn'];
+							$tmpp[$contap]['account_status'] = $accountp['account_accountstatus'];
+							$tmpp[$contap]['account_mail'] = $accountp['account_mail'];
+							$tmpp[$contap]['createTimestamp'] = $accountp['createtimestamp'];
+							$tmpp[$contap]['li_dias']= $accountp['li_dias'];
+							$tmpp[$contap]['li_date']= $accountp['li_date'];
+		
+							$sortp[] = $accountp['li_dias'];
+						}else{
+							if ($numacesso == $access_log_array[0]) {
+								$accountp['li_dias'] = $access_log_array[1];
+								$accountp['li_date'] = $access_log_array[0];
+			
+								$tmpp[$contap]['account_id']	 = $accountp['account_id']; 
+								$tmpp[$contap]['account_lid'] = $accountp['account_lid'];
+								$tmpp[$contap]['account_cn'] = $accountp['account_cn'];
+								$tmpp[$contap]['account_status'] = $accountp['account_accountstatus'];
+								$tmpp[$contap]['account_mail'] = $accountp['account_mail'];
+								$tmpp[$contap]['createTimestamp'] = $accountp['createtimestamp'];
+								$tmpp[$contap]['li_dias']= $accountp['li_dias'];
+								$tmpp[$contap]['li_date']= $accountp['li_date'];
+			
+								$sortp[] = $accountp['li_dias'];
+							}
+						}	
+
+						if (count($sortp))
+						{
+							natcasesort($sortp);
+						}
+	
+						$contap = $contap + 1;
+					}
+	
+					while (list($key,$accountr1) = each($sortp))
+					{
+						$returnp[] = $tmpp[$key];
+					}
+	
+					$returnp = array_reverse($returnp); 
+					
+					$ii = 0;
+					
+					while (list($null,$accountr) = each($returnp))
+					{
+						$this->nextmatchs->template_alternate_row_color($p);
+						$ii = $ii + 1;
+						
+						$varr = array(
+							'formname'		=> "formlog".$ii,
+							'formsubmit'	=> "document.formlog".$ii.".submit()",
+							'row_idnumber'	=> $accountr['account_id'],
+							'row_loginid'	=> $accountr['account_lid'],
+							'row_cn'		=> $accountr['account_cn'],
+							'row_status'	=> $accountr['account_status'] == 'active' ? '<font color="#0033FF">Ativado</font> ' : '<font color="#FF0000">Desativado</font>',
+							'row_mail'		=> (!$accountr['account_mail']?'<font color=red>Sem E-mail</font>':$accountr['account_mail']),
+							'row_timestamp'		=> substr($accountr['createTimestamp'], 6, 2)."/".substr($accountr['createTimestamp'], 4, 2)."/".substr($accountr['createTimestamp'], 0, 4),
+							'row_li_date'		=> $accountr['li_date'] =='Nunca logou' ? '<font color="#FF0000">'.$accountr['li_date'].'</font>' : $accountr['li_date'],
+							'row_li_dias'		=> $accountr['li_dias']
+						);
+						
+						$p->set_var($varr);
+		
+						$p->parse('rows','row',True);
+					}
+					// ********************** Fim ****************************
+				}
+			}
+
+			$p->pfp('out','body');
+		}
+
+		function get_user_info($userdn,$usercontexts,$usersizelimit)
+		{
+			$user_info = $this->functions->Paginate_user('accounts',$setordn,$contexts,'cn','asc',$npag,$numpage);
+
+			return $user_info;
+		}
+
+		function css()
+		{
+			$appCSS = 
+			'th.activetab
+			{
+				color:#000000;
+				background-color:#D3DCE3;
+				border-top-width : 1px;
+				border-top-style : solid;
+				border-top-color : Black;
+				border-left-width : 1px;
+				border-left-style : solid;
+				border-left-color : Black;
+				border-right-width : 1px;
+				border-right-style : solid;
+				border-right-color : Black;
+				font-size: 12px;
+				font-family: Tahoma, Arial, Helvetica, sans-serif;
+			}
+			
+			th.inactivetab
+			{
+				color:#000000;
+				background-color:#E8F0F0;
+				border-bottom-width : 1px;
+				border-bottom-style : solid;
+				border-bottom-color : Black;
+				font-size: 12px;
+				font-family: Tahoma, Arial, Helvetica, sans-serif;				
+			}
+			
+			.td_left {border-left:1px solid Gray; border-top:1px solid Gray; border-bottom:1px solid Gray;}
+			.td_right {border-right:1px solid Gray; border-top:1px solid Gray; border-bottom:1px solid Gray;}
+			
+			div.activetab{ display:inline; }
+			div.inactivetab{ display:none; }';
+			
+			return $appCSS;
+		}
+
+		function show_access()
+		{	
+			$vnumacesso = trim($_POST['nacesso']);
+			$account_id = $_POST['account_id']; 
+			$nome_usuario = $_POST['nome_usuario']; 
+			$grouplist = $_POST['setor'];
+			$organizacao = $_POST['organizacao'];
+			$setordn = $_POST['setordn'];
+			$organizacaodn = $_POST['organizacaodn'];
+			$x = $_POST['page'];
+			$gpag = $_POST['gpage'];
+			$sectornamedncompleto = $_POST['Psectornamedncompleto'];
+
+			$manager_account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
+			$tmp = $this->functions->read_acl($manager_account_lid);
+			$manager_context = $tmp[0]['context'];
+			
+			// Verifica se tem acesso a este modulo
+			if ((!$this->functions->check_acl($manager_account_lid,'edit_users')) && (!$this->functions->check_acl($manager_account_lid,'change_users_password')))
+			{
+				$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/reports/inc/access_denied.php'));
+			}
+
+			// Seta header.
+			unset($GLOBALS['phpgw_info']['flags']['noheader']);
+			unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+
+			$GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['reports']['title'].' - '.lang('Access Log');
+			$GLOBALS['phpgw']->common->phpgw_header();
+
+			// Seta templates.
+			$t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+			$t->set_file(array("body" => "accesslog.tpl"));
+			$t->set_block('body','main');
+			$t->set_block('body','row','row');
+
+			// GET access log from the user.
+			$GLOBALS['phpgw']->db->limit_query("select loginid,ip,li,lo,account_id,sessionid from phpgw_access_log WHERE account_id=".$account_id." order by li desc",$start,__LINE__,__FILE__);
+			while ($GLOBALS['phpgw']->db->next_record())
+			{
+				$records[] = array(
+					'loginid'    	=> $GLOBALS['phpgw']->db->f('loginid'),
+					'ip'         	=> $GLOBALS['phpgw']->db->f('ip'),
+					'li'         	=> $GLOBALS['phpgw']->db->f('li'),
+					'lo'         	=> $GLOBALS['phpgw']->db->f('lo'),
+					'account_id' 	=> $GLOBALS['phpgw']->db->f('account_id'),
+					'sessionid'  	=> $GLOBALS['phpgw']->db->f('sessionid')
+				);
+			}
+
+			// Seta as vcariaveis
+			while (is_array($records) && list(,$record) = each($records))
+			{
+				$var = array(
+					'row_loginid' => $record['loginid'],
+					'row_ip'      => $record['ip'],
+					'row_li'      => date("d/m/Y - H:i:s", $record['li']),
+					'row_lo'      => $record['lo'] == 0 ? 0 : date("d/m/Y - H:i:s", $record['lo'])
+				);
+				$t->set_var($var);
+				$t->fp('rows','row',True);
+			}
+
+			$var = Array(
+				'th_bg'			=> $GLOBALS['phpgw_info']['theme']['th_bg'],
+				'nome_usuario' 	=> $nome_usuario,				
+				'back_url'		=>  "<form name='formlog' method='POST' action='./index.php?menuaction=reports.uireports_logon.report_logon_group_setor_print'>
+				<input type='hidden' name='setor' value='$grouplist'>
+				<input type='hidden' name='organizacao' value='$organizacao'>
+				<input type='hidden' name='setordn' value='$setordn'>
+				<input type='hidden' name='organizacaodn' value='$organizacaodn'>
+				<input type='hidden' name='page' value='$x'>
+				<input type='hidden' name='gpage' value='$gpag'>
+				<input type='hidden' name='Psectornamedncompleto' value='$sectornamedncompleto'>
+				<input type='hidden' name='nacesso' value='$vnumacesso'>
+				<input name='button' type='submit' value='".lang('back')."'></div></form>"
+			);
+
+			$t->set_var($var);
+			$t->set_var($this->functions->make_dinamic_lang($t, 'body'));
+			$t->pfp('out','body');
+		}
+	}
+?>
Index: /trunk/reports/inc/class.uireports_fpdf.inc.php
===================================================================
--- /trunk/reports/inc/class.uireports_fpdf.inc.php	(revision 5291)
+++ /trunk/reports/inc/class.uireports_fpdf.inc.php	(revision 5291)
@@ -0,0 +1,164 @@
+<?php
+/*******************************************************************************
+ * FPDF                                                                         *
+ *                                                                              *
+ * Version: 1.6                                                                 *
+ * Date:    2008-08-03                                                          *
+ * Author:  Olivier PLATHEY                                                     *
+ *******************************************************************************/
+
+require('class.fpdf.inc.php');
+
+class uireports_fpdf extends FPDF
+{
+	var $a = "1";
+	var $b = "1";
+
+	var $widths;
+	var $aligns;
+
+	function __construct($orientation = "P") {
+		parent::__construct($orientation);
+	}
+	 
+	function SetWidths($w)
+	{
+		//Set the array of column widths
+		$this->widths=$w;
+	}
+
+	function SetAligns($a)
+	{
+		//Set the array of column alignments
+		$this->aligns=$a;
+	}
+
+	function Row($data)
+	{
+		//Calculate the height of the row
+		$nb=0;
+		for($i=0;$i< count($data);$i++)
+		$nb=max($nb,$this->NbLines($this->widths[$i],$data[$i]));
+		$h=5*$nb;
+		//Issue a page break first if needed
+		$this->CheckPageBreak($h);
+		//Draw the cells of the row
+		for($i=0;$i< count($data);$i++)
+		{
+			$w=$this->widths[$i];
+			$a=isset($this->aligns[$i]) ? $this->aligns[$i] : 'L';
+			//Save the current position
+			$x=$this->GetX();
+			$y=$this->GetY();
+			//Draw the border
+			$this->Rect($x,$y,$w,$h);
+			//Print the text
+			$this->MultiCell($w,5,$data[$i],0,$a);
+			//Put the position to the right of the cell
+			$this->SetXY($x+$w,$y);
+		}
+		//Go to the next line
+		$this->Ln($h);
+	}
+
+	function CheckPageBreak($h)
+	{
+		//If the height h would cause an overflow, add a new page immediately
+		if($this->GetY()+$h>$this->PageBreakTrigger)
+		$this->AddPage($this->CurOrientation);
+	}
+
+	function NbLines($w,$txt)
+	{
+		//Computes the number of lines a MultiCell of width w will take
+		$cw=&$this->CurrentFont['cw'];
+		if($w==0)
+		$w=$this->w-$this->rMargin-$this->x;
+		$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+		$s=str_replace("\r",'',$txt);
+		$nb=strlen($s);
+		if($nb>0 and $s[$nb-1]=="\n")
+		$nb--;
+		$sep=-1;
+		$i=0;
+		$j=0;
+		$l=0;
+		$nl=1;
+		while($i<$nb)
+		{
+			$c=$s[$i];
+			if($c=="\n")
+			{
+				$i++;
+				$sep=-1;
+				$j=$i;
+				$l=0;
+				$nl++;
+				continue;
+			}
+			if($c==' ')
+			$sep=$i;
+			$l+=$cw[$c];
+			if($l>$wmax)
+			{
+				if($sep==-1)
+				{
+					if($i==$j)
+					$i++;
+				}
+				else
+				$i=$sep+1;
+				$sep=-1;
+				$j=$i;
+				$l=0;
+				$nl++;
+			}
+			else
+			$i++;
+		}
+		return $nl;
+	}
+
+	/*	function Header()
+	 {
+		$SubTituloR = lang('report cota organization');
+
+		//Restore font and colors
+		$this->SetFont('Arial','',8);
+		$this->SetFillColor(224,235,255);
+		$this->SetTextColor(0);
+
+		$this->Cell(95,5,lang('name'),1,0,'L',1);
+		//				$pdf->Cell(53,5,lang('report email'),1,0,'L',1);
+		$this->Cell(17,5,lang('cota'),1,0,'C',1);
+		$this->Cell(31,5,lang('cota used'),1,0,'C',1);
+		$this->Cell(29,5,lang('percent cota'),1,0,'C',1);
+		$this->Cell(20,5,lang('status'),1,1,'C',1);
+
+		return;
+		}
+		*/
+	function Footer()
+	{
+		// Esta função foi implemantada para realizar o rodapé dos relatórios
+
+		$titulo_system = $GLOBALS['phpgw_info']['apps']['reports']['title'];
+		$SubTitulo = $GLOBALS['phpgw_info']['apps']['reports']['subtitle'];
+
+		//Seleciona Arial itálico 8
+		$this->SetY(-15);
+		$this->SetFont('Arial','I',8);
+		$this->SetTextColor(0,0,100);
+		$this->SetFillColor(224,235,255);
+
+		//Imprime o número da página
+		//		$this->Cell(0,5,$titulo_system.'                  '.$SubTitulo.'                  Página n. '.$this->PageNo(),1,0,'C',1);
+
+		$this->Rect(9,281,197,6,'D');
+		$this->Cell(55,4,$titulo_system,0,0,'L',1);
+		$this->Cell(100,4,$SubTitulo,0,0,'C',1);
+		$this->Cell(40,4,'Página n. '.$this->PageNo(),0,1,'R',1);
+	}
+
+}
+?>
Index: /trunk/reports/inc/class.uireports.inc.php
===================================================================
--- /trunk/reports/inc/class.uireports.inc.php	(revision 5291)
+++ /trunk/reports/inc/class.uireports.inc.php	(revision 5291)
@@ -0,0 +1,204 @@
+<?php
+	/*************************************************************************************\
+	* Expresso Relatório                										         *
+	* by Elvio Rufino da Silva (elviosilva@yahoo.com.br, elviosilva@cepromat.mt.gov.br)  *
+	* -----------------------------------------------------------------------------------*
+	*  This program is free software; you can redistribute it and/or modify it			 *
+	*  under the terms of the GNU General Public License as published by the			 *
+	*  Free Software Foundation; either version 2 of the License, or (at your			 *
+	*  option) any later version.														 *
+	*************************************************************************************/
+
+	class uireports
+	{
+		var $public_functions = array
+		(
+			'report_config_global'				=> True,
+			'get_user_info'						=> True,
+			'css'								=> True
+		);
+
+		var $nextmatchs;
+		var $user;
+		var $functions;
+		var $current_config;
+		var $ldap_functions;
+		var $db_functions;
+		var $imap_functions;
+		
+		function uireports()
+		{
+			$this->user			= CreateObject('reports.user');
+			$this->nextmatchs	= CreateObject('phpgwapi.nextmatchs');
+			$this->functions	= CreateObject('reports.functions');
+			$this->ldap_functions = CreateObject('reports.ldap_functions');
+			$this->db_functions = CreateObject('reports.db_functions');
+			$this->fpdf = CreateObject('reports.fpdf'); // Class para PDF
+						
+			$c = CreateObject('phpgwapi.config','reports'); // cria o objeto relatorio no $c
+			$c->read_repository(); // na classe config do phpgwapi le os dados da tabela phpgw_config where relatorio, como passagem acima
+			$this->current_config = $c->config_data; // carrega os dados em do array no current_config
+
+			if(!@is_object($GLOBALS['phpgw']->js))
+			{
+				$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
+			}
+			$GLOBALS['phpgw']->js->validate_file('jscode','cc','reports');
+		}
+
+		function report_config_global()
+		{
+			if ($GLOBALS['phpgw']->acl->check('site_config_access',1,'admin'))
+			{
+				$GLOBALS['phpgw']->redirect_link('/index.php');
+			}
+
+			$t = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir($appname));
+			$t->set_unknowns('keep');
+			$t->set_file(array('config' => 'config.tpl'));
+			$t->set_block('config','header','header');
+			$t->set_block('config','body','body');
+			$t->set_block('config','footer','footer');
+
+			$c = CreateObject('phpgwapi.config',$config_appname);
+			$c->read_repository();
+
+			if ($c->config_data)
+			{
+				$current_config = $c->config_data;
+			}
+
+			$GLOBALS['phpgw']->common->phpgw_header();
+			echo parse_navbar();
+
+			$t->set_var('title',lang('Site Configuration'));
+			$t->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname));
+			$t->set_var('th_bg',     $GLOBALS['phpgw_info']['theme']['th_bg']);
+			$t->set_var('th_text',   $GLOBALS['phpgw_info']['theme']['th_text']);
+			$t->set_var('row_on',    $GLOBALS['phpgw_info']['theme']['row_on']);
+			$t->set_var('row_off',   $GLOBALS['phpgw_info']['theme']['row_off']);
+			$t->pparse('out','header');
+
+			$vars = $t->get_undefined('body');
+
+			$GLOBALS['phpgw']->hooks->single('config',$appname);
+
+			foreach($vars as $value)
+			{
+				$valarray = explode('_',$value);
+				$type = array_shift($valarray);
+				$newval = implode(' ',$valarray);
+				switch ($type)
+				{
+					case 'lang':
+						$t->set_var($value,lang($newval));
+						break;
+					case 'value':
+						$newval = str_replace(' ','_',$newval);
+						/* Don't show passwords in the form */
+						if(ereg('passwd',$value) || ereg('password',$value) || ereg('root_pw',$value))
+						{
+							$t->set_var($value,'');
+						}
+						else
+						{
+							$t->set_var($value,htmlspecialchars($current_config[$newval]));
+						}
+						break;
+					case 'selected':
+						$configs = array();
+						$config  = '';
+						$newvals = explode(' ',$newval);
+						$setting = end($newvals);
+						for ($i=0;$i<(count($newvals) - 1); $i++)
+						{
+							$configs[] = $newvals[$i];
+						}
+						$config = implode('_',$configs);
+						/* echo $config . '=' . $current_config[$config]; */
+						if ($current_config[$config] == $setting)
+						{
+							$t->set_var($value,' selected');
+						}
+						else
+						{
+							$t->set_var($value,'');
+						}
+						break;
+					case 'hook':
+						$newval = str_replace(' ','_',$newval);
+						if(function_exists($newval))
+						{
+							$t->set_var($value,$newval($current_config));
+						}
+						else
+						{
+							$t->set_var($value,'');
+						}
+						break;
+					default:
+					$t->set_var($value,'');
+					break;
+				}
+			}
+			$mbstring = ini_get_all("mbstring");
+			$t->set_var('mbstring_value',(extension_loaded('mbstring')  || function_exists('dl') && @dl(PHP_SHLIB_PREFIX.'mbstring.'.PHP_SHLIB_SUFFIX)? 
+				$mbstring['mbstring.func_overload']['global_value'] != ''? 
+					'mbstring.func_overload = '.$mbstring['mbstring.func_overload']['global_value']:'' : ''));
+
+			$t->pfp('out','body');
+
+			$t->set_var('lang_cancel', lang('Back'));
+			$t->pfp('out','footer');
+		}
+
+		function row_action($action,$type,$account_id)
+		{
+			return '<a href="'.$GLOBALS['phpgw']->link('/index.php',Array(
+				'menuaction' => 'reports.uireports.'.$action.'_'.$type,
+				'account_id' => $account_id
+			)).'"> '.lang($action).' </a>';
+		}
+
+		function css()
+		{
+			$appCSS = 
+			'th.activetab
+			{
+				color:#000000;
+				background-color:#D3DCE3;
+				border-top-width : 1px;
+				border-top-style : solid;
+				border-top-color : Black;
+				border-left-width : 1px;
+				border-left-style : solid;
+				border-left-color : Black;
+				border-right-width : 1px;
+				border-right-style : solid;
+				border-right-color : Black;
+				font-size: 12px;
+				font-family: Tahoma, Arial, Helvetica, sans-serif;
+			}
+			
+			th.inactivetab
+			{
+				color:#000000;
+				background-color:#E8F0F0;
+				border-bottom-width : 1px;
+				border-bottom-style : solid;
+				border-bottom-color : Black;
+				font-size: 12px;
+				font-family: Tahoma, Arial, Helvetica, sans-serif;				
+			}
+			
+			.td_left {border-left:1px solid Gray; border-top:1px solid Gray; border-bottom:1px solid Gray;}
+			.td_right {border-right:1px solid Gray; border-top:1px solid Gray; border-bottom:1px solid Gray;}
+			
+			div.activetab{ display:inline; }
+			div.inactivetab{ display:none; }';
+			
+			return $appCSS;
+		}
+
+	}
+?>
Index: /trunk/reports/index.php
===================================================================
--- /trunk/reports/index.php	(revision 5291)
+++ /trunk/reports/index.php	(revision 5291)
@@ -0,0 +1,39 @@
+<?php
+	/*************************************************************************************\
+	* Expresso Relatório                										         *
+	* by Elvio Rufino da Silva (elviosilva@yahoo.com.br, elviosilva@cepromat.mt.gov.br)  *
+	* -----------------------------------------------------------------------------------*
+	*  This program is free software; you can redistribute it and/or modify it			 *
+	*  under the terms of the GNU General Public License as published by the			 *
+	*  Free Software Foundation; either version 2 of the License, or (at your			 *
+	*  option) any later version.														 *
+	\*************************************************************************************/
+	$GLOBALS['phpgw_info'] = array();
+	$GLOBALS['phpgw_info']['flags']['currentapp'] = 'reports';
+	include('../header.inc.php');
+
+	$c = CreateObject('phpgwapi.config','reports');
+	$c->read_repository();
+	$current_config = $c->config_data;
+	$boemailadmin	= CreateObject('emailadmin.bo');
+	$emailadmin_profile = $boemailadmin->getProfileList();
+	$_SESSION['phpgw_info']['expresso']['email_server'] = $boemailadmin->getProfile($emailadmin_profile[0]['profileID']);
+	
+	$template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+	$template->set_file(Array('reports' => 'index.tpl'));
+	$template->set_block('reports','body');	
+	
+	$var = Array(
+		'lang_rel_user_all'			=> lang('report user'),
+		'lang_rel_title'			=> lang('reports'),
+		'lang_rel_user_org'			=> lang('report organization'),
+		'lang_rel_cota_org' 		=> lang('report cota organization'),
+		'lang_rel_logon_org' 		=> lang('report of time without logging by Organization'),
+		'lang_rel_maillists_org' 	=> lang('report maillists organization'),
+		'lang_rel_usersgroups_org' 	=> lang('report usersgroups organization'),
+		'page'						=> $_GET[page]
+	);
+	$template->set_var($var);
+	$template->pfp('out','body');
+	$GLOBALS['phpgw']->common->phpgw_footer();
+?>
Index: /trunk/reports/templates/default/report_maillists_group_print.tpl
===================================================================
--- /trunk/reports/templates/default/report_maillists_group_print.tpl	(revision 5291)
+++ /trunk/reports/templates/default/report_maillists_group_print.tpl	(revision 5291)
@@ -0,0 +1,143 @@
+<!-- BEGIN body -->
+<style type="text/css">
+.myBox
+{
+    margin: 24px 0px 0px 0px;
+    border: 0px solid #ffffff;
+    color: #000000;
+    width: 99%;
+    padding: 20px;
+    text-align: left;
+    background-color: #ffffff;
+    border: 3px solid #ffffff;
+
+
+}
+
+.myBox2
+{
+    margin: 24px 0px 0px 0px;
+    border: 0px solid #ffffff;
+    width: 99%;
+    padding: 5px;
+    text-align: left;
+    background-color: #ECECE5;
+    border: 3px solid #ECECE5;
+}
+
+#loader{
+position:absolute;
+width:100%;
+height:600px;
+}
+
+.info{
+width:100px;
+float:left;
+margin-right:25%;
+margin-top: 300px;
+}
+
+.style1 {
+	font-size: 20px;
+	font-weight: bold;
+	color: #0000FF;
+}
+.style2 {
+	font-size: 18px
+	font-weight: bold;
+}
+.style4 {color: #000000}
+
+.style6 {
+	font-size: 12px;
+	font-weight: bold;
+	color: #0000FF;
+}
+</style>
+ <div id="conteudo"> <!-- Elemento camufla o contéudo até que todas as tags de imagens sejam carregadas -->
+<input type="hidden" id="accounts_form_imapDelimiter" value="{imapDelimiter}">
+{error_messages}
+<p>
+   <div align="center">
+		<table width="90%"  border="0">
+			<tr>
+			  <td colspan="2" align="left">
+			  	<div align="right" style="float:right">
+					<form name="back" method="post" action="./index.php?menuaction=reports.uireports_maillists.report_maillists_group">
+			  	    	<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+			  	    	<input type="button" value="{lang_back}" onClick="document.back.submit()">
+			      </form>
+	            </div>
+			  </td>
+		      <td width="9%" align="left">				  
+				  <div align="right" style="float:left">
+					<form action="./index.php?menuaction=reports.uireports_maillists.report_maillists_group_print_pdf" method="post" name="pdf" target="_blank">
+				      <input name="button" type="button" onClick="document.pdf.submit()" value="Imprimir">
+				      <input type="hidden" name="setor" value="{sector_name}">
+				      <input type="hidden" name="setordn" value="{sector_namedn}">			
+				      <input type="hidden" name="subtitulo" value="{subtitulo1}">			
+				    </form>		      
+			      </div>
+		  </tr>
+        </table>
+		<table border="0" width="90%">
+			<tr>
+			  <td colspan="3" align="left"><div align="center" class="style1">{subtitulo}</div><br></td>
+	      </tr>
+			<tr>
+			  <td colspan="3" align="left"><div align="center" class="style6">{subtitulo1}</div><br></td>
+	      </tr>
+			<tr>
+			  <td width="25%" align="left"><div align="left" class="style2">{lang_report date}:{data_atual}</div></td>
+		      <td width="60%" align="left">{lang_total_maillists}&nbsp;<strong>{cont_maillists}</strong></td>
+		      <td width="15%" align="left">
+			  <div align="right" class="style2">{titulo}</div></td>
+		  </tr>
+			<tr>
+			  <td colspan="3" align="left">
+				<table width="100%" border="0" align="center">
+					<tr bgcolor="{th_bg}">
+						<td colspan="2"></td>
+					</tr>
+					<tr>
+				  		<td width="50%">&nbsp;
+						</td>
+				  	    <td width="50%"><div align="right">{lang_page_now}:&nbsp;<strong>{page_now}</strong>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;{lang_total_pages}:&nbsp;<strong>{cont_page}</strong>&nbsp;&nbsp;<br></div></td>
+					</tr>
+			  </table>
+			</td>
+		  </tr>
+		</table>
+   </div>
+ 
+	<div align="center">
+		<table border="0" width="90%">
+			<tr>
+			  <td colspan="3" align="center">{pages}</td>
+		  </tr>
+			<tr bgcolor="{th_bg}">
+				<td width="20%">{lang_loginid}</td>
+				<td width="30%">{lang_name}</td>
+				<td width="30%">{lang_report email}</td>
+			</tr>
+			{rows}
+		</table>
+	</div>
+<!-- END body -->
+<!-- BEGIN rowpag -->
+    <b>{paginat}</b>
+<!-- END rowpag -->
+<!-- BEGIN row -->
+	<tr bgcolor="{tr_color}">
+		<td>{row_loginid}</td>
+		<td>{row_cn}</td>
+		<td>{row_mail}</td>
+	</tr>
+<!-- END row -->
+<!-- BEGIN row_empty -->
+	<tr>
+		<td colspan="7" align="center"><font color="red"><b>{message}</b></font></td>
+	</tr>
+<!-- END row_empty -->
+</div>
Index: /trunk/reports/templates/default/report_users_group_print.tpl
===================================================================
--- /trunk/reports/templates/default/report_users_group_print.tpl	(revision 5291)
+++ /trunk/reports/templates/default/report_users_group_print.tpl	(revision 5291)
@@ -0,0 +1,147 @@
+<!-- BEGIN body -->
+<style type="text/css">
+.myBox
+{
+    margin: 24px 0px 0px 0px;
+    border: 0px solid #ffffff;
+    color: #000000;
+    width: 99%;
+    padding: 20px;
+    text-align: left;
+    background-color: #ffffff;
+    border: 3px solid #ffffff;
+
+
+}
+
+.myBox2
+{
+    margin: 24px 0px 0px 0px;
+    border: 0px solid #ffffff;
+    width: 99%;
+    padding: 5px;
+    text-align: left;
+    background-color: #ECECE5;
+    border: 3px solid #ECECE5;
+}
+
+#loader{
+position:absolute;
+width:100%;
+height:600px;
+}
+
+.info{
+width:100px;
+float:left;
+margin-right:25%;
+margin-top: 300px;
+}
+
+.style1 {
+	font-size: 20px;
+	font-weight: bold;
+	color: #0000FF;
+}
+.style2 {
+	font-size: 18px
+	font-weight: bold;
+}
+.style4 {color: #000000}
+
+.style6 {
+	font-size: 12px;
+	font-weight: bold;
+	color: #0000FF;
+}
+</style>
+ <div id="conteudo"> <!-- Elemento camufla o contéudo até que todas as tags de imagens sejam carregadas -->
+<input type="hidden" id="accounts_form_imapDelimiter" value="{imapDelimiter}">
+{error_messages}
+<p>
+   <div align="center">
+		<table width="90%"  border="0">
+			<tr>
+			  <td colspan="2" align="left">
+			  	<div align="right" style="float:right">
+					<form name="back" method="post" action="./index.php?menuaction=reports.uireports_users.report_users_group">
+			  	    	<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+			  	    	<input type="button" value="{lang_back}" onClick="document.back.submit()">
+			      </form>
+	            </div>
+			  </td>
+		      <td width="9%" align="left">				  
+				  <div align="right" style="float:left">
+					<form action="./index.php?menuaction=reports.uireports_users.report_users_print_pdf" method="post" name="pdf" target="_blank">
+				      <input name="button" type="button" onClick="document.pdf.submit()" value="Imprimir">
+				      <input type="hidden" name="setor" value="{sector_name}">
+				      <input type="hidden" name="setordn" value="{sector_namedn}">			
+				      <input type="hidden" name="subtitulo" value="{subtitulo1}">			
+				    </form>		      
+			      </div>
+		  </tr>
+        </table>
+		<table border="0" width="90%">
+			<tr>
+			  <td colspan="3" align="left"><div align="center" class="style1">{subtitulo}</div><br></td>
+	      </tr>
+			<tr>
+			  <td colspan="3" align="left"><div align="center" class="style6">{subtitulo1}</div><br></td>
+	      </tr>
+			<tr>
+			  <td width="25%" align="left"><div align="left" class="style2">{lang_report date}:{data_atual}</div></td>
+		      <td width="60%" align="left">{lang_total_users}&nbsp;<strong>{cont_user}</strong>			  </td>
+		      <td width="15%" align="left">
+			  <div align="right" class="style2">{titulo}</div></td>
+		  </tr>
+			<tr>
+			  <td colspan="3" align="left">
+				<table width="100%" border="0" align="center">
+					<tr bgcolor="{th_bg}">
+						<td colspan="2"></td>
+					</tr>
+					<tr>
+				  		<td width="50%">&nbsp;
+						</td>
+				  	    <td width="50%"><div align="right">{lang_page_now}:&nbsp;<strong>{page_now}</strong>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;{lang_total_pages}:&nbsp;<strong>{cont_page}</strong>&nbsp;&nbsp;<br></div></td>
+					</tr>
+			  </table>
+			</td>
+		  </tr>
+		</table>
+   </div>
+ 
+	<div align="center">
+		<table border="0" width="90%">
+			<tr>
+			  <td colspan="3" align="center">{pages}</td>
+		  </tr>
+			<tr bgcolor="{th_bg}">
+				<td width="20%">{lang_loginid}</td>
+				<td width="20%">{lang_name}</td>
+				<td width="30%">{lang_report email}</td>
+				<td width="15%">{lang_report phone}</td>
+				<td width="15%">{lang_status}</td>
+			</tr>
+			{rows}
+		</table>
+	</div>
+<!-- END body -->
+<!-- BEGIN rowpag -->
+    <b>{paginat}</b>
+<!-- END rowpag -->
+<!-- BEGIN row -->
+	<tr bgcolor="{tr_color}">
+		<td>{row_loginid}</td>
+		<td>{row_cn}</td>
+		<td>{row_mail}</td>
+		<td>{row_phone}</td>
+		<td>{row_status}</td>
+	</tr>
+<!-- END row -->
+<!-- BEGIN row_empty -->
+	<tr>
+		<td colspan="7" align="center"><font color="red"><b>{message}</b></font></td>
+	</tr>
+<!-- END row_empty -->
+</div>
Index: /trunk/reports/templates/default/report_usersgroups_group_print.tpl
===================================================================
--- /trunk/reports/templates/default/report_usersgroups_group_print.tpl	(revision 5291)
+++ /trunk/reports/templates/default/report_usersgroups_group_print.tpl	(revision 5291)
@@ -0,0 +1,143 @@
+<!-- BEGIN body -->
+<style type="text/css">
+.myBox
+{
+    margin: 24px 0px 0px 0px;
+    border: 0px solid #ffffff;
+    color: #000000;
+    width: 99%;
+    padding: 20px;
+    text-align: left;
+    background-color: #ffffff;
+    border: 3px solid #ffffff;
+
+
+}
+
+.myBox2
+{
+    margin: 24px 0px 0px 0px;
+    border: 0px solid #ffffff;
+    width: 99%;
+    padding: 5px;
+    text-align: left;
+    background-color: #ECECE5;
+    border: 3px solid #ECECE5;
+}
+
+#loader{
+position:absolute;
+width:100%;
+height:600px;
+}
+
+.info{
+width:100px;
+float:left;
+margin-right:25%;
+margin-top: 300px;
+}
+
+.style1 {
+	font-size: 20px;
+	font-weight: bold;
+	color: #0000FF;
+}
+.style2 {
+	font-size: 18px
+	font-weight: bold;
+}
+.style4 {color: #000000}
+
+.style6 {
+	font-size: 12px;
+	font-weight: bold;
+	color: #0000FF;
+}
+</style>
+ <div id="conteudo"> <!-- Elemento camufla o contéudo até que todas as tags de imagens sejam carregadas -->
+<input type="hidden" id="accounts_form_imapDelimiter" value="{imapDelimiter}">
+{error_messages}
+<p>
+   <div align="center">
+		<table width="90%"  border="0">
+			<tr>
+			  <td colspan="2" align="left">
+			  	<div align="right" style="float:right">
+					<form name="back" method="post" action="./index.php?menuaction=reports.uireports_usersgroups.report_usersgroups_group">
+			  	    	<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+			  	    	<input type="button" value="{lang_back}" onClick="document.back.submit()">
+			      </form>
+	            </div>
+			  </td>
+		      <td width="9%" align="left">				  
+				  <div align="right" style="float:left">
+					<form action="./index.php?menuaction=reports.uireports_usersgroups.report_usersgroups_group_print_pdf" method="post" name="pdf" target="_blank">
+				      <input name="button" type="button" onClick="document.pdf.submit()" value="Imprimir">
+				      <input type="hidden" name="setor" value="{sector_name}">
+				      <input type="hidden" name="setordn" value="{sector_namedn}">			
+				      <input type="hidden" name="subtitulo" value="{subtitulo1}">			
+				    </form>		      
+			      </div>
+		  </tr>
+        </table>
+		<table border="0" width="90%">
+			<tr>
+			  <td colspan="3" align="left"><div align="center" class="style1">{subtitulo}</div><br></td>
+	      </tr>
+			<tr>
+			  <td colspan="3" align="left"><div align="center" class="style6">{subtitulo1}</div><br></td>
+	      </tr>
+			<tr>
+			  <td width="25%" align="left"><div align="left" class="style2">{lang_report date}:{data_atual}</div></td>
+		      <td width="60%" align="left">{lang_total_usersgroups}&nbsp;<strong>{cont_usersgroups}</strong></td>
+		      <td width="15%" align="left">
+			  <div align="right" class="style2">{titulo}</div></td>
+		  </tr>
+			<tr>
+			  <td colspan="3" align="left">
+				<table width="100%" border="0" align="center">
+					<tr bgcolor="{th_bg}">
+						<td colspan="2"></td>
+					</tr>
+					<tr>
+				  		<td width="50%">&nbsp;
+						</td>
+				  	    <td width="50%"><div align="right">{lang_page_now}:&nbsp;<strong>{page_now}</strong>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;{lang_total_pages}:&nbsp;<strong>{cont_page}</strong>&nbsp;&nbsp;<br></div></td>
+					</tr>
+			  </table>
+			</td>
+		  </tr>
+		</table>
+   </div>
+ 
+	<div align="center">
+		<table border="0" width="90%">
+			<tr>
+			  <td colspan="3" align="center">{pages}</td>
+		  </tr>
+			<tr bgcolor="{th_bg}">
+				<td width="20%">{lang_report id}</td>
+				<td width="30%">{lang_name}</td>
+				<td width="30%">{lang_report description}</td>
+			</tr>
+			{rows}
+		</table>
+	</div>
+<!-- END body -->
+<!-- BEGIN rowpag -->
+    <b>{paginat}</b>
+<!-- END rowpag -->
+<!-- BEGIN row -->
+	<tr bgcolor="{tr_color}">
+		<td>{row_id}</td>
+		<td>{row_name}</td>
+		<td>{row_description}</td>
+	</tr>
+<!-- END row -->
+<!-- BEGIN row_empty -->
+	<tr>
+		<td colspan="7" align="center"><font color="red"><b>{message}</b></font></td>
+	</tr>
+<!-- END row_empty -->
+</div>
Index: /trunk/reports/templates/default/report_logon_group.tpl
===================================================================
--- /trunk/reports/templates/default/report_logon_group.tpl	(revision 5291)
+++ /trunk/reports/templates/default/report_logon_group.tpl	(revision 5291)
@@ -0,0 +1,165 @@
+<style type="text/css">
+#link a:hover { 
+	background-color:#ffffcc; 
+} 
+.style2 {
+	font-size: 16px;
+	font-family: Arial, Helvetica, sans-serif;
+}
+.style3 {color: #999999}
+</style>
+<!-- BEGIN list -->
+
+<script type="text/javascript">
+function valida(theForm){
+	var digits="0123456789";
+	var temp; 
+	var ok = true;
+
+	for (var i=0;i<theForm.nacesso.value.length;i++){
+		temp=theForm.nacesso.value.substring(i,i+1);
+		if (digits.indexOf(temp)==-1){
+			alert("O campo deve ser preenchido apenas com números!");
+			theForm.nacesso.focus();
+			ok = false;
+			return(false);
+			break;
+		}
+	}
+
+	if (theForm.nacesso.value==0){
+		return true;	
+	}else{
+		if(theForm.nacesso.value < 7){
+			alert("O mínimo para pesquisar e 7 (sete) dias sem acesso.");
+			return false;
+		}	
+	}
+} 
+</script>
+
+<p>
+<div align="center">
+   <table border="0" width="90%">
+    <tr>
+	 	<td align="left">
+			<div align="center" class="style2">{lang_reports_title5}:<br><br>&nbsp;<font color="blue">{context_display}</font><br><br>
+	 	    </div></td>
+ 	 </tr>
+    <tr>
+      <td align="left">
+	  <form method="POST" action="./index.php?menuaction=reports.uireports_logon.report_logon_group">
+  {lang_search}:
+      <select name="organizacaodn">
+     			    {group_name}
+	  </select>
+      &nbsp;&nbsp;&nbsp;<input name="Enviar" type="submit" value="Enviar">
+      &nbsp;&nbsp;&nbsp;<input name="button" type="button" onClick="document.location.href='{back_url}'" value="{lang_back}">
+            </form>
+	  </td>
+     </tr>
+   </table>
+</div>
+ 
+ <div align="center">
+  <table border="0" width="90%">
+	<form  name="org" method="POST" action="./index.php?menuaction=reports.uireports_logon.report_logon_group_setor_print"  onSubmit="javascript:return valida(this);">
+   <tr bgcolor="{th_bg}">
+     <td colspan="3">
+		 <div id="div_nacesso1" style="position: absolute; visibility: hidden; width: 264px; height: 226px; top: 144px; left: 380px; background-color: rgb(238, 238, 238); 	border: 2px solid #999999; z-index: 62; cursor: auto;">
+			<span style="position: relative; width:257px; font-weight: bold; color: #0000FF; z-index: 1; background-color:#CCCCCC" class="undefined">
+				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Números de dias sem acesso&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="./phpgwapi/images/winclose.gif" style="" onClick="document.getElementById('div_nacesso1').style.display = 'none';">
+			</span>
+			<span style="position: absolute; top: 25px; left: 5px; text-align: left; border: 0px solid rgb(153, 153, 153); width: 252px; height: 125px;" id="texto1">
+				<font color="#FF0000"><strong>Atenção:<br>
+			<br> (0) - Zero ou Nulo Mostra todos os usuários.<br><br> (999) - Mostra todos os usuários que nunca acessaram.</strong></font>			</span>
+			<span style="position: absolute; top: 140px; left: 15px; text-align: left; border: 0px solid rgb(153, 153, 153);" id="texto1">
+				<font color="#000000"><strong>Número de dias:</strong></font>
+				<input name="nacesso" type="text" id="nacesso" style="position: absolute; top: -3px; left: 119px; width: 50px;" value="0" maxlength="3">				
+			</span>
+			<input type="submit" style="position: absolute; top: 193px; left: 56px; width: 60px;" value="Enviar" title="Enviar">
+			<input type="button" style="position: absolute; top: 192px; left: 152px; width: 60px;" value="Fechar" onclick="document.getElementById('div_nacesso1').style.display = 'none';" title="Fechar">
+		 </div>
+	 </td>
+   </tr>
+   <tr>
+    	<td width="89%">
+			<div align="center">
+				<font color="#0000FF"><strong><font size="3" face="Arial, Helvetica, sans-serif">
+    		   		<div onClick="document.getElementById('div_nacesso1').style.display = 'block';document.getElementById('div_nacesso1').style.visibility = 'visible';"><a href="#">{organizacao}</a></div>
+    			</font></strong></font>
+			</div>
+		</td>
+        <td width="9%">
+			<div align="right">
+   		   		  <div style="float:left" onClick="document.getElementById('div_nacesso1').style.display = 'block';document.getElementById('div_nacesso1').style.visibility = 'visible';" align="right">
+				  	<font color="#0000FF">
+						<strong>
+							<font size="2" face="Arial, Helvetica, sans-serif">
+								<a href="#">{all_user}</a>
+							</font>
+						</strong>
+					</font>
+				</div>
+					<strong>
+						<font size="2" face="Arial, Helvetica, sans-serif">
+							{total_user}
+						</font>
+					</strong>
+			</div>
+		</td>
+        <td width="2%">
+			<input type="hidden" name="setor" value="{organizacao}">
+			<input type="hidden" name="organizacao" value="{organizacao}">
+			<input type="hidden" name="setordn" value="{organizacaodn}">
+			<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+		</td>
+   </tr>
+	</form>										
+   <tr bgcolor="{th_bg}">
+     <td colspan="3">{lang_groups_names}</td>
+   </tr>
+
+   {rows}
+
+  </table>
+ </div>
+<!-- END list -->
+
+<!-- BEGIN row -->
+   <tr bgcolor="{tr_color}">
+<form name="{formname}" method="POST" action="./index.php?menuaction=reports.uireports_logon.report_logon_group_setor_print" onSubmit="javascript:return valida(this);">
+    <td width="30%">
+		 <div id="{div_nacesso}" style="position: absolute; visibility: hidden; width: 264px; height: 226px; top: 144px; left: 380px; background-color: rgb(238, 238, 238); 	border: 2px solid #999999; z-index: 62; cursor: auto;">
+			<span style="position: relative; width:257px; font-weight: bold; color: #0000FF; z-index: 1; background-color:#CCCCCC" class="undefined">
+				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Números de dias sem acesso&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="./phpgwapi/images/winclose.gif" style="" onClick="document.getElementById('{div_nacesso}').style.display = 'none';">
+			</span>
+			<span style="position: absolute; top: 25px; left: 5px; text-align: left; border: 0px solid rgb(153, 153, 153); width: 252px; height: 125px;" id="texto1">
+				<font color="#FF0000"><strong>Atenção:<br>
+			<br> (0) - Zero ou Nulo Mostra todos os usuários.<br><br> (999) - Mostra todos os usuários que nunca acessaram.</strong></font>			</span>
+			<span style="position: absolute; top: 140px; left: 15px; text-align: left; border: 0px solid rgb(153, 153, 153);" id="texto1">
+				<font color="#000000"><strong>Número de dias:</strong></font>
+				<input name="nacesso" type="text" id="nacesso" style="position: absolute; top: -3px; left: 119px; width: 50px;" value="0" maxlength="3">				
+			</span>
+			<input type="submit" style="position: absolute; top: 193px; left: 56px; width: 60px;" value="Enviar" title="Enviar">
+			<input type="button" style="position: absolute; top: 192px; left: 152px; width: 60px;" value="Fechar" onclick="document.getElementById('{div_nacesso}').style.display = 'none';" title="Fechar">
+			<input type="hidden" name="setor" value="{sector_name}">
+			<input type="hidden" name="organizacao" value="{organizacao}">
+			<input type="hidden" name="setordn" value="{sector_namedn}">
+			<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+			<input type="hidden" name="sectornamedncompleto" value="{sector_namedn_completo}">
+		 </div>
+
+		<div onClick="document.getElementById('{div_nacesso}').style.display = 'block';document.getElementById('{div_nacesso}').style.visibility = 'visible';">
+			<a href="#">{sector_name}</a>
+		</div>
+	</td>
+</form>
+   </tr>
+<!-- END row -->
+
+<!-- BEGIN row_empty -->
+	<tr>
+    	<td colspan="5" align="center"><font color="red"><b>{message}</b></font></td>
+	</tr>
+<!-- END row_empty -->
Index: /trunk/reports/templates/default/report_cota_group.tpl
===================================================================
--- /trunk/reports/templates/default/report_cota_group.tpl	(revision 5291)
+++ /trunk/reports/templates/default/report_cota_group.tpl	(revision 5291)
@@ -0,0 +1,102 @@
+<style type="text/css">
+#link a:hover { 
+	background-color:#ffffcc; 
+} 
+.style2 {
+	font-size: 16px;
+	font-family: Arial, Helvetica, sans-serif;
+}
+.style3 {color: #999999}
+</style>
+<!-- BEGIN list -->
+<p>
+<div align="center">
+   <table border="0" width="90%">
+    <tr>
+	 	<td align="left">
+			<div align="center" class="style2">{lang_reports_title3}:<br>
+			  <br>&nbsp;<font color="blue">{context_display}</font><br><br>
+	 	    </div></td>
+ 	 </tr>
+    <tr>
+      <td align="left"><form method="POST" action="./index.php?menuaction=reports.uireports_cota.report_cota_group">
+  {lang_search}:
+      <select name="organizacaodn">
+     			    {group_name}
+	  </select>
+      &nbsp;&nbsp;&nbsp;<input name="Enviar" type="submit" value="{lang_send}">
+      &nbsp;&nbsp;&nbsp;<input name="button" type="button" onClick="document.location.href='{back_url}'" value="{lang_back}">
+            </form>
+	  </td>
+     </tr>
+   </table>
+</div>
+ 
+ <div align="center">
+  <table border="0" width="90%">
+   <tr>
+	<form  name="org" method="POST" action="./index.php?menuaction=reports.uireports_cota.report_cota_group_setor_print">
+    	<td width="89%">
+			<div align="center">
+				<font color="#0000FF"><strong><font size="3" face="Arial, Helvetica, sans-serif">
+    		   		<div onClick="document.org.submit()"><a href="#">{organizacao}</a></div>
+    			</font></strong></font>
+			</div>
+		</td>
+        <td width="9%">
+			<div align="right">
+   		   		  <div style="float:left" onClick="document.org.submit()" align="right">
+				  	<font color="#0000FF">
+						<strong>
+							<font size="2" face="Arial, Helvetica, sans-serif">
+								<a href="#">{all_user}</a>
+							</font>
+						</strong>
+					</font>
+				</div>
+					<strong>
+						<font size="2" face="Arial, Helvetica, sans-serif">
+							{total_user}
+						</font>
+					</strong>
+			</div>
+		</td>
+        <td width="2%">
+			<input type="hidden" name="setor" value="{organizacao}">
+			<input type="hidden" name="organizacao" value="{organizacao}">
+			<input type="hidden" name="setordn" value="{organizacaodn}">
+			<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+		</td>
+	</form>										
+   </tr>
+   <tr bgcolor="{th_bg}">
+     <td colspan="3">{lang_groups_names}</td>
+   </tr>
+
+   {rows}
+
+  </table>
+ </div>
+<!-- END list -->
+
+<!-- BEGIN row -->
+   <tr bgcolor="{tr_color}">
+<form name="{formname}" method="POST" action="./index.php?menuaction=reports.uireports_cota.report_cota_group_setor_print">
+    <td width="30%">	  <div onClick="{formsubmit}">
+			<a href="#">{sector_name}</a>
+			<input type="hidden" name="setor" value="{sector_name}">
+			<input type="hidden" name="organizacao" value="{organizacao}">
+			<input type="hidden" name="setordn" value="{sector_namedn}">
+			<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+			<input type="hidden" name="sectornamedncompleto" value="{sector_namedn_completo}">			
+		</div>
+	</td>
+</form>
+   </tr>
+<!-- END row -->
+
+<!-- BEGIN row_empty -->
+	<tr>
+    	<td colspan="5" align="center"><font color="red"><b>{message}</b></font></td>
+	</tr>
+<!-- END row_empty -->
Index: /trunk/reports/templates/default/report_logon_group_print.tpl
===================================================================
--- /trunk/reports/templates/default/report_logon_group_print.tpl	(revision 5291)
+++ /trunk/reports/templates/default/report_logon_group_print.tpl	(revision 5291)
@@ -0,0 +1,168 @@
+<!-- BEGIN body -->
+<style type="text/css">
+.myBox
+{
+    margin: 24px 0px 0px 0px;
+    border: 0px solid #ffffff;
+    color: #000000;
+    width: 99%;
+    padding: 20px;
+    text-align: left;
+    background-color: #ffffff;
+    border: 3px solid #ffffff;
+
+
+}
+
+.myBox2
+{
+    margin: 24px 0px 0px 0px;
+    border: 0px solid #ffffff;
+    width: 99%;
+    padding: 5px;
+    text-align: left;
+    background-color: #ECECE5;
+    border: 3px solid #ECECE5;
+}
+
+#loader{
+position:absolute;
+width:100%;
+height:600px;
+}
+
+.info{
+width:100px;
+float:left;
+margin-right:25%;
+margin-top: 300px;
+}
+
+.style1 {
+	font-size: 20px;
+	font-weight: bold;
+	color: #0000FF;
+}
+.style2 {
+	font-size: 18px
+	font-weight: bold;
+}
+.style4 {color: #000000}
+
+.style6 {
+	font-size: 12px;
+	font-weight: bold;
+	color: #0000FF;
+}
+</style>
+ <div id="conteudo"> <!-- Elemento camufla o contéudo até que todas as tags de imagens sejam carregadas -->
+<input type="hidden" id="accounts_form_imapDelimiter" value="{imapDelimiter}">
+{error_messages}
+<p>
+   <div align="center">
+		<table width="90%"  border="0">
+			<tr>
+			  <td colspan="2" align="left">
+			  	<div align="right" style="float:right">
+					<form name="back" method="post" action="./index.php?menuaction=reports.uireports_logon.report_logon_group">
+			  	    	<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+			  	    	<input type="button" value="{lang_back}" onClick="document.back.submit()">
+			      </form>
+	            </div>
+			  </td>
+		      <td width="9%" align="left">				  
+				  <div align="right" style="float:left">
+					<form action="./index.php?menuaction=reports.uireports_logon.report_logon_print_pdf" method="post" name="pdf" target="_blank">
+				      <input name="button" type="button" onClick="document.pdf.submit()" value="Imprimir">
+				      <input type="hidden" name="setor" value="{sector_name}">
+				      <input type="hidden" name="setordn" value="{sector_namedn}">			
+				      <input type="hidden" name="subtitulo" value="{subtitulo1}">
+					  <input type='hidden' name='nacesso' value='{nacesso}'>									  			
+				    </form>		      
+			      </div>
+		  </tr>
+        </table>
+		<table border="0" width="90%">
+			<tr>
+			  <td colspan="3" align="left"><div align="center" class="style1">{subtitulo}</div><br></td>
+	      </tr>
+			<tr>
+			  <td colspan="3" align="left"><div align="center" class="style6">{subtitulo1}</div><br></td>
+	      </tr>
+			<tr>
+			  <td width="25%" align="left"><div align="left" class="style2">{lang_report date}:{data_atual}</div></td>
+		      <td width="60%" align="left">{lang_total_users}&nbsp;<strong>{cont_user}</strong>			  </td>
+		      <td width="15%" align="left">
+			  <div align="right" class="style2">{titulo}</div></td>
+		  </tr>
+			<tr>
+			  <td colspan="3" align="left">
+				<table width="100%" border="0" align="center">
+					<tr bgcolor="{th_bg}">
+						<td colspan="2"></td>
+					</tr>
+					<tr>
+				  		<td width="50%">&nbsp;
+						</td>
+				  	    <td width="50%"><div align="right">{lang_page_now}:&nbsp;<strong>{page_now}</strong>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;{lang_total_pages}:&nbsp;<strong>{cont_page}</strong>&nbsp;&nbsp;<br></div></td>
+					</tr>
+			  </table>
+			</td>
+		  </tr>
+		</table>
+   </div>
+ 
+	<div align="center">
+		<table border="0" width="90%">
+			<tr>
+			  <td colspan="3" align="center">{pages}</td>
+		  </tr>
+			<tr bgcolor="{th_bg}">
+				<td width="15%">{lang_loginid}</td>
+				<td width="20%">{lang_name}</td>
+				<td width="25%">{lang_report email}</td>
+				<td width="10%">{lang_Creation Date}</td>
+				<td width="14%"><div align="center">{lang_Last access}</div></td>
+			    <td width="8%"><div align="center">{lang_Days without login}</div></td>
+			    <td width="8%">{lang_status}</td>
+			</tr>
+			{rows}
+		</table>
+	</div>
+<!-- END body -->
+<!-- BEGIN rowpag -->
+    <b>{paginat}</b>
+<!-- END rowpag -->
+<!-- BEGIN row -->
+	<tr bgcolor="{tr_color}">
+		<form method="post" name="{formname}" action="./index.php?menuaction=reports.uireports_logon.show_access" >
+		<td>{row_loginid}</td>
+		<td>
+			<div onClick="{formsubmit}">			
+				<a href="#">{row_cn}</a>
+				<input name="account_id" type="hidden" value="{row_idnumber}">
+				<input name="nome_usuario" type="hidden" value="{row_cn}">
+				<input type='hidden' name='setor' value='{sector_name}'>
+				<input type='hidden' name='organizacao' value='{organizacao}'>
+				<input type='hidden' name='setordn' value='{sector_namedn}'>
+				<input type='hidden' name='organizacaodn' value='{organizacaodn}'>
+				<input type='hidden' name='page' value='{page}'>
+				<input type='hidden' name='gpage' value='{gpage}'>
+				<input type='hidden' name='nacesso' value='{nacesso}'>				
+				<input type='hidden' name='Psectornamedncompleto' value='{subtitulo1}'>
+			</div>
+		</td>
+		</form>
+		<td>{row_mail}</td>
+		<td><div align="center">{row_timestamp}</div></td>
+		<td><div align="center">{row_li_date}</div></td>
+		<td><div align="center">{row_li_dias}</div></td>
+		<td>{row_status}</td>
+	</tr>
+<!-- END row -->
+<!-- BEGIN row_empty -->
+	<tr>
+		<td colspan="7" align="center"><font color="red"><b>{message}</b></font></td>
+	</tr>
+<!-- END row_empty -->
+</div>
Index: /trunk/reports/templates/default/accesslog.tpl
===================================================================
--- /trunk/reports/templates/default/accesslog.tpl	(revision 5291)
+++ /trunk/reports/templates/default/accesslog.tpl	(revision 5291)
@@ -0,0 +1,45 @@
+<!-- BEGIN body -->
+<p>
+	<div align="center">
+		<table border="0" width="100%">
+			<tr>
+				<td align="left" width="12%">{lang_name}.:&nbsp;<strong>{nome_usuario}</strong></td>
+			    <td align="left" width="13%"><div align="right">
+			      {back_url}
+		        </div></td>
+			</tr>
+		</table>
+	</div>
+ 
+	<div align="center">
+		<table width="100%">
+			<tr bgcolor="{th_bg}" align="center">
+				<td width="20%">{lang_loginid}</td>
+				<td width="20%">{lang_ip_address}</td>
+				<td width="30%">{lang_login}</td>
+				<td width="30%">{lang_logout}</td>
+			</tr>
+			
+			{rows}
+			
+<!-- END body -->
+<!-- BEGIN row -->
+	<tr>
+		<td style="border-bottom:1px solid black">{row_loginid}</td>
+		<td style="border-bottom:1px solid black">{row_ip}</td>
+		<td style="border-bottom:1px solid black">{row_li}</td>
+		<td style="border-bottom:1px solid black">{row_lo}</td>
+	</tr>
+<!-- END row -->
+
+<!-- BEGIN row_empty -->
+	<tr>
+		<td colspan="7" align="center"><font color="red"><b>{message}</b></font></td>
+	</tr>
+<!-- END row_empty -->
+
+	<tr>
+		<td colspan="7" align="right">
+			{back_url}
+		</td>
+	</tr>
Index: /trunk/reports/templates/default/config.tpl
===================================================================
--- /trunk/reports/templates/default/config.tpl	(revision 5291)
+++ /trunk/reports/templates/default/config.tpl	(revision 5291)
@@ -0,0 +1,40 @@
+<!-- BEGIN header -->
+<style type="text/css">
+<!--
+.style1 {color: #0066FF}
+-->
+</style>
+
+<form method="POST" action="{action_url}">
+<table width="100%" border="0" align="center">
+<!-- END header -->
+<!-- BEGIN body -->
+	<tr class="th">
+		<td colspan="3" align="center"><b>{lang_config_global}</b></td>
+	</tr>
+	<tr><td colspan="2"></td></tr>
+
+	<tr class="row_off">
+		<td width="3%" align="center"><span class="style1">1</span></td>
+	    <td width="32%" align="center">{mbstring_value}</td>
+	    <td width="65%" align="left"><span class="style1">&nbsp;{lang_warning_config_global1}</span></td>
+	</tr>
+	<tr class="row_off">
+		<td colspan="3" align="center">&nbsp;</td>
+	</tr>
+	<tr class="row_off">
+		<td colspan="3" align="center">&nbsp;</td>
+	</tr>
+<!-- END body -->
+<!-- BEGIN footer -->
+	<tr class="th">
+		<td colspan="3">&nbsp;</td>
+	</tr>
+	<tr>
+		<td colspan="3" align="center">
+			<input type="submit" name="cancel" value="{lang_cancel}">
+		</td>
+	</tr>
+</table>
+</form>
+<!-- END footer -->
Index: /trunk/reports/templates/default/index.tpl
===================================================================
--- /trunk/reports/templates/default/index.tpl	(revision 5291)
+++ /trunk/reports/templates/default/index.tpl	(revision 5291)
@@ -0,0 +1,53 @@
+<!-- BEGIN body -->
+<style type="text/css">
+<!--
+.style1 {
+	font-family: Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	font-size: large;
+	font-style: italic;
+	color: #0000FF;
+}
+-->
+</style>
+<table width="90%" border="0" cellspacing="10" cellpadding="0" align="center">
+<!-- TODOS OS USUARIOS DO CONTEXTO
+	<tr>
+	  <td width="1%" align="center"><img src='./templates/default/images/user.png'></td>
+	  <td>
+	 	 <a href="../index.php?menuaction=reports.uireports.report_users_print">{lang_rel_user_all}</a>
+	  </td>
+  	</tr>
+-->	
+	<tr>
+	  <td width="1%" align="center"><img src='./templates/default/images/user.png'></td>
+	  <td>
+	 	 <a href="../index.php?menuaction=reports.uireports_users.report_users_group">{lang_rel_user_org}</a>
+	  </td>
+  	</tr>
+	<tr>
+	  <td width="1%" align="center"><img src='./templates/default/images/quota.png'></td>
+	  <td>
+	 	 <a href="../index.php?menuaction=reports.uireports_cota.report_cota_group">{lang_rel_cota_org}</a>
+	  </td>
+  	</tr>
+	<tr>
+	  <td width="1%" align="center"><img src='./templates/default/images/access.png'></td>
+	  <td>
+	 	 <a href="../index.php?menuaction=reports.uireports_logon.report_logon_group">{lang_rel_logon_org}</a>
+	  </td>
+	</tr>
+	<tr>
+	  <td width="1%" align="center"><img src='./templates/default/images/mail_list.png'></td>
+	  <td>
+	 	 <a href="../index.php?menuaction=reports.uireports_maillists.report_maillists_group">{lang_rel_maillists_org}</a>
+	  </td>
+	</tr>
+	<tr>
+	  <td width="1%" align="center"><img src='./templates/default/images/group.png'></td>
+	  <td>
+	 	 <a href="../index.php?menuaction=reports.uireports_usersgroups.report_usersgroups_group">{lang_rel_usersgroups_org}</a>
+	  </td>
+	</tr>		
+</table>
+<!-- END body -->
Index: /trunk/reports/templates/default/report_maillists_group.tpl
===================================================================
--- /trunk/reports/templates/default/report_maillists_group.tpl	(revision 5291)
+++ /trunk/reports/templates/default/report_maillists_group.tpl	(revision 5291)
@@ -0,0 +1,102 @@
+<style type="text/css">
+#link a:hover { 
+	background-color:#ffffcc; 
+} 
+.style2 {
+	font-size: 16px;
+	font-family: Arial, Helvetica, sans-serif;
+}
+.style3 {color: #999999}
+</style>
+<!-- BEGIN list -->
+<p>
+<div align="center">
+   <table border="0" width="90%">
+    <tr>
+	 	<td align="left">
+			<div align="center" class="style2">{lang_reports_title7}:<br><br>&nbsp;<font color="blue">{context_display}</font><br><br>
+	 	    </div></td>
+ 	 </tr>
+    <tr>
+      <td align="left"><form method="POST" action="./index.php?menuaction=reports.uireports_maillists.report_maillists_group">
+  {lang_search}:
+      <select name="organizacaodn">
+     			    {group_name}
+	  </select>
+      &nbsp;&nbsp;&nbsp;<input name="Enviar" type="submit" value="Enviar">
+      &nbsp;&nbsp;&nbsp;<input name="button" type="button" onClick="document.location.href='{back_url}'" value="{lang_back}">
+            </form>
+	  </td>
+     </tr>
+   </table>
+</div>
+ 
+ <div align="center">
+  <table border="0" width="90%">
+   <tr>
+	<form  name="org" method="POST" action="./index.php?menuaction=reports.uireports_maillists.report_maillists_group_print">
+    	<td width="89%">
+			<div align="center">
+				<font color="#0000FF"><strong><font size="3" face="Arial, Helvetica, sans-serif">
+    		   		<div onClick="document.org.submit()"><a href="#">{organizacao}</a></div>
+    			</font></strong></font>
+			</div>
+		</td>
+        <td width="9%">
+			<div align="right">
+   		   		  <div style="float:left" onClick="document.org.submit()" align="right">
+				  	<font color="#0000FF">
+						<strong>
+							<font size="2" face="Arial, Helvetica, sans-serif">
+								<a href="#">{all_maillists}</a>
+							</font>
+						</strong>
+					</font>
+				</div>
+					<strong>
+						<font size="2" face="Arial, Helvetica, sans-serif">
+							{total_maillists}
+						</font>
+					</strong>
+			</div>
+		</td>
+        <td width="2%">
+			<input type="hidden" name="setor" value="{organizacao}">
+			<input type="hidden" name="organizacao" value="{organizacao}">
+			<input type="hidden" name="setordn" value="{organizacaodn}">
+			<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+		</td>
+	</form>										
+   </tr>
+   <tr bgcolor="{th_bg}">
+     <td colspan="3">{lang_groups_names}</td>
+   </tr>
+
+   {rows}
+
+  </table>
+ </div>
+<!-- END list -->
+
+<!-- BEGIN row -->
+   <tr bgcolor="{tr_color}">
+<form name="{formname}" method="POST" action="./index.php?menuaction=reports.uireports_maillists.report_maillists_group_print">
+    <td width="30%">
+		<div onClick="{formsubmit}">
+			<a href="#">{sector_name}</a>
+			<input type="hidden" name="setor" value="{sector_name}">
+			<input type="hidden" name="organizacao" value="{organizacao}">
+			<input type="hidden" name="setordn" value="{sector_namedn}">
+			<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+			<input type="hidden" name="sectornamedncompleto" value="{sector_namedn_completo}">
+		</div>
+	</td>
+</form>
+   </tr>
+<!-- END row -->
+
+<!-- BEGIN row_empty -->
+	<tr>
+    	<td colspan="5" align="center"><font color="red"><b>{message}</b></font></td>
+	</tr>
+<!-- END row_empty -->
Index: /trunk/reports/templates/default/report_users_group.tpl
===================================================================
--- /trunk/reports/templates/default/report_users_group.tpl	(revision 5291)
+++ /trunk/reports/templates/default/report_users_group.tpl	(revision 5291)
@@ -0,0 +1,102 @@
+<style type="text/css">
+#link a:hover { 
+	background-color:#ffffcc; 
+} 
+.style2 {
+	font-size: 16px;
+	font-family: Arial, Helvetica, sans-serif;
+}
+.style3 {color: #999999}
+</style>
+<!-- BEGIN list -->
+<p>
+<div align="center">
+   <table border="0" width="90%">
+    <tr>
+	 	<td align="left">
+			<div align="center" class="style2">{lang_reports_title1}:<br><br>&nbsp;<font color="blue">{context_display}</font><br><br>
+	 	    </div></td>
+ 	 </tr>
+    <tr>
+      <td align="left"><form method="POST" action="./index.php?menuaction=reports.uireports_users.report_users_group">
+  {lang_search}:
+      <select name="organizacaodn">
+     			    {group_name}
+	  </select>
+      &nbsp;&nbsp;&nbsp;<input name="Enviar" type="submit" value="Enviar">
+      &nbsp;&nbsp;&nbsp;<input name="button" type="button" onClick="document.location.href='{back_url}'" value="{lang_back}">
+            </form>
+	  </td>
+     </tr>
+   </table>
+</div>
+ 
+ <div align="center">
+  <table border="0" width="90%">
+   <tr>
+	<form  name="org" method="POST" action="./index.php?menuaction=reports.uireports_users.report_users_group_setor_print">
+    	<td width="89%">
+			<div align="center">
+				<font color="#0000FF"><strong><font size="3" face="Arial, Helvetica, sans-serif">
+    		   		<div onClick="document.org.submit()"><a href="#">{organizacao}</a></div>
+    			</font></strong></font>
+			</div>
+		</td>
+        <td width="9%">
+			<div align="right">
+   		   		  <div style="float:left" onClick="document.org.submit()" align="right">
+				  	<font color="#0000FF">
+						<strong>
+							<font size="2" face="Arial, Helvetica, sans-serif">
+								<a href="#">{all_user}</a>
+							</font>
+						</strong>
+					</font>
+				</div>
+					<strong>
+						<font size="2" face="Arial, Helvetica, sans-serif">
+							{total_user}
+						</font>
+					</strong>
+			</div>
+		</td>
+        <td width="2%">
+			<input type="hidden" name="setor" value="{organizacao}">
+			<input type="hidden" name="organizacao" value="{organizacao}">
+			<input type="hidden" name="setordn" value="{organizacaodn}">
+			<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+		</td>
+	</form>										
+   </tr>
+   <tr bgcolor="{th_bg}">
+     <td colspan="3">{lang_groups_names}</td>
+   </tr>
+
+   {rows}
+
+  </table>
+ </div>
+<!-- END list -->
+
+<!-- BEGIN row -->
+   <tr bgcolor="{tr_color}">
+<form name="{formname}" method="POST" action="./index.php?menuaction=reports.uireports_users.report_users_group_setor_print">
+    <td width="30%">
+		<div onClick="{formsubmit}">
+			<a href="#">{sector_name}</a>
+			<input type="hidden" name="setor" value="{sector_name}">
+			<input type="hidden" name="organizacao" value="{organizacao}">
+			<input type="hidden" name="setordn" value="{sector_namedn}">
+			<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+			<input type="hidden" name="sectornamedncompleto" value="{sector_namedn_completo}">
+		</div>
+	</td>
+</form>
+   </tr>
+<!-- END row -->
+
+<!-- BEGIN row_empty -->
+	<tr>
+    	<td colspan="5" align="center"><font color="red"><b>{message}</b></font></td>
+	</tr>
+<!-- END row_empty -->
Index: /trunk/reports/templates/default/report_users_print.tpl
===================================================================
--- /trunk/reports/templates/default/report_users_print.tpl	(revision 5291)
+++ /trunk/reports/templates/default/report_users_print.tpl	(revision 5291)
@@ -0,0 +1,121 @@
+<!-- BEGIN body -->
+<style type="text/css">
+.myBox
+{
+    margin: 24px 0px 0px 0px;
+    border: 0px solid #ffffff;
+    color: #000000;
+    width: 99%;
+    padding: 20px;
+    text-align: left;
+    background-color: #ffffff;
+    border: 3px solid #ffffff;
+
+
+}
+
+.myBox2
+{
+    margin: 24px 0px 0px 0px;
+    border: 0px solid #ffffff;
+    width: 99%;
+    padding: 5px;
+    text-align: left;
+    background-color: #ECECE5;
+    border: 3px solid #ECECE5;
+}
+
+#loader{
+position:absolute;
+width:100%;
+height:600px;
+}
+
+.info{
+width:100px;
+float:left;
+margin-right:25%;
+margin-top: 300px;
+}
+
+.style1 {
+	font-size: 20px;
+	font-weight: bold;
+	color: #0000FF;
+}
+.style2 {
+	font-size: 18px
+	font-weight: bold;
+}
+.style4 {color: #000000}
+</style>
+ <div id="conteudo"> <!-- Elemento camufla o contéudo até que todas as tags de imagens sejam carregadas -->
+<input type="hidden" id="accounts_form_imapDelimiter" value="{imapDelimiter}">
+{error_messages}
+<p>
+   <div align="center">
+		<table border="0" width="90%">
+			<tr>
+			  <td colspan="2" align="left">
+				<div align="left" class="style1">{lang_reports title1}:&nbsp;{context_display}</div>
+				<br>
+		      </td>
+			  <td width="28%" align="left">
+			  	<div align="right">
+				<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
+				&nbsp;
+				<input type="button" value="Imprimir" onClick="document.location.href='./index.php?menuaction=reports.uireports.report_users_print_pdf'">
+			    </div></td>
+			</tr>
+			<tr>
+			  <td width="26%" align="left"><div align="left" class="style2">{lang_report date}:{data_atual}</div></td>
+		      <td align="left">{lang_total_users}&nbsp;<strong>{cont_user}</strong>			  </td>
+		      <td width="28%" align="left">
+			  <div align="right" class="style2">{titulo}</div></td>
+		  </tr>
+			<tr>
+			  <td colspan="3" align="left">
+				<table width="100%" border="0" align="center">
+					<tr bgcolor="{th_bg}">
+						<td colspan="2"></td>
+					</tr>
+					<tr>
+				  		<td width="50%">&nbsp;
+						</td>
+				  	    <td width="50%"><div align="right">{lang_page_now}:&nbsp;<strong>{page_now}</strong>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;{lang_total_pages}:&nbsp;<strong>{cont_page}</strong>&nbsp;&nbsp;<br></div></td>
+					</tr>
+					<tr>
+						<td colspan="2"></td>
+				  </tr>
+			  </table>			</td>
+		  </tr>
+		</table>
+   </div>
+ 
+	<div align="center">
+		<table border="0" width="90%">
+			<tr bgcolor="{th_bg}">
+				<td width="20%">{lang_loginid}</td>
+				<td width="30%">{lang_name}</td>
+				<td width="30%">{lang_report email}</td>
+			</tr>
+			{rows}
+		</table>
+	</div>
+<!-- END body -->
+<!-- BEGIN rowpag -->
+	<b>{paginat}</b>
+<!-- END rowpag -->
+<!-- BEGIN row -->
+	<tr bgcolor="{tr_color}">
+		<td>{row_loginid}</td>
+		<td>{row_cn}</td>
+		<td>{row_mail}</td>
+	</tr>
+<!-- END row -->
+<!-- BEGIN row_empty -->
+	<tr>
+		<td colspan="7" align="center"><font color="red"><b>{message}</b></font></td>
+	</tr> 
+	<!-- END row_empty -->
+</div>
Index: /trunk/reports/templates/default/report_usersgroups_group.tpl
===================================================================
--- /trunk/reports/templates/default/report_usersgroups_group.tpl	(revision 5291)
+++ /trunk/reports/templates/default/report_usersgroups_group.tpl	(revision 5291)
@@ -0,0 +1,102 @@
+<style type="text/css">
+#link a:hover { 
+	background-color:#ffffcc; 
+} 
+.style2 {
+	font-size: 16px;
+	font-family: Arial, Helvetica, sans-serif;
+}
+.style3 {color: #999999}
+</style>
+<!-- BEGIN list -->
+<p>
+<div align="center">
+   <table border="0" width="90%">
+    <tr>
+	 	<td align="left">
+			<div align="center" class="style2">{lang_reports_title7}:<br><br>&nbsp;<font color="blue">{context_display}</font><br><br>
+	 	    </div></td>
+ 	 </tr>
+    <tr>
+      <td align="left"><form method="POST" action="./index.php?menuaction=reports.uireports_usersgroups.report_usersgroups_group">
+  {lang_search}:
+      <select name="organizacaodn">
+     			    {group_name}
+	  </select>
+      &nbsp;&nbsp;&nbsp;<input name="Enviar" type="submit" value="Enviar">
+      &nbsp;&nbsp;&nbsp;<input name="button" type="button" onClick="document.location.href='{back_url}'" value="{lang_back}">
+            </form>
+	  </td>
+     </tr>
+   </table>
+</div>
+ 
+ <div align="center">
+  <table border="0" width="90%">
+   <tr>
+	<form  name="org" method="POST" action="./index.php?menuaction=reports.uireports_usersgroups.report_usersgroups_group_print">
+    	<td width="89%">
+			<div align="center">
+				<font color="#0000FF"><strong><font size="3" face="Arial, Helvetica, sans-serif">
+    		   		<div onClick="document.org.submit()"><a href="#">{organizacao}</a></div>
+    			</font></strong></font>
+			</div>
+		</td>
+        <td width="9%">
+			<div align="right">
+   		   		  <div style="float:left" onClick="document.org.submit()" align="right">
+				  	<font color="#0000FF">
+						<strong>
+							<font size="2" face="Arial, Helvetica, sans-serif">
+								<a href="#">{all_usersgroups}</a>
+							</font>
+						</strong>
+					</font>
+				</div>
+					<strong>
+						<font size="2" face="Arial, Helvetica, sans-serif">
+							{total_usersgroups}
+						</font>
+					</strong>
+			</div>
+		</td>
+        <td width="2%">
+			<input type="hidden" name="setor" value="{organizacao}">
+			<input type="hidden" name="organizacao" value="{organizacao}">
+			<input type="hidden" name="setordn" value="{organizacaodn}">
+			<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+		</td>
+	</form>										
+   </tr>
+   <tr bgcolor="{th_bg}">
+     <td colspan="3">{lang_groups_names}</td>
+   </tr>
+
+   {rows}
+
+  </table>
+ </div>
+<!-- END list -->
+
+<!-- BEGIN row -->
+   <tr bgcolor="{tr_color}">
+<form name="{formname}" method="POST" action="./index.php?menuaction=reports.uireports_usersgroups.report_usersgroups_group_print">
+    <td width="30%">
+		<div onClick="{formsubmit}">
+			<a href="#">{sector_name}</a>
+			<input type="hidden" name="setor" value="{sector_name}">
+			<input type="hidden" name="organizacao" value="{organizacao}">
+			<input type="hidden" name="setordn" value="{sector_namedn}">
+			<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+			<input type="hidden" name="sectornamedncompleto" value="{sector_namedn_completo}">
+		</div>
+	</td>
+</form>
+   </tr>
+<!-- END row -->
+
+<!-- BEGIN row_empty -->
+	<tr>
+    	<td colspan="5" align="center"><font color="red"><b>{message}</b></font></td>
+	</tr>
+<!-- END row_empty -->
Index: /trunk/reports/templates/default/access_denied.tpl
===================================================================
--- /trunk/reports/templates/default/access_denied.tpl	(revision 5291)
+++ /trunk/reports/templates/default/access_denied.tpl	(revision 5291)
@@ -0,0 +1,10 @@
+<!-- BEGIN main -->
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+	<tr>
+  		<td align="center"><font size="3" color="red"><b>{lang_access_denied}<b></font></td>
+  	</tr>
+	<tr>
+		<td align="center"><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"><td>
+	</tr>
+</table>
+<!-- END main -->
Index: /trunk/reports/templates/default/report_cota_group_print.tpl
===================================================================
--- /trunk/reports/templates/default/report_cota_group_print.tpl	(revision 5291)
+++ /trunk/reports/templates/default/report_cota_group_print.tpl	(revision 5291)
@@ -0,0 +1,152 @@
+<!-- BEGIN body -->
+<style type="text/css">
+.myBox
+{
+    margin: 24px 0px 0px 0px;
+    border: 0px solid #ffffff;
+    color: #000000;
+    width: 99%;
+    padding: 20px;
+    text-align: left;
+    background-color: #ffffff;
+    border: 3px solid #ffffff;
+
+
+}
+
+.myBox2
+{
+    margin: 24px 0px 0px 0px;
+    border: 0px solid #ffffff;
+    width: 99%;
+    padding: 5px;
+    text-align: left;
+    background-color: #ECECE5;
+    border: 3px solid #ECECE5;
+}
+
+#loader{
+position:absolute;
+width:100%;
+height:600px;
+}
+
+.info{
+width:100px;
+float:left;
+margin-right:25%;
+margin-top: 300px;
+}
+
+.style1 {
+	font-size: 20px;
+	font-weight: bold;
+	color: #0000FF;
+}
+.style2 {
+	font-size: 18px
+	font-weight: bold;
+}
+.style4 {color: #000000}
+
+.style6 {
+	font-size: 12px;
+	font-weight: bold;
+	color: #0000FF;
+}
+
+</style>
+ <div id="conteudo"> <!-- Elemento camufla o contéudo até que todas as tags de imagens sejam carregadas -->
+<input type="hidden" id="accounts_form_imapDelimiter" value="{imapDelimiter}">
+{error_messages}
+<p>
+   <div align="center">
+		<table width="90%"  border="0">
+			<tr>
+			  <td colspan="2" align="left">
+			  	<div align="right" style="float:right">
+					<form name="back" method="post" action="./index.php?menuaction=reports.uireports_cota.report_cota_group">
+			  	    	<input type="hidden" name="organizacaodn" value="{organizacaodn}">
+			  	    	<input type="button" value="{lang_back}" onClick="document.back.submit()">
+			      </form>
+	            </div>
+			  </td>
+		      <td width="9%" align="left">				  
+				  <div align="right" style="float:left">
+					<form action="./index.php?menuaction=reports.uireports_cota.report_users_cota_print_pdf" method="post" name="pdf" target="_blank">
+				      <input name="button" type="button" onClick="document.pdf.submit()" value="{lang_print}">
+				      <input type="hidden" name="setor" value="{sector_name}">
+				      <input type="hidden" name="setordn" value="{sector_namedn}">		
+				      <input type="hidden" name="subtitulo" value="{subtitulo1}">								  	
+				    </form>		      
+			      </div>
+		  </tr>
+        </table>
+		<table border="0" width="90%">
+			<tr>
+			  <td colspan="5" align="center"><div align="center" class="style1">{subtitulo}</div><br></td>
+	      </tr>
+			<tr>
+			  <td colspan="5" align="center"><div align="center" class="style6">{subtitulo1}</div><br></td>
+	      </tr>
+			<tr>
+			  <td width="25%" align="left"><div align="left" class="style2">{lang_report date}:{data_atual}</div></td>
+		      <td width="60%" colspan="2" align="left">{lang_total_users}&nbsp;<strong>{cont_user}</strong>			  </td>
+		      <td width="15%" colspan="2" align="left">
+			  <div align="right" class="style2">{titulo}</div></td>
+		  </tr>
+			<tr>
+			  <td colspan="5" align="left">
+				<table width="100%" border="0" align="center">
+					<tr bgcolor="{th_bg}">
+						<td colspan="2"></td>
+					</tr>
+					<tr>
+				  		<td width="50%">&nbsp;
+						</td>
+				  	    <td width="50%"><div align="right">{lang_page_now}:&nbsp;<strong>{page_now}</strong>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;{lang_total_pages}:&nbsp;<strong>{cont_page}</strong>&nbsp;&nbsp;<br></div></td>
+					</tr>
+			  </table>
+			</td>
+		  </tr>
+		</table>
+   </div>
+ 
+	<div align="center">
+		<table border="0" width="90%">
+			<tr>
+			  <td colspan="3" align="center">{pages}</td>
+		  </tr>
+			<tr bgcolor="{th_bg}">
+				<td width="15%">{lang_loginid}</td>
+				<td width="20%">{lang_name}</td>
+				<td width="25%">{lang_report email}</td>				
+				<td width="8%" align="center">{lang_cota}</td>
+				<td width="10%" align="center">{lang_cota_used}</td>
+				<td width="12%" align="center">{lang_percent_cota}</td>
+				<td width="10%" align="center">{lang_status}</td>
+			</tr>
+			{rows}
+		</table>
+	</div>
+<!-- END body -->
+<!-- BEGIN rowpag -->
+    <b>{paginat}</b>
+<!-- END rowpag -->
+<!-- BEGIN row -->
+	<tr bgcolor="{tr_color}">
+		<td>{row_loginid}</td>
+		<td>{row_cn}</td>
+		<td>{row_mail}</td>
+		<td align="right">{mailquota}</td>
+		<td align="right">{mailquota_used}</td>
+		<td align="right">{percent_cota}</td>
+		<td align="center">{row_status}</td>
+	</tr>
+<!-- END row -->
+<!-- BEGIN row_empty -->
+	<tr>
+		<td colspan="7" align="center"><font color="red"><b>{message}</b></font></td>
+	</tr>
+<!-- END row_empty -->
+</div>
