mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 00:53:00 +01:00
Qual: Standardisation of code. Clean some code.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user