';
- $urloption='?action=create'; // we use create not edit for more flexibility
+ $urloption = '?action=create&donotclearsession=1'; // we use create not edit for more flexibility
$url = DOL_URL_ROOT.'/comm/action/card.php'.$urloption;
// update task list
From afadf9dc0e11ddf846a63a945964d2e32a91b026 Mon Sep 17 00:00:00 2001
From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com>
Date: Tue, 18 Feb 2020 18:34:15 +0100
Subject: [PATCH 25/94] Fix Not Display Photo with Multicompany
---
htdocs/societe/list.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index be4b0125698..3ad44f224da 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -10,6 +10,7 @@
* Copyright (C) 2017 Rui Strecht
* Copyright (C) 2017 Juanjo Menent
* Copyright (C) 2018 Nicolas ZABOURI
+
*
* 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
@@ -371,6 +372,7 @@ if ($resql)
else dol_print_error($db);
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, s.logo,";
+$sql.= " s.entity,";
$sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
$sql.= " s.email, s.phone, s.fax, s.url, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.idprof5 as idprof5, s.idprof6 as idprof6, s.tva_intra, s.fk_pays,";
$sql.= " s.tms as date_update, s.datec as date_creation,";
@@ -1003,6 +1005,7 @@ while ($i < min($num, $limit))
$companystatic->fk_prospectlevel=$obj->fk_prospectlevel;
$companystatic->fk_parent = $obj->fk_parent;
+ $companystatic->entity = $obj->entity;
print '
Date: Tue, 18 Feb 2020 17:36:00 +0000
Subject: [PATCH 26/94] Fixing style errors.
---
htdocs/societe/list.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 3ad44f224da..c1fedf7cfe6 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -10,7 +10,7 @@
* Copyright (C) 2017 Rui Strecht
* Copyright (C) 2017 Juanjo Menent
* Copyright (C) 2018 Nicolas ZABOURI
-
+
*
* 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
From 016c7ad875c571e659e1bf9bd7719e3ae06b28f9 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 19 Feb 2020 01:17:16 +0100
Subject: [PATCH 27/94] FIX #13135
---
htdocs/core/class/CMailFile.class.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index f794c76bcac..6127a7d6044 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -144,6 +144,9 @@ class CMailFile
}
}
+ // Add autocopy to (Note: Adding bcc for specific modules are also done from pages)
+ if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) $addr_bcc .= ($addr_bcc ? ', ' : '').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
+
$this->subject = $subject;
$this->addr_to = $to;
$this->addr_from = $from;
@@ -268,9 +271,6 @@ class CMailFile
}
}
- // Add autocopy to (Note: Adding bcc for specific modules are also done from pages)
- if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) $addr_bcc .= ($addr_bcc ? ', ' : '').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
-
// We set all data according to choosed sending method.
// We also set a value for ->msgid
if ($this->sendmode == 'mail')
From 43b173ef76e2873313b9becd5ec6aacb04546b24 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 19 Feb 2020 01:23:54 +0100
Subject: [PATCH 28/94] FIX #13131
---
htdocs/compta/facture/card.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 34134f49d79..2f1941ff836 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -101,6 +101,9 @@ $usehm = (!empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? $conf->global-
$object = new Facture($db);
$extrafields = new ExtraFields($db);
+// Fetch optionals attributes and labels
+$extrafields->fetch_name_optionals_label($object->table_element);
+
// Load object
if ($id > 0 || !empty($ref)) {
if ($action != 'add') {
@@ -138,6 +141,7 @@ $result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isd
+
/*
* Actions
*/
From 7c07589850526007767f8e93866b2356e7145265 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 19 Feb 2020 03:07:12 +0100
Subject: [PATCH 29/94] FIX #13124
---
htdocs/core/class/html.form.class.php | 5 +-
htdocs/core/lib/ajax.lib.php | 1 +
htdocs/core/tpl/objectline_create.tpl.php | 68 ++++++++++++++---------
3 files changed, 45 insertions(+), 29 deletions(-)
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 73e9ae0709b..83fd976f627 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -2432,6 +2432,7 @@ class Form
$outlabel = $objp->label;
$outdesc = $objp->description;
$outbarcode = $objp->barcode;
+ $outpbq = empty($objp->price_by_qty_rowid) ? '' : $objp->price_by_qty_rowid;
$outtype = $objp->fk_product_type;
$outdurationvalue = $outtype == Product::TYPE_SERVICE ?substr($objp->duration, 0, dol_strlen($objp->duration) - 1) : '';
@@ -2479,7 +2480,7 @@ class Form
$opt .= ($objp->rowid == $selected) ? ' selected' : '';
if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0)
{
- $opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"';
+ $opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"';
}
if (!empty($conf->stock->enabled) && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)))
{
@@ -2665,7 +2666,7 @@ class Form
}
$opt .= "\n";
- $optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>price2num($outprice_ht), 'price_ttc'=>price2num($outprice_ttc), 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit);
+ $optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>price2num($outprice_ht), 'price_ttc'=>price2num($outprice_ttc), 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit, 'pbq'=>$outpbq);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php
index d2626414ba6..a430a1612af 100644
--- a/htdocs/core/lib/ajax.lib.php
+++ b/htdocs/core/lib/ajax.lib.php
@@ -107,6 +107,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
}
}
});
+
$("input#search_'.$htmlname.'").autocomplete({
source: function( request, response ) {
$.get("'.$url.($urloption?'?'.$urloption:'').'", { '.$htmlname.': request.term }, function(data){
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index b60c48da09c..6fd135af821 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -541,6 +541,7 @@ if (!empty($usemargins) && $user->rights->margins->creer)
else if (npRate == "np_markRate")
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
}
+
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value
return true;
@@ -552,26 +553,26 @@ if (!empty($usemargins) && $user->rights->margins->creer)
/* JQuery for product free or predefined select */
jQuery(document).ready(function() {
- jQuery("#price_ht").keyup(function(event) {
- // console.log(event.which); // discard event tag and arrows
- if (event.which != 9 && (event.which < 37 ||event.which > 40) && jQuery("#price_ht").val() != '') {
- jQuery("#price_ttc").val('');
- jQuery("#multicurrency_subprice").val('');
- }
+ jQuery("#price_ht").keyup(function(event) {
+ // console.log(event.which); // discard event tag and arrows
+ if (event.which != 9 && (event.which < 37 ||event.which > 40) && jQuery("#price_ht").val() != '') {
+ jQuery("#price_ttc").val('');
+ jQuery("#multicurrency_subprice").val('');
+ }
});
jQuery("#price_ttc").keyup(function(event) {
- // console.log(event.which); // discard event tag and arrows
- if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery("#price_ttc").val() != '') {
- jQuery("#price_ht").val('');
- jQuery("#multicurrency_subprice").val('');
- }
+ // console.log(event.which); // discard event tag and arrows
+ if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery("#price_ttc").val() != '') {
+ jQuery("#price_ht").val('');
+ jQuery("#multicurrency_subprice").val('');
+ }
});
jQuery("#multicurrency_subprice").keyup(function(event) {
- // console.log(event.which); // discard event tag and arrows
- if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery("#price_ttc").val() != '') {
- jQuery("#price_ht").val('');
- jQuery("#price_ttc").val('');
- }
+ // console.log(event.which); // discard event tag and arrows
+ if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery("#price_ttc").val() != '') {
+ jQuery("#price_ht").val('');
+ jQuery("#price_ttc").val('');
+ }
});
$("#prod_entry_mode_free").on( "click", function() {
@@ -630,15 +631,24 @@ if (!empty($usemargins) && $user->rights->margins->creer)
if (empty($conf->global->MAIN_DISABLE_EDIT_PREDEF_PRICEHT) && empty($senderissupplier))
{
?>
- // Get the HT price for the product and display it
- console.log("Load price without tax and set it into #price_ht");
- $.post('/product/ajax/products.php?action=fetch',
- { 'id': $(this).val(), 'socid' : socid; ?> },
- function(data) { jQuery("#price_ht").val(data.price_ht); },
- 'json'
- );
+ var pbq = parseInt($('option:selected', this).attr('data-pbq'));
+ if ((jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val()) && ! isNaN(pbq) && pbq > 0)
+ {
+ console.log("We are in a price per qty context, we do not call ajax/product");
+ } else {
+ // Get the HT price for the product and display it
+ console.log("Load price without tax and set it into #price_ht for id="+$(this).val()+" socid=socid; ?>");
+ $.post('/product/ajax/products.php?action=fetch',
+ { 'id': $(this).val(), 'socid': socid; ?> },
+ function(data) {
+ jQuery("#price_ht").val(data.price_ht);
+ },
+ 'json'
+ );
+ }
rights->margins->creer)
{
$langs->load('stocks');
@@ -744,15 +754,20 @@ if (!empty($usemargins) && $user->rights->margins->creer)
}
?>
- /* To process customer price per quantity */
+ /* To process customer price per quantity (CUSTOMER_PRICE_PER_QTY works only if combo product is not an ajax after x key pressed) */
var pbq = parseInt($('option:selected', this).attr('data-pbq'));
+ var pbqup = parseInt($('option:selected', this).attr('data-pbqup'));
+ var pbqbase = $('option:selected', this).attr('data-pbqbase');
var pbqqty = parseFloat($('option:selected', this).attr('data-pbqqty'));
var pbqpercent = parseFloat($('option:selected', this).attr('data-pbqpercent'));
- if ((jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val()) && typeof pbq !== "undefined")
+ if ((jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val()) && ! isNaN(pbq) && pbq > 0)
{
- console.log("We choose a price by quanty price_by_qty id = "+pbq+" price_by_qty qty = "+pbqqty+" price_by_qty percent = "+pbqpercent);
+ var pbqupht = pbqup; /* TODO support of price per qty TTC not yet available */
+
+ console.log("We choose a price by quanty price_by_qty id = "+pbq+" price_by_qty upht = "+pbqupht+" price_by_qty qty = "+pbqqty+" price_by_qty percent = "+pbqpercent);
jQuery("#pbq").val(pbq);
+ jQuery("#price_ht").val(pbqupht);
if (jQuery("#qty").val() < pbqqty)
{
jQuery("#qty").val(pbqqty);
@@ -809,7 +824,6 @@ if (!empty($usemargins) && $user->rights->margins->creer)
jQuery("#price_ht").val('').hide();
jQuery("#multicurrency_price_ht").val('').hide();
- jQuery("#price_ht").val('');
jQuery("#price_ttc, #fourn_ref, #tva_tx, #title_vat, #title_up_ht_currency, #title_up_ttc, #title_up_ttc_currency").hide();
jQuery("#np_marginRate, #np_markRate, .np_marginRate, .np_markRate, #units, #title_units").hide();
jQuery("#buying_price").show();
From d0d352be1af0d6e4c76dd78c1e20e5b0800853a6 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 19 Feb 2020 03:37:28 +0100
Subject: [PATCH 30/94] FIX #13118
---
htdocs/compta/paiement.php | 10 +++++++---
htdocs/fourn/facture/paiement.php | 10 +++++++---
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 5b297eed309..b00ef1d9a0a 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -95,6 +95,8 @@ if (empty($reshook))
$totalpayment = 0;
$multicurrency_totalpayment = 0;
$atleastonepaymentnotnull = 0;
+ $formquestion = array();
+ $i = 0;
// Generate payment array and check if there is payment higher than invoice and payment date before invoice date
$tmpinvoice = new Facture($db);
@@ -214,7 +216,7 @@ if (empty($reshook))
{
$error = 0;
- $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
+ $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
$db->begin();
@@ -260,8 +262,10 @@ if (empty($reshook))
$paiement->amounts = $amounts; // Array with all payments dispatching with invoice id
$paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching
$paiement->paiementid = dol_getIdFromCode($db, GETPOST('paiementcode'), 'c_paiement', 'code', 'id', 1);
- $paiement->num_paiement = GETPOST('num_paiement', 'alpha');
- $paiement->note = GETPOST('comment', 'alpha');
+ $paiement->num_payment = GETPOST('num_paiement', 'alpha');
+ $paiement->note_private = GETPOST('comment', 'alpha');
+ $paiement->num_paiement = $paiement->num_payment; // For bacward compatibility
+ $paiement->note = $paiement->note_private; // For bacward compatibility
if (!$error)
{
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index e9198ebcc91..19fed7a3387 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -297,9 +297,13 @@ if (empty($reshook))
$paiement->datepaye = $datepaye;
$paiement->amounts = $amounts; // Array of amounts
$paiement->multicurrency_amounts = $multicurrency_amounts;
- $paiement->paiementid = $_POST['paiementid'];
- $paiement->num_paiement = $_POST['num_paiement'];
- $paiement->note = $_POST['comment'];
+ $paiement->paiementid = GETPOST('paiementid', 'int');
+
+ $paiement->num_payment = GETPOST('num_paiement', 'alpha');
+ $paiement->note_private = GETPOST('comment', 'alpha');
+ $paiement->num_paiement = $paiement->num_payment; // For bacward compatibility
+ $paiement->note = $paiement->note_private; // For bacward compatibility
+
if (!$error)
{
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices') == 'on' ? 1 : 0), $thirdparty);
From 34d7fb887fff25636b983f75ae21842b5421da07 Mon Sep 17 00:00:00 2001
From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com>
Date: Wed, 19 Feb 2020 08:50:49 +0100
Subject: [PATCH 31/94] Show project Ref support if enable
Add search and Project Ref column in the list, only if project module is enable.
---
htdocs/compta/sociales/list.php | 36 ++++++++++++++++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php
index 5f7f7d0fc0a..6e7277c2f93 100644
--- a/htdocs/compta/sociales/list.php
+++ b/htdocs/compta/sociales/list.php
@@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
// Load translation files required by the page
$langs->loadLangs(array('compta', 'banks', 'bills'));
@@ -53,6 +54,11 @@ $search_day_lim = GETPOST('search_day_lim', 'int');
$search_month_lim = GETPOST('search_month_lim', 'int');
$search_year_lim = GETPOST('search_year_lim', 'int');
+if (! empty($conf->projet->enabled)) {
+ $search_project_ref=GETPOST('search_project_ref', 'alpha');
+ $search_project=GETPOST('search_project', 'alpha');
+}
+
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
@@ -95,6 +101,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_month_lim='';
$toselect='';
$search_array_options=array();
+
+ if (! empty($conf->projet->enabled)) {
+ $search_project_ref='';
+ $search_project='';
+ }
}
@@ -106,21 +117,25 @@ $form = new Form($db);
$formother = new FormOther($db);
$formsocialcontrib = new FormSocialContrib($db);
$chargesociale_static=new ChargeSociales($db);
+if (! empty($conf->projet->enabled)) $projectstatic=new Project($db);
llxHeader('', $langs->trans("SocialContributions"));
$sql = "SELECT cs.rowid as id, cs.fk_type as type, ";
$sql.= " cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode,";
+if (! empty($conf->projet->enabled)) $sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
$sql.= " c.libelle as type_lib,";
$sql.= " SUM(pc.amount) as alreadypayed";
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
$sql.= " ".MAIN_DB_PREFIX."chargesociales as cs";
+if (! empty($conf->projet->enabled)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cs.fk_projet";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
$sql.= " WHERE cs.fk_type = c.id";
$sql.= " AND cs.entity = ".$conf->entity;
// Search criteria
if ($search_ref) $sql.=" AND cs.rowid=".$db->escape($search_ref);
if ($search_label) $sql.=natural_search("cs.libelle", $search_label);
+if (! empty($conf->projet->enabled)) if ($search_project_ref != '') $sql.= natural_search("p.ref", $search_project_ref);
if ($search_amount) $sql.=natural_search("cs.amount", price2num(trim($search_amount)), 1);
if ($search_status != '' && $search_status >= 0) $sql.=" AND cs.paye = ".$db->escape($search_status);
$sql.= dolSqlDateFilter("cs.periode", $search_day_lim, $search_month_lim, $search_year_lim);
@@ -163,6 +178,7 @@ if ($resql)
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_label) $param.='&search_label='.urlencode($search_label);
+ if (! empty($conf->projet->enabled)) if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref);
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
if ($search_typeid) $param.='&search_typeid='.urlencode($search_typeid);
if ($search_status != '' && $search_status != '-1') $param.='&search_status='.urlencode($search_status);
@@ -219,6 +235,8 @@ if ($resql)
print '
';
-if (!empty($conf->global->PROJECT_SHOW_PROJECT_LIST_ON_PROJECT_AREA))
+if (empty($conf->global->PROJECT_HIDE_PROJECT_LIST_ON_PROJECT_AREA))
{
- // This list can be very long, so we don't show it by default on task area. We prefer to use the list page.
- // Add constant PROJECT_SHOW_PROJECT_LIST_ON_PROJECT_AREA to show this list
+ // This list can be very long, so we allow to hide it to prefer to use the list page.
+ // Add constant PROJECT_HIDE_PROJECT_LIST_ON_PROJECT_AREA to show this list
print ' ';
@@ -329,7 +348,7 @@ if (!empty($conf->global->PROJECT_SHOW_PROJECT_LIST_ON_PROJECT_AREA))
print '
';
$parameters = array('user' => $user);
-$reshook = $hookmanager->executeHooks('dashboardProjects', $parameters, $object); // Note that $action and $object may have been modified by hook
+$reshook = $hookmanager->executeHooks('dashboardProjects', $parameters, $projectstatic); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
From ace0c7f89dc9cd072de163ca39bb61056ad62bf0 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 19 Feb 2020 14:31:32 +0100
Subject: [PATCH 39/94] Fix list of opportunity with filter on
search_usage_opportunity
---
htdocs/core/menus/standard/eldy.lib.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 109de3a99c4..f66768b7ffb 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -1683,11 +1683,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 1)
{
$newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list');
- $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode);
+ $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode);
$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans("ListOpenProjects"), 2, $showmode);
}
elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
- $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99', $langs->trans("List"), 2, $showmode);
+ $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode);
}
$newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire);
From 91899d2f56c18761a28bfe2dc11207d91d3ed2cc Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 19 Feb 2020 14:31:32 +0100
Subject: [PATCH 40/94] Fix list of opportunity with filter on
search_usage_opportunity
---
htdocs/core/menus/standard/eldy.lib.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 109de3a99c4..f66768b7ffb 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -1683,11 +1683,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 1)
{
$newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list');
- $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode);
+ $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode);
$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans("ListOpenProjects"), 2, $showmode);
}
elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
- $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99', $langs->trans("List"), 2, $showmode);
+ $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode);
}
$newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire);
From 3fafbb372b39900adc7bb9a6bb9746f1f49199c2 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 19 Feb 2020 15:51:27 +0100
Subject: [PATCH 41/94] Remove call of $mc->dao than hangs. Replaced with $mc
use.
---
htdocs/compta/accounting-files.php | 21 ++++++++++++++++-----
htdocs/compta/bank/treso.php | 7 +++++--
2 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php
index ac019de8088..b7d1cdd633e 100644
--- a/htdocs/compta/accounting-files.php
+++ b/htdocs/compta/accounting-files.php
@@ -77,7 +77,13 @@ if ($user->socid > 0) {
accessforbidden();
}
-$entity = GETPOST('entity', 'int') ?GETPOST('entity', 'int') : $conf->entity;
+$entity = (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : (GETPOSTISSET('search_entity') ? GETPOST('search_entity', 'int') : $conf->entity));
+if (empty($entity) && ! empty($conf->global->MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES)) {
+ $tmparray = $mc->getEntitiesList();
+ $entity = '0,'.join(',', array_keys($tmparray));
+}
+if (empty($entity)) $entity = $conf->entity;
+
/*
@@ -400,13 +406,18 @@ print '';
print $langs->trans("ReportPeriod").': '.$form->selectDate($date_start, 'date_start', 0, 0, 0, "", 1, 1, 0);
print ' - '.$form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0)."\n";
-// Export is for current company only !
+// Export is for current company only
if (!empty($conf->multicompany->enabled) && is_object($mc))
{
+ $mc->getInfo($conf->entity);
print '('.$langs->trans("Entity").' : ';
- $mc->dao->getEntities();
- $mc->dao->fetch($conf->entity);
- print $mc->dao->label;
+ print "
'."\n";
@@ -710,12 +710,12 @@ if (! empty($conf->global->PRODUCT_CANVAS_ABILITY))
if (is_dir($dir))
{
- require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
+ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
- $handle=opendir($dir);
+ $handle = opendir($dir);
if (is_resource($handle))
{
- while (($file = readdir($handle))!==false)
+ while (($file = readdir($handle)) !== false)
{
if (file_exists($dir.$file.'/product.'.$file.'.class.php'))
{
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 473671fd1a3..bffc941a35c 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1724,7 +1724,7 @@ class Product extends CommonObject
$sql .= " pfp.fk_product, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_soc, pfp.tva_tx, pfp.fk_supplier_price_expression";
$sql .= " ,pfp.default_vat_code";
$sql .= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code";
- if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql.= ", pfp.packaging";
+ if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql .= ", pfp.packaging";
$sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql .= " WHERE pfp.rowid = ".$prodfournprice;
if ($qty > 0) { $sql .= " AND pfp.quantity <= ".$qty;
@@ -1778,7 +1778,7 @@ class Product extends CommonObject
$sql .= " pfp.fk_product, pfp.ref_fourn as ref_supplier, pfp.desc_fourn as desc_supplier, pfp.tva_tx, pfp.fk_supplier_price_expression";
$sql .= " ,pfp.default_vat_code";
$sql .= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code";
- if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql.= ", pfp.packaging";
+ if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql .= ", pfp.packaging";
$sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql .= " WHERE pfp.fk_product = ".$product_id;
if ($fourn_ref != 'none') { $sql .= " AND pfp.ref_fourn = '".$fourn_ref."'";
diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php
index 4b0c61073cf..d0eae2f3b17 100644
--- a/htdocs/product/dynamic_price/class/price_parser.class.php
+++ b/htdocs/product/dynamic_price/class/price_parser.class.php
@@ -181,7 +181,7 @@ class PriceParser
//Do processing
$res = $entry->process();
//Store any error or clear status if OK
- $entry->update_status($res < 1?$entry->error:'', $user);
+ $entry->update_status($res < 1 ? $entry->error : '', $user);
}
//Get all global values
@@ -216,7 +216,7 @@ class PriceParser
{
$data = explode($this->special_chr, $expression);
$variable = $this->special_chr.$data[1];
- if (isset($data[2])) $variable.= $this->special_chr;
+ if (isset($data[2])) $variable .= $this->special_chr;
$this->error_parser = array(23, array($variable, $expression));
return -6;
}
@@ -276,7 +276,7 @@ class PriceParser
if ($res < 0) {
$this->error_parser = array(25, null);
return -1;
- } elseif($res == 0){
+ } elseif ($res == 0) {
$supplier_min_price = 0;
} else {
$supplier_min_price = $productFournisseur->fourn_unitprice;
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index aab0d428191..55d12f26c6c 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -77,7 +77,7 @@ class MouvementStock extends CommonObject
public $batch;
- public $fields=array(
+ public $fields = array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10, 'showoncombobox'=>1),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15),
'datem' =>array('type'=>'datetime', 'label'=>'Datem', 'enabled'=>1, 'visible'=>-1, 'position'=>20),
@@ -376,8 +376,8 @@ class MouvementStock extends CommonObject
if ($movestock && $entrepot_id > 0) // Change stock for current product, change for subproduct is done after
{
$fk_project = 0;
- if(!empty($this->origin)) { // This is set by caller for tracking reason
- $origintype = empty($this->origin->origin_type)?$this->origin->element:$this->origin->origin_type;
+ if (!empty($this->origin)) { // This is set by caller for tracking reason
+ $origintype = empty($this->origin->origin_type) ? $this->origin->element : $this->origin->origin_type;
$fk_origin = $this->origin->id;
if ($origintype == 'project') $fk_project = $fk_origin;
else
@@ -985,7 +985,7 @@ class MouvementStock extends CommonObject
$origintype_array = explode('@', $origintype);
$classname = ucfirst($origintype_array[0]);
$modulename = empty($origintype_array[1]) ? $classname : empty($origintype_array[1]);
- $result=dol_include_once('/'.$modulename.'/class/'.strtolower($classname).'.class.php');
+ $result = dol_include_once('/'.$modulename.'/class/'.strtolower($classname).'.class.php');
if ($result)
{
$classname = ucfirst($classname);
diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php
index 2ad465bdedb..bd7941e1448 100644
--- a/htdocs/product/stock/replenish.php
+++ b/htdocs/product/stock/replenish.php
@@ -160,7 +160,7 @@ if ($action == 'order' && isset($_POST['valid']))
$desc = $productsupplier->description;
}
$line->desc = $desc;
- if (! empty($conf->global->MAIN_MULTILANGS))
+ if (!empty($conf->global->MAIN_MULTILANGS))
{
// TODO Get desc in language of thirdparty
}
@@ -362,8 +362,8 @@ $sql .= ', s.fk_product';
if ($usevirtualstock)
{
- if (! empty($conf->commande->enabled)) {
- $sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
+ if (!empty($conf->commande->enabled)) {
+ $sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1";
$sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity('commande').")";
$sqlCommandesCli .= " AND cd1.fk_product = p.rowid";
@@ -372,8 +372,8 @@ if ($usevirtualstock)
$sqlCommandesCli = '0';
}
- if (! empty($conf->expedition->enabled)) {
- $sqlExpeditionsCli = "(SELECT ".$db->ifsql("SUM(ed2.qty) IS NULL", "0", "SUM(ed2.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
+ if (!empty($conf->expedition->enabled)) {
+ $sqlExpeditionsCli = "(SELECT ".$db->ifsql("SUM(ed2.qty) IS NULL", "0", "SUM(ed2.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlExpeditionsCli .= " FROM ".MAIN_DB_PREFIX."expedition as e2,";
$sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."expeditiondet as ed2,";
$sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."commandedet as cd2";
@@ -384,8 +384,8 @@ if ($usevirtualstock)
$sqlExpeditionsCli = '0';
}
- if (! empty($conf->fournisseur->enabled)) {
- $sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd3.qty) IS NULL", "0", "SUM(cd3.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
+ if (!empty($conf->fournisseur->enabled)) {
+ $sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd3.qty) IS NULL", "0", "SUM(cd3.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd3,";
$sqlCommandesFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur as c3";
$sqlCommandesFourn .= " WHERE c3.rowid = cd3.fk_commande";
@@ -393,7 +393,7 @@ if ($usevirtualstock)
$sqlCommandesFourn .= " AND cd3.fk_product = p.rowid";
$sqlCommandesFourn .= " AND c3.fk_statut IN (3,4))";
- $sqlReceptionFourn = "(SELECT ".$db->ifsql("SUM(fd4.qty) IS NULL", "0", "SUM(fd4.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
+ $sqlReceptionFourn = "(SELECT ".$db->ifsql("SUM(fd4.qty) IS NULL", "0", "SUM(fd4.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlReceptionFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf4,";
$sqlReceptionFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as fd4";
$sqlReceptionFourn .= " WHERE fd4.fk_commande = cf4.rowid AND cf4.entity IN (".getEntity('supplier_order').")";
@@ -404,8 +404,8 @@ if ($usevirtualstock)
$sqlReceptionFourn = '0';
}
- if (! empty($conf->mrp->enabled)) {
- $sqlProductionToConsume = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
+ if (!empty($conf->mrp->enabled)) {
+ $sqlProductionToConsume = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlProductionToConsume .= " FROM ".MAIN_DB_PREFIX."mrp_mo as mm5,";
$sqlProductionToConsume .= " ".MAIN_DB_PREFIX."mrp_production as mp5";
$sqlProductionToConsume .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity('mo').")";
@@ -413,7 +413,7 @@ if ($usevirtualstock)
$sqlProductionToConsume .= " AND mp5.role IN ('toconsume', 'consummed')";
$sqlProductionToConsume .= " AND mm5.status IN (1,2))";
- $sqlProductionToProduce = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toproduce'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
+ $sqlProductionToProduce = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toproduce'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlProductionToProduce .= " FROM ".MAIN_DB_PREFIX."mrp_mo as mm5,";
$sqlProductionToProduce .= " ".MAIN_DB_PREFIX."mrp_production as mp5";
$sqlProductionToProduce .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity('mo').")";
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 7baefc6964e..d80c7220866 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -263,8 +263,8 @@ if (empty($reshook))
$object->socid = GETPOST('socid', 'int');
$object->description = GETPOST('description', 'none'); // Do not use 'alpha' here, we want field as it is
$object->public = GETPOST('public', 'alpha');
- $object->date_start = (! GETPOST('projectstart')) ? '' : $date_start;
- $object->date_end = (! GETPOST('projectend')) ? '' : $date_end;
+ $object->date_start = (!GETPOST('projectstart')) ? '' : $date_start;
+ $object->date_end = (!GETPOST('projectend')) ? '' : $date_end;
if (GETPOSTISSET('opp_amount')) $object->opp_amount = price2num(GETPOST('opp_amount', 'alpha'));
if (GETPOSTISSET('budget_amount')) $object->budget_amount = price2num(GETPOST('budget_amount', 'alpha'));
if (GETPOSTISSET('opp_status')) $object->opp_status = $opp_status;
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index b7a4c800ee3..f7f7cce75e1 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -131,7 +131,7 @@ $arrayfields = array(
'p.opp_amount'=>array('label'=>$langs->trans("OpportunityAmountShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>103),
'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>104),
'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>105),
- 'opp_weighted_amount'=>array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>106),
+ 'opp_weighted_amount'=>array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>106),
'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110),
'p.usage_opportunity'=>array('label'=>$langs->trans("UsageOpportunity"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>115),
'p.usage_task'=>array('label'=>$langs->trans("UsageTasks"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_HIDE_TASKS ? 0 : 1), 'position'=>116),
@@ -847,16 +847,16 @@ while ($i < min($num, $limit))
$totalarray['val']['p.opp_amount'] += $obj->opp_amount;
}
print '';
- if (! $i) $totalarray['nbfield']++;
- if (! $i) $totalarray['pos'][$totalarray['nbfield']]='p.opp_amount';
+ if (!$i) $totalarray['nbfield']++;
+ if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.opp_amount';
}
// Opp percent
- if (! empty($arrayfields['p.opp_percent']['checked']))
+ if (!empty($arrayfields['p.opp_percent']['checked']))
{
print '
';
print $moreforfilter;
- $parameters=array('type'=>$type);
- $reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
+ $parameters = array('type'=>$type);
+ $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '
';
}
-$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
-$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
-if ($massactionbutton && $contextpage != 'poslist') $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
+$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
+$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
+if ($massactionbutton && $contextpage != 'poslist') $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
if (empty($arrayfields['customerorsupplier']['checked'])) print '';
print '
';
diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php
index c6029544c90..1c2604e0e44 100644
--- a/htdocs/societe/project.php
+++ b/htdocs/societe/project.php
@@ -35,7 +35,7 @@ $langs->loadLangs(array("companies", "projects"));
// Security check
$socid = GETPOST('socid', 'int');
-if ($user->socid) $socid=$user->socid;
+if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'societe', $socid, '&societe');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -46,8 +46,8 @@ $hookmanager->initHooks(array('projectthirdparty'));
* Actions
*/
-$parameters=array('id'=>$socid);
-$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+$parameters = array('id'=>$socid);
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -71,25 +71,25 @@ if ($socid)
$object = new Societe($db);
$result = $object->fetch($socid);
- $title=$langs->trans("Projects");
- if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
+ $title = $langs->trans("Projects");
+ if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->name." - ".$title;
llxHeader('', $title);
- if (! empty($conf->notification->enabled)) $langs->load("mails");
+ if (!empty($conf->notification->enabled)) $langs->load("mails");
$head = societe_prepare_head($object);
dol_fiche_head($head, 'project', $langs->trans("ThirdParty"), -1, 'company');
$linkback = ''.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom');
print '
';
print '';
print '
';
- if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
+ if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '