forked from Wavyzz/dolibarr
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop
Conflicts: htdocs/admin/system/perf.php
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -48,7 +48,10 @@ For developers:
|
||||
- New: Make some changes to allow usage of several alternative $dolibarr_main_url_root variables.
|
||||
Fix also several bugs with old code.
|
||||
|
||||
WARNING: We started to clean hooks code. If your hook want to modify value of $actions, it's role
|
||||
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)
|
||||
@@ -57,6 +60,11 @@ 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 *****
|
||||
For users:
|
||||
- New: Can use ODS templates as document templates.
|
||||
|
||||
@@ -186,7 +186,7 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
|
||||
$prodid = rand(1, $num_prods);
|
||||
$product=new Product($db);
|
||||
$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)
|
||||
{
|
||||
dol_print_error($db,$propal->error);
|
||||
|
||||
@@ -112,8 +112,12 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0)
|
||||
$prodid = rand(1, $num_prods);
|
||||
$product=new Product($db);
|
||||
$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);
|
||||
$xnbp++;
|
||||
$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);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$propal->error);
|
||||
}
|
||||
$xnbp++;
|
||||
}
|
||||
|
||||
print " OK with ref ".$facture->ref."\n";;
|
||||
|
||||
@@ -143,7 +143,9 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
|
||||
while ($xnbp < $nbp)
|
||||
{
|
||||
$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)
|
||||
{
|
||||
dol_print_error($db,$propal->error);
|
||||
|
||||
10
htdocs/.gitignore
vendored
10
htdocs/.gitignore
vendored
@@ -1,9 +1,11 @@
|
||||
/test.php
|
||||
/custom*
|
||||
/bootstrap
|
||||
/multicompany
|
||||
/ovh
|
||||
/numberingpack
|
||||
/extensions
|
||||
/google
|
||||
/skincoloreditor
|
||||
/multicompany
|
||||
/numberingpack
|
||||
/ovh
|
||||
/pos
|
||||
/skincoloreditor
|
||||
/ultimatepdf
|
||||
|
||||
@@ -368,7 +368,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
||||
$vattouse=get_default_tva($mysoc, $mysoc, $idprodsubscription);
|
||||
}
|
||||
//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)
|
||||
{
|
||||
$errmsg=$invoice->error;
|
||||
@@ -538,7 +538,7 @@ if ($rowid)
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.dol_print_email($object->email,0,$object->fk_soc,1).'</td></tr>';
|
||||
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$object->getLibStatut(4).'</td></tr>';
|
||||
|
||||
|
||||
@@ -88,6 +88,8 @@ if ($result)
|
||||
|
||||
$title=$langs->trans("ListOfSubscriptions");
|
||||
if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')';
|
||||
|
||||
$param="";
|
||||
$param.="&statut=$statut&date_select=$date_select";
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);
|
||||
|
||||
|
||||
@@ -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_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_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_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"],'chaine',0,'',$conf->entity);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -403,7 +403,7 @@ if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
|
||||
|
||||
// Product search
|
||||
print '<br>';
|
||||
print '<strong>'.$langs->trans("ProductSearch").'</strong>: ';
|
||||
print '<strong>'.$langs->trans("SearchOptim").'</strong>: ';
|
||||
print '<br>';
|
||||
$tab = array();
|
||||
$sql = "SELECT COUNT(*) as nb";
|
||||
@@ -433,6 +433,7 @@ if ($resql)
|
||||
}
|
||||
|
||||
// Browser
|
||||
<<<<<<< HEAD
|
||||
print '<br>';
|
||||
print '<strong>'.$langs->trans("Browser").'</strong>: ';
|
||||
var_dump($conf->browser);
|
||||
@@ -443,6 +444,26 @@ print '<br>';
|
||||
print '<strong>'.$langs->trans("DatabaseStatistics").'</strong>: ';
|
||||
print '<br>';
|
||||
|
||||
=======
|
||||
print '<br>';
|
||||
print '<strong>'.$langs->trans("Browser").'</strong>:<br>';
|
||||
if (! in_array($conf->browser->name, array('chrome','opera','safari','firefox')))
|
||||
{
|
||||
print img_picto('','warning.png').' '.$langs->trans("BrowserIsKO",$conf->browser->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_picto('','tick.png').' '.$langs->trans("BrowserIsOK",$conf->browser->name);
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
// Database statistics update
|
||||
/*
|
||||
print '<br>';
|
||||
print '<strong>'.$langs->trans("DatabaseStatistics").'</strong>: ';
|
||||
print '<br>';
|
||||
*/
|
||||
>>>>>>> 7485192cfbca23027d10cfdc41a33a14f332d23c
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -804,7 +804,6 @@ else if ($action == "addline" && $user->rights->propal->creer)
|
||||
{
|
||||
// Insert line
|
||||
$result=$object->addline(
|
||||
$id,
|
||||
$desc,
|
||||
$pu_ht,
|
||||
GETPOST('qty'),
|
||||
|
||||
@@ -314,9 +314,9 @@ class Propal extends CommonObject
|
||||
*
|
||||
* @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");
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
@@ -414,7 +414,6 @@ class Propal extends CommonObject
|
||||
$this->line->pa_ht = $pa_ht;
|
||||
|
||||
// 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;
|
||||
|
||||
// TODO deprecated
|
||||
@@ -762,7 +761,6 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
$result = $this->addline(
|
||||
$this->id,
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
|
||||
@@ -681,7 +681,6 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
$result = $this->addline(
|
||||
$this->id,
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
@@ -1005,7 +1004,6 @@ class Commande extends CommonOrder
|
||||
/**
|
||||
* 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 double $pu_ht Unit price (without tax)
|
||||
* @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)
|
||||
* 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);
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
@@ -322,7 +322,6 @@ else if ($action == 'add' && $user->rights->commande->creer)
|
||||
}
|
||||
|
||||
$result = $object->addline(
|
||||
$object_id,
|
||||
$desc,
|
||||
$lines[$i]->subprice,
|
||||
$lines[$i]->qty,
|
||||
@@ -739,7 +738,6 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
{
|
||||
// Insert line
|
||||
$result = $object->addline(
|
||||
$object->id,
|
||||
$desc,
|
||||
$pu_ht,
|
||||
GETPOST('qty'),
|
||||
|
||||
@@ -269,7 +269,6 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
|
||||
$fk_parent_line = 0;
|
||||
}
|
||||
$result = $object->addline(
|
||||
$id,
|
||||
$desc,
|
||||
$lines[$i]->subprice,
|
||||
$lines[$i]->qty,
|
||||
@@ -428,7 +427,7 @@ if ($action == 'create' && empty($mesgs))
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$formproject=new FormProjets($db);
|
||||
|
||||
|
||||
$langs->load('projects');
|
||||
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
|
||||
$formproject->select_projects($soc->id, $projectid, 'projectid');
|
||||
|
||||
@@ -758,7 +758,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
||||
$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']);
|
||||
$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(
|
||||
$id,
|
||||
$langs->trans('Deposit'),
|
||||
$amountdeposit, //subprice
|
||||
1, //quantity
|
||||
@@ -1016,7 +1015,6 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
||||
}
|
||||
|
||||
$result = $object->addline(
|
||||
$id,
|
||||
$desc,
|
||||
$lines[$i]->subprice,
|
||||
$lines[$i]->qty,
|
||||
@@ -1093,7 +1091,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
||||
$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']);
|
||||
$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
|
||||
$result = $object->addline(
|
||||
$id,
|
||||
$desc,
|
||||
$pu_ht,
|
||||
GETPOST('qty'),
|
||||
|
||||
@@ -147,7 +147,6 @@ class FactureRec extends Facture
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
$result_insert = $this->addline(
|
||||
$this->id,
|
||||
$facsrc->lines[$i]->desc,
|
||||
$facsrc->lines[$i]->subprice,
|
||||
$facsrc->lines[$i]->qty,
|
||||
@@ -399,7 +398,6 @@ class FactureRec extends Facture
|
||||
/**
|
||||
* Add a line to invoice
|
||||
*
|
||||
* @param int $facid Id de la facture
|
||||
* @param string $desc Description de la ligne
|
||||
* @param double $pu_ht Prix unitaire HT (> 0 even for credit note)
|
||||
* @param double $qty Quantite
|
||||
@@ -416,8 +414,10 @@ class FactureRec extends Facture
|
||||
* @param string $label Label of the line
|
||||
* @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);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
|
||||
@@ -344,7 +344,6 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
$result = $this->addline(
|
||||
$this->id,
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
@@ -403,7 +402,6 @@ class Facture extends CommonInvoice
|
||||
$localtax2_tx=get_localtax($tva_tx,2,$soc);
|
||||
|
||||
$result_insert = $this->addline(
|
||||
$this->id,
|
||||
$_facrec->lines[$i]->desc,
|
||||
$_facrec->lines[$i]->subprice,
|
||||
$_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)
|
||||
* 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 double $pu_ht Prix unitaire HT (> 0 even for credit note)
|
||||
* @param double $qty Quantite
|
||||
@@ -1971,8 +1968,10 @@ class Facture extends CommonInvoice
|
||||
* @param array $array_option extrafields array
|
||||
* @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);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
|
||||
@@ -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.
|
||||
$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 (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
|
||||
$modulealreadyexecuted=array();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?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 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)
|
||||
{
|
||||
global $conf,$langs;
|
||||
global $conf,$langs, $hookmanager;
|
||||
$hookmanager->initHooks(array('formfile'));
|
||||
|
||||
if (! empty($conf->browser->phone)) return 0;
|
||||
|
||||
@@ -76,22 +77,22 @@ class FormFile
|
||||
{
|
||||
$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 ($title != 'none') print_titre($title);
|
||||
|
||||
print '<form name="formuserfile" action="'.$url.'" enctype="multipart/form-data" method="POST">';
|
||||
print '<input type="hidden" id="formuserfile_section_dir" name="section_dir" value="">';
|
||||
print '<input type="hidden" id="formuserfile_section_id" name="section_id" value="'.$sectionid.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$out .= '<form name="formuserfile" action="'.$url.'" enctype="multipart/form-data" method="POST">';
|
||||
$out .= '<input type="hidden" id="formuserfile_section_dir" name="section_dir" value="">';
|
||||
$out .= '<input type="hidden" id="formuserfile_section_id" name="section_id" value="'.$sectionid.'">';
|
||||
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
print '<tr>';
|
||||
$out .= '<table width="100%" class="nobordernopadding">';
|
||||
$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
|
||||
$maxphp=@ini_get('upload_max_filesize'); // En inconnu
|
||||
@@ -102,20 +103,20 @@ class FormFile
|
||||
|
||||
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.'"';
|
||||
print (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':'');
|
||||
print '>';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"';
|
||||
print (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':'');
|
||||
print '>';
|
||||
$out .= '<input class="flat" type="file" name="userfile" size="'.$maxlength.'"';
|
||||
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':'');
|
||||
$out .= '>';
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"';
|
||||
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':'');
|
||||
$out .= '>';
|
||||
|
||||
if ($addcancel)
|
||||
{
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
@@ -123,22 +124,29 @@ class FormFile
|
||||
if ($perm)
|
||||
{
|
||||
$langs->load('other');
|
||||
print ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb");
|
||||
print ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1);
|
||||
print ')';
|
||||
$out .= ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb");
|
||||
$out .= ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1);
|
||||
$out .= ')';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ('.$langs->trans("UploadDisabled").')';
|
||||
$out .= ' ('.$langs->trans("UploadDisabled").')';
|
||||
}
|
||||
print "</td></tr>";
|
||||
print "</table>";
|
||||
$out .= "</td></tr>";
|
||||
$out .= "</table>";
|
||||
|
||||
print '</form>';
|
||||
if (empty($sectionid)) print '<br>';
|
||||
$out .= '</form>';
|
||||
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;
|
||||
}
|
||||
@@ -495,7 +503,7 @@ class FormFile
|
||||
// Autre cas
|
||||
if ($modulepart == 'donation') { $relativepath = get_exdir($filename,2).$file["name"]; }
|
||||
if ($modulepart == 'export') { $relativepath = $file["name"]; }
|
||||
|
||||
|
||||
$out.= "<tr ".$bc[$var].">";
|
||||
|
||||
// Show file name with link to download
|
||||
@@ -533,10 +541,13 @@ class FormFile
|
||||
$out.= ($param?'&'.$param:'');
|
||||
$out.= '">'.img_printer().'</a></td>';
|
||||
}
|
||||
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);
|
||||
$out.= $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file);
|
||||
$res = $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file);
|
||||
if(!$res) {
|
||||
$out .= $hookmanager->resPrint;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,9 +144,9 @@ if (! empty($hookmanager->resArray['options'])) {
|
||||
<br>
|
||||
|
||||
<?php if ($message) { ?>
|
||||
<center><div align="center" style="max-width: 680px; margin-left: 10px; margin-right: 10px;"><div class="error">
|
||||
<?php echo $message; ?>
|
||||
</div></div></center>
|
||||
<center><div align="center" style="max-width: 680px; margin-left: 10px; margin-right: 10px;">
|
||||
<?php echo dol_htmloutput_mesg($message,'','',1); ?>
|
||||
</div></center>
|
||||
<?php } ?>
|
||||
|
||||
</center> <!-- end of center -->
|
||||
|
||||
@@ -33,6 +33,10 @@ $sref=GETPOST('search_ref');
|
||||
$snom=GETPOST('search_nom');
|
||||
$suser=GETPOST('search_user');
|
||||
$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');
|
||||
|
||||
$page = GETPOST('page','int');
|
||||
@@ -119,9 +123,13 @@ if ($resql)
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
|
||||
print_barre_liste($title, $page, "liste.php", "", $sortfield, $sortorder, '', $num);
|
||||
print '<form action="liste.php" method="GET">';
|
||||
$param="";
|
||||
if ($search_ref) $param.="&search_ref=".$search_ref;
|
||||
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 '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","","",'',$sortfield,$sortorder);
|
||||
|
||||
@@ -162,4 +162,6 @@ Pcg_version=Versió del pla
|
||||
Pcg_type=Tipus de compte
|
||||
Pcg_subtype=Subtipus de compte
|
||||
InvoiceLinesToDispatch=Línies de factures a desglossar
|
||||
InvoiceDispatched=Factures desglossades
|
||||
InvoiceDispatched=Factures desglossades
|
||||
AccountancyDashboard=Resum financer
|
||||
ByProductsAndServices=Per productes i serveis
|
||||
@@ -986,7 +986,10 @@ YouUseBestDriver=You use driver %s that is best driver available currently.
|
||||
YouDoNotUseBestDriver=You use drive %s but driver %s is recommanded.
|
||||
SearchProduct=Optimisation recherche produits
|
||||
NbOfProductIsLowerThanNoPb=You have only %s products/services into database. This does not required any particular optimization.
|
||||
|
||||
SearchOptim=Search optimization
|
||||
YouHaveXProductUseSearchOptim=You have %s product into database. You should add the constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 into Home-Setup-Other, you limit the search to the beginning of strings making possible for database to use index and you should get an immediate response.
|
||||
BrowserIsOK=You are using the web browser %s. This browser is ok for security and performance.
|
||||
BrowserIsKO=You are using the web browser %s. This browser is known to be a bad choice for security, performance and reliability. We recommand you to use Firefox, Chrome, Opera or Safari.
|
||||
##### Module password generation
|
||||
PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase.
|
||||
PasswordGenerationNone=Do not suggest any generated password. Password must be type in manually.
|
||||
|
||||
@@ -165,3 +165,5 @@ Pcg_type=Tipo de cuenta
|
||||
Pcg_subtype=Subtipo de cuenta
|
||||
InvoiceLinesToDispatch=Líneas de facturas a desglosar
|
||||
InvoiceDispatched=Facturas desglosadas
|
||||
AccountancyDashboard=Resumen financiero
|
||||
ByProductsAndServices=Por productos y servicios
|
||||
@@ -1002,6 +1002,10 @@ TestNotPossibleWithCurrentBrowsers=Détection automatique non possible
|
||||
YouUseBestDriver=Vous utilisez le driver %s qui est le driver recommandé actuellement.
|
||||
YouDoNotUseBestDriver=Vous utilisez le driver %s mais le driver %s est recommandé.
|
||||
NbOfProductIsLowerThanNoPb=Vous n'avez que %s produits/services en base. Ceci ne requiert pas d'optimisation particulière.
|
||||
SearchOptim=Optimization des recherches
|
||||
YouHaveXProductUseSearchOptim=Vous avez %s produits/services en base. Il est recommandé d'ajouter la constante PRODUCT_DONOTSEARCH_ANYWHERE à 1 dans Accueil-Configuration-Divers, vous limiterez ainsi la recherche au début de la chaine rendant possible l'utilisation de l'index et obtiendrez une réponse immédiate.
|
||||
BrowserIsOK=Vous utilisez le navigateur %s. Ce navigateur est réputé optimisé pour la sécurité et performance.
|
||||
BrowserIsKO=Vous utilisez le navigateur %s. Ce navigateur est déconseillé pour des raisons de sécurité, performance et qualité des pages restituées. Nous vous recommandons d'utiliser Firefox, Chrome, Opera ou Safari.
|
||||
##### Module password generation
|
||||
PasswordGenerationStandard=Renvoie un mot de passe généré selon l'algorithme interne de Dolibarr : 8 caractères, chiffres et caractères en minuscules mélangés.
|
||||
PasswordGenerationNone=Ne propose pas de mots de passe générés. Le mot de passe est à saisir manuellement.
|
||||
|
||||
@@ -450,7 +450,6 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
$result = $propal->addline(
|
||||
$propal->id,
|
||||
$desc,
|
||||
$pu_ht,
|
||||
GETPOST('qty'),
|
||||
@@ -524,7 +523,6 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
$result = $commande->addline(
|
||||
$commande->id,
|
||||
$desc,
|
||||
$pu_ht,
|
||||
GETPOST('qty'),
|
||||
@@ -598,7 +596,6 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
$result = $facture->addline(
|
||||
$facture->id,
|
||||
$desc,
|
||||
$pu_ht,
|
||||
GETPOST('qty'),
|
||||
|
||||
@@ -126,10 +126,10 @@ class ModulesTest extends PHPUnit_Framework_TestCase
|
||||
$db=$this->savdb;
|
||||
|
||||
$modulelist=array('Accounting','Adherent','Agenda','Banque','Barcode','Bookmark','Boutique',
|
||||
'CashDesk','Categorie','ClickToDial','Commande','Comptabilite','Contrat','Deplacement','Document','Don',
|
||||
'CashDesk','Categorie','ClickToDial','Commande','Comptabilite','Contrat','Cron','Deplacement','Document','Don',
|
||||
'ECM','Expedition','Export','ExternalRss','ExternalSite','Facture',
|
||||
'Fckeditor','Ficheinter','Fournisseur','FTP','GeoIPMaxmind','Gravatar','Import','Label','Ldap','Mailing',
|
||||
'Notification','Paybox','Paypal','Prelevement','Product','Projet','Propale',
|
||||
'Fckeditor','Ficheinter','Fournisseur','FTP','GeoIPMaxmind','Gravatar','Holiday','Import','Label','Ldap','Mailing',
|
||||
'Notification','Opensurvey','Paybox','Paypal','Prelevement','Product','Projet','Propale',
|
||||
'Service','Societe','Stock','Syslog','Tax','User','WebServices','Workflow');
|
||||
foreach($modulelist as $modlabel)
|
||||
{
|
||||
|
||||
@@ -116,7 +116,7 @@ class PropalTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testPropalCreate
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testPropalCreate()
|
||||
@@ -138,10 +138,10 @@ class PropalTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testPropalFetch
|
||||
*
|
||||
*
|
||||
* @param int $id Id of object
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
* @depends testPropalCreate
|
||||
* The depends says test is run only if previous is ok
|
||||
*/
|
||||
@@ -161,13 +161,37 @@ class PropalTest extends PHPUnit_Framework_TestCase
|
||||
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
|
||||
*
|
||||
*
|
||||
* @param Proposal $localobject Proposal
|
||||
* @return Proposal
|
||||
*
|
||||
* @depends testPropalFetch
|
||||
*
|
||||
* @depends testPropalAddLine
|
||||
* The depends says test is run only if previous is ok
|
||||
*/
|
||||
public function testPropalValid($localobject)
|
||||
@@ -187,10 +211,10 @@ class PropalTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testPropalOther
|
||||
*
|
||||
*
|
||||
* @param Proposal $localobject Proposal
|
||||
* @return int
|
||||
*
|
||||
*
|
||||
* @depends testPropalValid
|
||||
* The depends says test is run only if previous is ok
|
||||
*/
|
||||
@@ -216,10 +240,10 @@ class PropalTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testPropalDelete
|
||||
*
|
||||
*
|
||||
* @param int $id Id of proposal
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
* @depends testPropalOther
|
||||
* The depends says test is run only if previous is ok
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user