Add barbaros info
This commit is contained in:
parent
dc38c7d9e8
commit
47ce07c9a7
@ -2,7 +2,7 @@
|
|||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# \file build/makepack-dolibarr.pl
|
# \file build/makepack-dolibarr.pl
|
||||||
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
|
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
|
||||||
# \version $Id: makepack-dolibarr.pl,v 1.121 2011/07/28 23:05:13 eldy Exp $
|
# \version $Id: makepack-dolibarr.pl,v 1.120 2011/07/28 18:32:00 eldy Exp $
|
||||||
# \author (c)2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
# \author (c)2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") {
|
|||||||
|
|
||||||
|
|
||||||
use vars qw/ $REVISION $VERSION /;
|
use vars qw/ $REVISION $VERSION /;
|
||||||
$REVISION='$Revision: 1.121 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1;
|
$REVISION='$Revision: 1.120 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1;
|
||||||
$VERSION="1.0 (build $REVISION)";
|
$VERSION="1.0 (build $REVISION)";
|
||||||
|
|
||||||
|
|
||||||
@ -276,19 +276,6 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/test`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/spec`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/spec`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/licence`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/licence`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/uml`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/xdebug`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot2.png`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot3.png`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot4.png`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot5.png`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot6.png`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot7.png`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot8.png`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot9.png`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot10.png`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot11.png`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php`;
|
||||||
@ -438,15 +425,6 @@ if ($nboftargetok) {
|
|||||||
|
|
||||||
print "Remove other files\n";
|
print "Remove other files\n";
|
||||||
$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/htdocs/includes/barcode/php-barcode/genbarcode/genbarcode`;
|
$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/htdocs/includes/barcode/php-barcode/genbarcode/genbarcode`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/aps`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/deb`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/dmg`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/doap`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/exe`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/live`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/patch`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/zip`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/perl`;
|
|
||||||
|
|
||||||
print "Compress $FILENAMETGZ2 into $FILENAMETGZ2.tgz...\n";
|
print "Compress $FILENAMETGZ2 into $FILENAMETGZ2.tgz...\n";
|
||||||
$ret=`tar --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" -czvf "$BUILDROOT/$FILENAMETGZ2.tgz" $FILENAMETGZ2`;
|
$ret=`tar --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" -czvf "$BUILDROOT/$FILENAMETGZ2.tgz" $FILENAMETGZ2`;
|
||||||
@ -526,7 +504,6 @@ if ($nboftargetok) {
|
|||||||
|
|
||||||
print "Remove other files\n";
|
print "Remove other files\n";
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/aps`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/aps`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/dmg`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/po`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/po`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/changelog`;
|
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/changelog`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/compat`;
|
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/compat`;
|
||||||
@ -546,15 +523,18 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/exe`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/exe`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/live`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/live`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/patch`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/patch`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/perl`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/rpm`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/rpm`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/zip`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/zip`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/perl`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/dmg`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/dbmodel`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/dbmodel`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/fpdf`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/fpdf`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/initdata`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/initdata`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/iso-normes`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/iso-normes`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/phpcheckstyle`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/phpcheckstyle`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/phpunit`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/phpunit`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/uml`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev/xdebug`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/flyer`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/flyer`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/font`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/font`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/tshirt`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/tshirt`;
|
||||||
@ -723,21 +703,14 @@ if ($nboftargetok) {
|
|||||||
$ret=`$cmd`;
|
$ret=`$cmd`;
|
||||||
|
|
||||||
print "Remove other files\n";
|
print "Remove other files\n";
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/deb`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/dmg`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/doap`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/exe`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/live`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/patch`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/rpm`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/zip`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/perl`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/dbmodel`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/dbmodel`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/fpdf`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/fpdf`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/initdata`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/initdata`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/iso-normes`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/iso-normes`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/phpcheckstyle`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/phpcheckstyle`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/phpunit`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/phpunit`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/uml`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev/xdebug`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc/flyer`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc/flyer`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc/font`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc/font`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc/tshirt`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc/tshirt`;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
--
|
--
|
||||||
-- $Id: 3.0.0-3.1.0.sql,v 1.83 2011/07/28 22:22:32 eldy Exp $
|
-- $Id: 3.0.0-3.1.0.sql,v 1.82 2011/07/28 18:34:46 eldy Exp $
|
||||||
--
|
--
|
||||||
-- Be carefull to requests order.
|
-- Be carefull to requests order.
|
||||||
-- This file must be loaded by calling /install/index.php page
|
-- This file must be loaded by calling /install/index.php page
|
||||||
@ -25,10 +25,8 @@ ALTER TABLE llx_c_ziptown MODIFY fk_county integer NULL;
|
|||||||
|
|
||||||
ALTER TABLE llx_c_actioncomm ADD COLUMN position integer NOT NULL DEFAULT 0;
|
ALTER TABLE llx_c_actioncomm ADD COLUMN position integer NOT NULL DEFAULT 0;
|
||||||
ALTER TABLE llx_propal ADD COLUMN fk_demand_reason integer NULL DEFAULT 0;
|
ALTER TABLE llx_propal ADD COLUMN fk_demand_reason integer NULL DEFAULT 0;
|
||||||
ALTER TABLE llx_commande_fournisseur ADD COLUMN fk_cond_reglement integer NULL DEFAULT 0 after model_pdf;
|
ALTER TABLE llx_commande_fournisseur ADD COLUMN fk_cond_reglement integer NULL DEFAULT 0;
|
||||||
ALTER TABLE llx_commande_fournisseur ADD COLUMN fk_mode_reglement integer NULL DEFAULT 0 after fk_cond_reglement;
|
ALTER TABLE llx_commande_fournisseur ADD COLUMN fk_mode_reglement integer NULL DEFAULT 0;
|
||||||
ALTER TABLE llx_commande_fournisseur ADD COLUMN import_key varchar(14);
|
|
||||||
|
|
||||||
--ALTER TABLE llx_c_currencies ADD COLUMN symbole varchar(3) NOT NULL default '';
|
--ALTER TABLE llx_c_currencies ADD COLUMN symbole varchar(3) NOT NULL default '';
|
||||||
|
|
||||||
ALTER TABLE llx_commande_fournisseur MODIFY model_pdf varchar(255);
|
ALTER TABLE llx_commande_fournisseur MODIFY model_pdf varchar(255);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
-- Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
-- Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
-- Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
-- Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
-- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
-- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
--
|
--
|
||||||
-- This program is free software; you can redistribute it and/or modify
|
-- This program is free software; you can redistribute it and/or modify
|
||||||
@ -17,7 +17,7 @@
|
|||||||
-- along with this program; if not, write to the Free Software
|
-- along with this program; if not, write to the Free Software
|
||||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
--
|
--
|
||||||
-- $Id: llx_product_fournisseur.key.sql,v 1.2 2011/07/29 06:58:52 tiaris Exp $
|
-- $Id: llx_product_fournisseur.key.sql,v 1.3 2011/07/29 19:59:33 eldy Exp $
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -13,15 +13,14 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
* or see http://www.gnu.org/
|
* or see http://www.gnu.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/lib/ajax.lib.php
|
* \file htdocs/lib/ajax.lib.php
|
||||||
* \brief Page called by Ajax request for produts
|
* \brief Page called by Ajax request for produts
|
||||||
* \version $Id: ajax.lib.php,v 1.59 2011/07/28 18:57:23 eldy Exp $
|
* \version $Id: ajax.lib.php,v 1.60 2011/07/31 23:25:18 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -17,15 +17,14 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/product/class/product.class.php
|
* \file htdocs/product/class/product.class.php
|
||||||
* \ingroup produit
|
* \ingroup produit
|
||||||
* \brief Fichier de la classe des produits predefinis
|
* \brief Fichier de la classe des produits predefinis
|
||||||
* \version $Id: product.class.php,v 1.46 2011/07/29 06:59:36 tiaris Exp $
|
* \version $Id: product.class.php,v 1.48 2011/07/31 23:24:03 eldy Exp $
|
||||||
*/
|
*/
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
|
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
|
||||||
|
|
||||||
@ -192,13 +191,14 @@ class Product extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Insert product into database
|
* Insert product into database
|
||||||
* @param user User making insert
|
* @param user User making insert
|
||||||
* @return int id of product/service if OK or number of error < 0
|
* @param notrigger Disable triggers
|
||||||
|
* @return int Id of product/service if OK or number of error < 0
|
||||||
*/
|
*/
|
||||||
function create($user)
|
function create($user,$notrigger=0)
|
||||||
{
|
{
|
||||||
global $conf ;
|
global $conf, $langs;
|
||||||
|
|
||||||
$this->errno = 0;
|
$error=0;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->ref = dol_string_nospecial(trim($this->ref));
|
$this->ref = dol_string_nospecial(trim($this->ref));
|
||||||
@ -250,14 +250,18 @@ class Product extends CommonObject
|
|||||||
$this->error='ErrorWrongParameters';
|
$this->error='ErrorWrongParameters';
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (empty($this->ref))
|
||||||
|
{
|
||||||
|
$this->error='ErrorWrongParameters';
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
dol_syslog("Product::Create ref=".$this->ref." price=".$this->price." price_ttc=".$this->price_ttc." tva_tx=".$this->tva_tx." price_base_type=".$this->price_base_type." Category : ".$this->catid, LOG_DEBUG);
|
dol_syslog("Product::Create ref=".$this->ref." price=".$this->price." price_ttc=".$this->price_ttc." tva_tx=".$this->tva_tx." price_base_type=".$this->price_base_type." Category : ".$this->catid, LOG_DEBUG);
|
||||||
|
|
||||||
if ($this->ref)
|
|
||||||
{
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "SELECT count(*)";
|
$sql = "SELECT count(*) as nb";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product";
|
||||||
$sql.= " WHERE ref = '" .$this->ref."'";
|
$sql.= " WHERE ref = '" .$this->ref."'";
|
||||||
$sql.= " AND entity = ".$conf->entity;
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
@ -265,8 +269,8 @@ class Product extends CommonObject
|
|||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$row = $this->db->fetch_array($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
if ($row[0] == 0)
|
if ($obj->nb == 0)
|
||||||
{
|
{
|
||||||
// Produit non deja existant
|
// Produit non deja existant
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product (";
|
||||||
@ -281,6 +285,8 @@ class Product extends CommonObject
|
|||||||
$sql.= ", price";
|
$sql.= ", price";
|
||||||
$sql.= ", price_ttc";
|
$sql.= ", price_ttc";
|
||||||
$sql.= ", price_base_type";
|
$sql.= ", price_base_type";
|
||||||
|
$sql.= ", tobuy";
|
||||||
|
$sql.= ", tosell";
|
||||||
$sql.= ", canvas";
|
$sql.= ", canvas";
|
||||||
$sql.= ", finished";
|
$sql.= ", finished";
|
||||||
$sql.= ", hidden";
|
$sql.= ", hidden";
|
||||||
@ -296,6 +302,8 @@ class Product extends CommonObject
|
|||||||
$sql.= ", ".price2num($price_ht);
|
$sql.= ", ".price2num($price_ht);
|
||||||
$sql.= ", ".price2num($price_ttc);
|
$sql.= ", ".price2num($price_ttc);
|
||||||
$sql.= ", '".$this->price_base_type."'";
|
$sql.= ", '".$this->price_base_type."'";
|
||||||
|
$sql.= ", ".$this->status;
|
||||||
|
$sql.= ", ".$this->status_buy;
|
||||||
$sql.= ", '".$this->canvas."'";
|
$sql.= ", '".$this->canvas."'";
|
||||||
$sql.= ", ".$this->finished;
|
$sql.= ", ".$this->finished;
|
||||||
$sql.= ", ".$this->hidden;
|
$sql.= ", ".$this->hidden;
|
||||||
@ -329,42 +337,41 @@ class Product extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_setErrNo("Create",260,$this->error);
|
$error++;
|
||||||
|
$this->error='ErrorFailedToUpdateRecord';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$error++;
|
||||||
$this->_setErrNo("Create",264,$this->error);
|
$this->error=$this->db->lasterror();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_setErrNo("Create",259);
|
$error++;
|
||||||
|
$this->error='ErrorFailedToGetInsertedId';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$error++;
|
||||||
$this->_setErrNo("Create",258,$this->error);
|
$this->error=$this->db->lasterror();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Le produit existe deja
|
// Product already exists with this ref
|
||||||
$this->error='ErrorProductAlreadyExists';
|
$langs->trans("Error")." : ".$langs->trans("ErrorProductAlreadyExists",$this->ref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_setErrNo("Create",263);
|
$error++;
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
if (! $error && ! $notrigger)
|
||||||
* END COMMIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ($this->errno === 0)
|
|
||||||
{
|
{
|
||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||||
@ -372,49 +379,19 @@ class Product extends CommonObject
|
|||||||
$result=$interface->run_triggers('PRODUCT_CREATE',$this,$user,$langs,$conf);
|
$result=$interface->run_triggers('PRODUCT_CREATE',$this,$user,$langs,$conf);
|
||||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -$error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->_setErrNo("Create",262);
|
|
||||||
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Positionne le numero d'erreur
|
|
||||||
* @param func Nom de la fonction
|
|
||||||
* @param num Numero de l'erreur
|
|
||||||
* @param error string
|
|
||||||
*/
|
|
||||||
function _setErrNo($func, $num, $error='')
|
|
||||||
{
|
|
||||||
$this->errno = $num;
|
|
||||||
dol_syslog(get_class($this)."::".$func." - ERRNO(".$this->errno.")".($error?' - '.$error:''), LOG_ERR);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retourne le texte de l'erreur
|
|
||||||
*/
|
|
||||||
function error()
|
|
||||||
{
|
|
||||||
$errs[257] = "ErrorProductAlreadyExists";
|
|
||||||
$errs[262] = "ErrorProductBadRefOrLabel";
|
|
||||||
|
|
||||||
return $errs[$this->errno];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update a record into database
|
* Update a record into database
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/theme/auguria/style.css.php
|
* \file htdocs/theme/auguria/style.css.php
|
||||||
* \brief Fichier de style CSS du theme auguria
|
* \brief Fichier de style CSS du theme auguria
|
||||||
* \version $Id: style.css.php,v 1.91 2011/07/28 20:54:02 eldy Exp $
|
* \version $Id: style.css.php,v 1.90 2011/07/28 13:26:34 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||||
@ -1101,7 +1101,7 @@ border-left-style: solid;
|
|||||||
}
|
}
|
||||||
|
|
||||||
table.noborder td {
|
table.noborder td {
|
||||||
padding: 1px 2px 2px 1px; /* t r b l */
|
padding: 1px 2px 0px 1px; /* t r b l */
|
||||||
}
|
}
|
||||||
|
|
||||||
table.nobordernopadding {
|
table.nobordernopadding {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user