';
// Center
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index a09b962ee26..bb34806965a 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -1056,13 +1056,13 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
{
$numFinal = preg_replace('/\{yyyy\}/i',date("Y",$date)+$yearoffset, $numFinal);
$numFinal = preg_replace('/\{yy\}/i', date("y",$date)+$yearoffset, $numFinal);
- $numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),2,1)+$yearoffset, $numFinal);
+ $numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),1,1)+$yearoffset, $numFinal);
}
else // we want yyyy to be current year
{
$numFinal = preg_replace('/\{yyyy\}/i',date("Y",$date), $numFinal);
$numFinal = preg_replace('/\{yy\}/i', date("y",$date), $numFinal);
- $numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),2,1), $numFinal);
+ $numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),1,1), $numFinal);
}
$numFinal = preg_replace('/\{mm\}/i', date("m",$date), $numFinal);
$numFinal = preg_replace('/\{dd\}/i', date("d",$date), $numFinal);
diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php
index acfdeba7d8e..5ca0fc61cf2 100644
--- a/htdocs/cron/list.php
+++ b/htdocs/cron/list.php
@@ -225,7 +225,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/don/list.php b/htdocs/don/list.php
index 9ca8a79bb15..d925573b859 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -113,7 +113,7 @@ if (trim($search_name) != '')
if ($search_amount) $sql.= natural_search(array('d.amount'), price2num(trim($search_amount)), 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/expedition/list.php b/htdocs/expedition/list.php
index 34c989587af..65d7fd5223e 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -238,7 +238,7 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index 00b6343bf97..7928e0f8e3d 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -266,7 +266,7 @@ $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/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index f8faa5fa753..90647b7c65a 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -371,7 +371,7 @@ $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/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index a66e624619c..ad05d000f8c 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -6,7 +6,7 @@
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2013 Cédric Salvador
* Copyright (C) 2015 Marcos García
- * Copyright (C) 2015 juanjo Menent
+ * Copyright (C) 2015-2007 Juanjo Menent
* Copyright (C) 2015 Abbes Bahfir
* Copyright (C) 2015-2016 Ferran Marcet
*
@@ -372,7 +372,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
@@ -434,6 +434,7 @@ if ($resql)
print '';
print '';
print '';
+ print '';
print_barre_liste($langs->trans("BillsSuppliers").($socid?" - $soc->name":""), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
@@ -797,7 +798,7 @@ if ($resql)
$thirdparty->name=$obj->name;
$thirdparty->client=$obj->client;
$thirdparty->code_client=$obj->code_client;
- print $thirdparty->getNomUrl(1,'customer');
+ print $thirdparty->getNomUrl(1,'supplier');
print '';
if (! $i) $totalarray['nbfield']++;
}
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index a41978064f6..2400992b250 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -639,7 +639,7 @@ if (empty($action))
if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user";
$sql.= $db->order($sortfield,$sortorder);
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php
index 97184909290..0e17a48b356 100644
--- a/htdocs/fourn/product/list.php
+++ b/htdocs/fourn/product/list.php
@@ -120,7 +120,7 @@ if ($fourn_id > 0)
$sql .= " AND ppf.fk_soc = ".$fourn_id;
}
// Count total nb of records without orderby and limit
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 00fb2e768ab..0deb024118f 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -586,7 +586,7 @@ Permission34=Delete products
Permission36=See/manage hidden products
Permission38=Export products
Permission41=Read projects and tasks (shared project and projects i'm contact for). Can also enter time consumed on assigned tasks (timesheet)
-Permission42=Create/modify projects (shared project and projects i'm contact for)
+Permission42=Create/modify projects (shared project and projects i'm contact for). Can also create tasks and assign users to project and tasks
Permission44=Delete projects (shared project and projects i'm contact for)
Permission45=Export projects
Permission61=Read interventions
@@ -689,7 +689,7 @@ PermissionAdvanced253=Create/modify internal/external users and permissions
Permission254=Create/modify external users only
Permission255=Modify other users password
Permission256=Delete or disable other users
-Permission262=Extend access to all third parties (not only those linked to user). Not effective for external users (always limited to themselves).
+Permission262=Extend access to all third parties (not only third parties that user is a sale representative). Not effective for external users (always limited to themselves for proposals, orders, invoices, contracts, etc). Not effective for projects (only rules on project permissions, visibility and assignement matters).
Permission271=Read CA
Permission272=Read invoices
Permission273=Issue invoices
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 90f3ea5e15b..465db427f6c 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -179,6 +179,7 @@ ErrorModuleNotFound=File of module was not found.
ErrorFieldAccountNotDefinedForBankLine=Value for Accounting account not defined for source bank line %s
ErrorBankStatementNameMustFollowRegex=Error, bank statement name must follow the following syntax rule %s
ErrorPhpMailDelivery=Check that you don't use a too high number of recipients and that your email content is not similar to a Spam. Ask also your administrator to check firewall and server logs files for a more complete information.
+ErrorUserNotAssignedToTask=User must be assigned to task to be able to enter time consumed.
# Warnings
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
diff --git a/htdocs/loan/index.php b/htdocs/loan/index.php
index c15f27a2e7f..d2a60973a7f 100644
--- a/htdocs/loan/index.php
+++ b/htdocs/loan/index.php
@@ -86,7 +86,7 @@ if ($filtre) {
$sql.= " GROUP BY l.rowid, l.label, l.capital, l.datestart, l.dateend";
$sql.= $db->order($sortfield,$sortorder);
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 92df8f48f05..8aba2e428f2 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1935,11 +1935,11 @@ if (! function_exists("llxFooter"))
var scrollBottom = $(window).scrollTop() + $(window).height();
//console.log(scrollBottom);
diffoutsidebottom = (posbottom - scrollBottom);
- console.log("diffoutsidebottom (positive = outside) = "+diffoutsidebottom);
+ console.log("heigthofcontent="+heigthofcontent+", diffoutsidebottom (posbottom="+posbottom+" - scrollBottom="+scrollBottom+") = "+diffoutsidebottom);
if (diffoutsidebottom > 0)
{
- pix = "-"+diffoutsidebottom+"px";
- console.log(pix);
+ pix = "-"+(diffoutsidebottom+8)+"px";
+ console.log("We reposition top by "+pix);
$(this).parent().parent().find(\'dd\').css("top", pix);
}
// $(".dropdown dd ul").slideToggle(\'fast\');
diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php
index eb3292cd332..93f6e6915f9 100644
--- a/htdocs/margin/checkMargins.php
+++ b/htdocs/margin/checkMargins.php
@@ -157,7 +157,7 @@ if (! empty($enddate))
$sql .= " AND d.buy_price_ht IS NOT NULL";
$sql .= $db->order($sortfield, $sortorder);
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
dol_syslog(__FILE__, LOG_DEBUG);
diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php
index 847cd5289dc..9a95797736d 100644
--- a/htdocs/opensurvey/list.php
+++ b/htdocs/opensurvey/list.php
@@ -124,7 +124,7 @@ $sql.= " u.login, u.firstname, u.lastname";
$sql.= " FROM ".MAIN_DB_PREFIX."opensurvey_sondage as p";
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."user u ON u.rowid = p.fk_user_creat";
// Count total nb of records
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/product/class/api_deprecated_product.class.php b/htdocs/product/class/api_deprecated_product.class.php
index df0cddd8aaf..49af8c73123 100644
--- a/htdocs/product/class/api_deprecated_product.class.php
+++ b/htdocs/product/class/api_deprecated_product.class.php
@@ -126,7 +126,7 @@ class ProductApi extends DolibarrApi
// Show product on buy
if ($to_buy) $sql.= " AND p.to_buy = ".$db->escape($to_buy);
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
@@ -212,7 +212,7 @@ class ProductApi extends DolibarrApi
// Show product on buy
if ($to_buy) $sql.= " AND p.to_buy = ".$db->escape($to_buy);
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index 48693cd0ac7..4f1f97cef8a 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -304,7 +304,7 @@ else
$sql.=$hookmanager->resPrint;
//if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
$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/price.php b/htdocs/product/price.php
index d3c3784c00c..eb0f49cb77f 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -1668,7 +1668,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
$filter = array('t.fk_product' => $object->id,'t.fk_soc' => GETPOST('socid', 'int'));
// Count total nb of records
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $prodcustprice->fetch_all_log($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);
}
@@ -1748,7 +1748,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
// List of all prices by customers
// Count total nb of records
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $prodcustprice->fetch_all($sortorder, $sortfield, 0, 0, $filter);
}
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/societe.class.php b/htdocs/societe/class/societe.class.php
index 4bff08c71dd..fd3445375a9 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1945,6 +1945,13 @@ class Societe extends CommonObject
$linkstart.=$linkclose.'>';
$linkend='';
+ global $user;
+ if (! $user->rights->societe->client->voir && $user->societe_id > 0 && $this->id != $user->societe_id)
+ {
+ $linkstart='';
+ $linkend='';
+ }
+
if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), 'company', ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$linkstart.($maxlen?dol_trunc($name,$maxlen):$name).$linkend;
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 8982d2db32d..301ca845286 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -439,7 +439,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/societe/price.php b/htdocs/societe/price.php
index db2592f225c..e8dc595c6c3 100644
--- a/htdocs/societe/price.php
+++ b/htdocs/societe/price.php
@@ -379,7 +379,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
);
// Count total nb of records
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $prodcustprice->fetch_all_log($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);
}
@@ -469,7 +469,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
// Count total nb of records
- $nbtotalofrecords = -1;
+ $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$nbtotalofrecords = $prodcustprice->fetch_all('', '', 0, 0, $filter);
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index a8e38098775..401eef99a35 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -285,7 +285,7 @@ if ($search_user > 0)
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder.', sp.ref DESC';
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);