Suppression TODO

This commit is contained in:
Laurent Destailleur 2007-11-28 21:15:25 +00:00
parent aedddbff03
commit c7ea48fdb4

View File

@ -41,7 +41,7 @@ class Fichinter extends CommonObject
var $id; var $id;
var $socid; // Id client var $socid; // Id client
var $client; // Objet societe client (à charger par fetch_client) var $client; // Objet societe client (<EFBFBD> charger par fetch_client)
var $author; var $author;
var $ref; var $ref;
@ -57,7 +57,7 @@ class Fichinter extends CommonObject
/** /**
* \brief Constructeur de la classe * \brief Constructeur de la classe
* \param DB Handler accès base de données * \param DB Handler acc<EFBFBD>s base de donn<EFBFBD>es
* \param socid Id societe * \param socid Id societe
*/ */
function Fichinter($DB, $socid="") function Fichinter($DB, $socid="")
@ -69,7 +69,7 @@ class Fichinter extends CommonObject
$this->products = array(); $this->products = array();
$this->projet_id = 0; $this->projet_id = 0;
// Statut 0=brouillon, 1=validé // Statut 0=brouillon, 1=valid<EFBFBD>
$this->statuts[0]=$langs->trans("Draft"); $this->statuts[0]=$langs->trans("Draft");
$this->statuts[1]=$langs->trans("Validated"); $this->statuts[1]=$langs->trans("Validated");
$this->statuts_short[0]=$langs->trans("Draft"); $this->statuts_short[0]=$langs->trans("Draft");
@ -78,7 +78,7 @@ class Fichinter extends CommonObject
/* /*
* \brief Crée une fiche intervention en base * \brief Cr<EFBFBD>e une fiche intervention en base
* \return int <0 if KO, >0 if OK * \return int <0 if KO, >0 if OK
*/ */
function create() function create()
@ -95,7 +95,7 @@ class Fichinter extends CommonObject
$this->db->begin(); $this->db->begin();
// on vérifie si la ref n'est pas utilisée // on v<EFBFBD>rifie si la ref n'est pas utilis<69>e
$soc = new Societe($this->db); $soc = new Societe($this->db);
$result=$soc->fetch($this->socid); $result=$soc->fetch($this->socid);
$this->verifyNumRef($soc); $this->verifyNumRef($soc);
@ -163,8 +163,8 @@ class Fichinter extends CommonObject
} }
/** /**
* \brief Charge en mémoire la fiche intervention * \brief Charge en m<EFBFBD>moire la fiche intervention
* \param rowid Id de la fiche à charger * \param rowid Id de la fiche <EFBFBD> charger
* \return int <0 si ko, >0 si ok * \return int <0 si ko, >0 si ok
*/ */
function fetch($rowid) function fetch($rowid)
@ -240,8 +240,8 @@ class Fichinter extends CommonObject
} }
/** /**
* \brief Retourne le libellé du statut de l'intervantion * \brief Retourne le libell<EFBFBD> du statut de l'intervantion
* \return string Libellé * \return string Libell<EFBFBD>
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
@ -249,9 +249,9 @@ class Fichinter extends CommonObject
} }
/** /**
* \brief Renvoi le libellé d'un statut donné * \brief Renvoi le libell<EFBFBD> d'un statut donn<EFBFBD>
* \param statut id statut * \param statut id statut
* \return string Libellé * \return string Libell<EFBFBD>
*/ */
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {
@ -312,7 +312,7 @@ class Fichinter extends CommonObject
} }
/** /**
* \brief Vérifie si la ref n'est pas déjà utilisée * \brief V<EFBFBD>rifie si la ref n'est pas d<EFBFBD>j<EFBFBD> utilis<EFBFBD>e
* \param soc objet societe * \param soc objet societe
*/ */
function verifyNumRef($soc) function verifyNumRef($soc)
@ -333,8 +333,8 @@ class Fichinter extends CommonObject
/** /**
* \brief Renvoie la référence de fiche intervention suivante non utilisée en fonction du module * \brief Renvoie la r<EFBFBD>f<EFBFBD>rence de fiche intervention suivante non utilis<EFBFBD>e en fonction du module
* de numérotation actif défini dans FICHEINTER_ADDON * de num<EFBFBD>rotation actif d<EFBFBD>fini dans FICHEINTER_ADDON
* \param soc objet societe * \param soc objet societe
* \return string reference libre pour la fiche intervention * \return string reference libre pour la fiche intervention
*/ */
@ -349,7 +349,7 @@ class Fichinter extends CommonObject
{ {
$file = FICHEINTER_ADDON.".php"; $file = FICHEINTER_ADDON.".php";
// Chargement de la classe de numérotation // Chargement de la classe de num<EFBFBD>rotation
$classname = FICHEINTER_ADDON; $classname = FICHEINTER_ADDON;
require_once($dir.$file); require_once($dir.$file);
@ -376,7 +376,7 @@ class Fichinter extends CommonObject
} }
/** /**
* \brief Mets à jour les commentaires publiques et privés * \brief Mets <EFBFBD> jour les commentaires publiques et priv<EFBFBD>s
* \param note Commentaire * \param note Commentaire
* \param type Type de note * \param type Type de note
* \return int <0 si ko, >0 si ok * \return int <0 si ko, >0 si ok
@ -453,7 +453,7 @@ class Fichinter extends CommonObject
{ {
if ($user->rights->ficheinter->creer) if ($user->rights->ficheinter->creer)
{ {
//verif que le projet et la société concordent //verif que le projet et la soci<EFBFBD>t<EFBFBD> concordent
$sql = 'SELECT p.rowid, p.title FROM '.MAIN_DB_PREFIX.'projet as p WHERE p.fk_soc ='.$this->socid.' AND p.rowid='.$project_id; $sql = 'SELECT p.rowid, p.title FROM '.MAIN_DB_PREFIX.'projet as p WHERE p.fk_soc ='.$this->socid.' AND p.rowid='.$project_id;
$sqlres = $this->db->query($sql); $sqlres = $this->db->query($sql);
if ($sqlres) if ($sqlres)
@ -490,7 +490,7 @@ class Fichinter extends CommonObject
if ( $this->db->query($sql) ) if ( $this->db->query($sql) )
{ {
// On efface le répertoire du pdf // On efface le r<EFBFBD>pertoire du pdf
$fichinterref = sanitize_string($this->ref); $fichinterref = sanitize_string($this->ref);
if ($conf->fichinter->dir_output) if ($conf->fichinter->dir_output)
{ {
@ -531,7 +531,7 @@ class Fichinter extends CommonObject
} }
/** /**
* \brief Définit une date de livraison du bon d'intervention * \brief D<EFBFBD>finit une date de livraison du bon d'intervention
* \param user Objet utilisateur qui modifie * \param user Objet utilisateur qui modifie
* \param date_creation date de livraison * \param date_creation date de livraison
* \return int <0 si ko, >0 si ok * \return int <0 si ko, >0 si ok
@ -559,7 +559,7 @@ class Fichinter extends CommonObject
} }
/** /**
* \brief Définit le label de l'intervention * \brief D<EFBFBD>finit le label de l'intervention
* \param user Objet utilisateur qui modifie * \param user Objet utilisateur qui modifie
* \param description description * \param description description
* \return int <0 si ko, >0 si ok * \return int <0 si ko, >0 si ok
@ -591,7 +591,7 @@ class Fichinter extends CommonObject
* \param fichinterid Id de la fiche d'intervention * \param fichinterid Id de la fiche d'intervention
* \param desc Description de la ligne * \param desc Description de la ligne
* \param date_intervention Date de l'intervention * \param date_intervention Date de l'intervention
* \param duration Durée de l'intervention * \param duration Dur<EFBFBD>e de l'intervention
* \return int >0 si ok, <0 si ko * \return int >0 si ok, <0 si ko
*/ */
function addline($fichinterid, $desc, $date_intervention, $duration) function addline($fichinterid, $desc, $date_intervention, $duration)
@ -629,7 +629,7 @@ class Fichinter extends CommonObject
/** /**
* \brief Supprime une ligne d'intervention * \brief Supprime une ligne d'intervention
* \param idligne Id de la ligne detail à supprimer * \param idligne Id de la ligne detail <EFBFBD> supprimer
* \return int >0 si ok, <0 si ko * \return int >0 si ok, <0 si ko
*/ */
function delete_line($idligne) function delete_line($idligne)
@ -640,7 +640,7 @@ class Fichinter extends CommonObject
if ($this->db->query($sql) ) if ($this->db->query($sql) )
{ {
//Todo : faire un update du total de la durée //Todo : faire un update du total de la dur<EFBFBD>e
//$this->update_price(); //$this->update_price();
return 1; return 1;
@ -657,7 +657,7 @@ class Fichinter extends CommonObject
} }
/** /**
* \brief Stocke un numéro de rang pour toutes les lignes de * \brief Stocke un num<EFBFBD>ro de rang pour toutes les lignes de
* detail d'une fiche d'intervention qui n'en ont pas. * detail d'une fiche d'intervention qui n'en ont pas.
*/ */
function line_order() function line_order()
@ -781,14 +781,14 @@ class Fichinter extends CommonObject
} }
/** /**
* \brief Initialise la fiche intervention avec valeurs fictives aléatoire * \brief Initialise la fiche intervention avec valeurs fictives al<EFBFBD>atoire
* Sert à générer une fiche intervention pour l'aperu des modèles ou demo * Sert <EFBFBD> g<EFBFBD>n<EFBFBD>rer une fiche intervention pour l'aperu des mod<EFBFBD>les ou demo
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {
global $user,$langs; global $user,$langs;
// Charge tableau des id de société socids // Charge tableau des id de soci<EFBFBD>t<EFBFBD> socids
$socids = array(); $socids = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client=1 LIMIT 10"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client=1 LIMIT 10";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
@ -821,7 +821,7 @@ class Fichinter extends CommonObject
} }
} }
// Initialise paramètres // Initialise param<EFBFBD>tres
$this->id=0; $this->id=0;
$this->ref = 'SPECIMEN'; $this->ref = 'SPECIMEN';
$this->specimen=1; $this->specimen=1;
@ -871,13 +871,13 @@ class FichinterLigne
var $fk_fichinter; var $fk_fichinter;
var $desc; // Description ligne var $desc; // Description ligne
var $datei; // Date intervention var $datei; // Date intervention
var $duration; // Durée de l'intervention var $duration; // Dur<EFBFBD>e de l'intervention
var $rang = 0; var $rang = 0;
/** /**
* \brief Constructeur d'objets ligne d'intervention * \brief Constructeur d'objets ligne d'intervention
* \param DB handler d'accès base de donnée * \param DB handler d'acc<EFBFBD>s base de donn<EFBFBD>e
*/ */
function FichinterLigne($DB) function FichinterLigne($DB)
{ {
@ -885,7 +885,7 @@ class FichinterLigne
} }
/** /**
* \brief Recupére l'objet ligne d'intervention * \brief Recup<EFBFBD>re l'objet ligne d'intervention
* \param rowid id de la ligne * \param rowid id de la ligne
*/ */
function fetch($rowid) function fetch($rowid)
@ -919,7 +919,7 @@ class FichinterLigne
} }
/** /**
* \brief Insère l'objet ligne d'intervention en base * \brief Ins<EFBFBD>re l'objet ligne d'intervention en base
* \return int <0 si ko, >0 si ok * \return int <0 si ko, >0 si ok
*/ */
function insert() function insert()
@ -930,7 +930,7 @@ class FichinterLigne
$rangToUse=$this->rang; $rangToUse=$this->rang;
if ($rangToUse == -1) if ($rangToUse == -1)
{ {
// Récupère rang max de la ligne d'intervention dans $rangmax // R<EFBFBD>cup<EFBFBD>re rang max de la ligne d'intervention dans $rangmax
$sql = 'SELECT max(rang) as max FROM '.MAIN_DB_PREFIX.'fichinterdet'; $sql = 'SELECT max(rang) as max FROM '.MAIN_DB_PREFIX.'fichinterdet';
$sql.= ' WHERE fk_fichinter ='.$this->fk_fichinter; $sql.= ' WHERE fk_fichinter ='.$this->fk_fichinter;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
@ -1025,10 +1025,12 @@ class FichinterLigne
} }
} }
/**
* \brief Mise a jour duree total dans table llx_fichinter
* \return int <0 si ko, >0 si ok
*/
function update_total() function update_total()
{ {
// \TODO
// Mettre à jour duree total dans table llx_fichinter
$sql = "SELECT SUM(duree) as total_duration"; $sql = "SELECT SUM(duree) as total_duration";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinterdet"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinterdet";
$sql.= " WHERE fk_fichinter=".$this->fk_fichinter; $sql.= " WHERE fk_fichinter=".$this->fk_fichinter;