You are not logged in.
Pages: 1
Hello guys,
I have a big problem. I need to put my GLPI to print to PDF but I can not in version 84.5 .
I had the 80.4 version and it worked normal.
what happens is that when I put the javascript code in my code , all this disappears below it . Examples: buttons and the remainder of the form. all the code after some javascript . have any more that must be done to run the javascript? following the below codes to use :
?>
<SCRIPT LANGUAGE="JavaScript">
function chamaRelatorio(){
<?php
//print_r (get_defined_vars());
//echo $entdata->fields["address"];
// pega o primeiro tecnico
$resultado= mysql_query("SELECT `users_id`
FROM `glpi_tickets_users`
WHERE `tickets_id` = ".$ID."
AND `TYPE` =2");
$tecnico= mysql_result($resultado,0,"users_id");
//print_r ($tecnico);
//print_r ($resultado);
// pega o endereco
$consulta1=mysql_query("SELECT E.address
FROM `glpi_tickets` T
inner join `glpi_entitydatas` E on E.entities_id = T.entities_id
WHERE T.id = ".$ID."");
$endereco=mysql_result($consulta1,0,"address");
?>;
var ID = <?php echo $ID ?>;
var NomeAbertura = <?php echo "'".getUserName($this->fields["users_id_recipient"])."'" ?>;
var Local = <?php echo "'".Dropdown::getDropdownName('glpi_entities',$this->fields['entities_id']) . "'" ?>;
var TipoSolucao = <?php echo "'".Dropdown::getDropdownName('glpi_ticketsolutiontypes',$this->getField('ticketsolutiontypes_id')). "'"?>;
var Urgencia = <?php echo $this->fields["urgency"] ?>;
var Prioridade = <?php echo $this->fields["impact"]?>;
var Impacto = <?php echo $this->fields["priority"]?>;
var DataAbertura = <?php echo "'".$this->fields["date"]."'"?>;
var DataSolucao = <?php echo "'".$this->fields["solvedate"]."'"?>;
var DataVencimento = <?php echo "'".$this->fields["due_date"]."'"?>;
var DescricaoProb = <?php echo "'".$params['data']."'"?>;
var DescSolucao = <?php echo "'".rawurlencode(strip_tags(unclean_cross_side_scripting_deep(str_replace(' ','',$this->getField('solution')))))."'"?>;
var Solicitante = <?php echo "'".getUserName($dev_user_id)."'"?>;
var Tecnico = <?php echo "'".getUserName($tecnico)."'"?>;
var Endereco = <?php echo "'".rawurlencode($endereco)."'"?>;
if(Urgencia == 1){
Urgencia = 'Muito Baixa';
}else if(Urgencia == 2){
Urgencia = 'Baixa';
}else if(Urgencia == 3){
Urgencia = 'Media';
}else if(Urgencia == 4){
Urgencia = 'Alta';
}else if(Urgencia == 5){
Urgencia = 'Muito Alta';
}
if(Prioridade == 1){
Prioridade = 'Muito Baixa';
}else if(Prioridade == 2){
Prioridade = 'Baixa';
}else if(Prioridade == 3){
Prioridade = 'Media';
}else if(Prioridade == 4){
Prioridade = 'Alta';
}else if(Prioridade == 5){
Prioridade = 'Muito Alta';
}
if(Impacto == 1){
Impacto = 'Muito Baixa';
}else if(Impacto == 2){
Impacto = 'Baixa';
}else if(Impacto == 3){
Impacto = 'Media';
}else if(Impacto == 4){
Impacto = 'Alta';
}else if(Impacto == 5){
Impacto = 'Muito Alta';
}
window.open('imp/un_relchamado.php?ID='+ID+'&Urgencia='+Urgencia+'&Prioridade='+Prioridade+'&Impacto='+Impacto+'&NomeAbertura='+NomeAbertura+'&DataAbertura='+DataAbertura+'&DataVencimento='+DataVencimento+'&DataSolucao='+DataSolucao+'&TipoSolucao='+TipoSolucao+'&Local='+Local+'&Solicitante='+Solicitante+'&Tecnico='+Tecnico+'&Endereco='+Endereco+'&DescSolucao='+DescSolucao+'&DescricaoProb='+DescricaoProb,'Pagina', 'STATUS=NO, TOOLBAR=NO, LOCATION=NO, DIRECTORIES=NO, RESIZABLE=YES, SCROLLBARS=YES');
}
</SCRIPT>
<?php
Offline
I don't understand your problem.
You have problem with PDF plugin?
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
Yes. in PDF
the code deletes everything after . the code:
unclean_cross_side_scripting_deep
Offline
Pages: 1