Fix: Info tab was wrong with interventions
This commit is contained in:
parent
190dabc3f7
commit
223e50276c
@ -205,13 +205,15 @@ function dol_print_object_info($object)
|
||||
print $langs->trans("CreatedBy").': ';
|
||||
if (is_object($object->user_creation))
|
||||
{
|
||||
print $object->user_creation->getNomUrl(1);
|
||||
if ($object->user_creation->id) print $object->user_creation->getNomUrl(1);
|
||||
else print $langs->trans("Unknown");
|
||||
}
|
||||
else
|
||||
{
|
||||
$userstatic=new User($db);
|
||||
$userstatic->fetch($object->user_creation);
|
||||
print $userstatic->getNomUrl(1);
|
||||
if ($userstatic->id) print $userstatic->getNomUrl(1);
|
||||
else print $langs->trans("Unknown");
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
@ -230,13 +232,15 @@ function dol_print_object_info($object)
|
||||
print $langs->trans("ModifiedBy").': ';
|
||||
if (is_object($object->user_modification))
|
||||
{
|
||||
print $object->user_modification->getNomUrl(1);
|
||||
if ($object->user_modification->id) print $object->user_modification->getNomUrl(1);
|
||||
else print $langs->trans("Unknown");
|
||||
}
|
||||
else
|
||||
{
|
||||
$userstatic=new User($db);
|
||||
$userstatic->fetch($object->user_modification);
|
||||
print $userstatic->getNomUrl(1);
|
||||
if ($userstatic->id) print $userstatic->getNomUrl(1);
|
||||
else print $langs->trans("Unknown");
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
@ -255,13 +259,15 @@ function dol_print_object_info($object)
|
||||
print $langs->trans("ValidatedBy").': ';
|
||||
if (is_object($object->user_validation))
|
||||
{
|
||||
print $object->user_validation->getNomUrl(1);
|
||||
if ($object->user_validation->id) print $object->user_validation->getNomUrl(1);
|
||||
else print $langs->trans("Unknown");
|
||||
}
|
||||
else
|
||||
{
|
||||
$userstatic=new User($db);
|
||||
$userstatic->fetch($object->user_validation);
|
||||
print $userstatic->getNomUrl(1);
|
||||
if ($userstatic->id) print $userstatic->getNomUrl(1);
|
||||
else print $langs->trans("Unknown");
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
@ -280,13 +286,15 @@ function dol_print_object_info($object)
|
||||
print $langs->trans("ApprovedBy").': ';
|
||||
if (is_object($object->user_approve))
|
||||
{
|
||||
print $object->user_approve->getNomUrl(1);
|
||||
if ($object->user_approve->id) print $object->user_approve->getNomUrl(1);
|
||||
else print $langs->trans("Unknown");
|
||||
}
|
||||
else
|
||||
{
|
||||
$userstatic=new User($db);
|
||||
$userstatic->fetch($object->user_approve);
|
||||
print $userstatic->getNomUrl(1);
|
||||
if ($userstatic->id) print $userstatic->getNomUrl(1);
|
||||
else print $langs->trans("Unknown");
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
@ -305,13 +313,15 @@ function dol_print_object_info($object)
|
||||
print $langs->trans("ClosedBy").': ';
|
||||
if (is_object($object->user_cloture))
|
||||
{
|
||||
print $object->user_cloture->getNomUrl(1);
|
||||
if ($object->user_cloture->id) print $object->user_cloture->getNomUrl(1);
|
||||
else print $langs->trans("Unknown");
|
||||
}
|
||||
else
|
||||
{
|
||||
$userstatic=new User($db);
|
||||
$userstatic->fetch($object->user_cloture);
|
||||
print $userstatic->getNomUrl(1);
|
||||
if ($userstatic->id) print $userstatic->getNomUrl(1);
|
||||
else print $langs->trans("Unknown");
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
@ -330,13 +340,15 @@ function dol_print_object_info($object)
|
||||
print $langs->trans("ConciliatedBy").': ';
|
||||
if (is_object($object->user_rappro))
|
||||
{
|
||||
print $object->user_rappro->getNomUrl(1);
|
||||
if ($object->user_rappro->id) print $object->user_rappro->getNomUrl(1);
|
||||
else print $langs->trans("Unknown");
|
||||
}
|
||||
else
|
||||
{
|
||||
$userstatic=new User($db);
|
||||
$userstatic->fetch($object->user_rappro);
|
||||
print $userstatic->getNomUrl(1);
|
||||
if ($userstatic->id) print $userstatic->getNomUrl(1);
|
||||
else print $langs->trans("Unknown");
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
@ -607,9 +607,9 @@ class Fichinter extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Information sur l'objet fiche intervention
|
||||
* Load information on object
|
||||
*
|
||||
* @param int $id Id de la fiche d'intervention
|
||||
* @param int $id Id of object
|
||||
* @return void
|
||||
*/
|
||||
function info($id)
|
||||
@ -625,13 +625,12 @@ class Fichinter extends CommonObject
|
||||
$sql.= " WHERE f.rowid = ".$id;
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
if ($result)
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->num_rows($result))
|
||||
if ($this->db->num_rows($resql))
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
|
||||
@ -649,7 +648,7 @@ class Fichinter extends CommonObject
|
||||
$this->user_validation = $vuser;
|
||||
}
|
||||
}
|
||||
$this->db->free($result);
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2009-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -31,32 +31,36 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
|
||||
$langs->load('companies');
|
||||
$langs->load("interventions");
|
||||
|
||||
$fichinterid = GETPOST('id','int');
|
||||
$id = GETPOST('id','int');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
|
||||
|
||||
$object = new Fichinter($db);
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
$object->fetch($id);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$fichinter = new Fichinter($db);
|
||||
$fichinter->fetch($fichinterid);
|
||||
|
||||
$societe = new Societe($db);
|
||||
$societe->fetch($fichinter->socid);
|
||||
$societe->fetch($object->socid);
|
||||
|
||||
$head = fichinter_prepare_head($fichinter);
|
||||
$head = fichinter_prepare_head($object);
|
||||
dol_fiche_head($head, 'info', $langs->trans('InterventionCard'), 0, 'intervention');
|
||||
|
||||
$fichinter->info($fichinter->id);
|
||||
$object->info($object->id);
|
||||
|
||||
print '<table width="100%"><tr><td>';
|
||||
dol_print_object_info($fichinter);
|
||||
dol_print_object_info($object);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user