diff --git a/.travis.yml b/.travis.yml
index 718356e8075..4f32a1dea43 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,6 +12,7 @@ php:
- '5.5'
- '5.6'
- '7.0'
+- '7.1'
- nightly
addons:
@@ -50,6 +51,7 @@ env:
matrix:
fast_finish: true
allow_failures:
+ - php: 7.1
- php: nightly
# FIXME
#- env: DB=postgresql
@@ -96,7 +98,7 @@ install:
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
composer -n require phpunit/phpunit ^4
fi
- if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
+ if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
composer -n require phpunit/phpunit ^5
fi
echo
@@ -136,7 +138,7 @@ before_script:
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
echo
echo "Enabling Memcached for PHP <= 5.4"
- # Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly!
+ # Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1 and nightly!
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
fi
phpenv rehash
@@ -208,7 +210,7 @@ before_script:
echo "Setting up Apache + FPM"
# enable php-fpm
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
- if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
+ if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
# Copy the included pool
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf
fi
diff --git a/ChangeLog b/ChangeLog
index 798f3ef91f4..87e7f4ba18b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -151,6 +151,9 @@ Dolibarr better:
no more required, were also removed. Use this new one if you were using one of them.
- The trigger that activate or close a contract line is run on a contract line, not on contract.
+Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful on PHP 7.1 but we don't have enough
+feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0.
+
***** ChangeLog for 4.0.3 to 4.0.2 *****
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
diff --git a/README-FR.md b/README-FR.md
index 41edb8ba50e..1c097e7914e 100644
--- a/README-FR.md
+++ b/README-FR.md
@@ -54,19 +54,10 @@ Pour mettre a jour Dolibarr depuis une vieille version vers celle ci:
- Ecraser les vieux fichiers dans le vieux repertoire 'dolibarr' par les fichiers
fournis dans ce nouveau package.
-- Si vous venez d'une version x.y.z vers x.y.w (seul le 3eme chiffre varie),
- il n'y a pas besoin de migration de données.
-
-- Si vous venez d'une beta ou d'un version x.y.z vers une autre ou les numeros x
- ou y varient, vous devez appelez la page "install/" de migration dans votre
- navigateur (ceci doit se faire automatiquement au premier accès de l'application).
- Ce sera une URL du genre:
- http://localhost/dolibarr/htdocs/install/index.php
- ou
- http://yourdolibarrhost/install/index.php
+- Au prochain accès, Dolibarr proposera la page de "mise a jour" des données (si necessaire).
+ Si un fichier install.lock existe pour vérouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transféré sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")
- Ensuite, choisir l'option de "mise a jour" en rapport avec votre cas.
- Note: Le processus de migration peut etre lance plusieurs fois sans risque.
+*Note: Le processus de migration peut etre lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
## CE QUI EST NOUVEAU
@@ -86,11 +77,13 @@ Voir fichier ChangeLog.
- Gestion des factures clients/fournisseurs et paiements
- Gestion des virements bancaires SEPA
- Gestion des comptes bancaires
-- Agenda partagé
+- Calendrier/Agenda partagé (avec export ical, vcal)
- Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...)
- Gestion de contrats de services
- Gestion de stock
- Gestion des expéditions
+- Gestion des demandes de congès
+- Gestion des notes de frais
- GED (Gestion Electronique de Documents)
- EMailings de masse
- Réalisation de sondages
diff --git a/README.md b/README.md
index dddf387cab9..cf2de36b81d 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,16 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git
Releases can be downloaded from [official website](https://www.dolibarr.org/).
+### Install from composer
+If you do not already have Composer installed, you may do so by following the instructions at getcomposer.org. On Linux and Mac OS X, you'll run the following commands:
+
+curl -sS https://getcomposer.org/installer | php
+mv composer.phar /usr/local/bin/composer
+
+On Windows, you'll download and run https://getcomposer.org/Composer-Setup.exe
+
+composer create-project dolibarr/dolibarr erp
+
### Simple setup
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in few clicks, you can use one of the packaged versions:
@@ -60,10 +70,10 @@ You can use a Web server and a supported database (MariaDb, MySql or Postgresql)
## UPGRADING
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
-- If you're upgrading from version x.y.z to x.y.w (only third number differs), there is no need to run any migration process.
-- If you're upgrading from a beta version or from any version x.y.z to any other where x or y number differs, you must call the Dolibarr "install/" page in your browser (this should be done automatically at first dolibarr access) and follow the upgrade process.
+- At first next access, Dolibarr will redirect your to the "install/" page to make the upgrade process.
+ If a file install.lock exists to lock any run of upgrade process, the application will ask you to remove the file manually (you should find the install.lock file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "documents").
-*Note: migration process can safely be done multiple times.*
+*Note: migration process can safely be done multiple times by calling the page /install/index.php*
## WHAT'S NEW
@@ -80,17 +90,17 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Invoices and payment management
- Standing orders management (European SEPA)
- Bank accounts management
-- Shared calendar
+- Shared calendar/agenda (with ical and vcal export for third party tools integration)
- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...)
- Projects management
- Contracts management
- Stock management
- Shipping management
- Interventions management
-- Agenda with ical and vcal export for third party tools integration
+- Employee's leave requests management
+- Expense report management
- Electronic Document Management (EDM)
- Foundations members management
-- Employee's holidays management
- Mass emailing
- Surveys
- Point of Sale
diff --git a/build/debian/README.howto b/build/debian/README.howto
index 1b64380cc26..afc2d391e1e 100644
--- a/build/debian/README.howto
+++ b/build/debian/README.howto
@@ -320,8 +320,8 @@ x.y.z+dfsgw
Note: If there was errors solved manually after get-orig-sources.sh, you may need to make a git commit
* Update/fix debian/* files used to build package.
-At least, add an entry into debian/changelog
-> dch -v x.y.z+dfsgw-v "My comment" will add entry.
+At least, add an entry into debian/changelog with command
+> dch -v x.y.z+dfsgw-1 "My comment"
For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increased for each new import)
Then check/modify changelog to replace "version" or "unstable" with "UNRELEASED".
Then check/modify also the user/date signature:
@@ -332,7 +332,9 @@ Then check/modify also the user/date signature:
To update dolibarr debian package when only files into debian has changed:
* Change files and commit.
-* Add a tag debian/x.y.z+dfsgw-2 (increase the last 1 into 2, 3...)
+* Add a line into changelog for version debian/x.y.z+dfsgw-v (increase the last v into 2, 3...)
+> dch -v x.y.z+dfsgw-v "My comment"
+* git tag will be added when package is pushed.
To update dolibarr debian package when only files not into debian has changed:
diff --git a/build/debian/control b/build/debian/control
index 37689ef9bcc..75ffb43b2c0 100755
--- a/build/debian/control
+++ b/build/debian/control
@@ -26,11 +26,11 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
# Misc dependencies
# fonts-dejavu-core | ttf-dejavu-core,
xdg-utils,
- virtual-mysql-client,
+ mariadb-client | virtual-mysql-client,
${misc:Depends},
${perl:Depends}
Recommends: apache2 | lighttpd | httpd,
- virtual-mysql-server
+ mariadb-server | virtual-mysql-server
Suggests: www-browser, php5-geoip
Description: Web based software to manage a company or foundation
Dolibarr ERP & CRM is an easy to use open source/free software package for
diff --git a/dev/initdemo/initdemo.sh b/dev/initdemo/initdemo.sh
index 497d3abbf50..c34d9e2ffda 100755
--- a/dev/initdemo/initdemo.sh
+++ b/dev/initdemo/initdemo.sh
@@ -162,7 +162,7 @@ export res=$?
# ---------------------------- copy demo files
-export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" `
+export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' `
if [ "x$documentdir" != "x" ]
then
echo cp -pr $mydir/documents_demo/* "$documentdir/"
@@ -174,7 +174,7 @@ then
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
else
- echo Detection of documents directory failed so demo files were not copied.
+ echo Detection of documents directory $documentdir failed so demo files were not copied.
fi
diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php
index 0ca4d6f8589..77485c6d638 100644
--- a/dev/skeletons/skeleton_list.php
+++ b/dev/skeletons/skeleton_list.php
@@ -247,7 +247,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/dev/tools/fixaltlanguages.sh b/dev/tools/fixaltlanguages.sh
index 7f42be5b954..65171f9acea 100755
--- a/dev/tools/fixaltlanguages.sh
+++ b/dev/tools/fixaltlanguages.sh
@@ -42,11 +42,15 @@ then
then
aaupper="US"
fi
+ if [ $aaupper = "EL" ]
+ then
+ aaupper="GR"
+ fi
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
then
reflang="htdocs/langs/"$aa"_"$aaupper
- if [ -d $reflang ]
+ if [ -d $reflang -a $aa"_"$bb != $aa"_"$aaupper ]
then
echo "***** Process language "$aa"_"$bb" - Search original into "$reflang
echo $dirshort is an alternative language of $reflang
diff --git a/dev/tools/test/testdiv.php b/dev/tools/test/testdiv.php
index 5b57f0a3667..b529af4eb60 100644
--- a/dev/tools/test/testdiv.php
+++ b/dev/tools/test/testdiv.php
@@ -39,8 +39,8 @@
-
-
+
+
diff --git a/dev/translation/erp_comparison_translation.txt b/dev/translation/erp_comparison_translation.txt
new file mode 100644
index 00000000000..daa1bc79e92
--- /dev/null
+++ b/dev/translation/erp_comparison_translation.txt
@@ -0,0 +1,14 @@
+
+
+Term Dolibarr SAP Odoo ...
+----------------------------------------------------------------------------
+Thirdparty Contact partner Partner/Contact (company)
+Contact/address Contact person Partner/Contact (individual)
+
+Financial ?? Invoicing
+
+Income / Expense ?? Profit / Loss
+Balance Net profit
+
+
+
diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index 47dcce5031b..e82522df26f 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -172,7 +172,7 @@ if (strlen(trim($search_pcgsubtype))) {
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
-$nbtotalofrecords = -1;
+$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$resql = $db->query($sql);
diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php
index c5a1bffc694..817905f7b56 100644
--- a/htdocs/accountancy/admin/fiscalyear.php
+++ b/htdocs/accountancy/admin/fiscalyear.php
@@ -90,7 +90,7 @@ $sql .= " WHERE f.entity = " . $conf->entity;
$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/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php
index 7c5c6d08c73..2c22d8f191a 100644
--- a/htdocs/accountancy/admin/fiscalyear_card.php
+++ b/htdocs/accountancy/admin/fiscalyear_card.php
@@ -268,7 +268,7 @@ if ($action == 'create')
print '';
// Label
- print '
';
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 460e698e432..65c4e6bc94c 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -1569,17 +1569,15 @@ class Project extends CommonObject
$langs->load("projects");
- // Positionne modele sur le nom du modele de projet a utiliser
- if (! dol_strlen($modele))
- {
- if (! empty($conf->global->PROJECT_ADDON_PDF))
- {
+ if (! dol_strlen($modele)) {
+
+ $modele = 'baleine';
+
+ if ($this->modelpdf) {
+ $modele = $this->modelpdf;
+ } elseif (! empty($conf->global->PROJECT_ADDON_PDF)) {
$modele = $conf->global->PROJECT_ADDON_PDF;
}
- else
- {
- $modele='baleine';
- }
}
$modelpath = "core/modules/project/doc/";
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index ec180704563..905098d202a 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -534,6 +534,40 @@ class Task extends CommonObject
return -1;
}
}
+
+ /**
+ * Return nb of time spent
+ *
+ * @return int <0 if KO, 0 if no children, >0 if OK
+ */
+ function hasTimeSpent()
+ {
+ $error=0;
+ $ret=0;
+
+ $sql = "SELECT COUNT(*) as nb";
+ $sql.= " FROM ".MAIN_DB_PREFIX."projet_task_time";
+ $sql.= " WHERE fk_task=".$this->id;
+
+ dol_syslog(get_class($this)."::hasTimeSpent", LOG_DEBUG);
+ $resql = $this->db->query($sql);
+ if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
+ else
+ {
+ $obj=$this->db->fetch_object($resql);
+ if ($obj) $ret=$obj->nb;
+ $this->db->free($resql);
+ }
+
+ if (! $error)
+ {
+ return $ret;
+ }
+ else
+ {
+ return -1;
+ }
+ }
/**
@@ -1619,17 +1653,15 @@ class Task extends CommonObject
$langs->load("projects");
- // Positionne modele sur le nom du modele de projet a utiliser
- if (! dol_strlen($modele))
- {
- if (! empty($conf->global->PROJECT_TASK_ADDON_PDF))
- {
+ if (! dol_strlen($modele)) {
+
+ $modele = 'nodefault';
+
+ if ($this->modelpdf) {
+ $modele = $this->modelpdf;
+ } elseif (! empty($conf->global->PROJECT_TASK_ADDON_PDF)) {
$modele = $conf->global->PROJECT_TASK_ADDON_PDF;
}
- else
- {
- $modele='nodefault';
- }
}
$modelpath = "core/modules/project/task/doc/";
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..cd8728b3013 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
@@ -392,7 +392,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print '';
// Description
- print '
'.$langs->trans("Description").'
';
+ print '
'.$langs->trans("Description").'
';
print '
';
print '';
print '
';
@@ -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..060155d6507 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();
@@ -212,7 +212,7 @@ if ($id > 0 || ! empty($ref))
$projectstatic->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")";
}
- dol_banner_tab($projectstatic, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+ dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '
';
print '
';
diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php
index e51c0fb28cc..d985454119d 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();
@@ -155,7 +155,7 @@ if ($object->id > 0)
$projectstatic->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")";
}
- dol_banner_tab($projectstatic, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+ dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '
';
print '
';
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index 45e6e06fb68..74f9b122f14 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);
@@ -816,7 +816,7 @@ if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['tota
}
elseif ($totalarray['totalplannedworkloadfield'] == $i) print '
'."\n";
// Add specific fields used by Dolibarr foundation for example
diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php
index cbac1692103..8f28cd12827 100644
--- a/htdocs/public/members/public_card.php
+++ b/htdocs/public/members/public_card.php
@@ -111,7 +111,7 @@ if ($id > 0)
// print "