Add function fetch_delivery_methods()
This commit is contained in:
parent
16a8a8bd5f
commit
332414303b
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
|
||||||
* Copyright (C) 2005-2008 Régis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2008 Régis Houssin <regis@dolibarr.fr>
|
||||||
|
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||||
|
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -37,38 +37,38 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande
|
|||||||
*/
|
*/
|
||||||
class Expedition extends CommonObject
|
class Expedition extends CommonObject
|
||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
var $error;
|
var $error;
|
||||||
var $element="expedition";
|
var $element="expedition";
|
||||||
var $table_element="expedition";
|
var $table_element="expedition";
|
||||||
|
|
||||||
var $id;
|
var $id;
|
||||||
var $socid;
|
var $socid;
|
||||||
var $brouillon;
|
var $brouillon;
|
||||||
var $entrepot_id;
|
var $entrepot_id;
|
||||||
var $modelpdf;
|
var $modelpdf;
|
||||||
var $origin;
|
var $origin;
|
||||||
var $origin_id;
|
var $origin_id;
|
||||||
|
|
||||||
|
var $meths;
|
||||||
/**
|
/**
|
||||||
* Initialisation
|
* Initialisation
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function Expedition($DB)
|
function Expedition($DB)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
$this->lignes = array();
|
$this->lignes = array();
|
||||||
|
|
||||||
$this->statuts[-1] = $langs->trans("Canceled");
|
$this->statuts[-1] = $langs->trans("Canceled");
|
||||||
$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->products = array();
|
$this->products = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Créé expédition en base
|
* \brief Créé expédition en base
|
||||||
* \param user Objet du user qui cré
|
* \param user Objet du user qui cré
|
||||||
@ -733,6 +733,26 @@ class Expedition extends CommonObject
|
|||||||
$xnbp++;
|
$xnbp++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
Fecth deliveries method and return an array
|
||||||
|
*/
|
||||||
|
function fetch_delivery_methods()
|
||||||
|
{
|
||||||
|
$meths = array();
|
||||||
|
|
||||||
|
$sql = "SELECT em.rowid, em.libelle";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."expedition_methode as em";
|
||||||
|
$sql.= " WHERE em.statut = 1";
|
||||||
|
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
while ($obj = $this->db->fetch_object($resql))
|
||||||
|
{
|
||||||
|
$this->meths[$obj->rowid] = $obj->libelle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user