';
diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php
index d3691e85df9..c44932655ed 100644
--- a/htdocs/admin/tools/listevents.php
+++ b/htdocs/admin/tools/listevents.php
@@ -174,6 +174,15 @@ if ($search_user) { $usefilter++; $sql.=natural_search("u.login", $search_user,
if ($search_desc) { $usefilter++; $sql.=natural_search("e.description", $search_desc, 0); }
if ($search_ua) { $usefilter++; $sql.=natural_search("e.user_agent", $search_ua, 0); }
$sql.= $db->order($sortfield,$sortorder);
+
+// Count total nb of records
+$nbtotalofrecords = '';
+/*if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
+{
+ $result = $db->query($sql);
+ $nbtotalofrecords = $db->num_rows($result);
+}*/
+
$sql.= $db->plimit($conf->liste_limit+1, $offset);
//print $sql;
$result = $db->query($sql);
@@ -195,7 +204,7 @@ if ($result)
$center=''.$langs->trans("Purge").'';
}
- print_barre_liste($langs->trans("ListOfSecurityEvents").' ('.$num.')', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, 0, 'setup');
+ print_barre_liste($langs->trans("ListOfSecurityEvents"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $nbtotalofrecords, 'setup');
if ($action == 'purge')
{
diff --git a/htdocs/cashdesk/css/style.css b/htdocs/cashdesk/css/style.css
index 2931ad7638e..97c0e95a982 100644
--- a/htdocs/cashdesk/css/style.css
+++ b/htdocs/cashdesk/css/style.css
@@ -214,6 +214,7 @@ p.titre {
.blocksellfinished {
min-width: 215px;
+ margin-top: 8px;
}
.titre1 {
font-weight: bold;
diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php
index 4904bbea3b7..1f37623544b 100644
--- a/htdocs/categories/class/api_categories.class.php
+++ b/htdocs/categories/class/api_categories.class.php
@@ -209,7 +209,7 @@ class Categories extends DolibarrApi
$sql.= ' AND s.rowid = sub.fk_categorie';
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/categories/class/api_deprecated_category.class.php b/htdocs/categories/class/api_deprecated_category.class.php
index 62f92b71bea..6f2f16bb222 100644
--- a/htdocs/categories/class/api_deprecated_category.class.php
+++ b/htdocs/categories/class/api_deprecated_category.class.php
@@ -124,7 +124,7 @@ class CategoryApi extends DolibarrApi
$sql.= ' WHERE s.entity IN ('.getEntity('category', 1).')';
$sql.= ' AND s.type='.array_search($type,CategoryApi::$TYPES);
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
@@ -205,7 +205,7 @@ class CategoryApi extends DolibarrApi
$sql.= ' AND s.rowid = sub.fk_categorie';
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php
index c01e62ae3b5..0a08b6e55f1 100644
--- a/htdocs/comm/action/listactions.php
+++ b/htdocs/comm/action/listactions.php
@@ -245,7 +245,7 @@ if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AN
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
$sql.= $db->order($sortfield,$sortorder);
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php
index fdc94005cdb..97f255abe14 100644
--- a/htdocs/comm/action/rapport/index.php
+++ b/htdocs/comm/action/rapport/index.php
@@ -85,7 +85,7 @@ $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
$sql.= " GROUP BY year, month, df";
$sql.= " ORDER BY year DESC, month DESC, df DESC";
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index c37c61ca88c..aeaf19f8471 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -758,7 +758,7 @@ else
// MAILING_NO_USING_PHPMAIL may be defined or not.
// MAILING_LIMIT_SENDBYWEB is always defined to something != 0 (-1=forbidden).
- // MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0=no limit).
+ // MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0 or undefined=no limit).
if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
{
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
@@ -772,8 +772,8 @@ else
}
else if ($conf->global->MAILING_LIMIT_SENDBYWEB == '-1')
{
- if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
- if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
+ if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
+ if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
// The feature is forbidden from GUI, we show just message to use from command line.
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
@@ -786,8 +786,8 @@ else
}
else
{
- if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
- if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
+ if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
+ if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
$text='';
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index ab7ee3c7c8a..e104db4dcda 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -412,7 +412,7 @@ if ($object->fetch($id) >= 0)
$sql .= $db->order($sortfield,$sortorder);
// Count total nb of records
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 647ed8a7b4b..040e78b7f1a 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -333,7 +333,7 @@ $sql.= $db->order($sortfield,$sortorder);
$sql.=', p.ref DESC';
// Count total nb of records
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/commande/class/api_deprecated_commande.class.php b/htdocs/commande/class/api_deprecated_commande.class.php
index 4595bdbb287..aa1584c4fed 100644
--- a/htdocs/commande/class/api_deprecated_commande.class.php
+++ b/htdocs/commande/class/api_deprecated_commande.class.php
@@ -139,7 +139,7 @@ class CommandeApi extends DolibarrApi
$sql .= " AND sc.fk_user = ".$search_sale;
}
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php
index 8190367a06a..5f9a5a570ff 100644
--- a/htdocs/commande/customer.php
+++ b/htdocs/commande/customer.php
@@ -97,7 +97,7 @@ $sql.= " GROUP BY s.nom";
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 6e304a019d0..662a727c88b 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -560,7 +560,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php
index 5cae7aff723..f13b650eff2 100644
--- a/htdocs/compta/bank/bankentries.php
+++ b/htdocs/compta/bank/bankentries.php
@@ -502,7 +502,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
$nbtotalofpages = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index 73dd2d4f199..0e9b25c39a8 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -662,7 +662,7 @@ class Account extends CommonObject
*
* @param User $user Object user making action
* @param int $notrigger 1=Disable triggers
- * @return int <0 si ko, >0 si ok
+ * @return int <0 if KO, >0 if OK
*/
function update(User $user = null, $notrigger = 0)
{
diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php
index 82283547d99..29877302104 100644
--- a/htdocs/compta/bank/index.php
+++ b/htdocs/compta/bank/index.php
@@ -175,7 +175,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/compta/facture/class/api_deprecated_invoice.class.php b/htdocs/compta/facture/class/api_deprecated_invoice.class.php
index 7dd8a7ee6bc..b638a46b920 100644
--- a/htdocs/compta/facture/class/api_deprecated_invoice.class.php
+++ b/htdocs/compta/facture/class/api_deprecated_invoice.class.php
@@ -138,7 +138,7 @@ class InvoiceApi extends DolibarrApi
$sql .= " AND sc.fk_user = ".$search_sale;
}
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index 17627964362..584d3915430 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -1575,7 +1575,7 @@ else
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($year_date_when,1,false))."' AND '".$db->idate(dol_get_last_day($year_date_when,12,false))."'";
}
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index d2c20099edc..8807023784d 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -402,7 +402,7 @@ $listfield=explode(',',$sortfield);
foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.',';
$sql.= ' f.rowid DESC ';
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 9980ea396de..aec64683e3a 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -396,7 +396,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
var form = $("#payment_form");
json["invoice_type"] = $("#invoice_type").val();
- json["amountPayment"] = $("#amountpayment").attr("value");
+ json["amountPayment"] = $("#amountpayment").attr("value");
json["amounts"] = _elemToJson(form.find("input.amount"));
json["remains"] = _elemToJson(form.find("input.remain"));
diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php
index e7cd70c1e30..ae9bc315877 100644
--- a/htdocs/compta/paiement/cheque/list.php
+++ b/htdocs/compta/paiement/cheque/list.php
@@ -112,7 +112,7 @@ else if ($year > 0)
}
$sql.= $db->order($sortfield,$sortorder);
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php
index 46c54d32a47..4cb63b7d905 100644
--- a/htdocs/compta/paiement/list.php
+++ b/htdocs/compta/paiement/list.php
@@ -186,7 +186,7 @@ else
}
$sql.= $db->order($sortfield,$sortorder);
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 33e5110153b..04010fd3ad2 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -365,7 +365,7 @@ else
}
// Count total nb of records
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index 8a8ff68097a..849a466e18d 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -288,7 +288,7 @@ if ($result)
$totalnboflines = $db->num_rows($result);
}
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php
index 4fc2f9f53c3..42ff4b04e83 100644
--- a/htdocs/contrat/services.php
+++ b/htdocs/contrat/services.php
@@ -236,7 +236,7 @@ if (! empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql.= " A
if (! empty($filter_opcloture) && $filter_opcloture != -1 && $filter_datecloture != '') $sql.= " AND cd.date_cloture ".$filter_opcloture." '".$db->idate($filter_datecloture)."'";
$sql .= $db->order($sortfield,$sortorder);
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 22f4e45c25f..396952ace9c 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -371,7 +371,9 @@ class CMailFile
{
// Use Swift Mailer library
// ------------------------------------------
-
+
+ $host = dol_getprefix('email');
+
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php';
// Create the message
$this->message = Swift_Message::newInstance();
@@ -379,7 +381,7 @@ class CMailFile
// Adding a trackid header to a message
$headers = $this->message->getHeaders();
$headers->addTextHeader('X-Dolibarr-TRACKID', $trackid);
- $headerID = time() . '.swiftmailer-dolibarr-' . $trackid . '@' . $conf->global->MAIN_MAIL_SMTP_SERVER;
+ $headerID = time() . '.swiftmailer-dolibarr-' . $trackid . '@' . $host;
$msgid = $headers->get('Message-ID');
$msgid->setId($headerID);
$headers->addIdHeader('References', $headerID);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index db3be3bc4ac..22718e534cc 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -3020,9 +3020,16 @@ abstract class CommonObject
foreach ($this->lines as $line)
{
-
- $totalOrdered+=$line->qty_asked; // defined for shipment only
- $totalToShip+=$line->qty_shipped; // defined for shipment only
+ if (isset($line->qty_asked))
+ {
+ if (empty($totalOrdered)) $totalOrdered=0; // Avoid warning because $totalOrdered is ''
+ $totalOrdered+=$line->qty_asked; // defined for shipment only
+ }
+ if (isset($line->qty_shipped))
+ {
+ if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is ''
+ $totalToShip+=$line->qty_shipped; // defined for shipment only
+ }
// Define qty, weight, volume, weight_units, volume_units
if ($this->element == 'shipping') $qty=$line->qty_shipped; // for shipments
@@ -3037,8 +3044,11 @@ abstract class CommonObject
if (! empty($weight_units)) $weightUnit = $weight_units;
if (! empty($volume_units)) $volumeUnit = $volume_units;
+ if (empty($totalWeight)) $totalWeight=0; // Avoid warning because $totalWeight is ''
+ if (empty($totalVolume)) $totalVolume=0; // Avoid warning because $totalVolume is ''
+
//var_dump($line->volume_units);
- if ($weight_units < 50) // >50 means a standard unit (power of 10 of official unit) > 50 means an exotic unit (like inch)
+ if ($weight_units < 50) // >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
{
$trueWeightUnit=pow(10, $weightUnit);
$totalWeight += $weight * $qty * $trueWeightUnit;
@@ -3047,7 +3057,7 @@ abstract class CommonObject
{
$totalWeight += $weight * $qty; // This may be wrong if we mix different units
}
- if ($volume_units < 50) // >50 means a standard unit (power of 10 of official unit) > 50 means an exotic unit (like inch)
+ if ($volume_units < 50) // >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
{
//print $line->volume."x".$line->volume_units."x".($line->volume_units < 50)."x".$volumeUnit;
$trueVolumeUnit=pow(10, $volumeUnit);
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index cd56b4d0b59..b6aad949b64 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -76,7 +76,7 @@ class FormFile
global $conf,$langs, $hookmanager;
$hookmanager->initHooks(array('formfile'));
-
+
if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0;
if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2))
@@ -275,7 +275,7 @@ class FormFile
if (0 !== $iconPDF) {
dol_syslog(__METHOD__ . ": passing iconPDF parameter is deprecated", LOG_WARNING);
}
-
+
global $langs, $conf, $user, $hookmanager;
global $form, $bc;
@@ -287,7 +287,7 @@ class FormFile
if (! empty($iconPDF)) {
return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
}
-
+
$printer=0;
if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur', 'expensereport'))) // The direct print feature is implemented only for such elements
{
@@ -559,7 +559,7 @@ class FormFile
$addcolumforpicto=($delallowed || $printer || $morepicto);
$out.= '
';
-
+
// Model
if (! empty($modellist))
{
@@ -1116,10 +1116,11 @@ class FormFile
$minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original
if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension
//print $file['path'].'/'.$minifile.' ';
+
$urlforhref=getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
- if (empty($urlforhref)) $urlforhref=DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
+ if (empty($urlforhref)) $urlforhref=DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
print '';
- print '';
+ print '';
print '';
}
else print ' ';
diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php
index 083bec812fa..e7c7b343ac9 100644
--- a/htdocs/core/class/smtps.class.php
+++ b/htdocs/core/class/smtps.class.php
@@ -1217,7 +1217,7 @@ class SMTPs
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
- $host=dol_getprefix('email').'-'.$host;
+ $host=dol_getprefix('email');
//NOTE: Message-ID should probably contain the username of the user who sent the msg
$_header .= 'Subject: ' . $this->getSubject() . "\r\n";
diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php
index 74078740080..1df180452c3 100644
--- a/htdocs/core/lib/bank.lib.php
+++ b/htdocs/core/lib/bank.lib.php
@@ -197,9 +197,10 @@ function checkBanForAccount($account)
$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789");
// Separation du rib en 3 groupes de 7 + 1 groupe de 2.
// Multiplication de chaque groupe par les coef du tableau
+var_dump($rib);
for ($i = 0, $s = 0; $i < 3; $i++) {
$code = substr($rib, 7 * $i, 7);
- $s += (0 + $code) * $coef[$i];
+ $s += (0 + (int) $code) * $coef[$i];
}
// Soustraction du modulo 97 de $s a 97 pour obtenir la cle
$cle_rib = 97 - ($s % 97);
diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php
index aade8149ce5..9afd0e7835b 100644
--- a/htdocs/core/lib/cron.lib.php
+++ b/htdocs/core/lib/cron.lib.php
@@ -110,21 +110,24 @@ function dol_print_cron_urls()
print ' ';
// Add note
- $linuxlike=1;
- if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
- if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
- print $langs->trans("Note").': ';
- if ($linuxlike)
+ if (empty($conf->global->CRON_DISABLE_TUTORIAL_CRON))
{
- print $langs->trans("CronExplainHowToRunUnix");
- print ' ';
- print ' ';
+ $linuxlike=1;
+ if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
+ if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
+ print $langs->trans("Note").': ';
+ if ($linuxlike)
+ {
+ print $langs->trans("CronExplainHowToRunUnix");
+ print ' ';
+ print ' ';
+ }
+ else
+ {
+ print $langs->trans("CronExplainHowToRunWin");
+ }
}
- else
- {
- print $langs->trans("CronExplainHowToRunWin");
- }
-
+
return 0;
}
diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php
index a0d61144582..cd897071551 100644
--- a/htdocs/core/lib/date.lib.php
+++ b/htdocs/core/lib/date.lib.php
@@ -175,7 +175,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
$sTime='';
$sDay=0;
- $sWeek='';
+ $sWeek=0;
if ($iSecond >= $lengthOfDay)
{
@@ -218,7 +218,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
}
if ($format == 'allhourmin')
{
- return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))).':'.sprintf("%02d",((int) floor(($iSecond % 3600)/60)));
+ return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))).':'.sprintf("%02d",((int) floor(($iSecond % 3600)/60)));
}
if ($format == 'allhour')
{
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 3cb4cc31093..c36531fd1c4 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3184,7 +3184,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
* @param string $sortorder Order to sort ('' by default)
* @param string $center String in the middle ('' by default). We often find here string $massaction comming from $form->selectMassAction()
* @param int $num Number of records found by select with limit+1
- * @param int $totalnboflines Total number of records/lines for all pages (if known). Use a negative value to not show number.
+ * @param int|string $totalnboflines Total number of records/lines for all pages (if known). Use a negative value of number to not show number. Use '' if unknown.
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
* @param string $morehtml More html to show
@@ -3193,7 +3193,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
* @param int $hideselectlimit Force to hide select limit
* @return void
*/
-function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=-1, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
+function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
{
global $conf,$langs;
@@ -3223,7 +3223,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
print '
'."\n";
}
}
-
+
if (GETPOST('id') == 'all')
{
dol_fiche_end();
diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php
index 3771bc8afd9..944cc27dffb 100644
--- a/htdocs/product/stock/massstockmove.php
+++ b/htdocs/product/stock/massstockmove.php
@@ -374,7 +374,8 @@ else
{
$limit = $conf->global->PRODUIT_LIMIT_SIZE;
}
-print $form->select_produits($id_product, 'productid', $filtertype, $limit, 0, 1, 2, '', 0, array(), 0, '1', 0, 'minwidth300imp maxwidth400', 1);
+
+print $form->select_produits($id_product, 'productid', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, '1', 0, 'minwidth300imp maxwidth400', 1);
print '';
// Batch number
if ($conf->productbatch->enabled)
diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php
index 3505247862b..8e6775e2e6e 100644
--- a/htdocs/product/stock/mouvement.php
+++ b/htdocs/product/stock/mouvement.php
@@ -456,7 +456,7 @@ $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // No
$sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php
index 848bc519946..2910103e380 100644
--- a/htdocs/product/stock/productlot_list.php
+++ b/htdocs/product/stock/productlot_list.php
@@ -259,7 +259,7 @@ $sql.=$db->order($sortfield,$sortorder);
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
// Count total nb of records
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 6d20078a785..be6de2313a0 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -69,7 +69,7 @@ if ($id > 0 || ! empty($ref))
// Security check
$socid=GETPOST('socid');
-if ($user->societe_id > 0) $socid=$user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $object->id,'projet&project');
// fetch optionals attributes and labels
@@ -704,7 +704,7 @@ elseif ($object->id > 0)
print '
'.$langs->trans("ThirdParty").'
';
$filteronlist='';
if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
- $text=$form->select_thirdparty_list($object->thirdparty->id, 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), '', 0, 0, 'minwidth300');
+ $text=$form->select_thirdparty_list($object->thirdparty->id, 'socid', $filteronlist, 'None', 1, 0, array(), '', 0, 0, 'minwidth300');
if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile))
{
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");
diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php
index c2a24458015..e9de1f7f787 100644
--- a/htdocs/projet/contact.php
+++ b/htdocs/projet/contact.php
@@ -46,7 +46,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid=$user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id,'projet&project');
diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php
index f6f1a51fed7..d61c9085f68 100644
--- a/htdocs/projet/document.php
+++ b/htdocs/projet/document.php
@@ -42,7 +42,7 @@ $mine = (GETPOST('mode','alpha') == 'mine' ? 1 : 0);
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid=$user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result=restrictedArea($user,'projet',$id,'projet&project');
$object = new Project($db);
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 77a6464e563..908acd89b3f 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -95,7 +95,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
// Security check
$socid=$object->socid;
-if ($user->societe_id > 0) $socid=$user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $projectid, 'projet&project');
diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php
index 1751b30a4bb..d96e21cf194 100644
--- a/htdocs/projet/ganttview.php
+++ b/htdocs/projet/ganttview.php
@@ -43,7 +43,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid=$user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id,'projet&project');
$langs->load("users");
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index 96f98111c2e..c91bfe1f980 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -37,7 +37,7 @@ $mine = GETPOST('mode')=='mine' ? 1 : 0;
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid=$user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (!$user->rights->projet->lire) accessforbidden();
$sortfield = GETPOST("sortfield",'alpha');
diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php
index e3c151df7a6..de27a363533 100644
--- a/htdocs/projet/info.php
+++ b/htdocs/projet/info.php
@@ -58,9 +58,11 @@ else
}
$search_agenda_label=GETPOST('search_agenda_label');
+
// Security check
+$id = GETPOST("id",'int');
$socid=0;
-if ($user->societe_id) $socid=$user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result=restrictedArea($user,'projet',$id,'');
if (!$user->rights->projet->lire) accessforbidden();
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index fd3a65df1af..68077621771 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -40,7 +40,7 @@ $title = $langs->trans("Projects");
// Security check
$socid = (is_numeric($_GET["socid"]) ? $_GET["socid"] : 0 );
-if ($user->societe_id > 0) $socid=$user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if ($socid > 0)
{
$soc = new Societe($db);
@@ -235,7 +235,9 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = c
// We'll need this table joined to the select in order to filter by categ
if (! empty($search_categ)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_project as cs ON p.rowid = cs.fk_project"; // We'll need this table joined to the select in order to filter by categ
// We'll need this table joined to the select in order to filter by sale
-if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
+// For external user, no check is done on company permission because readability is managed by public status of project and assignement.
+//if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
+if ($search_sale > 0) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
if ($search_user > 0)
{
$sql.=", ".MAIN_DB_PREFIX."element_contact as ecp";
@@ -292,7 +294,8 @@ if ($search_opp_status)
}
if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public);
if ($search_sale > 0) $sql.= " AND sc.fk_user = " .$search_sale;
-if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
+// For external user, no check is done on company permission because readability is managed by public status of project and assignement.
+//if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
if ($search_user > 0) $sql.= " AND ecp.fk_c_type_contact IN (".join(',',array_keys($listofprojectcontacttype)).") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".$search_user;
if ($search_opp_amount != '') $sql .= natural_search('p.opp_amount', $search_opp_amount, 1);
if ($search_budget_amount != '') $sql .= natural_search('p.budget_amount', $search_budget_amount, 1);
@@ -315,7 +318,7 @@ $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // No
$sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php
index 31081c92256..b00eae5d54d 100644
--- a/htdocs/projet/note.php
+++ b/htdocs/projet/note.php
@@ -41,7 +41,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid=$user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id,'projet&project');
$permissionnote=$user->rights->projet->creer; // Used by the include of actions_setnotes.inc.php
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 8a98b99221b..0e19e35b1f8 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -61,7 +61,7 @@ $extralabels_task=$extrafields_task->fetch_name_optionals_label($taskstatic->tab
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id,'projet&project');
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
@@ -455,7 +455,8 @@ else if ($id > 0 || ! empty($ref))
// Get list of tasks in tasksarray and taskarrayfiltered
// We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him).
- $tasksarray=$taskstatic->getTasksArray(0, 0, $object->id, $socid, 0);
+ $filteronthirdpartyid = $socid;
+ $tasksarray=$taskstatic->getTasksArray(0, 0, $object->id, $filteronthirdpartyid, 0);
// We load also tasks limited to a particular user
$tasksrole=($mode=='mine' ? $taskstatic->getUserRolesForProjectsOrTasks(0,$user,$object->id,0) : '');
//var_dump($tasksarray);
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index 096f44cc2f2..ebc486fec7e 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -42,7 +42,7 @@ $project_ref=GETPOST('project_ref','alpha');
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
//$result = restrictedArea($user, 'projet', $id, 'projet_task');
if (! $user->rights->projet->lire) accessforbidden();
diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php
index e51c0fb28cc..0108f754293 100644
--- a/htdocs/projet/tasks/document.php
+++ b/htdocs/projet/tasks/document.php
@@ -47,7 +47,7 @@ $project_ref = GETPOST('project_ref','alpha');
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
//$result=restrictedArea($user,'projet',$id,'');
if (!$user->rights->projet->lire) accessforbidden();
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index 45e6e06fb68..e1da8444319 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -75,7 +75,7 @@ $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (!$user->rights->projet->lire) accessforbidden();
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
@@ -308,7 +308,7 @@ $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // No
$sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php
index 9ee9c160ad0..0c4ab4b707f 100644
--- a/htdocs/projet/tasks/note.php
+++ b/htdocs/projet/tasks/note.php
@@ -39,7 +39,7 @@ $project_ref = GETPOST('project_ref','alpha');
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (!$user->rights->projet->lire) accessforbidden();
//$result = restrictedArea($user, 'projet', $id, '', 'task'); // TODO ameliorer la verification
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 2e5c17acc59..3c6f9bb7e6e 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -47,7 +47,7 @@ $planned_workload=((GETPOST('planned_workloadhour')!='' && GETPOST('planned_work
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (! $user->rights->projet->lire) accessforbidden();
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index d0b9475bfc1..49d57ae946e 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -52,7 +52,7 @@ $search_value=GETPOST('search_value','int');
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (!$user->rights->projet->lire) accessforbidden();
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
@@ -170,7 +170,7 @@ if ($action == 'addtimespent' && $user->rights->projet->lire)
}
}
-if ($action == 'updateline' && ! $_POST["cancel"] && $user->rights->projet->creer)
+if ($action == 'updateline' && ! $_POST["cancel"] && $user->rights->projet->lire)
{
$error=0;
@@ -183,7 +183,8 @@ if ($action == 'updateline' && ! $_POST["cancel"] && $user->rights->projet->cree
if (! $error)
{
$object->fetch($id, $ref);
-
+ // TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids))
+
$object->timespent_id = $_POST["lineid"];
$object->timespent_note = $_POST["timespent_note_line"];
$object->timespent_old_duration = $_POST["old_duration"];
@@ -217,9 +218,10 @@ if ($action == 'updateline' && ! $_POST["cancel"] && $user->rights->projet->cree
}
}
-if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->creer)
+if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->lire)
{
$object->fetchTimeSpent($_GET['lineid']);
+ // TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids))
$result = $object->delTimeSpent($user);
if ($result < 0)
@@ -789,6 +791,9 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$tasktmp = new Task($db);
$i = 0;
+
+ $childids = $user->getAllChildIds();
+
$total = 0;
$totalvalue = 0;
$totalarray=array();
@@ -933,17 +938,20 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print ' ';
print '';
}
- else if ($user->rights->projet->creer)
+ else if ($user->rights->projet->lire) // Read project and enter time consumed on assigned tasks
{
- print ' ';
- print 'fk_task.'&action=editline&lineid='.$task_time->rowid.($withproject?'&withproject=1':'').'">';
- print img_edit();
- print '';
-
- print ' ';
- print 'fk_task.'&action=deleteline&lineid='.$task_time->rowid.($withproject?'&withproject=1':'').'">';
- print img_delete();
- print '';
+ if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids))
+ {
+ print ' ';
+ print 'fk_task.'&action=editline&lineid='.$task_time->rowid.($withproject?'&withproject=1':'').'">';
+ print img_edit();
+ print '';
+
+ print ' ';
+ print 'fk_task.'&action=deleteline&lineid='.$task_time->rowid.($withproject?'&withproject=1':'').'">';
+ print img_delete();
+ print '';
+ }
}
print '
';
if (! $i) $totalarray['nbfield']++;
diff --git a/htdocs/societe/class/api_deprecated_contact.class.php b/htdocs/societe/class/api_deprecated_contact.class.php
index b9c991c7fa5..196a1386b5d 100644
--- a/htdocs/societe/class/api_deprecated_contact.class.php
+++ b/htdocs/societe/class/api_deprecated_contact.class.php
@@ -143,7 +143,7 @@ class ContactApi extends DolibarrApi
$sql .= " AND sc.fk_user = " . $search_sale;
}
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/societe/class/api_deprecated_thirdparty.class.php b/htdocs/societe/class/api_deprecated_thirdparty.class.php
index 8b0302f9c11..96a2ebac321 100644
--- a/htdocs/societe/class/api_deprecated_thirdparty.class.php
+++ b/htdocs/societe/class/api_deprecated_thirdparty.class.php
@@ -190,7 +190,7 @@ class ThirdpartyApi extends DolibarrApi
$sql .= " AND sc.fk_user = ".$search_sale;
}
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php
index e5d5eb5cc8f..46927e7bc64 100644
--- a/htdocs/societe/class/companybankaccount.class.php
+++ b/htdocs/societe/class/companybankaccount.class.php
@@ -102,10 +102,11 @@ class CompanyBankAccount extends Account
/**
* Update bank account
*
- * @param User $user Object user
- * @return int <=0 if KO, >0 if OK
+ * @param User $user Object user
+ * @param int $notrigger 1=Disable triggers
+ * @return int <=0 if KO, >0 if OK
*/
- function update(User $user = null)
+ function update(User $user = null, $notrigger=0)
{
global $conf;
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 4bff08c71dd..9248a07469c 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1909,10 +1909,9 @@ class Societe extends CommonObject
if (! empty($conf->accounting->enabled) && $this->fournisseur)
$label.= ' ' . $langs->trans('SupplierAccountancyCode') . ': '. $this->code_compta_fournisseur;
- if (! empty($this->logo))
+ if (! empty($this->logo) && class_exists('Form'))
{
$label.= '