develop

Conflicts:
	htdocs/.gitignore
This commit is contained in:
Laurent Destailleur 2013-07-11 11:52:32 +02:00
commit 158a2b8ca8
33 changed files with 200 additions and 125 deletions

View File

@ -26,6 +26,7 @@ For users:
- New: Add a cron module to define scheduled jobs. - New: Add a cron module to define scheduled jobs.
- New: Add new graphical boxes (customer invoices and orders per month). - New: Add new graphical boxes (customer invoices and orders per month).
- New: [ task #286 ] Enhance rounding function of prices to allow round of sum instead of sum of rounding. - New: [ task #286 ] Enhance rounding function of prices to allow round of sum instead of sum of rounding.
- New: Can add an event automatically when a projet is create.
- Qual: Implement same rule for return value of all command line scripts (0 when success, <>0 if error). - Qual: Implement same rule for return value of all command line scripts (0 when success, <>0 if error).
For translators: For translators:
@ -47,6 +48,22 @@ For developers:
- New: Make some changes to allow usage of several alternative $dolibarr_main_url_root variables. - New: Make some changes to allow usage of several alternative $dolibarr_main_url_root variables.
Fix also several bugs with old code. Fix also several bugs with old code.
WARNING: This may create regression for some external modules, but was necessary to make
Dolibarr better:
- We started to clean hooks code. If your hook want to modify value of $actions, it's role
of your hook to modify it. Dolibarr hook code will not decide this for your module anymore.
If your action class for hook was returning a string or an array, instead your module must
set $actionclassinstance->results (to return array)
or $actionclassinstance->resprints (to return string)
to return same thing. The return value must be replaced by a "return 0";
Goal is to fix old compatibility code that does not match hook
specification: http://wiki.dolibarr.org/index.php/Hooks_system
- Some methods object->addline used a first parameter that was object->id, some not. Of course
this was not a good pratice, since object->id is already known so no need to provide it as
parameter. All methods addline in this case were modified to remove this information.
***** ChangeLog for 3.4 compared to 3.3.2 ***** ***** ChangeLog for 3.4 compared to 3.3.2 *****
For users: For users:

View File

@ -186,7 +186,7 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
$prodid = rand(1, $num_prods); $prodid = rand(1, $num_prods);
$product=new Product($db); $product=new Product($db);
$result=$product->fetch($prodids[$prodid]); $result=$product->fetch($prodids[$prodid]);
$result=$com->addline($com->id, $product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type); $result=$com->addline($product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type);
if ($result < 0) if ($result < 0)
{ {
dol_print_error($db,$propal->error); dol_print_error($db,$propal->error);

View File

@ -112,8 +112,12 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0)
$prodid = rand(1, $num_prods); $prodid = rand(1, $num_prods);
$product=new Product($db); $product=new Product($db);
$result=$product->fetch($prodids[$prodid]); $result=$product->fetch($prodids[$prodid]);
$result=$facture->addline($facture->id,$product->description,$product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); $result=$facture->addline($product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
$xnbp++; if ($result < 0)
{
dol_print_error($db,$propal->error);
}
$xnbp++;
} }
print " OK with ref ".$facture->ref."\n";; print " OK with ref ".$facture->ref."\n";;

View File

@ -143,7 +143,9 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
while ($xnbp < $nbp) while ($xnbp < $nbp)
{ {
$prodid = rand(1, $num_prods); $prodid = rand(1, $num_prods);
$result=$propal->addline($propal->id, 'Description '.$xnbp, '100', rand(1,5), '19.6', 0, 0, $prodids[$prodid], 0); $product=new Product($db);
$result=$product->fetch($prodids[$prodid]);
$result=$propal->addline($product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0);
if ($result < 0) if ($result < 0)
{ {
dol_print_error($db,$propal->error); dol_print_error($db,$propal->error);

9
htdocs/.gitignore vendored
View File

@ -1,10 +1,11 @@
/test.php /test.php
/custom* /custom*
/bootstrap /bootstrap
/multicompany /extensions
/ovh
/numberingpack
/google /google
/skincoloreditor /multicompany
/numberingpack
/ovh
/pos /pos
/skincoloreditor
/ultimatepdf /ultimatepdf

View File

@ -368,7 +368,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
$vattouse=get_default_tva($mysoc, $mysoc, $idprodsubscription); $vattouse=get_default_tva($mysoc, $mysoc, $idprodsubscription);
} }
//print xx".$vattouse." - ".$mysoc." - ".$customer;exit; //print xx".$vattouse." - ".$mysoc." - ".$customer;exit;
$result=$invoice->addline($invoice->id,$label,0,1,$vattouse,0,0,$idprodsubscription,0,$datecotisation,$datesubend,0,0,'','TTC',$cotisation,1); $result=$invoice->addline($label,0,1,$vattouse,0,0,$idprodsubscription,0,$datecotisation,$datesubend,0,0,'','TTC',$cotisation,1);
if ($result <= 0) if ($result <= 0)
{ {
$errmsg=$invoice->error; $errmsg=$invoice->error;

View File

@ -88,6 +88,8 @@ if ($result)
$title=$langs->trans("ListOfSubscriptions"); $title=$langs->trans("ListOfSubscriptions");
if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')'; if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')';
$param="";
$param.="&amp;statut=$statut&amp;date_select=$date_select"; $param.="&amp;statut=$statut&amp;date_select=$date_select";
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);

View File

@ -161,8 +161,9 @@ if (! empty($triggers))
if ($module == 'order_supplier' || $module == 'invoice_supplier') $module = 'fournisseur'; if ($module == 'order_supplier' || $module == 'invoice_supplier') $module = 'fournisseur';
if ($module == 'shipping') $module = 'expedition_bon'; if ($module == 'shipping') $module = 'expedition_bon';
if ($module == 'member') $module = 'adherent'; if ($module == 'member') $module = 'adherent';
if ($module == 'project') $module = 'projet';
//print 'module='.$module.'<br>'; //print 'module='.$module.'<br>';
if ($conf->$module->enabled) if (! empty($conf->$module->enabled))
{ {
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';

View File

@ -52,10 +52,10 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", $_POST["MAIN_PROFID1_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"],'chaine',0,'',$conf->entity);

View File

@ -40,9 +40,9 @@ class ActionComm extends CommonObject
var $id; var $id;
var $type_id; // id into parent table llx_c_actioncomm (will be deprecated into future, link should not be required) var $type_id; // id into parent table llx_c_actioncomm (will be deprecated into future, link should not be required)
var $type_code; // code into parent table llx_c_actioncomm (will be deprecated into future, link should not be required) var $type_code; // code into parent table llx_c_actioncomm (will be deprecated into future, link should not be required). With defautl setup, should be AC_OTH_AUTO or AC_OTH
var $type; // label into parent table llx_c_actioncomm (will be deprecated into future, link should not be required) var $type; // label into parent table llx_c_actioncomm (will be deprecated into future, link should not be required)
var $code; var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
var $label; var $label;
var $datec; // Date creation record (datec) var $datec; // Date creation record (datec)

View File

@ -804,7 +804,6 @@ else if ($action == "addline" && $user->rights->propal->creer)
{ {
// Insert line // Insert line
$result=$object->addline( $result=$object->addline(
$id,
$desc, $desc,
$pu_ht, $pu_ht,
GETPOST('qty'), GETPOST('qty'),

View File

@ -314,9 +314,9 @@ class Propal extends CommonObject
* *
* @see add_product * @see add_product
*/ */
function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_option=0) function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_option=0)
{ {
global $conf; $propalid=$this->id;
dol_syslog(get_class($this)."::addline propalid=$propalid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits, type=$type"); dol_syslog(get_class($this)."::addline propalid=$propalid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits, type=$type");
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
@ -414,7 +414,6 @@ class Propal extends CommonObject
$this->line->pa_ht = $pa_ht; $this->line->pa_ht = $pa_ht;
// Mise en option de la ligne // Mise en option de la ligne
//if ($conf->global->PROPALE_USE_OPTION_LINE && !$qty) $ligne->special_code=3;
if (empty($qty) && empty($special_code)) $this->line->special_code=3; if (empty($qty) && empty($special_code)) $this->line->special_code=3;
// TODO deprecated // TODO deprecated
@ -762,7 +761,6 @@ class Propal extends CommonObject
} }
$result = $this->addline( $result = $this->addline(
$this->id,
$this->lines[$i]->desc, $this->lines[$i]->desc,
$this->lines[$i]->subprice, $this->lines[$i]->subprice,
$this->lines[$i]->qty, $this->lines[$i]->qty,

View File

@ -681,7 +681,6 @@ class Commande extends CommonOrder
} }
$result = $this->addline( $result = $this->addline(
$this->id,
$this->lines[$i]->desc, $this->lines[$i]->desc,
$this->lines[$i]->subprice, $this->lines[$i]->subprice,
$this->lines[$i]->qty, $this->lines[$i]->qty,
@ -1005,7 +1004,6 @@ class Commande extends CommonOrder
/** /**
* Add an order line into database (linked to product/service or not) * Add an order line into database (linked to product/service or not)
* *
* @param int $commandeid Id of line
* @param string $desc Description of line * @param string $desc Description of line
* @param double $pu_ht Unit price (without tax) * @param double $pu_ht Unit price (without tax)
* @param double $qty Quantite * @param double $qty Quantite
@ -1037,8 +1035,10 @@ class Commande extends CommonOrder
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit)
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
*/ */
function addline($commandeid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$array_option=0) function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$array_option=0)
{ {
$commandeid=$this->id;
dol_syslog(get_class($this)."::addline commandeid=$commandeid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type", LOG_DEBUG); dol_syslog(get_class($this)."::addline commandeid=$commandeid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type", LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';

View File

@ -322,7 +322,6 @@ else if ($action == 'add' && $user->rights->commande->creer)
} }
$result = $object->addline( $result = $object->addline(
$object_id,
$desc, $desc,
$lines[$i]->subprice, $lines[$i]->subprice,
$lines[$i]->qty, $lines[$i]->qty,
@ -739,7 +738,6 @@ else if ($action == 'addline' && $user->rights->commande->creer)
{ {
// Insert line // Insert line
$result = $object->addline( $result = $object->addline(
$object->id,
$desc, $desc,
$pu_ht, $pu_ht,
GETPOST('qty'), GETPOST('qty'),

View File

@ -269,7 +269,6 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
$fk_parent_line = 0; $fk_parent_line = 0;
} }
$result = $object->addline( $result = $object->addline(
$id,
$desc, $desc,
$lines[$i]->subprice, $lines[$i]->subprice,
$lines[$i]->qty, $lines[$i]->qty,

View File

@ -758,7 +758,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
$product->fetch($_POST['idprod'.$i]); $product->fetch($_POST['idprod'.$i]);
$startday=dol_mktime(12, 0, 0, $_POST['date_start'.$i.'month'], $_POST['date_start'.$i.'day'], $_POST['date_start'.$i.'year']); $startday=dol_mktime(12, 0, 0, $_POST['date_start'.$i.'month'], $_POST['date_start'.$i.'day'], $_POST['date_start'.$i.'year']);
$endday=dol_mktime(12, 0, 0, $_POST['date_end'.$i.'month'], $_POST['date_end'.$i.'day'], $_POST['date_end'.$i.'year']); $endday=dol_mktime(12, 0, 0, $_POST['date_end'.$i.'month'], $_POST['date_end'.$i.'day'], $_POST['date_end'.$i.'year']);
$result=$object->addline($id,$product->description,$product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); $result=$object->addline($product->description,$product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
} }
} }
} }
@ -913,7 +913,6 @@ else if ($action == 'add' && $user->rights->facture->creer)
} }
$result = $object->addline( $result = $object->addline(
$id,
$langs->trans('Deposit'), $langs->trans('Deposit'),
$amountdeposit, //subprice $amountdeposit, //subprice
1, //quantity 1, //quantity
@ -1016,7 +1015,6 @@ else if ($action == 'add' && $user->rights->facture->creer)
} }
$result = $object->addline( $result = $object->addline(
$id,
$desc, $desc,
$lines[$i]->subprice, $lines[$i]->subprice,
$lines[$i]->qty, $lines[$i]->qty,
@ -1093,7 +1091,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
$product->fetch($_POST['idprod'.$i]); $product->fetch($_POST['idprod'.$i]);
$startday=dol_mktime(12, 0, 0, $_POST['date_start'.$i.'month'], $_POST['date_start'.$i.'day'], $_POST['date_start'.$i.'year']); $startday=dol_mktime(12, 0, 0, $_POST['date_start'.$i.'month'], $_POST['date_start'.$i.'day'], $_POST['date_start'.$i.'year']);
$endday=dol_mktime(12, 0, 0, $_POST['date_end'.$i.'month'], $_POST['date_end'.$i.'day'], $_POST['date_end'.$i.'year']); $endday=dol_mktime(12, 0, 0, $_POST['date_end'.$i.'month'], $_POST['date_end'.$i.'day'], $_POST['date_end'.$i.'year']);
$result=$object->addline($id,$product->description,$product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); $result=$object->addline($product->description,$product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
} }
} }
} }
@ -1311,7 +1309,6 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
{ {
// Insert line // Insert line
$result = $object->addline( $result = $object->addline(
$id,
$desc, $desc,
$pu_ht, $pu_ht,
GETPOST('qty'), GETPOST('qty'),

View File

@ -147,7 +147,6 @@ class FactureRec extends Facture
for ($i = 0; $i < $num; $i++) for ($i = 0; $i < $num; $i++)
{ {
$result_insert = $this->addline( $result_insert = $this->addline(
$this->id,
$facsrc->lines[$i]->desc, $facsrc->lines[$i]->desc,
$facsrc->lines[$i]->subprice, $facsrc->lines[$i]->subprice,
$facsrc->lines[$i]->qty, $facsrc->lines[$i]->qty,
@ -399,7 +398,6 @@ class FactureRec extends Facture
/** /**
* Add a line to invoice * Add a line to invoice
* *
* @param int $facid Id de la facture
* @param string $desc Description de la ligne * @param string $desc Description de la ligne
* @param double $pu_ht Prix unitaire HT (> 0 even for credit note) * @param double $pu_ht Prix unitaire HT (> 0 even for credit note)
* @param double $qty Quantite * @param double $qty Quantite
@ -416,8 +414,10 @@ class FactureRec extends Facture
* @param string $label Label of the line * @param string $label Label of the line
* @return int <0 if KO, Id of line if OK * @return int <0 if KO, Id of line if OK
*/ */
function addline($facid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='') function addline($desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='')
{ {
$facid=$this->id;
dol_syslog("FactureRec::addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type", LOG_DEBUG); dol_syslog("FactureRec::addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type", LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';

View File

@ -344,7 +344,6 @@ class Facture extends CommonInvoice
} }
$result = $this->addline( $result = $this->addline(
$this->id,
$this->lines[$i]->desc, $this->lines[$i]->desc,
$this->lines[$i]->subprice, $this->lines[$i]->subprice,
$this->lines[$i]->qty, $this->lines[$i]->qty,
@ -403,7 +402,6 @@ class Facture extends CommonInvoice
$localtax2_tx=get_localtax($tva_tx,2,$soc); $localtax2_tx=get_localtax($tva_tx,2,$soc);
$result_insert = $this->addline( $result_insert = $this->addline(
$this->id,
$_facrec->lines[$i]->desc, $_facrec->lines[$i]->desc,
$_facrec->lines[$i]->subprice, $_facrec->lines[$i]->subprice,
$_facrec->lines[$i]->qty, $_facrec->lines[$i]->qty,
@ -1943,7 +1941,6 @@ class Facture extends CommonInvoice
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit)
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
* *
* @param int $facid Id de la facture
* @param string $desc Description de la ligne * @param string $desc Description de la ligne
* @param double $pu_ht Prix unitaire HT (> 0 even for credit note) * @param double $pu_ht Prix unitaire HT (> 0 even for credit note)
* @param double $qty Quantite * @param double $qty Quantite
@ -1971,8 +1968,10 @@ class Facture extends CommonInvoice
* @param array $array_option extrafields array * @param array $array_option extrafields array
* @return int <0 if KO, Id of line if OK * @return int <0 if KO, Id of line if OK
*/ */
function addline($facid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$array_option=0) function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$array_option=0)
{ {
$facid=$this->id;
dol_syslog(get_class($this)."::Addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type", LOG_DEBUG); dol_syslog(get_class($this)."::Addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type", LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';

View File

@ -37,18 +37,17 @@ $dolibarr_main_document_root='';
// dolibarr_main_url_root_alt // dolibarr_main_url_root_alt
// This parameter defines the alternative URL of your Dolibarr. // This parameter defines the relative sub URLs of alternative Dolibarr root directories.
// It must link to some other secondary htdocs directories, separated by a coma. // It can be links to some other secondary htdocs directories, separated by a coma.
// Examples: // Examples:
// $dolibarr_main_url_root_alt='http://localhost/extensions'; // $dolibarr_main_url_root_alt='/extensions';
// $dolibarr_main_url_root_alt='http://mydolibarrvirtualhost/extensions1,http://mydolibarrvirtualhost/extensions2'; // $dolibarr_main_url_root_alt='/extensions1,/extensions2';
// //
$dolibarr_main_url_root_alt=''; $dolibarr_main_url_root_alt='';
// dolibarr_main_document_root_alt // dolibarr_main_document_root_alt
// This parameter contains absolute alternative file system directory of Dolibarr // This parameter contains absolute alternative root file system directories of Dolibarr
// It must link to url to other secondary htdocs directories, separated by a coma.
// Examples: // Examples:
// $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/extensions'; // $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/extensions';
// $dolibarr_main_document_root_alt='C:/My web sites/dolibarr/htdocs/extensions1,C:/My web sites/dolibarr/htdocs/extensions2'; // $dolibarr_main_document_root_alt='C:/My web sites/dolibarr/htdocs/extensions1,C:/My web sites/dolibarr/htdocs/extensions2';

View File

@ -131,7 +131,7 @@ class HookManager
// Define type of hook ('output', 'returnvalue' or 'addreplace'). 'addreplace' should be type for all hooks. 'output' and 'returnvalue' are deprecated. // Define type of hook ('output', 'returnvalue' or 'addreplace'). 'addreplace' should be type for all hooks. 'output' and 'returnvalue' are deprecated.
$hooktype='output'; $hooktype='output';
if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win. if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win.
if (in_array($method,array('doActions','formObjectOptions','moveUploadedFile','pdf_writelinedesc','paymentsupplierinvoices','printSearchForm'))) $hooktype='addreplace'; if (in_array($method,array('doActions','formObjectOptions','moveUploadedFile','pdf_writelinedesc','paymentsupplierinvoices','printSearchForm', 'formattachOptions', 'formBuilddocLineOptions'))) $hooktype='addreplace';
// Loop on each hook to qualify modules that declared context // Loop on each hook to qualify modules that declared context
$modulealreadyexecuted=array(); $modulealreadyexecuted=array();
@ -159,13 +159,13 @@ class HookManager
{ {
$error++; $error++;
$this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors); $this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors);
// TODO remove this.
// TODO remove this. Change must be inside the method of hook if required /* Change must be inside the method of hook if required. Only hook must decide if $action must be modified or not.
if ($method == 'doActions') if ($method == 'doActions')
{ {
if ($action=='add') $action='create'; if ($action=='add') $action='create';
if ($action=='update') $action='edit'; if ($action=='update') $action='edit';
} }*/
} }
if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
@ -181,11 +181,10 @@ class HookManager
if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
// TODO. remove this. array result must be set into $actionclassinstance->results // TODO. remove this. array result must be set into $actionclassinstance->results
if (is_array($result)) $this->resArray = array_merge($this->resArray, $result); //if (is_array($result)) $this->resArray = array_merge($this->resArray, $result);
// TODO. remove this. result must not be a string. we must use $actionclassinstance->resprint to return a string // TODO. remove this. result must not be a string. we must use $actionclassinstance->resprints to return a string
if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result; //if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result;
} }
//print "After hook ".get_class($actionclassinstance)." method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction."<br>\n"; //print "After hook ".get_class($actionclassinstance)." method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction."<br>\n";

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (c) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (c) 2008-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (c) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (c) 2010 Juanjo Menent <jmenent@2byte.es>
* *
@ -64,7 +64,8 @@ class FormFile
*/ */
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=true) function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=true)
{ {
global $conf,$langs; global $conf,$langs, $hookmanager;
$hookmanager->initHooks(array('formfile'));
if (! empty($conf->browser->phone)) return 0; if (! empty($conf->browser->phone)) return 0;
@ -76,22 +77,22 @@ class FormFile
{ {
$maxlength=$size; $maxlength=$size;
print "\n\n<!-- Start form attach new file -->\n"; $out = "\n\n<!-- Start form attach new file -->\n";
if (empty($title)) $title=$langs->trans("AttachANewFile"); if (empty($title)) $title=$langs->trans("AttachANewFile");
if ($title != 'none') print_titre($title); if ($title != 'none') print_titre($title);
print '<form name="formuserfile" action="'.$url.'" enctype="multipart/form-data" method="POST">'; $out .= '<form name="formuserfile" action="'.$url.'" enctype="multipart/form-data" method="POST">';
print '<input type="hidden" id="formuserfile_section_dir" name="section_dir" value="">'; $out .= '<input type="hidden" id="formuserfile_section_dir" name="section_dir" value="">';
print '<input type="hidden" id="formuserfile_section_id" name="section_id" value="'.$sectionid.'">'; $out .= '<input type="hidden" id="formuserfile_section_id" name="section_id" value="'.$sectionid.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; $out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table width="100%" class="nobordernopadding">'; $out .= '<table width="100%" class="nobordernopadding">';
print '<tr>'; $out .= '<tr>';
if (! empty($options)) print '<td>'.$options.'</td>'; if (! empty($options)) $out .= '<td>'.$options.'</td>';
print '<td valign="middle" class="nowrap">'; $out .= '<td valign="middle" class="nowrap">';
$max=$conf->global->MAIN_UPLOAD_DOC; // En Kb $max=$conf->global->MAIN_UPLOAD_DOC; // En Kb
$maxphp=@ini_get('upload_max_filesize'); // En inconnu $maxphp=@ini_get('upload_max_filesize'); // En inconnu
@ -102,20 +103,20 @@ class FormFile
if ($max > 0) if ($max > 0)
{ {
print '<input type="hidden" name="max_file_size" value="'.($max*1024).'">'; $out .= '<input type="hidden" name="max_file_size" value="'.($max*1024).'">';
} }
print '<input class="flat" type="file" name="userfile" size="'.$maxlength.'"'; $out .= '<input class="flat" type="file" name="userfile" size="'.$maxlength.'"';
print (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':''); $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':'');
print '>'; $out .= '>';
print ' &nbsp; '; $out .= ' &nbsp; ';
print '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"'; $out .= '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"';
print (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':''); $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':'');
print '>'; $out .= '>';
if ($addcancel) if ($addcancel)
{ {
print ' &nbsp; '; $out .= ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; $out .= '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
} }
if (! empty($conf->global->MAIN_UPLOAD_DOC)) if (! empty($conf->global->MAIN_UPLOAD_DOC))
@ -123,22 +124,29 @@ class FormFile
if ($perm) if ($perm)
{ {
$langs->load('other'); $langs->load('other');
print ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb"); $out .= ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb");
print ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); $out .= ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1);
print ')'; $out .= ')';
} }
} }
else else
{ {
print ' ('.$langs->trans("UploadDisabled").')'; $out .= ' ('.$langs->trans("UploadDisabled").')';
} }
print "</td></tr>"; $out .= "</td></tr>";
print "</table>"; $out .= "</table>";
print '</form>'; $out .= '</form>';
if (empty($sectionid)) print '<br>'; if (empty($sectionid)) $out .= '<br>';
print "\n<!-- End form attach new file -->\n\n"; $out .= "\n<!-- End form attach new file -->\n\n";
$parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url);
$res = $hookmanager->executeHooks('formattachOptions',$parameters,$object);
if (empty($res))
{
print $out;
}
print $hookmanager->resprint;
return 1; return 1;
} }
@ -536,7 +544,10 @@ class FormFile
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''),'modulepart'=>$modulepart,'relativepath'=>$relativepath); $parameters=array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''),'modulepart'=>$modulepart,'relativepath'=>$relativepath);
$out.= $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file); $res = $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file);
if(!$res) {
$out .= $hookmanager->resPrint;
}
} }
} }

View File

@ -285,7 +285,7 @@ function dol_buildpath($path, $type=0)
if (! empty($regs[1])) if (! empty($regs[1]))
{ {
//print $key.'-'.$dirroot.'/'.$path.'-'.$conf->file->dol_url_root[$type].'<br>'."\n"; //print $key.'-'.$dirroot.'/'.$path.'-'.$conf->file->dol_url_root[$type].'<br>'."\n";
if (file_exists($dirroot.'/'.$path)) if (file_exists($dirroot.'/'.$regs[1]))
{ {
if ($type == 1) if ($type == 1)
{ {

View File

@ -144,9 +144,9 @@ if (! empty($hookmanager->resArray['options'])) {
<br> <br>
<?php if ($message) { ?> <?php if ($message) { ?>
<center><div align="center" style="max-width: 680px; margin-left: 10px; margin-right: 10px;"><div class="error"> <center><div align="center" style="max-width: 680px; margin-left: 10px; margin-right: 10px;">
<?php echo $message; ?> <?php echo dol_htmloutput_mesg($message,'','',1); ?>
</div></div></center> </div></center>
<?php } ?> <?php } ?>
</center> <!-- end of center --> </center> <!-- end of center -->

View File

@ -555,6 +555,23 @@ class InterfaceActionsAuto
$ok=1; $ok=1;
} }
// Projects
elseif ($action == 'PROJECT_CREATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("projects");
$langs->load("agenda");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Project").': '.$object->ref;
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
$ok=1;
}
// If not found // If not found
/* /*
else else

View File

@ -175,22 +175,6 @@ $suburi = strstr($uri, '/'); // $suburi contains url without domain:p
if ($suburi == '/') $suburi = ''; // If $suburi is /, it is now '' if ($suburi == '/') $suburi = ''; // If $suburi is /, it is now ''
define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...)
/*
// Define DOL_MAIN_URL_ROOT_ALT and DOL_URL_ROOT_ALT (deprecated)
if (! empty($dolibarr_main_url_root_alt))
{
$altpart=str_replace($dolibarr_main_url_root,'',$dolibarr_main_url_root_alt);
if (! preg_match('/^\//',$altpart) && ! empty($altpart)) { $tmp_alt=$dolibarr_main_url_root_alt; } // Manage case url=http://localhost/aaa and url_alt=http://localhost/aaabbb
else $tmp_alt=$tmp.((preg_match('/\/$/',$tmp)||preg_match('/^\//',$altpart))?'':'/').$altpart;
//$tmp_alt=$dolibarr_main_url_root_alt;
define('DOL_MAIN_URL_ROOT_ALT', $tmp_alt); // URL absolute root (https://sss/dolibarr/custom, ...)
$uri=preg_replace('/^http(s?):\/\//i','',constant('DOL_MAIN_URL_ROOT_ALT')); // $uri contains url without http*
$suburi = strstr($uri, '/'); // $suburi contains url without domain:port
if ($suburi == '/') $suburi = ''; // If $suburi is /, it is now ''
define('DOL_URL_ROOT_ALT', $suburi); // URL relative root ('', '/dolibarr/custom', ...)
}
*/
//print DOL_URL_ROOT; //print DOL_URL_ROOT;
// Define prefix MAIN_DB_PREFIX // Define prefix MAIN_DB_PREFIX

View File

@ -33,6 +33,10 @@ $sref=GETPOST('search_ref');
$snom=GETPOST('search_nom'); $snom=GETPOST('search_nom');
$suser=GETPOST('search_user'); $suser=GETPOST('search_user');
$sttc=GETPOST('search_ttc'); $sttc=GETPOST('search_ttc');
$search_ref=GETPOST('search_ref');
$search_nom=GETPOST('search_nom');
$search_user=GETPOST('search_user');
$search_ttc=GETPOST('search_ttc');
$sall=GETPOST('search_all'); $sall=GETPOST('search_all');
$page = GETPOST('page','int'); $page = GETPOST('page','int');
@ -119,9 +123,13 @@ if ($resql)
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
$param="";
print_barre_liste($title, $page, "liste.php", "", $sortfield, $sortorder, '', $num); if ($search_ref) $param.="&search_ref=".$search_ref;
print '<form action="liste.php" method="GET">'; if ($search_nom) $param.="&search_nom=".$search_nom;
if ($search_user) $param.="&search_user=".$search_user;
if ($search_ttc) $param.="&search_ttc=".$search_ttc;
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","","",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","","",'',$sortfield,$sortorder);

View File

@ -1,6 +1,6 @@
-- Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> -- Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
-- Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> -- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
-- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be> -- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
-- Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> -- Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
@ -57,3 +57,4 @@ insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang)
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (27,'MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25); insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (27,'MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (28,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10); insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (28,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (29,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',29); insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (29,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',29);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (30,'PROJECT_CREATE','Project creation','Executed when a project is created','project',30);

View File

@ -72,3 +72,6 @@ DELETE FROM llx_boxes where box_id IN (SELECT rowid FROM llx_boxes_def where fil
DELETE FROM llx_boxes_def where file='box_activity.php' AND note IS NULL; DELETE FROM llx_boxes_def where file='box_activity.php' AND note IS NULL;
ALTER TABLE llx_cronjob ADD libname VARCHAR(255); ALTER TABLE llx_cronjob ADD libname VARCHAR(255);
INSERT INTO llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (30,'PROJECT_CREATE','Project creation','Executed when a project is created','project',30);

View File

@ -94,6 +94,7 @@ ConfirmCloneProject=Are you sure to clone this project ?
ProjectReportDate=Change task date according project start date ProjectReportDate=Change task date according project start date
ErrorShiftTaskDate=Impossible to shift task date according to new project start date ErrorShiftTaskDate=Impossible to shift task date according to new project start date
ProjectsAndTasksLines=Projects and tasks ProjectsAndTasksLines=Projects and tasks
ProjectCreatedInDolibarr=Project %s created
##### Types de contacts ##### ##### Types de contacts #####
TypeContact_project_internal_PROJECTLEADER=Project leader TypeContact_project_internal_PROJECTLEADER=Project leader
TypeContact_project_external_PROJECTLEADER=Project leader TypeContact_project_external_PROJECTLEADER=Project leader

View File

@ -94,6 +94,7 @@ ConfirmCloneProject=Êtes-vous sûr de vouloir cloner ce projet ?
ProjectReportDate=Reporter les dates des tâches en fonction de la date de départ. ProjectReportDate=Reporter les dates des tâches en fonction de la date de départ.
ErrorShiftTaskDate=Une erreur c'est produite dans le report des dates des tâches. ErrorShiftTaskDate=Une erreur c'est produite dans le report des dates des tâches.
ProjectsAndTasksLines=Projets et tâches ProjectsAndTasksLines=Projets et tâches
ProjectCreatedInDolibarr=Projet %s créé
##### Types de contacts ##### ##### Types de contacts #####
TypeContact_project_internal_PROJECTLEADER=Chef de projet TypeContact_project_internal_PROJECTLEADER=Chef de projet
TypeContact_project_external_PROJECTLEADER=Chef de projet TypeContact_project_external_PROJECTLEADER=Chef de projet

View File

@ -74,7 +74,20 @@ if (! empty($dolibarr_main_document_root_alt))
foreach($values as $value) $conf->file->dol_document_root['alt'.($i++)]=(string) $value; foreach($values as $value) $conf->file->dol_document_root['alt'.($i++)]=(string) $value;
$values=preg_split('/[;,]/',$dolibarr_main_url_root_alt); $values=preg_split('/[;,]/',$dolibarr_main_url_root_alt);
$i=0; $i=0;
foreach($values as $value) $conf->file->dol_url_root['alt'.($i++)]=(string) $value; foreach($values as $value)
{
if (preg_match('/^http(s)?:/',$value))
{
print 'Error: values for <b>$dolibarr_main_url_root_alt</b> into <b>conf.php</b> file must contains relative path to alternative URLs.<br>'."\n";
print "Found: \"".$value."\"<br>\n";
print "Should found something like following examples:<br>\n";
print "\"/extensions\"<br>\n";
print "\"/extensions1,/extensions2,...\"<br>\n";
print "\"/custom\"<br>\n";
exit;
}
$conf->file->dol_url_root['alt'.($i++)]=(string) $value;
}
} }
// Set properties specific to multicompany // Set properties specific to multicompany

View File

@ -450,7 +450,6 @@ if (empty($reshook))
} }
$result = $propal->addline( $result = $propal->addline(
$propal->id,
$desc, $desc,
$pu_ht, $pu_ht,
GETPOST('qty'), GETPOST('qty'),
@ -524,7 +523,6 @@ if (empty($reshook))
} }
$result = $commande->addline( $result = $commande->addline(
$commande->id,
$desc, $desc,
$pu_ht, $pu_ht,
GETPOST('qty'), GETPOST('qty'),
@ -598,7 +596,6 @@ if (empty($reshook))
} }
$result = $facture->addline( $result = $facture->addline(
$facture->id,
$desc, $desc,
$pu_ht, $pu_ht,
GETPOST('qty'), GETPOST('qty'),

View File

@ -161,13 +161,37 @@ class PropalTest extends PHPUnit_Framework_TestCase
return $localobject; return $localobject;
} }
/**
* testPropalAddLine
*
* @param int $localobject Proposal
* @return void
*
* @depends testPropalFetch
* The depends says test is run only if previous is ok
*/
public function testPropalAddLine($localobject)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
$result=$localobject->addline($localobject->id, 'Added line', 10, 2, 19.6);
$this->assertLessThan($result, 0);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
return $localobject;
}
/** /**
* testPropalValid * testPropalValid
* *
* @param Proposal $localobject Proposal * @param Proposal $localobject Proposal
* @return Proposal * @return Proposal
* *
* @depends testPropalFetch * @depends testPropalAddLine
* The depends says test is run only if previous is ok * The depends says test is run only if previous is ok
*/ */
public function testPropalValid($localobject) public function testPropalValid($localobject)