Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-02-15 23:11:22 +01:00
commit c614c7d84a
8 changed files with 241 additions and 248 deletions

View File

@ -2,10 +2,10 @@
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley <marc@ocebo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* *
@ -1788,6 +1788,20 @@ class Propal extends CommonObject
$this->db->begin(); $this->db->begin();
if (! $error && ! $notrigger)
{
// Call triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('PROPAL_DELETE',$this,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
}
// End call triggers
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = ".$this->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = ".$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
@ -1834,16 +1848,6 @@ class Propal extends CommonObject
} }
} }
if (! $error && ! $notrigger)
{
// Call triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('PROPAL_DELETE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// End call triggers
}
if (! $error) if (! $error)
{ {
dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG); dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG);
@ -1859,6 +1863,14 @@ class Propal extends CommonObject
} }
} }
else else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
$this->db->rollback();
return -3;
}
}
else
{ {
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
@ -2316,6 +2316,20 @@ class Commande extends CommonObject
$this->db->begin(); $this->db->begin();
if (! $error && ! $notrigger)
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('ORDER_DELETE',$this,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
}
// Fin appel triggers
}
if (! $error)
{
// Delete order details // Delete order details
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE fk_commande = ".$this->id; $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE fk_commande = ".$this->id;
dol_syslog("Commande::delete sql=".$sql); dol_syslog("Commande::delete sql=".$sql);
@ -2369,15 +2383,6 @@ class Commande extends CommonObject
} }
} }
} }
if (! $error && ! $notrigger)
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('ORDER_DELETE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
} }
if (! $error) if (! $error)

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
@ -1132,9 +1132,24 @@ class Facture extends CommonObject
$error=0; $error=0;
$this->db->begin(); $this->db->begin();
if (! $error && ! $notrigger)
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('BILL_DELETE',$this,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
}
// Fin appel triggers
}
if (! $error)
{
// Delete linked object // Delete linked object
$res = $this->deleteObjectLinked(); $res = $this->deleteObjectLinked();
if ($res < 0) $error++; if ($res < 0) $error++;
}
if (! $error) if (! $error)
{ {
@ -1177,16 +1192,6 @@ class Facture extends CommonObject
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
if (! $notrigger)
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('BILL_DELETE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
}
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }

View File

@ -1562,7 +1562,7 @@ abstract class CommonObject
{ {
// Parse element/subelement (ex: project_task) // Parse element/subelement (ex: project_task)
$module = $element = $subelement = $objecttype; $module = $element = $subelement = $objecttype;
if (preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs)) if ($objecttype != 'order_supplier' && $objecttype != 'invoice_supplier' && preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs))
{ {
$module = $element = $regs[1]; $module = $element = $regs[1];
$subelement = $regs[2]; $subelement = $regs[2];
@ -1583,8 +1583,8 @@ abstract class CommonObject
else if ($objecttype == 'delivery') { else if ($objecttype == 'delivery') {
$classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon'; $classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon';
} }
else if ($objecttype == 'invoice_supplier') { else if ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') {
$classpath = 'fourn/class'; $classpath = 'fourn/class'; $module = 'fournisseur';
} }
else if ($objecttype == 'order_supplier') { else if ($objecttype == 'order_supplier') {
$classpath = 'fourn/class'; $classpath = 'fourn/class';

View File

@ -2,8 +2,8 @@
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr> * Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.fr> * Copyright (C) 2005 Marc Barilley <marc@ocebo.fr>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -126,13 +126,18 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisse
} }
} }
if ($action == 'confirm_deleteproductline' && $confirm == 'yes') if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer)
{
if ($user->rights->fournisseur->facture->creer)
{ {
$object->fetch($id); $object->fetch($id);
$object->deleteline(GETPOST('lineid')); $ret = $object->deleteline(GETPOST('lineid'));
$action = ''; if ($ret > 0)
{
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
} }
} }
@ -187,37 +192,6 @@ if($action == 'deletepaiement')
} }
} }
if ($action == 'update' && ! $_POST['cancel'])
{
$error=0;
$date = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
$date_echeance = dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']);
if (! $date)
{
$msg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateEch"));
$error++;
}
if ($date_echeance && $date_echeance < $date)
{
$date_echeance = $date;
}
if (! $error)
{
// TODO move to DAO class
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn set ';
$sql .= " facnumber='".$db->escape(trim($_POST['facnumber']))."'";
$sql .= ", libelle='".$db->escape(trim($_POST['libelle']))."'";
$sql .= ", note='".$db->escape($_POST['note'])."'";
$sql .= ", datef = '".$db->idate($date)."'";
$sql .= ", date_lim_reglement = '".$db->idate($date_echeance)."'";
$sql .= ' WHERE rowid = '.$id;
$result = $db->query($sql);
}
}
// Create // Create
if ($action == 'add' && $user->rights->fournisseur->facture->creer) if ($action == 'add' && $user->rights->fournisseur->facture->creer)
{ {
@ -404,13 +378,6 @@ if ($action == 'add' && $user->rights->fournisseur->facture->creer)
} }
} }
if ($action == 'del_ligne')
{
$object->fetch($id);
$object->deleteline(GETPOST('lineid'));
$action = 'edit';
}
// Modification d'une ligne // Modification d'une ligne
if ($action == 'update_line') if ($action == 'update_line')
{ {
@ -434,7 +401,7 @@ if ($action == 'update_line')
$prod = new Product($db); $prod = new Product($db);
$prod->fetch($_POST['idprod']); $prod->fetch($_POST['idprod']);
$label = $prod->description; $label = $prod->description;
if (trim($_POST['label']) != trim($label)) $label=$_POST['label']; if (trim($_POST['desc']) != trim($label)) $label=$_POST['desc'];
$type = $prod->type; $type = $prod->type;
$localtax1tx = $prod->localtax1_tx; $localtax1tx = $prod->localtax1_tx;
@ -447,7 +414,7 @@ if ($action == 'update_line')
$societe=new Societe($db); $societe=new Societe($db);
$societe->fetch($object->socid); $societe->fetch($object->socid);
} }
$label = $_POST['label']; $label = $_POST['desc'];
$type = $_POST["type"]?$_POST["type"]:0; $type = $_POST["type"]?$_POST["type"]:0;
$localtax1tx= get_localtax($_POST['tauxtva'], 1, $societe); $localtax1tx= get_localtax($_POST['tauxtva'], 1, $societe);
$localtax2tx= get_localtax($_POST['tauxtva'], 2, $societe); $localtax2tx= get_localtax($_POST['tauxtva'], 2, $societe);
@ -512,9 +479,9 @@ if ($action == 'addline')
$localtax1tx= get_localtax($tauxtva, 1, $societe); $localtax1tx= get_localtax($tauxtva, 1, $societe);
$localtax2tx= get_localtax($tauxtva, 2, $societe); $localtax2tx= get_localtax($tauxtva, 2, $societe);
if (! $_POST['label']) if (! $_POST['dp_desc'])
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")).'</div>'; $mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")).'</div>';
} }
else else
{ {
@ -525,14 +492,14 @@ if ($action == 'addline')
$price_base_type = 'HT'; $price_base_type = 'HT';
//$desc, $pu, $txtva, $qty, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits='', $price_base_type='HT', $type=0) //$desc, $pu, $txtva, $qty, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits='', $price_base_type='HT', $type=0)
$result=$object->addline($_POST['label'], $ht, $tauxtva, $localtax1tx, $localtax2tx, $_POST['qty'], 0, 0, $datestart, $dateend, 0, 0, $price_base_type, $type); $result=$object->addline($_POST['dp_desc'], $ht, $tauxtva, $localtax1tx, $localtax2tx, $_POST['qty'], 0, 0, $datestart, $dateend, 0, 0, $price_base_type, $type);
} }
else else
{ {
$ttc = price2num($_POST['amountttc']); $ttc = price2num($_POST['amountttc']);
$ht = $ttc / (1 + ($tauxtva / 100)); $ht = $ttc / (1 + ($tauxtva / 100));
$price_base_type = 'HT'; $price_base_type = 'HT';
$result=$object->addline($_POST['label'], $ht, $tauxtva,$localtax1tx, $localtax2tx, $_POST['qty'], 0, 0, $datestart, $dateend, 0, 0, $price_base_type, $type); $result=$object->addline($_POST['dp_desc'], $ht, $tauxtva,$localtax1tx, $localtax2tx, $_POST['qty'], 0, 0, $datestart, $dateend, 0, 0, $price_base_type, $type);
} }
} }
} }
@ -1170,7 +1137,7 @@ else
// Confirmation de la suppression d'une ligne produit // Confirmation de la suppression d'une ligne produit
if ($action == 'confirm_delete_line') if ($action == 'confirm_delete_line')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline', '', 1, 1); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 1, 1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
@ -1285,9 +1252,8 @@ else
print '</td></tr>'; print '</td></tr>';
// Label // Label
print '<tr><td>'.$form->editfieldkey("Label",'label',$object->label,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)).'</td><td colspan="3">'; print '<tr><td>'.$form->editfieldkey("Label",'label',$object->label,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)).'</td>';
print $form->editfieldval("Label",'label',$object->label,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)); print '<td colspan="3">'.$form->editfieldval("Label",'label',$object->label,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer)).'</td>';
print '</td>';
/* /*
* List of payments * List of payments
@ -1370,13 +1336,13 @@ else
print '</tr>'; print '</tr>';
// Date // Date
print '<tr><td>'.$form->editfieldkey("Date",'date',$object->datep,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0)).'</td><td colspan="3">'; print '<tr><td>'.$form->editfieldkey("Date",'date',$object->datep,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'datepicker').'</td><td colspan="3">';
print $form->editfieldval("Date",'date',$object->datep,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'day'); print $form->editfieldval("Date",'date',$object->datep,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'datepicker');
print '</td>'; print '</td>';
// Due date // Due date
print '<tr><td>'.$form->editfieldkey("DateMaxPayment",'date_echeance',$object->date_echeance,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0)).'</td><td colspan="3">'; print '<tr><td>'.$form->editfieldkey("DateMaxPayment",'date_echeance',$object->date_echeance,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'datepicker').'</td><td colspan="3">';
print $form->editfieldval("DateMaxPayment",'date_echeance',$object->date_echeance,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'day'); print $form->editfieldval("DateMaxPayment",'date_echeance',$object->date_echeance,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'datepicker');
print '</td>'; print '</td>';
// Status // Status
@ -1471,7 +1437,7 @@ else
$var=!$var; $var=!$var;
// Edit line // Edit line
if ($object->statut == 0 && $action == 'mod_ligne' && $_GET['etat'] == '0' && $_GET['lineid'] == $object->lines[$i]->rowid) if ($object->statut == 0 && $action == 'edit_line' && $_GET['etat'] == '0' && $_GET['lineid'] == $object->lines[$i]->rowid)
{ {
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;etat=1&amp;lineid='.$object->lines[$i]->rowid.'" method="post">'; print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;etat=1&amp;lineid='.$object->lines[$i]->rowid.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -1500,7 +1466,7 @@ else
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$nbrows=ROWS_2; $nbrows=ROWS_2;
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$doleditor=new DolEditor('label',$object->lines[$i]->description,'',128,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); $doleditor=new DolEditor('desc',$object->lines[$i]->description,'',128,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
$doleditor->Create(); $doleditor->Create();
print '</td>'; print '</td>';
@ -1577,7 +1543,7 @@ else
print '<td align="right" nowrap="nowrap">'.price($object->lines[$i]->total_ttc).'</td>'; print '<td align="right" nowrap="nowrap">'.price($object->lines[$i]->total_ttc).'</td>';
print '<td align="center" width="16">'; print '<td align="center" width="16">';
if ($object->statut == 0) print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=mod_ligne&amp;etat=0&amp;lineid='.$object->lines[$i]->rowid.'">'.img_edit().'</a>'; if ($object->statut == 0) print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit_line&amp;etat=0&amp;lineid='.$object->lines[$i]->rowid.'">'.img_edit().'</a>';
else print '&nbsp;'; else print '&nbsp;';
print '</td>'; print '</td>';
@ -1595,7 +1561,7 @@ else
* Form to add new line * Form to add new line
*/ */
if ($object->statut == 0 && $action != 'mod_ligne') if ($object->statut == 0 && $action != 'edit_line')
{ {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'; print '<td>';
@ -1630,7 +1596,7 @@ else
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$nbrows=ROWS_2; $nbrows=ROWS_2;
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$doleditor=new DolEditor('label',GETPOST("label"),'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); $doleditor=new DolEditor('dp_desc',GETPOST("dp_desc"),'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
$doleditor->Create(); $doleditor->Create();
print '</td>'; print '</td>';
@ -1861,7 +1827,7 @@ else
} }
} }
$db->close();
llxFooter(); llxFooter();
$db->close();
?> ?>

View File

@ -183,6 +183,7 @@ insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (13, 'Cotisation sur la valeur ajoutée des entreprises', 0, 1, 'TAXCVAE', '1'); insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (13, 'Cotisation sur la valeur ajoutée des entreprises', 0, 1, 'TAXCVAE', '1');
ALTER TABLE llx_paiement ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; ALTER TABLE llx_paiement ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
ALTER TABLE llx_product_price ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
-- Restore foreign key (on llx_expedition_methode before) on correct table (llx_c_shipment_mode) -- Restore foreign key (on llx_expedition_methode before) on correct table (llx_c_shipment_mode)
ALTER TABLE llx_expedition DROP FOREIGN KEY fk_expedition_fk_expedition_methode; ALTER TABLE llx_expedition DROP FOREIGN KEY fk_expedition_fk_expedition_methode;

View File

@ -1,5 +1,6 @@
-- ============================================================================ -- ============================================================================
-- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
-- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> -- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- This program is free software; you can redistribute it and/or modify
@ -20,6 +21,7 @@
create table llx_product_price create table llx_product_price
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- Multi company id
tms timestamp, tms timestamp,
fk_product integer NOT NULL, fk_product integer NOT NULL,
date_price datetime NOT NULL, date_price datetime NOT NULL,

View File

@ -100,6 +100,7 @@ class Project extends CommonObject
$sql.= ", datec"; $sql.= ", datec";
$sql.= ", dateo"; $sql.= ", dateo";
$sql.= ", datee"; $sql.= ", datee";
$sql.= ", entity";
$sql.= ") VALUES ("; $sql.= ") VALUES (";
$sql.= "'" . $this->db->escape($this->ref) . "'"; $sql.= "'" . $this->db->escape($this->ref) . "'";
$sql.= ", '" . $this->db->escape($this->title) . "'"; $sql.= ", '" . $this->db->escape($this->title) . "'";
@ -111,6 +112,7 @@ class Project extends CommonObject
$sql.= ", " . ($this->datec != '' ? $this->db->idate($this->datec) : 'null'); $sql.= ", " . ($this->datec != '' ? $this->db->idate($this->datec) : 'null');
$sql.= ", " . ($this->dateo != '' ? $this->db->idate($this->dateo) : 'null'); $sql.= ", " . ($this->dateo != '' ? $this->db->idate($this->dateo) : 'null');
$sql.= ", " . ($this->datee != '' ? $this->db->idate($this->datee) : 'null'); $sql.= ", " . ($this->datee != '' ? $this->db->idate($this->datee) : 'null');
$sql.= ", ".$conf->entity;
$sql.= ")"; $sql.= ")";
dol_syslog("Project::create sql=" . $sql, LOG_DEBUG); dol_syslog("Project::create sql=" . $sql, LOG_DEBUG);