| '.$langs->trans('Project').' | ';
$formproject->select_projects($soc->id, $projectid, 'projectid');
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index dcacf578843..b8bc0b1ed10 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -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'),
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index 565e63fd749..bd512016825 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -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';
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 53e7178ce6d..b863d80e91c 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.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';
diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php
index 7227556d5ac..e41334a30e0 100755
--- a/htdocs/core/class/hookmanager.class.php
+++ b/htdocs/core/class/hookmanager.class.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();
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 9368864c7d0..0e433509489 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1,5 +1,5 @@
+/* Copyright (c) 2008-2013 Laurent Destailleur
* Copyright (C) 2010-2012 Regis Houssin
* Copyright (c) 2010 Juanjo Menent
*
@@ -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\n";
+ $out = "\n\n\n";
if (empty($title)) $title=$langs->trans("AttachANewFile");
if ($title != 'none') print_titre($title);
- print '';
- if (empty($sectionid)) print ' ';
+ $out .= '';
+ if (empty($sectionid)) $out .= ' ';
- print "\n\n\n";
+ $out .= "\n\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.= "";
// Show file name with link to download
@@ -533,10 +541,13 @@ class FormFile
$out.= ($param?'&'.$param:'');
$out.= '">'.img_printer().'';
}
- 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;
+ }
}
}
diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php
index 8109f5fe157..102a2a8bcc1 100644
--- a/htdocs/core/tpl/passwordforgotten.tpl.php
+++ b/htdocs/core/tpl/passwordforgotten.tpl.php
@@ -144,9 +144,9 @@ if (! empty($hookmanager->resArray['options'])) {
-
+
+
+
diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php
index bfd2be80cd5..a65e19137ee 100644
--- a/htdocs/fourn/commande/liste.php
+++ b/htdocs/fourn/commande/liste.php
@@ -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 ' |