Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qual: Uniformize code #73

Merged
merged 2 commits into from
Dec 19, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 45 additions & 27 deletions htdocs/fichinter/class/fichinter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ function fetch($rowid,$ref='')

/**
* Set status to draft
*
* @param User $user User that set draft
* @return int <0 if KO, >0 if OK
*/
function setDraft($user)
Expand Down Expand Up @@ -302,8 +304,9 @@ function setDraft($user)

/**
* Validate a intervention
* @param user User that validate
* @param outputdir
*
* @param User $user User that validate
* @param string $outputdir Output directory
* @return int <0 if KO, >0 if OK
*/
function setValid($user, $outputdir)
Expand Down Expand Up @@ -360,6 +363,7 @@ function setValid($user, $outputdir)

/**
* Set intervetnion as billed
*
* @return int <0 si ko, >0 si ok
*/
function setBilled()
Expand All @@ -385,8 +389,8 @@ function setBilled()

/**
* Returns the label status
* @param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/
function getLibStatut($mode=0)
{
Expand All @@ -395,9 +399,10 @@ function getLibStatut($mode=0)

/**
* Returns the label of a statut
* @param statut id statut
* @param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*
* @param int $statut id statut
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/
function LibStatut($statut,$mode=0)
{
Expand Down Expand Up @@ -439,8 +444,9 @@ function LibStatut($statut,$mode=0)

/**
* Return clicable name (with picto eventually)
* @param withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
* @return string String with URL
*
* @param int withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
* @return string String with URL
*/
function getNomUrl($withpicto=0)
{
Expand All @@ -465,8 +471,9 @@ function getNomUrl($withpicto=0)
/**
* Returns the next non used reference of intervention
* depending on the module numbering assets within FICHEINTER_ADDON
* @param soc Object society
* @return string Free reference for intervention
*
* @param Societe $soc Object society
* @return string Free reference for intervention
*/
function getNextNumRef($soc)
{
Expand Down Expand Up @@ -512,7 +519,8 @@ function getNextNumRef($soc)

/**
* Information sur l'objet fiche intervention
* @param id id de la fiche d'intervention
*
* @param int $id id de la fiche d'intervention
*/
function info($id)
{
Expand Down Expand Up @@ -561,7 +569,8 @@ function info($id)

/**
* Delete intervetnion
* @param user Object user who deletes
*
* @param User $user Object user who deletes
*/
function delete($user)
{
Expand Down Expand Up @@ -658,9 +667,10 @@ function delete($user)

/**
* Defines a delivery date of intervention
* @param user Object user who define
* @param date_delivery date of delivery
* @return int <0 if ko, >0 if ok
*
* @param User $user Object user who define
* @param date $date_delivery date of delivery
* @return int <0 if ko, >0 if ok
*/
function set_date_delivery($user, $date_delivery)
{
Expand Down Expand Up @@ -690,9 +700,10 @@ function set_date_delivery($user, $date_delivery)

/**
* Define the label of the intervention
* @param user Object user who modify
* @param description description
* @return int <0 if ko, >0 if ok
*
* @param User $user Object user who modify
* @param string $description description
* @return int <0 if ko, >0 if ok
*/
function set_description($user, $description)
{
Expand Down Expand Up @@ -722,11 +733,12 @@ function set_description($user, $description)

/**
* Adding a line of intervention into data base
* @param fichinterid Id of intervention
* @param desc Line description
* @param date_intervention Intervention date
* @param duration Intervention duration
* @return int >0 if ok, <0 if ko
*
* @param int $fichinterid Id of intervention
* @param string $desc Line description
* @param date $date_intervention Intervention date
* @param int $duration Intervention duration
* @return int >0 if ok, <0 if ko
*/
function addline($fichinterid, $desc, $date_intervention, $duration)
{
Expand Down Expand Up @@ -800,6 +812,7 @@ function initAsSpecimen()

/**
* Load array lines
*
* @return int <0 if Ko, >0 if OK
*/
function fetch_lines()
Expand Down Expand Up @@ -862,8 +875,8 @@ class FichinterLigne


/**
* \brief Constructeur d'objets ligne d'intervention
* \param DB handler d'acces base de donnee
* Constructeur d'objets ligne d'intervention
* @param DoliDB $DB handler d'acces base de donnee
*/
function FichinterLigne($DB)
{
Expand All @@ -872,7 +885,8 @@ function FichinterLigne($DB)

/**
* Retrieve the line of intervention
* @param rowid line id
*
* @param int $rowid line id
*/
function fetch($rowid)
{
Expand Down Expand Up @@ -906,6 +920,7 @@ function fetch($rowid)

/**
* Insert the line into database
*
* @return int <0 if ko, >0 if ok
*/
function insert()
Expand Down Expand Up @@ -973,6 +988,7 @@ function insert()

/**
* Update intervention into database
*
* @return int <0 if ko, >0 if ok
*/
function update()
Expand Down Expand Up @@ -1016,6 +1032,7 @@ function update()

/**
* Update total duration into llx_fichinter
*
* @return int <0 si ko, >0 si ok
*/
function update_total()
Expand Down Expand Up @@ -1067,6 +1084,7 @@ function update_total()

/**
* Delete a intervention line
*
* @return int >0 if ok, <0 if ko
*/
function deleteline()
Expand Down
28 changes: 16 additions & 12 deletions htdocs/fourn/class/fournisseur.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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
Expand Down Expand Up @@ -101,11 +102,13 @@ function NbProduct()
}
}

/**
* \brief Cree la commande au statut brouillon
* \param user Utilisateur qui cree
* \return int <0 si ko, id de la commande creee si ok
*/
/**
* Create the order from an existing
*
* @param User $user Creator user
* @param int $idc Id source
* @param int $comclientid Id thirdparty
*/
function updateFromCommandeClient($user, $idc, $comclientid)
{
$comm = new CommandeFournisseur($this->db);
Expand All @@ -115,9 +118,10 @@ function updateFromCommandeClient($user, $idc, $comclientid)
}

/**
* \brief Cree la commande au statut brouillon
* \param user Utilisateur qui cree
* \return int <0 si ko, id de la commande creee si ok
* Create the order with draft status

* @param User $user Creator user
* @return int <0 if ko, id of order if ok
*/
function create_commande($user)
{
Expand Down Expand Up @@ -183,9 +187,9 @@ function load_state_board()
/**
* Create a supplier category
*
* @param user User asking creation
* @param name Nom categorie
* @return int <0 if KO, 0 if OK
* @param User $user User asking creation
* @param string $name Category name
* @return int <0 if KO, 0 if OK
*/
function CreateCategory($user, $name)
{
Expand All @@ -209,7 +213,7 @@ function CreateCategory($user, $name)
}

/**
* Retourne la liste des fournisseurs
* Return the suppliers list
*
* @return array Array of suppliers
*/
Expand Down
Loading