Qual: Standardisation of code. Clean some code.

This commit is contained in:
Laurent Destailleur
2008-02-24 15:51:06 +00:00
parent 8ce7d5193f
commit 72d107a5d0
14 changed files with 162 additions and 256 deletions

View File

@@ -36,8 +36,10 @@ require_once(DOL_DOCUMENT_ROOT."/product.class.php");
*/
class Commande extends CommonObject
{
var $db ;
var $db;
var $error;
var $element='commande';
var $table_element='commande';
var $id ;
@@ -1997,26 +1999,6 @@ class Commande extends CommonObject
}
}
/**
* \brief Classer la commande dans un projet
* \param cat_id Id du projet
*/
function classin($cat_id)
{
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande SET fk_projet = $cat_id";
$sql .= " WHERE rowid = $this->id;";
if ($this->db->query($sql) )
{
return 1;
}
else
{
$this->error=$this->db->error();
return -1;
}
}
/**
* \brief Charge indicateurs this->nbtodo et this->nbtodolate de tableau de bord

View File

@@ -18,15 +18,13 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/
/**
\file htdocs/commande/fiche.php
\ingroup commande
\brief Fiche commande client
\version $Revision$
\version $Id$
*/
require('./pre.inc.php');
@@ -121,11 +119,11 @@ if (($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes
}
// Categorisation dans projet
if ($_POST['action'] == 'classin' && $user->rights->commande->creer)
if ($_POST['action'] == 'classin')
{
$commande = new Commande($db);
$commande->fetch($_GET['id']);
$commande->classin($_POST['projetid']);
$commande->setProject($_POST['projetid']);
}
// Ajout commande
@@ -708,6 +706,11 @@ if ($_POST['action'] == 'send')
}
}
/*
* View
*/
llxHeader('',$langs->trans('Order'),'Commande');
$html = new Form($db);