Skip to content

Commit

Permalink
Qual: Uniformize code
Browse files Browse the repository at this point in the history
Doxygen
  • Loading branch information
eldy committed Jan 19, 2012
1 parent 8eb1da9 commit 08e33f2
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 182 deletions.
12 changes: 6 additions & 6 deletions htdocs/categories/class/categorie.class.php
Expand Up @@ -3,7 +3,7 @@
* Copyright (C) 2005 Davoleau Brice <brice.davoleau@gmail.com>
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -54,12 +54,12 @@ class Categorie
/**
* Constructor
*
* @param DoliDB $DB Database handler
* @param DoliDB $db Database handler
* @param int $id Id of category to fetch during init
*/
function Categorie($DB, $id=-1)
function Categorie($db, $id=-1)
{
$this->db = $DB;
$this->db = $db;
$this->id = $id;

if ($id != -1) $this->fetch($this->id);
Expand Down Expand Up @@ -132,7 +132,7 @@ function create($user='')
$langs->load('categories');

$error=0;

// Clean parameters
if (empty($this->visible)) $this->visible=0;
$this->parentId = ($this->id_mere) != "" ? intval($this->id_mere) : 0;
Expand Down Expand Up @@ -214,7 +214,7 @@ function update($user='')
global $conf, $langs;

$error=0;

// Clean parameters
$this->label=trim($this->label);
$this->description=trim($this->description);
Expand Down
41 changes: 0 additions & 41 deletions htdocs/fourn/class/fournisseur.class.php
Expand Up @@ -104,47 +104,6 @@ function nbOfProductRefs()
}
}

/**
* 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);
$comm->socid = $this->id;

$comm->updateFromCommandeClient($user, $idc, $comclientid);
}

/**
* 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)
{
dol_syslog("Fournisseur::Create_Commande");
$comm = new CommandeFournisseur($this->db);
$comm->socid = $this->id;

if ($comm->create($user) > 0)
{
$this->single_open_commande = $comm->id;
return $comm->id;
}
else
{
$this->error=$comm->error;
dol_syslog("Fournisseur::Create_Commande Failed ".$this->error, LOG_ERR);
return -1;
}
}


/**
* Load statistics indicators
*
Expand Down

0 comments on commit 08e33f2

Please sign in to comment.