Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
This commit is contained in:
commit
2e1e6120ce
@ -4200,6 +4200,12 @@ class OrderLine extends CommonOrderLine
|
|||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$objp = $this->db->fetch_object($result);
|
$objp = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
if (!$objp) {
|
||||||
|
$this->error = 'OrderLine with id '. $rowid .' not found sql='.$sql;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
$this->rowid = $objp->rowid;
|
$this->rowid = $objp->rowid;
|
||||||
$this->id = $objp->rowid;
|
$this->id = $objp->rowid;
|
||||||
$this->fk_commande = $objp->fk_commande;
|
$this->fk_commande = $objp->fk_commande;
|
||||||
|
|||||||
@ -5812,6 +5812,11 @@ class FactureLigne extends CommonInvoiceLine
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$objp = $this->db->fetch_object($result);
|
$objp = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
if (!$objp) {
|
||||||
|
$this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
$this->rowid = $objp->rowid;
|
$this->rowid = $objp->rowid;
|
||||||
$this->id = $objp->rowid;
|
$this->id = $objp->rowid;
|
||||||
$this->fk_facture = $objp->fk_facture;
|
$this->fk_facture = $objp->fk_facture;
|
||||||
|
|||||||
@ -5612,6 +5612,9 @@ abstract class CommonObject
|
|||||||
if ($this->element == 'contrat' && !empty($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD)) {
|
if ($this->element == 'contrat' && !empty($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||||
$setsharekey = true;
|
$setsharekey = true;
|
||||||
}
|
}
|
||||||
|
if ($this->element == 'fichinter' && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||||
|
$setsharekey = true;
|
||||||
|
}
|
||||||
if ($this->element == 'supplier_proposal' && !empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) {
|
if ($this->element == 'supplier_proposal' && !empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||||
$setsharekey = true;
|
$setsharekey = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -131,7 +131,12 @@ function bank_prepare_head(Account $object)
|
|||||||
*/
|
*/
|
||||||
function bank_admin_prepare_head($object)
|
function bank_admin_prepare_head($object)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user, $db;
|
||||||
|
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$extrafields->fetch_name_optionals_label('bank_account');
|
||||||
|
$extrafields->fetch_name_optionals_label('bank');
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
@ -154,11 +159,19 @@ function bank_admin_prepare_head($object)
|
|||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankAccounts").')';
|
$head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankAccounts").')';
|
||||||
|
$nbExtrafields = $extrafields->attributes['bank_account']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributes';
|
$head[$h][2] = 'attributes';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankTransactions").')';
|
$head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankTransactions").')';
|
||||||
|
$nbExtrafields = $extrafields->attributes['bank']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'bankline_extrafields';
|
$head[$h][2] = 'bankline_extrafields';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|||||||
@ -139,7 +139,11 @@ function fichinter_prepare_head($object)
|
|||||||
*/
|
*/
|
||||||
function fichinter_admin_prepare_head()
|
function fichinter_admin_prepare_head()
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user, $db;
|
||||||
|
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$extrafields->fetch_name_optionals_label('fichinter');
|
||||||
|
$extrafields->fetch_name_optionals_label('fichinterdet');
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
@ -159,19 +163,25 @@ function fichinter_admin_prepare_head()
|
|||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinter_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinter_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFields");
|
$head[$h][1] = $langs->trans("ExtraFields");
|
||||||
|
$nbExtrafields = $extrafields->attributes['fichinter']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributes';
|
$head[$h][2] = 'attributes';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||||
|
$nbExtrafields = $extrafields->attributes['fichinterdet']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributesdet';
|
$head[$h][2] = 'attributesdet';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'fichinter_admin', 'remove');
|
complete_head_from_modules($conf, $langs, null, $head, $h, 'fichinter_admin', 'remove');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -7787,6 +7787,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
if (is_object($object) && $object->element == 'contrat') {
|
if (is_object($object) && $object->element == 'contrat') {
|
||||||
$typeforonlinepayment = 'contract';
|
$typeforonlinepayment = 'contract';
|
||||||
}
|
}
|
||||||
|
if (is_object($object) && $object->element == 'fichinter') {
|
||||||
|
$typeforonlinepayment = 'ficheinter';
|
||||||
|
}
|
||||||
$url = getOnlinePaymentUrl(0, $typeforonlinepayment, $substitutionarray['__REF__']);
|
$url = getOnlinePaymentUrl(0, $typeforonlinepayment, $substitutionarray['__REF__']);
|
||||||
$paymenturl = $url;
|
$paymenturl = $url;
|
||||||
}
|
}
|
||||||
@ -7819,6 +7822,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
} else {
|
} else {
|
||||||
$substitutionarray['__DIRECTDOWNLOAD_URL_CONTRACT__'] = '';
|
$substitutionarray['__DIRECTDOWNLOAD_URL_CONTRACT__'] = '';
|
||||||
}
|
}
|
||||||
|
if (!empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'fichinter') {
|
||||||
|
$substitutionarray['__DIRECTDOWNLOAD_URL_FICHINTER__'] = $object->getLastMainDocLink($object->element);
|
||||||
|
} else {
|
||||||
|
$substitutionarray['__DIRECTDOWNLOAD_URL_FICHINTER__'] = '';
|
||||||
|
}
|
||||||
if (!empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'supplier_proposal') {
|
if (!empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'supplier_proposal') {
|
||||||
$substitutionarray['__DIRECTDOWNLOAD_URL_SUPPLIER_PROPOSAL__'] = $object->getLastMainDocLink($object->element);
|
$substitutionarray['__DIRECTDOWNLOAD_URL_SUPPLIER_PROPOSAL__'] = $object->getLastMainDocLink($object->element);
|
||||||
} else {
|
} else {
|
||||||
@ -7837,6 +7845,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
if (is_object($object) && $object->element == 'contrat') {
|
if (is_object($object) && $object->element == 'contrat') {
|
||||||
$substitutionarray['__URL_CONTRACT__'] = DOL_MAIN_URL_ROOT."/contrat/card.php?id=".$object->id;
|
$substitutionarray['__URL_CONTRACT__'] = DOL_MAIN_URL_ROOT."/contrat/card.php?id=".$object->id;
|
||||||
}
|
}
|
||||||
|
if (is_object($object) && $object->element == 'fichinter') {
|
||||||
|
$substitutionarray['__URL_FICHINTER__'] = DOL_MAIN_URL_ROOT."/fichinter/card.php?id=".$object->id;
|
||||||
|
}
|
||||||
if (is_object($object) && $object->element == 'supplier_proposal') {
|
if (is_object($object) && $object->element == 'supplier_proposal') {
|
||||||
$substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id;
|
$substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2017 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2017 Charlie Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2017 ATM-CONSULTING <contact@atm-consulting.fr>
|
* Copyright (C) 2017 ATM-CONSULTING <contact@atm-consulting.fr>
|
||||||
*
|
*
|
||||||
@ -137,7 +137,13 @@ function facture_prepare_head($object)
|
|||||||
*/
|
*/
|
||||||
function invoice_admin_prepare_head()
|
function invoice_admin_prepare_head()
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user, $db;
|
||||||
|
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$extrafields->fetch_name_optionals_label('facture');
|
||||||
|
$extrafields->fetch_name_optionals_label('facturedet');
|
||||||
|
$extrafields->fetch_name_optionals_label('facture_rec');
|
||||||
|
$extrafields->fetch_name_optionals_label('facturedet_rec');
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
@ -160,25 +166,41 @@ function invoice_admin_prepare_head()
|
|||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices");
|
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices");
|
||||||
|
$nbExtrafields = $extrafields->attributes['facture']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributes';
|
$head[$h][2] = 'attributes';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||||
|
$nbExtrafields = $extrafields->attributes['facturedet']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributeslines';
|
$head[$h][2] = 'attributeslines';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec");
|
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec");
|
||||||
|
$nbExtrafields = $extrafields->attributes['facture_rec']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributesrec';
|
$head[$h][2] = 'attributesrec';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFieldsLinesRec");
|
$head[$h][1] = $langs->trans("ExtraFieldsLinesRec");
|
||||||
|
$nbExtrafields = $extrafields->attributes['facturedet_rec']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributeslinesrec';
|
$head[$h][2] = 'attributeslinesrec';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if ($conf->global->INVOICE_USE_SITUATION) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable
|
if (!empty($conf->global->INVOICE_USE_SITUATION)) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php';
|
$head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php';
|
||||||
$head[$h][1] = $langs->trans("InvoiceSituation");
|
$head[$h][1] = $langs->trans("InvoiceSituation");
|
||||||
$head[$h][2] = 'situation';
|
$head[$h][2] = 'situation';
|
||||||
|
|||||||
@ -1713,8 +1713,14 @@ if ($action == 'create') {
|
|||||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('fichinter'));
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('fichinter'));
|
||||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||||
|
|
||||||
|
// Show direct download link
|
||||||
|
if ($object->statut != Fichinter::STATUS_DRAFT && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||||
|
print '<br><!-- Link to download main doc -->'."\n";
|
||||||
|
print showDirectDownloadLink($object).'<br>';
|
||||||
|
}
|
||||||
|
|
||||||
// Show online signature link
|
// Show online signature link
|
||||||
if ($object->statut != Fichinter::STATUS_DRAFT && $conf->global->FICHINTER_ALLOW_ONLINE_SIGN) {
|
if ($object->statut != Fichinter::STATUS_DRAFT && !empty($conf->global->FICHINTER_ALLOW_ONLINE_SIGN)) {
|
||||||
print '<br><!-- Link to sign -->';
|
print '<br><!-- Link to sign -->';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
|
||||||
|
|
||||||
|
|||||||
@ -150,6 +150,8 @@ class PriceParser
|
|||||||
"length" => $product->length,
|
"length" => $product->length,
|
||||||
"surface" => $product->surface,
|
"surface" => $product->surface,
|
||||||
"price_min" => $product->price_min,
|
"price_min" => $product->price_min,
|
||||||
|
"cost_price" => $product->cost_price,
|
||||||
|
"pmp" => $product->pmp,
|
||||||
));
|
));
|
||||||
|
|
||||||
//Retrieve all extrafield for product and add it to values
|
//Retrieve all extrafield for product and add it to values
|
||||||
|
|||||||
@ -78,6 +78,9 @@ $message = GETPOST('message', 'aZ09');
|
|||||||
$suffix = GETPOST("suffix", 'aZ09');
|
$suffix = GETPOST("suffix", 'aZ09');
|
||||||
$source = GETPOST("source", 'alpha');
|
$source = GETPOST("source", 'alpha');
|
||||||
$ref = $REF = GETPOST("ref", 'alpha');
|
$ref = $REF = GETPOST("ref", 'alpha');
|
||||||
|
$urlok = '';
|
||||||
|
$urlko = '';
|
||||||
|
|
||||||
|
|
||||||
if (empty($source)) {
|
if (empty($source)) {
|
||||||
$source = 'proposal';
|
$source = 'proposal';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user