Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
commit
22a815a1b4
@ -12,6 +12,7 @@ php:
|
|||||||
- '5.5'
|
- '5.5'
|
||||||
- '5.6'
|
- '5.6'
|
||||||
- '7.0'
|
- '7.0'
|
||||||
|
- '7.1'
|
||||||
- nightly
|
- nightly
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
@ -50,6 +51,7 @@ env:
|
|||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
|
- php: 7.1
|
||||||
- php: nightly
|
- php: nightly
|
||||||
# FIXME
|
# FIXME
|
||||||
#- env: DB=postgresql
|
#- 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
|
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
|
||||||
composer -n require phpunit/phpunit ^4
|
composer -n require phpunit/phpunit ^4
|
||||||
fi
|
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
|
composer -n require phpunit/phpunit ^5
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
@ -136,7 +138,7 @@ before_script:
|
|||||||
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||||
echo
|
echo
|
||||||
echo "Enabling Memcached for PHP <= 5.4"
|
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
|
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||||
fi
|
fi
|
||||||
phpenv rehash
|
phpenv rehash
|
||||||
@ -208,7 +210,7 @@ before_script:
|
|||||||
echo "Setting up Apache + FPM"
|
echo "Setting up Apache + FPM"
|
||||||
# enable php-fpm
|
# enable php-fpm
|
||||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
|
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
|
# 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
|
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
|
fi
|
||||||
|
|||||||
@ -151,6 +151,9 @@ Dolibarr better:
|
|||||||
no more required, were also removed. Use this new one if you were using one of them.
|
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.
|
- 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 *****
|
***** ChangeLog for 4.0.3 to 4.0.2 *****
|
||||||
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||||
|
|||||||
@ -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
|
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.
|
* Update/fix debian/* files used to build package.
|
||||||
At least, add an entry into debian/changelog
|
At least, add an entry into debian/changelog with command
|
||||||
> dch -v x.y.z+dfsgw-v "My comment" will add entry.
|
> 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)
|
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 changelog to replace "version" or "unstable" with "UNRELEASED".
|
||||||
Then check/modify also the user/date signature:
|
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:
|
To update dolibarr debian package when only files into debian has changed:
|
||||||
|
|
||||||
* Change files and commit.
|
* 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:
|
To update dolibarr debian package when only files not into debian has changed:
|
||||||
|
|||||||
@ -26,11 +26,11 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
|
|||||||
# Misc dependencies
|
# Misc dependencies
|
||||||
# fonts-dejavu-core | ttf-dejavu-core,
|
# fonts-dejavu-core | ttf-dejavu-core,
|
||||||
xdg-utils,
|
xdg-utils,
|
||||||
virtual-mysql-client,
|
mariadb-client | virtual-mysql-client,
|
||||||
${misc:Depends},
|
${misc:Depends},
|
||||||
${perl:Depends}
|
${perl:Depends}
|
||||||
Recommends: apache2 | lighttpd | httpd,
|
Recommends: apache2 | lighttpd | httpd,
|
||||||
virtual-mysql-server
|
mariadb-server | virtual-mysql-server
|
||||||
Suggests: www-browser, php5-geoip
|
Suggests: www-browser, php5-geoip
|
||||||
Description: Web based software to manage a company or foundation
|
Description: Web based software to manage a company or foundation
|
||||||
Dolibarr ERP & CRM is an easy to use open source/free software package for
|
Dolibarr ERP & CRM is an easy to use open source/free software package for
|
||||||
|
|||||||
@ -162,7 +162,7 @@ export res=$?
|
|||||||
|
|
||||||
|
|
||||||
# ---------------------------- copy demo files
|
# ---------------------------- 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" ]
|
if [ "x$documentdir" != "x" ]
|
||||||
then
|
then
|
||||||
echo cp -pr $mydir/documents_demo/* "$documentdir/"
|
echo cp -pr $mydir/documents_demo/* "$documentdir/"
|
||||||
@ -174,7 +174,7 @@ then
|
|||||||
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||||
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -247,7 +247,7 @@ $sql.=$db->order($sortfield,$sortorder);
|
|||||||
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
8
dev/tools/github_authors_peryear.sh
Executable file
8
dev/tools/github_authors_peryear.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
FROM=2016-01-01
|
||||||
|
TO=2016-12-31
|
||||||
|
|
||||||
|
echo "git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l"
|
||||||
|
git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l
|
||||||
|
|
||||||
15
dev/tools/github_commits_perversion.sh
Executable file
15
dev/tools/github_commits_perversion.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#/bin/bash
|
||||||
|
Releases=("3.8" "3.9" "4.0" "5.0", "develop")
|
||||||
|
Dates=("2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-07-01")
|
||||||
|
let "counter = 1"
|
||||||
|
|
||||||
|
for i in "${Releases[@]}"
|
||||||
|
do
|
||||||
|
git shortlog -s -n --after=${Dates[counter-1]} --before=${Dates[counter]}
|
||||||
|
echo -n "Total $i: "
|
||||||
|
git log --pretty=oneline --after=${Dates[counter-1]} --before=${Dates[counter]} | wc -l
|
||||||
|
echo "======================="
|
||||||
|
echo
|
||||||
|
let "counter +=1"
|
||||||
|
done
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ if (strlen(trim($search_pcgsubtype))) {
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|||||||
@ -90,7 +90,7 @@ $sql .= " WHERE f.entity = " . $conf->entity;
|
|||||||
$sql.=$db->order($sortfield,$sortorder);
|
$sql.=$db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -248,7 +248,7 @@ if (strlen(trim($search_desc))) {
|
|||||||
}
|
}
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -143,7 +143,7 @@ else {
|
|||||||
|
|
||||||
// List
|
// List
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
|
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
|
||||||
if ($nbtotalofrecords < 0) {
|
if ($nbtotalofrecords < 0) {
|
||||||
|
|||||||
@ -293,7 +293,7 @@ llxHeader('', $title_page);
|
|||||||
|
|
||||||
// List
|
// List
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
||||||
if ($nbtotalofrecords < 0) {
|
if ($nbtotalofrecords < 0) {
|
||||||
|
|||||||
@ -162,7 +162,7 @@ llxHeader('', $title_page);
|
|||||||
|
|
||||||
// List
|
// List
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
|
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
|
||||||
if ($nbtotalofrecords < 0) {
|
if ($nbtotalofrecords < 0) {
|
||||||
|
|||||||
@ -158,7 +158,7 @@ if (! empty($search_code_journal)) {
|
|||||||
* Mode List
|
* Mode List
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0);
|
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0);
|
||||||
if ($nbtotalofrecords < 0) {
|
if ($nbtotalofrecords < 0) {
|
||||||
|
|||||||
@ -200,7 +200,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -220,7 +220,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -178,7 +178,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -208,7 +208,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -182,7 +182,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -217,7 +217,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -250,7 +250,7 @@ $sql.=$hookmanager->resPrint;
|
|||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
// Count total nb of records with no order and no limits
|
// Count total nb of records with no order and no limits
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|||||||
@ -110,7 +110,7 @@ if ($search_account > 0) $sql.= " AND b.fk_account = ".$search_account;
|
|||||||
if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1);
|
if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1);
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -407,7 +407,7 @@ if ($rowid > 0)
|
|||||||
$sql.=" AND datefin < '".$db->idate($now)."'";
|
$sql.=" AND datefin < '".$db->idate($now)."'";
|
||||||
}
|
}
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|||||||
@ -203,7 +203,7 @@ foreach ($modulesdir as $dir)
|
|||||||
}
|
}
|
||||||
ksort($arrayofnatures);
|
ksort($arrayofnatures);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define array $categ with categ with at least one qualified module
|
// Define array $categ with categ with at least one qualified module
|
||||||
if ($modulequalified > 0)
|
if ($modulequalified > 0)
|
||||||
{
|
{
|
||||||
@ -319,7 +319,7 @@ if ($mode != 'marketplace')
|
|||||||
$moreforfilter.= $langs->trans('Keyword') . ': <input type="text" name="search_keyword" value="'.dol_escape_htmltag($search_keyword).'">';
|
$moreforfilter.= $langs->trans('Keyword') . ': <input type="text" name="search_keyword" value="'.dol_escape_htmltag($search_keyword).'">';
|
||||||
$moreforfilter.= '</div>';
|
$moreforfilter.= '</div>';
|
||||||
$moreforfilter.='<div class="divsearchfield">';
|
$moreforfilter.='<div class="divsearchfield">';
|
||||||
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, $search_nature, 1);
|
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1);
|
||||||
$moreforfilter.= '</div>';
|
$moreforfilter.= '</div>';
|
||||||
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||||
{
|
{
|
||||||
@ -398,7 +398,7 @@ if ($mode != 'marketplace')
|
|||||||
if ($search_keyword)
|
if ($search_keyword)
|
||||||
{
|
{
|
||||||
$qualified=0;
|
$qualified=0;
|
||||||
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
|
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
|
||||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|
||||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|
||||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
|
||||||
@ -417,7 +417,7 @@ if ($mode != 'marketplace')
|
|||||||
{
|
{
|
||||||
//print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher());
|
//print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher());
|
||||||
$publisher=dol_escape_htmltag($objMod->getPublisher());
|
$publisher=dol_escape_htmltag($objMod->getPublisher());
|
||||||
if ($reg[1] && $reg[1] != $publisher) continue;
|
if ($reg[1] && dol_escape_htmltag($reg[1]) != $publisher) continue;
|
||||||
if (! $reg[1] && ! empty($publisher)) continue;
|
if (! $reg[1] && ! empty($publisher)) continue;
|
||||||
}
|
}
|
||||||
if ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue;
|
if ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue;
|
||||||
@ -496,11 +496,12 @@ if ($mode != 'marketplace')
|
|||||||
// Help
|
// Help
|
||||||
print '<td align="center" valign="top" class="nowrap" style="width: 82px;">';
|
print '<td align="center" valign="top" class="nowrap" style="width: 82px;">';
|
||||||
$text='';
|
$text='';
|
||||||
|
|
||||||
if ($objMod->getDescLong()) $text.='<div class="titre">'.$objMod->getDesc().'</div><br>'.$objMod->getDescLong().'<br>';
|
if ($objMod->getDescLong()) $text.='<div class="titre">'.$objMod->getDesc().'</div><br>'.$objMod->getDescLong().'<br>';
|
||||||
else $text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
|
else $text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
|
||||||
|
|
||||||
$textexternal='';
|
$textexternal='';
|
||||||
$imginfo="info";
|
$imginfo="info";
|
||||||
if ($objMod->isCoreOrExternalModule() == 'external')
|
if ($objMod->isCoreOrExternalModule() == 'external')
|
||||||
{
|
{
|
||||||
$imginfo="info_black";
|
$imginfo="info_black";
|
||||||
@ -647,6 +648,7 @@ if ($mode != 'marketplace')
|
|||||||
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
|
||||||
$text.=$langs->trans("DetectionNotPossible");
|
$text.=$langs->trans("DetectionNotPossible");
|
||||||
|
|
||||||
|
|
||||||
print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20');
|
print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20');
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -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_desc) { $usefilter++; $sql.=natural_search("e.description", $search_desc, 0); }
|
||||||
if ($search_ua) { $usefilter++; $sql.=natural_search("e.user_agent", $search_ua, 0); }
|
if ($search_ua) { $usefilter++; $sql.=natural_search("e.user_agent", $search_ua, 0); }
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$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);
|
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -195,7 +204,7 @@ if ($result)
|
|||||||
$center='<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("Purge").'</a>';
|
$center='<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("Purge").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
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')
|
if ($action == 'purge')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -115,7 +115,7 @@ li.menu_choix0 {
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------- R<EFBFBD>capitulatif des articles ------------------- */
|
/* ------------------- Remind of products ------------------- */
|
||||||
.liste_articles {
|
.liste_articles {
|
||||||
min-width: 215px;
|
min-width: 215px;
|
||||||
float: right;
|
float: right;
|
||||||
@ -212,6 +212,10 @@ p.titre {
|
|||||||
max-width: 900px;
|
max-width: 900px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.blocksellfinished {
|
||||||
|
min-width: 215px;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
.titre1 {
|
.titre1 {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #ff9900;
|
color: #ff9900;
|
||||||
|
|||||||
@ -106,23 +106,23 @@ $langs->load("cashdesk");
|
|||||||
<th><?php echo $langs->trans("VATRate"); ?></th>
|
<th><?php echo $langs->trans("VATRate"); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input class="texte1" type="text" id="txtQte" name="txtQte" value="1" onkeyup="javascript: modif();" onfocus="javascript: this.select();" />
|
<td><input class="texte1 maxwidth50onsmartphone" type="text" id="txtQte" name="txtQte" value="1" onkeyup="javascript: modif();" onfocus="javascript: this.select();" />
|
||||||
<?php print genkeypad("txtQte", "frmQte");?>
|
<?php print genkeypad("txtQte", "frmQte");?>
|
||||||
</td>
|
</td>
|
||||||
<!-- Affichage du stock pour l'article courant -->
|
<!-- Affichage du stock pour l'article courant -->
|
||||||
<td>
|
<td>
|
||||||
<input class="texte1_off" type="text" name="txtStock" value="<?php echo $obj_facturation->stock() ?>" disabled />
|
<input class="texte1_off maxwidth50onsmartphone" type="text" name="txtStock" value="<?php echo $obj_facturation->stock() ?>" disabled />
|
||||||
</td>
|
</td>
|
||||||
<!-- Show unit price -->
|
<!-- Show unit price -->
|
||||||
<?php // TODO Remove the disabled and use this value when adding product into cart ?>
|
<?php // TODO Remove the disabled and use this value when adding product into cart ?>
|
||||||
<td><input class="texte1_off" type="text" name="txtPrixUnit" value="<?php echo price2num($obj_facturation->prix(), 'MU'); ?>" onchange="javascript: modif();" disabled /></td>
|
<td><input class="texte1_off maxwidth50onsmartphone" type="text" name="txtPrixUnit" value="<?php echo price2num($obj_facturation->prix(), 'MU'); ?>" onchange="javascript: modif();" disabled /></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<!-- Choix de la remise -->
|
<!-- Choix de la remise -->
|
||||||
<td><input class="texte1" type="text" id="txtRemise" name="txtRemise" value="0" onkeyup="javascript: modif();" onfocus="javascript: this.select();"/>
|
<td><input class="texte1 maxwidth50onsmartphone" type="text" id="txtRemise" name="txtRemise" value="0" onkeyup="javascript: modif();" onfocus="javascript: this.select();"/>
|
||||||
<?php print genkeypad("txtRemise", "frmQte");?>
|
<?php print genkeypad("txtRemise", "frmQte");?>
|
||||||
</td>
|
</td>
|
||||||
<!-- Affichage du total HT -->
|
<!-- Affichage du total HT -->
|
||||||
<td><input class="texte1_off" type="text" name="txtTotal" value="" disabled /></td><td></td>
|
<td><input class="texte1_off maxwidth50onsmartphone" type="text" name="txtTotal" value="" disabled /></td><td></td>
|
||||||
<!-- Choix du taux de TVA -->
|
<!-- Choix du taux de TVA -->
|
||||||
<td class="select_tva">
|
<td class="select_tva">
|
||||||
<?php //var_dump($tab_tva); ?>
|
<?php //var_dump($tab_tva); ?>
|
||||||
@ -155,17 +155,17 @@ $langs->load("cashdesk");
|
|||||||
<input type="hidden" name="hdnChoix" value="" />
|
<input type="hidden" name="hdnChoix" value="" />
|
||||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
||||||
<fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Amount"); ?></legend>
|
<fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Amount"); ?></legend>
|
||||||
<table>
|
<table class="centpercent">
|
||||||
<tr><th class="label1"><?php echo $langs->trans("TotalTicket"); ?></th><th class="label1"><?php echo $langs->trans("Received"); ?></th><th class="label1"><?php echo $langs->trans("Change"); ?></th></tr>
|
<tr><th class="label1"><?php echo $langs->trans("TotalTicket"); ?></th><th class="label1"><?php echo $langs->trans("Received"); ?></th><th class="label1"><?php echo $langs->trans("Change"); ?></th></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<!-- Affichage du montant du -->
|
<!-- Affichage du montant du -->
|
||||||
<td><input class="texte2_off" type="text" name="txtDu" value="<?php echo price2num($obj_facturation->prixTotalTtc(), 'MT'); ?>" disabled /></td>
|
<td><input class="texte2_off maxwidthonsmartphone" type="text" name="txtDu" value="<?php echo price2num($obj_facturation->prixTotalTtc(), 'MT'); ?>" disabled /></td>
|
||||||
<!-- Choix du montant encaisse -->
|
<!-- Choix du montant encaisse -->
|
||||||
<td><input class="texte2" type="text" id="txtEncaisse" name="txtEncaisse" value="" onkeyup="javascript: verifDifference();" onfocus="javascript: this.select();" />
|
<td><input class="texte2 maxwidthonsmartphone" type="text" id="txtEncaisse" name="txtEncaisse" value="" onkeyup="javascript: verifDifference();" onfocus="javascript: this.select();" />
|
||||||
<?php print genkeypad("txtEncaisse", "frmDifference");?>
|
<?php print genkeypad("txtEncaisse", "frmDifference");?>
|
||||||
</td>
|
</td>
|
||||||
<!-- Affichage du montant rendu -->
|
<!-- Affichage du montant rendu -->
|
||||||
<td><input class="texte2_off" type="text" name="txtRendu" value="0" disabled /></td>
|
<td><input class="texte2_off maxwidthonsmartphone" type="text" name="txtRendu" value="0" disabled /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@ -22,9 +22,10 @@ $langs->load("bills");
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h3 class="titre1"><?php echo $langs->trans("SellFinished"); ?></h3><br>
|
<div class="blocksellfinished">
|
||||||
|
|
||||||
<div class="cadre_facturation">
|
<div class="cadre_facturation">
|
||||||
|
<h3 class="titre1"><?php echo $langs->trans("SellFinished"); ?></h3><br>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
@ -45,3 +46,6 @@ $langs->load("bills");
|
|||||||
<p><a class="lien1" href="#" onclick="Javascript: popupTicket(); return(false);"><?php echo $langs->trans("PrintTicket"); ?></a></p>
|
<p><a class="lien1" href="#" onclick="Javascript: popupTicket(); return(false);"><?php echo $langs->trans("PrintTicket"); ?></a></p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|||||||
@ -209,7 +209,7 @@ class Categories extends DolibarrApi
|
|||||||
$sql.= ' AND s.rowid = sub.fk_categorie';
|
$sql.= ' AND s.rowid = sub.fk_categorie';
|
||||||
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
|
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -124,7 +124,7 @@ class CategoryApi extends DolibarrApi
|
|||||||
$sql.= ' WHERE s.entity IN ('.getEntity('category', 1).')';
|
$sql.= ' WHERE s.entity IN ('.getEntity('category', 1).')';
|
||||||
$sql.= ' AND s.type='.array_search($type,CategoryApi::$TYPES);
|
$sql.= ' AND s.type='.array_search($type,CategoryApi::$TYPES);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -205,7 +205,7 @@ class CategoryApi extends DolibarrApi
|
|||||||
$sql.= ' AND s.rowid = sub.fk_categorie';
|
$sql.= ' AND s.rowid = sub.fk_categorie';
|
||||||
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
|
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -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)."'";
|
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -85,7 +85,7 @@ $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
|
|||||||
$sql.= " GROUP BY year, month, df";
|
$sql.= " GROUP BY year, month, df";
|
||||||
$sql.= " ORDER BY year DESC, month DESC, df DESC";
|
$sql.= " ORDER BY year DESC, month DESC, df DESC";
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -758,7 +758,7 @@ else
|
|||||||
|
|
||||||
// MAILING_NO_USING_PHPMAIL may be defined or not.
|
// MAILING_NO_USING_PHPMAIL may be defined or not.
|
||||||
// MAILING_LIMIT_SENDBYWEB is always defined to something != 0 (-1=forbidden).
|
// 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')
|
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.
|
// 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')
|
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_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($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, 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.
|
// The feature is forbidden from GUI, we show just message to use from command line.
|
||||||
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
|
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
|
||||||
@ -786,8 +786,8 @@ else
|
|||||||
}
|
}
|
||||||
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_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($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
|
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
|
||||||
|
|
||||||
$text='';
|
$text='';
|
||||||
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)
|
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)
|
||||||
|
|||||||
@ -412,7 +412,7 @@ if ($object->fetch($id) >= 0)
|
|||||||
$sql .= $db->order($sortfield,$sortorder);
|
$sql .= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -333,7 +333,7 @@ $sql.= $db->order($sortfield,$sortorder);
|
|||||||
$sql.=', p.ref DESC';
|
$sql.=', p.ref DESC';
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class CommandeApi extends DolibarrApi
|
|||||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||||
}
|
}
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -194,7 +194,7 @@ class CommandeApi extends DolibarrApi
|
|||||||
* @return array Array of order objects
|
* @return array Array of order objects
|
||||||
*/
|
*/
|
||||||
function getListForSoc($socid = 0) {
|
function getListForSoc($socid = 0) {
|
||||||
return getList(0,"s.rowid","ASC",0,0,$socid);
|
return $this->getList(0,"s.rowid","ASC",0,0,$socid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -97,7 +97,7 @@ $sql.= " GROUP BY s.nom";
|
|||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -560,7 +560,7 @@ $sql.=$hookmanager->resPrint;
|
|||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -54,6 +54,7 @@ $langs->load("loan");
|
|||||||
$langs->load("donations");
|
$langs->load("donations");
|
||||||
$langs->load("trips");
|
$langs->load("trips");
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
|
$langs->load("compta");
|
||||||
|
|
||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
$ref = GETPOST('ref','alpha');
|
$ref = GETPOST('ref','alpha');
|
||||||
@ -501,7 +502,7 @@ $sql.=$hookmanager->resPrint;
|
|||||||
|
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
$nbtotalofpages = 0;
|
$nbtotalofpages = 0;
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -662,7 +662,7 @@ class Account extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param User $user Object user making action
|
* @param User $user Object user making action
|
||||||
* @param int $notrigger 1=Disable triggers
|
* @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)
|
function update(User $user = null, $notrigger = 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -175,7 +175,7 @@ $sql.=$hookmanager->resPrint;
|
|||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -449,7 +449,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
// Ref
|
// Ref
|
||||||
if (! empty($arrayfields['b.ref']['checked']))
|
if (! empty($arrayfields['b.ref']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="titlefield">'.$acc->getNomUrl(1).'</td>';
|
print '<td>'.$acc->getNomUrl(1).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -138,7 +138,7 @@ class InvoiceApi extends DolibarrApi
|
|||||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||||
}
|
}
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -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))."'";
|
$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))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -402,7 +402,7 @@ $listfield=explode(',',$sortfield);
|
|||||||
foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.',';
|
foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.',';
|
||||||
$sql.= ' f.rowid DESC ';
|
$sql.= ' f.rowid DESC ';
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -396,7 +396,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
var form = $("#payment_form");
|
var form = $("#payment_form");
|
||||||
|
|
||||||
json["invoice_type"] = $("#invoice_type").val();
|
json["invoice_type"] = $("#invoice_type").val();
|
||||||
json["amountPayment"] = $("#amountpayment").attr("value");
|
json["amountPayment"] = $("#amountpayment").attr("value");
|
||||||
json["amounts"] = _elemToJson(form.find("input.amount"));
|
json["amounts"] = _elemToJson(form.find("input.amount"));
|
||||||
json["remains"] = _elemToJson(form.find("input.remain"));
|
json["remains"] = _elemToJson(form.find("input.remain"));
|
||||||
|
|
||||||
|
|||||||
@ -112,7 +112,7 @@ else if ($year > 0)
|
|||||||
}
|
}
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -186,7 +186,7 @@ else
|
|||||||
}
|
}
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -131,6 +131,7 @@ class Contact extends CommonObject
|
|||||||
$clause = "AND";
|
$clause = "AND";
|
||||||
}
|
}
|
||||||
$sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element, 1).')';
|
$sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element, 1).')';
|
||||||
|
$sql.= " AND (sp.priv='0' OR (sp.priv='1' AND sp.fk_user_creat=".$user->id."))";
|
||||||
if ($user->societe_id > 0) $sql.=" AND sp.fk_soc = ".$user->societe_id;
|
if ($user->societe_id > 0) $sql.=" AND sp.fk_soc = ".$user->societe_id;
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
|
|||||||
@ -365,7 +365,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -919,7 +919,19 @@ if (empty($reshook))
|
|||||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
|
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Send mail
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Actions to send emails
|
||||||
|
$actiontypecode='AC_CONT';
|
||||||
|
$trigger_name='CONTRACT_SENTBYMAIL';
|
||||||
|
$paramname='id';
|
||||||
|
$mode='emailfromcontract';
|
||||||
|
$trackid='cont'.$object->id;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat->creer)
|
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat->creer)
|
||||||
{
|
{
|
||||||
if ($action == 'addcontact')
|
if ($action == 'addcontact')
|
||||||
@ -2026,37 +2038,164 @@ else
|
|||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
// Select mail models is same action as presend
|
||||||
|
if (GETPOST('modelselected')) {
|
||||||
|
$action = 'presend';
|
||||||
|
}
|
||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
if ($action != 'presend')
|
||||||
|
{
|
||||||
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Documents generes
|
* Documents generes
|
||||||
*/
|
*/
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
$filedir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||||
$genallowed = $user->rights->contrat->creer;
|
$genallowed = $user->rights->contrat->creer;
|
||||||
$delallowed = $user->rights->contrat->supprimer;
|
$delallowed = $user->rights->contrat->supprimer;
|
||||||
|
|
||||||
$var = true;
|
$var = true;
|
||||||
|
|
||||||
print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||||
|
|
||||||
|
|
||||||
// Show links to link elements
|
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat'));
|
|
||||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
|
||||||
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
// Show links to link elements
|
||||||
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat'));
|
||||||
|
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||||
|
|
||||||
|
|
||||||
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
// List of actions on element
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||||
|
$formactions = new FormActions($db);
|
||||||
|
$somethingshown = $formactions->showactions($object, 'contract', $socid);
|
||||||
|
|
||||||
|
|
||||||
|
print '</div></div></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Action presend
|
||||||
|
*/
|
||||||
|
if ($action == 'presend')
|
||||||
|
{
|
||||||
|
$object->fetch_projet();
|
||||||
|
|
||||||
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||||
|
$fileparams = dol_most_recent_file($conf->contrat->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
|
$file = $fileparams['fullname'];
|
||||||
|
|
||||||
|
// Define output language
|
||||||
|
$outputlangs = $langs;
|
||||||
|
$newlang = '';
|
||||||
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
|
||||||
|
$newlang = $_REQUEST['lang_id'];
|
||||||
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang))
|
||||||
|
$newlang = $object->thirdparty->default_lang;
|
||||||
|
|
||||||
|
if (!empty($newlang))
|
||||||
|
{
|
||||||
|
$outputlangs = new Translate('', $conf);
|
||||||
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
$outputlangs->load('commercial');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build document if it not exists
|
||||||
|
if (! $file || ! is_readable($file)) {
|
||||||
|
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
if ($result <= 0) {
|
||||||
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
|
$file = $fileparams['fullname'];
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<div class="clearboth"></div>';
|
||||||
|
print '<br>';
|
||||||
|
print load_fiche_titre($langs->trans('SendOrderByMail'));
|
||||||
|
|
||||||
|
dol_fiche_head('');
|
||||||
|
|
||||||
|
// Cree l'objet formulaire mail
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||||
|
$formmail = new FormMail($db);
|
||||||
|
$formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang);
|
||||||
|
$formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user'));
|
||||||
|
|
||||||
|
if($formmail->fromtype === 'user'){
|
||||||
|
$formmail->fromid = $user->id;
|
||||||
|
|
||||||
|
}
|
||||||
|
$formmail->trackid='ord'.$object->id;
|
||||||
|
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
|
||||||
|
{
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'ord'.$object->id);
|
||||||
|
}
|
||||||
|
$formmail->withfrom = 1;
|
||||||
|
$liste = array();
|
||||||
|
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value)
|
||||||
|
$liste [$key] = $value;
|
||||||
|
$formmail->withto = GETPOST('sendto') ? GETPOST('sendto') : $liste;
|
||||||
|
$formmail->withtocc = $liste;
|
||||||
|
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
|
||||||
|
if (empty($object->ref_client)) {
|
||||||
|
$formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__');
|
||||||
|
} else if (! empty($object->ref_client)) {
|
||||||
|
$formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__ (__REFCLIENT__)');
|
||||||
|
}
|
||||||
|
$formmail->withfile = 2;
|
||||||
|
$formmail->withbody = 1;
|
||||||
|
$formmail->withdeliveryreceipt = 1;
|
||||||
|
$formmail->withcancel = 1;
|
||||||
|
// Tableau des substitutions
|
||||||
|
$formmail->setSubstitFromObject($object);
|
||||||
|
$formmail->substit ['__ORDERREF__'] = $object->ref;
|
||||||
|
|
||||||
|
$custcontact = '';
|
||||||
|
$contactarr = array();
|
||||||
|
$contactarr = $object->liste_contact(- 1, 'external');
|
||||||
|
|
||||||
|
if (is_array($contactarr) && count($contactarr) > 0)
|
||||||
|
{
|
||||||
|
foreach ($contactarr as $contact)
|
||||||
|
{
|
||||||
|
if ($contact['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label
|
||||||
|
$contactstatic = new Contact($db);
|
||||||
|
$contactstatic->fetch($contact ['id']);
|
||||||
|
$custcontact = $contactstatic->getFullName($langs, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($custcontact)) {
|
||||||
|
$formmail->substit['__CONTACTCIVNAME__'] = $custcontact;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tableau des parametres complementaires
|
||||||
|
$formmail->param['action'] = 'send';
|
||||||
|
$formmail->param['models'] = 'order_send';
|
||||||
|
$formmail->param['models_id']=GETPOST('modelmailselected','int');
|
||||||
|
$formmail->param['orderid'] = $object->id;
|
||||||
|
$formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
|
||||||
|
|
||||||
|
// Init list of files
|
||||||
|
if (GETPOST("mode") == 'init') {
|
||||||
|
$formmail->clear_attached_files();
|
||||||
|
$formmail->add_attached_files($file, basename($file), dol_mimetype($file));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show form
|
||||||
|
print $formmail->get_form();
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
}
|
||||||
|
|
||||||
// List of actions on element
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
|
||||||
$formactions = new FormActions($db);
|
|
||||||
$somethingshown = $formactions->showactions($object, 'contract', $socid);
|
|
||||||
|
|
||||||
|
|
||||||
print '</div></div></div>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -288,7 +288,7 @@ if ($result)
|
|||||||
$totalnboflines = $db->num_rows($result);
|
$totalnboflines = $db->num_rows($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -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)."'";
|
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);
|
$sql .= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -155,7 +155,7 @@ class CMailFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
|
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
|
||||||
|
|
||||||
// Detect images
|
// Detect images
|
||||||
if ($this->msgishtml)
|
if ($this->msgishtml)
|
||||||
{
|
{
|
||||||
@ -210,9 +210,10 @@ class CMailFile
|
|||||||
$this->addr_bcc = $addr_bcc;
|
$this->addr_bcc = $addr_bcc;
|
||||||
$this->deliveryreceipt = $deliveryreceipt;
|
$this->deliveryreceipt = $deliveryreceipt;
|
||||||
$this->trackid = $trackid;
|
$this->trackid = $trackid;
|
||||||
|
|
||||||
$smtp_headers = $this->write_smtpheaders();
|
$smtp_headers = $this->write_smtpheaders();
|
||||||
if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n
|
if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n
|
||||||
|
|
||||||
// Define mime_headers
|
// Define mime_headers
|
||||||
$mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list);
|
$mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list);
|
||||||
|
|
||||||
@ -272,8 +273,9 @@ class CMailFile
|
|||||||
$smtps->setFrom($this->getValidAddress($from,0,1));
|
$smtps->setFrom($this->getValidAddress($from,0,1));
|
||||||
$smtps->setTrackId($trackid);
|
$smtps->setTrackId($trackid);
|
||||||
$smtps->setReplyTo($this->getValidAddress($from,0,1)); // Set property with this->smtps->setReplyTo after constructor if you want to use another value than the From
|
$smtps->setReplyTo($this->getValidAddress($from,0,1)); // Set property with this->smtps->setReplyTo after constructor if you want to use another value than the From
|
||||||
|
|
||||||
if (! empty($moreinheader)) $smtps->setMoreInHeader($moreinheader);
|
if (! empty($moreinheader)) $smtps->setMoreInHeader($moreinheader);
|
||||||
|
|
||||||
if (! empty($this->html))
|
if (! empty($this->html))
|
||||||
{
|
{
|
||||||
if (!empty($css))
|
if (!empty($css))
|
||||||
@ -369,7 +371,9 @@ class CMailFile
|
|||||||
{
|
{
|
||||||
// Use Swift Mailer library
|
// Use Swift Mailer library
|
||||||
// ------------------------------------------
|
// ------------------------------------------
|
||||||
|
|
||||||
|
$host = dol_getprefix('email');
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php';
|
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php';
|
||||||
// Create the message
|
// Create the message
|
||||||
$this->message = Swift_Message::newInstance();
|
$this->message = Swift_Message::newInstance();
|
||||||
@ -377,7 +381,7 @@ class CMailFile
|
|||||||
// Adding a trackid header to a message
|
// Adding a trackid header to a message
|
||||||
$headers = $this->message->getHeaders();
|
$headers = $this->message->getHeaders();
|
||||||
$headers->addTextHeader('X-Dolibarr-TRACKID', $trackid);
|
$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 = $headers->get('Message-ID');
|
||||||
$msgid->setId($headerID);
|
$msgid->setId($headerID);
|
||||||
$headers->addIdHeader('References', $headerID);
|
$headers->addIdHeader('References', $headerID);
|
||||||
@ -478,16 +482,16 @@ class CMailFile
|
|||||||
'maildao'
|
'maildao'
|
||||||
));
|
));
|
||||||
$reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if (! empty($reshook))
|
if (! empty($reshook))
|
||||||
{
|
{
|
||||||
$this->error = "Error in hook maildao doactions " . $reshook;
|
$this->error = "Error in hook maildao doactions " . $reshook;
|
||||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR);
|
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR);
|
||||||
|
|
||||||
return $reshook;
|
return $reshook;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL
|
// Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL
|
||||||
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10;
|
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL=10;
|
||||||
$tmparray1 = explode(',', $this->addr_to);
|
$tmparray1 = explode(',', $this->addr_to);
|
||||||
if (count($tmparray1) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)
|
if (count($tmparray1) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)
|
||||||
{
|
{
|
||||||
@ -495,6 +499,7 @@ class CMailFile
|
|||||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL=10;
|
||||||
$tmparray2 = explode(',', $this->addr_cc);
|
$tmparray2 = explode(',', $this->addr_cc);
|
||||||
if (count($tmparray2) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)
|
if (count($tmparray2) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)
|
||||||
{
|
{
|
||||||
@ -502,6 +507,7 @@ class CMailFile
|
|||||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL=10;
|
||||||
$tmparray3 = explode(',', $this->addr_bcc);
|
$tmparray3 = explode(',', $this->addr_bcc);
|
||||||
if (count($tmparray3) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)
|
if (count($tmparray3) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)
|
||||||
{
|
{
|
||||||
@ -509,14 +515,14 @@ class CMailFile
|
|||||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10;
|
||||||
if ((count($tmparray1)+count($tmparray2)+count($tmparray3)) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
|
if ((count($tmparray1)+count($tmparray2)+count($tmparray3)) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
|
||||||
{
|
{
|
||||||
$this->error = 'Too much recipients in to:, cc:, bcc:';
|
$this->error = 'Too much recipients in to:, cc:, bcc:';
|
||||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Action according to choosed sending method
|
// Action according to choosed sending method
|
||||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||||
{
|
{
|
||||||
@ -558,6 +564,7 @@ class CMailFile
|
|||||||
{
|
{
|
||||||
$additionnalparam .= ($additionnalparam?' ':'').'-ba';
|
$additionnalparam .= ($additionnalparam?' ':'').'-ba';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_ADDPARAM)) $additionnalparam .= ($additionnalparam?' ':'').'-U '.$additionnalparam; // Use -U to add additionnal params
|
if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_ADDPARAM)) $additionnalparam .= ($additionnalparam?' ':'').'-U '.$additionnalparam; // Use -U to add additionnal params
|
||||||
|
|
||||||
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$additionnalparam, LOG_DEBUG);
|
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$additionnalparam, LOG_DEBUG);
|
||||||
@ -881,7 +888,7 @@ class CMailFile
|
|||||||
|
|
||||||
// Receiver
|
// Receiver
|
||||||
if (isset($this->addr_cc) && $this->addr_cc) $out.= "Cc: ".$this->getValidAddress($this->addr_cc,2).$this->eol2;
|
if (isset($this->addr_cc) && $this->addr_cc) $out.= "Cc: ".$this->getValidAddress($this->addr_cc,2).$this->eol2;
|
||||||
if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2; // Question: bcc must not be into header, only into SMTP command "RCPT TO". Does php mail support this ?
|
if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2; // TODO Question: bcc must not be into header, only into SMTP command "RCPT TO". Does php mail support this ?
|
||||||
|
|
||||||
// Delivery receipt
|
// Delivery receipt
|
||||||
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $out.= "Disposition-Notification-To: ".$this->getValidAddress($this->addr_from,2).$this->eol2;
|
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $out.= "Disposition-Notification-To: ".$this->getValidAddress($this->addr_from,2).$this->eol2;
|
||||||
|
|||||||
@ -2448,9 +2448,10 @@ abstract class CommonObject
|
|||||||
* Fetch array of objects linked to current object. Links are loaded into this->linkedObjects array and this->linkedObjectsIds
|
* Fetch array of objects linked to current object. Links are loaded into this->linkedObjects array and this->linkedObjectsIds
|
||||||
* Possible usage for parameters:
|
* Possible usage for parameters:
|
||||||
* - all parameters empty -> we look all link to current object (current object can be source or target)
|
* - all parameters empty -> we look all link to current object (current object can be source or target)
|
||||||
* - one couple id+type is provided -> this will set $justsource or $justtarget
|
* - source id+type -> will get target list linked to source
|
||||||
* - one couple id+type is provided and other type is provided -> this will set $justsource or $justtarget + criteria on other type
|
* - target id+type -> will get source list linked to target
|
||||||
*
|
* - source id+type + target type -> will get target list of the type
|
||||||
|
* - target id+type + target source -> will get source list of the type
|
||||||
*
|
*
|
||||||
* @param int $sourceid Object source id (if not defined, id of object)
|
* @param int $sourceid Object source id (if not defined, id of object)
|
||||||
* @param string $sourcetype Object source type (if not defined, element name of object)
|
* @param string $sourcetype Object source type (if not defined, element name of object)
|
||||||
@ -3019,9 +3020,16 @@ abstract class CommonObject
|
|||||||
|
|
||||||
foreach ($this->lines as $line)
|
foreach ($this->lines as $line)
|
||||||
{
|
{
|
||||||
|
if (isset($line->qty_asked))
|
||||||
$totalOrdered+=$line->qty_asked; // defined for shipment only
|
{
|
||||||
$totalToShip+=$line->qty_shipped; // defined for shipment only
|
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
|
// Define qty, weight, volume, weight_units, volume_units
|
||||||
if ($this->element == 'shipping') $qty=$line->qty_shipped; // for shipments
|
if ($this->element == 'shipping') $qty=$line->qty_shipped; // for shipments
|
||||||
@ -3036,8 +3044,11 @@ abstract class CommonObject
|
|||||||
if (! empty($weight_units)) $weightUnit = $weight_units;
|
if (! empty($weight_units)) $weightUnit = $weight_units;
|
||||||
if (! empty($volume_units)) $volumeUnit = $volume_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);
|
//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);
|
$trueWeightUnit=pow(10, $weightUnit);
|
||||||
$totalWeight += $weight * $qty * $trueWeightUnit;
|
$totalWeight += $weight * $qty * $trueWeightUnit;
|
||||||
@ -3046,7 +3057,7 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
$totalWeight += $weight * $qty; // This may be wrong if we mix different units
|
$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;
|
//print $line->volume."x".$line->volume_units."x".($line->volume_units < 50)."x".$volumeUnit;
|
||||||
$trueVolumeUnit=pow(10, $volumeUnit);
|
$trueVolumeUnit=pow(10, $volumeUnit);
|
||||||
|
|||||||
@ -116,8 +116,8 @@ class HookManager
|
|||||||
* @param array $parameters Array of parameters
|
* @param array $parameters Array of parameters
|
||||||
* @param Object $object Object to use hooks on
|
* @param Object $object Object to use hooks on
|
||||||
* @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
|
* @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
|
||||||
* @return mixed For 'addreplace hooks (doActions,formObjectOptions,pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results and set into ->resArray.
|
* @return mixed For 'addreplace' hooks (doActions,formObjectOptions,pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
|
||||||
* For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results and set into ->resArray.
|
* For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results bu hook and set into ->resArray for caller.
|
||||||
* All types can also return some values into an array ->results.
|
* All types can also return some values into an array ->results.
|
||||||
* $this->error or this->errors are also defined by class called by this function if error.
|
* $this->error or this->errors are also defined by class called by this function if error.
|
||||||
*/
|
*/
|
||||||
@ -142,6 +142,7 @@ class HookManager
|
|||||||
'formObjectOptions',
|
'formObjectOptions',
|
||||||
'formattachOptions',
|
'formattachOptions',
|
||||||
'formBuilddocLineOptions',
|
'formBuilddocLineOptions',
|
||||||
|
'formatNotificationMessage',
|
||||||
'getFormMail',
|
'getFormMail',
|
||||||
'getIdProfUrl',
|
'getIdProfUrl',
|
||||||
'moveUploadedFile',
|
'moveUploadedFile',
|
||||||
|
|||||||
@ -5876,7 +5876,7 @@ class Form
|
|||||||
*/
|
*/
|
||||||
global $dolibarr_main_url_root;
|
global $dolibarr_main_url_root;
|
||||||
$ret.='<!-- Put link to gravatar -->';
|
$ret.='<!-- Put link to gravatar -->';
|
||||||
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)),3).'?s='.$width.'&d='.urlencode(dol_buildpath($nophoto,2)).'">'; // gravatar need md5 hash
|
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)),3).'?s='.$width.'&d='.urlencode(dol_buildpath($nophoto,3)).'">'; // gravatar need md5 hash
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -76,7 +76,7 @@ class FormFile
|
|||||||
global $conf,$langs, $hookmanager;
|
global $conf,$langs, $hookmanager;
|
||||||
$hookmanager->initHooks(array('formfile'));
|
$hookmanager->initHooks(array('formfile'));
|
||||||
|
|
||||||
|
|
||||||
if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0;
|
if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0;
|
||||||
|
|
||||||
if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2))
|
if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2))
|
||||||
@ -275,7 +275,7 @@ class FormFile
|
|||||||
if (0 !== $iconPDF) {
|
if (0 !== $iconPDF) {
|
||||||
dol_syslog(__METHOD__ . ": passing iconPDF parameter is deprecated", LOG_WARNING);
|
dol_syslog(__METHOD__ . ": passing iconPDF parameter is deprecated", LOG_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
global $langs, $conf, $user, $hookmanager;
|
global $langs, $conf, $user, $hookmanager;
|
||||||
global $form, $bc;
|
global $form, $bc;
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ class FormFile
|
|||||||
if (! empty($iconPDF)) {
|
if (! empty($iconPDF)) {
|
||||||
return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
|
return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
|
||||||
}
|
}
|
||||||
|
|
||||||
$printer=0;
|
$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
|
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);
|
$addcolumforpicto=($delallowed || $printer || $morepicto);
|
||||||
$out.= '<th align="center" colspan="'.(3+($addcolumforpicto?'2':'1')).'" class="formdoc liste_titre maxwidthonsmartphone">';
|
$out.= '<th align="center" colspan="'.(3+($addcolumforpicto?'2':'1')).'" class="formdoc liste_titre maxwidthonsmartphone">';
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
if (! empty($modellist))
|
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
|
$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
|
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.'<br>';
|
//print $file['path'].'/'.$minifile.'<br>';
|
||||||
|
|
||||||
$urlforhref=getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
|
$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 '<a href="'.$urlforhref.'" class="aphoto" target="_blank">';
|
print '<a href="'.$urlforhref.'" class="aphoto" target="_blank">';
|
||||||
print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$minifile).'" title="">';
|
print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$minifile).'" title="">';
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
else print ' ';
|
else print ' ';
|
||||||
|
|||||||
@ -278,12 +278,20 @@ class Notify
|
|||||||
*/
|
*/
|
||||||
function send($notifcode, $object)
|
function send($notifcode, $object)
|
||||||
{
|
{
|
||||||
global $user,$conf,$langs,$mysoc,$dolibarr_main_url_root;
|
global $user,$conf,$langs,$mysoc;
|
||||||
|
global $hookmanager;
|
||||||
|
global $dolibarr_main_url_root;
|
||||||
|
|
||||||
if (! in_array($notifcode, $this->arrayofnotifsupported)) return 0;
|
if (! in_array($notifcode, $this->arrayofnotifsupported)) return 0;
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
if (! is_object($hookmanager))
|
||||||
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||||
|
$hookmanager=new HookManager($this->db);
|
||||||
|
}
|
||||||
|
$hookmanager->initHooks(array('notification'));
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::send notifcode=".$notifcode.", object=".$object->id);
|
dol_syslog(get_class($this)."::send notifcode=".$notifcode.", object=".$object->id);
|
||||||
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
@ -294,8 +302,8 @@ class Notify
|
|||||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
// Define some vars
|
// Define some vars
|
||||||
$application = $mysoc->name;
|
$application = 'Dolibarr';
|
||||||
//if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $application = $conf->global->MAIN_APPLICATION_TITLE;
|
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $application = $conf->global->MAIN_APPLICATION_TITLE;
|
||||||
$replyto = $conf->notification->email_from;
|
$replyto = $conf->notification->email_from;
|
||||||
$filename = basename($file);
|
$filename = basename($file);
|
||||||
$mimefile = dol_mimetype($file);
|
$mimefile = dol_mimetype($file);
|
||||||
@ -321,18 +329,7 @@ class Notify
|
|||||||
|
|
||||||
// Check notification per user
|
// Check notification per user
|
||||||
$sql.= "\nUNION\n";
|
$sql.= "\nUNION\n";
|
||||||
/*
|
|
||||||
$sql.= "SELECT 1 as user, c.email, c.rowid as cid, c.lastname, c.firstname, '$langs->defaultlang' as default_lang,";
|
|
||||||
$sql.= " a.rowid as adid, a.label, a.code, n.rowid, n.type";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as c,";
|
|
||||||
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
|
||||||
$sql.= " ".MAIN_DB_PREFIX."notify_def as n,";
|
|
||||||
$sql.= " ".MAIN_DB_PREFIX."element_contact as ec";
|
|
||||||
$sql.= " WHERE n.fk_user = c.rowid AND a.rowid = n.fk_action";
|
|
||||||
$sql.= " AND n.fk_user = ec.fk_socpeople";
|
|
||||||
if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage
|
|
||||||
else $sql.= " AND a.code = '".$notifcode."'"; // New usage
|
|
||||||
$sql .= " AND ec.element_id = ".$object->id;*/
|
|
||||||
$sql.= "SELECT 'touserid' as type_target, c.email, c.rowid as cid, c.lastname, c.firstname, c.lang as default_lang,";
|
$sql.= "SELECT 'touserid' as type_target, c.email, c.rowid as cid, c.lastname, c.firstname, c.lang as default_lang,";
|
||||||
$sql.= " a.rowid as adid, a.label, a.code, n.rowid, n.type";
|
$sql.= " a.rowid as adid, a.label, a.code, n.rowid, n.type";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as c,";
|
$sql.= " FROM ".MAIN_DB_PREFIX."user as c,";
|
||||||
@ -367,6 +364,8 @@ class Notify
|
|||||||
$outputlangs->setDefaultLang($obj->default_lang);
|
$outputlangs->setDefaultLang($obj->default_lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification");
|
||||||
|
|
||||||
switch ($notifcode) {
|
switch ($notifcode) {
|
||||||
case 'BILL_VALIDATE':
|
case 'BILL_VALIDATE':
|
||||||
$link='/compta/facture.php?facid='.$object->id;
|
$link='/compta/facture.php?facid='.$object->id;
|
||||||
@ -446,14 +445,20 @@ class Notify
|
|||||||
$filepdf = $pdf_path;
|
$filepdf = $pdf_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
$subject = '['.$application.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification");
|
|
||||||
|
|
||||||
$message = $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification",$application,$mysoc->name)."\n";
|
$message = $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification",$application,$mysoc->name)."\n";
|
||||||
$message.= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n";
|
$message.= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n";
|
||||||
$message.= "\n";
|
$message.= "\n";
|
||||||
$message.= $mesg;
|
$message.= $mesg;
|
||||||
if ($link) $message=dol_concatdesc($message,$urlwithroot.$link);
|
if ($link) $message=dol_concatdesc($message,$urlwithroot.$link);
|
||||||
|
|
||||||
|
$parameters=array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$file, 'mimefile'=>$mimefile, 'filename'=>$filename);
|
||||||
|
$reshook=$hookmanager->executeHooks('formatNotificationMessage',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
|
if (! empty($hookmanager->resArray['subject'])) $subject.=$hookmanager->resArray['subject'];
|
||||||
|
if (! empty($hookmanager->resArray['message'])) $message.=$hookmanager->resArray['message'];
|
||||||
|
}
|
||||||
|
|
||||||
$mailfile = new CMailFile(
|
$mailfile = new CMailFile(
|
||||||
$subject,
|
$subject,
|
||||||
$sendto,
|
$sendto,
|
||||||
@ -535,7 +540,9 @@ class Notify
|
|||||||
$link = '';
|
$link = '';
|
||||||
$num++;
|
$num++;
|
||||||
|
|
||||||
switch ($notifcode) {
|
$subject = '['.$mysoc->name.'] '.$langs->transnoentitiesnoconv("DolibarrNotification");
|
||||||
|
|
||||||
|
switch ($notifcode) {
|
||||||
case 'BILL_VALIDATE':
|
case 'BILL_VALIDATE':
|
||||||
$link='/compta/facture.php?facid='.$object->id;
|
$link='/compta/facture.php?facid='.$object->id;
|
||||||
$dir_output = $conf->facture->dir_output;
|
$dir_output = $conf->facture->dir_output;
|
||||||
@ -622,8 +629,6 @@ class Notify
|
|||||||
$filepdf = $pdf_path;
|
$filepdf = $pdf_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
$subject = '['.$application.'] '.$langs->transnoentitiesnoconv("DolibarrNotification");
|
|
||||||
|
|
||||||
$message = $langs->transnoentities("YouReceiveMailBecauseOfNotification",$application,$mysoc->name)."\n";
|
$message = $langs->transnoentities("YouReceiveMailBecauseOfNotification",$application,$mysoc->name)."\n";
|
||||||
$message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n";
|
$message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n";
|
||||||
$message.= "\n";
|
$message.= "\n";
|
||||||
@ -648,7 +653,15 @@ class Notify
|
|||||||
|
|
||||||
if ($sendto)
|
if ($sendto)
|
||||||
{
|
{
|
||||||
$mailfile = new CMailFile(
|
$parameters=array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$file, 'mimefile'=>$mimefile, 'filename'=>$filename);
|
||||||
|
$reshook=$hookmanager->executeHooks('formatNotificationMessage',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
|
if (! empty($hookmanager->resArray['subject'])) $subject.=$hookmanager->resArray['subject'];
|
||||||
|
if (! empty($hookmanager->resArray['message'])) $message.=$hookmanager->resArray['message'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$mailfile = new CMailFile(
|
||||||
$subject,
|
$subject,
|
||||||
$sendto,
|
$sendto,
|
||||||
$replyto,
|
$replyto,
|
||||||
|
|||||||
@ -1217,7 +1217,7 @@ class SMTPs
|
|||||||
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
|
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
|
||||||
$host=preg_replace('@ssl://@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
|
//NOTE: Message-ID should probably contain the username of the user who sent the msg
|
||||||
$_header .= 'Subject: ' . $this->getSubject() . "\r\n";
|
$_header .= 'Subject: ' . $this->getSubject() . "\r\n";
|
||||||
|
|||||||
@ -197,9 +197,10 @@ function checkBanForAccount($account)
|
|||||||
$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789");
|
$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789");
|
||||||
// Separation du rib en 3 groupes de 7 + 1 groupe de 2.
|
// Separation du rib en 3 groupes de 7 + 1 groupe de 2.
|
||||||
// Multiplication de chaque groupe par les coef du tableau
|
// Multiplication de chaque groupe par les coef du tableau
|
||||||
|
var_dump($rib);
|
||||||
for ($i = 0, $s = 0; $i < 3; $i++) {
|
for ($i = 0, $s = 0; $i < 3; $i++) {
|
||||||
$code = substr($rib, 7 * $i, 7);
|
$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
|
// Soustraction du modulo 97 de $s a 97 pour obtenir la cle
|
||||||
$cle_rib = 97 - ($s % 97);
|
$cle_rib = 97 - ($s % 97);
|
||||||
|
|||||||
@ -110,21 +110,24 @@ function dol_print_cron_urls()
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Add note
|
// Add note
|
||||||
$linuxlike=1;
|
if (empty($conf->global->CRON_DISABLE_TUTORIAL_CRON))
|
||||||
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");
|
$linuxlike=1;
|
||||||
print '<br>';
|
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
|
||||||
print '<textarea class="quatrevingtpercent">*/5 * * * * pathtoscript/scripts/cron/cron_run_jobs.php '.(empty($conf->global->CRON_KEY)?'securitykey':''.$conf->global->CRON_KEY.'').' '.$logintouse.' > '.DOL_DATA_ROOT.'/cron_run_jobs.php.log</textarea><br>';
|
if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
|
||||||
|
print $langs->trans("Note").': ';
|
||||||
|
if ($linuxlike)
|
||||||
|
{
|
||||||
|
print $langs->trans("CronExplainHowToRunUnix");
|
||||||
|
print '<br>';
|
||||||
|
print '<textarea class="quatrevingtpercent">*/5 * * * * pathtoscript/scripts/cron/cron_run_jobs.php '.(empty($conf->global->CRON_KEY)?'securitykey':''.$conf->global->CRON_KEY.'').' '.$logintouse.' > '.DOL_DATA_ROOT.'/cron_run_jobs.php.log</textarea><br>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("CronExplainHowToRunWin");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
print $langs->trans("CronExplainHowToRunWin");
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -175,7 +175,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
|
|||||||
|
|
||||||
$sTime='';
|
$sTime='';
|
||||||
$sDay=0;
|
$sDay=0;
|
||||||
$sWeek='';
|
$sWeek=0;
|
||||||
|
|
||||||
if ($iSecond >= $lengthOfDay)
|
if ($iSecond >= $lengthOfDay)
|
||||||
{
|
{
|
||||||
@ -218,7 +218,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
|
|||||||
}
|
}
|
||||||
if ($format == 'allhourmin')
|
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')
|
if ($format == 'allhour')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3184,7 +3184,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
|
|||||||
* @param string $sortorder Order to sort ('' by default)
|
* @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 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 $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 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 int $pictoisfullpath 1=Icon name is a full absolute url of image
|
||||||
* @param string $morehtml More html to show
|
* @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
|
* @param int $hideselectlimit Force to hide select limit
|
||||||
* @return void
|
* @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;
|
global $conf,$langs;
|
||||||
|
|
||||||
@ -3223,7 +3223,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
|||||||
print '<td class="nobordernopadding valignmiddle">';
|
print '<td class="nobordernopadding valignmiddle">';
|
||||||
if ($picto && $titre) print img_picto('', $picto, 'class="hideonsmartphone valignmiddle" id="pictotitle"', $pictoisfullpath);
|
if ($picto && $titre) print img_picto('', $picto, 'class="hideonsmartphone valignmiddle" id="pictotitle"', $pictoisfullpath);
|
||||||
print '<div class="titre inline-block">'.$titre;
|
print '<div class="titre inline-block">'.$titre;
|
||||||
if (!empty($titre) && $savtotalnboflines >= 0) print ' ('.$totalnboflines.')';
|
if (!empty($titre) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') print ' ('.$totalnboflines.')';
|
||||||
print '</div></td>';
|
print '</div></td>';
|
||||||
|
|
||||||
// Center
|
// Center
|
||||||
|
|||||||
@ -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('/\{yyyy\}/i',date("Y",$date)+$yearoffset, $numFinal);
|
||||||
$numFinal = preg_replace('/\{yy\}/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
|
else // we want yyyy to be current year
|
||||||
{
|
{
|
||||||
$numFinal = preg_replace('/\{yyyy\}/i',date("Y",$date), $numFinal);
|
$numFinal = preg_replace('/\{yyyy\}/i',date("Y",$date), $numFinal);
|
||||||
$numFinal = preg_replace('/\{yy\}/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('/\{mm\}/i', date("m",$date), $numFinal);
|
||||||
$numFinal = preg_replace('/\{dd\}/i', date("d",$date), $numFinal);
|
$numFinal = preg_replace('/\{dd\}/i', date("d",$date), $numFinal);
|
||||||
|
|||||||
@ -1248,11 +1248,15 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
|||||||
{
|
{
|
||||||
if ($issupplierline)
|
if ($issupplierline)
|
||||||
{
|
{
|
||||||
//$ref_prodserv = $prodser->ref.($ref_supplier ? ' ('.$outputlangs->transnoentitiesnoconv("SupplierRef").' '.$ref_supplier.')' : ''); // Show local ref and supplier ref
|
if ($conf->global->PDF_HIDE_PRODUCT_REF_IN_SUPPLIER_LINES == 1)
|
||||||
if (! empty($conf->global->PDF_HIDE_PRODUCT_REF_IN_SUPPLIER_LINES)) $ref_prodserv =$ref_supplier;
|
$ref_prodserv = $ref_supplier;
|
||||||
else $ref_prodserv = $prodser->ref.($ref_supplier ? ' ('.$outputlangs->transnoentitiesnoconv("SupplierRef").' '.$ref_supplier.')' : ''); // Show local ref and supplier ref
|
elseif ($conf->global->PDF_HIDE_PRODUCT_REF_IN_SUPPLIER_LINES == 2)
|
||||||
|
$ref_prodserv = $ref_supplier. ' ('.$outputlangs->transnoentitiesnoconv("InternalRef").' '.$prodser->ref.')';
|
||||||
|
else
|
||||||
|
$ref_prodserv = $prodser->ref.' ('.$outputlangs->transnoentitiesnoconv("SupplierRef").' '.$ref_supplier.')';
|
||||||
}
|
}
|
||||||
else $ref_prodserv = $prodser->ref; // Show local ref only
|
else
|
||||||
|
$ref_prodserv = $prodser->ref; // Show local ref only
|
||||||
|
|
||||||
if (! empty($libelleproduitservice)) $ref_prodserv .= " - ";
|
if (! empty($libelleproduitservice)) $ref_prodserv .= " - ";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,6 +80,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
|||||||
$result=array();
|
$result=array();
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
|
if (empty($info_bits)) $info_bits=0;
|
||||||
if (empty($txtva)) $txtva=0;
|
if (empty($txtva)) $txtva=0;
|
||||||
if (empty($seller) || ! is_object($seller))
|
if (empty($seller) || ! is_object($seller))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -483,7 +483,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
|
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
|
||||||
|
|
||||||
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
||||||
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
|
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
|
||||||
$this->tva[$vatrate] += $tvaligne;
|
$this->tva[$vatrate] += $tvaligne;
|
||||||
|
|
||||||
// Add line
|
// Add line
|
||||||
|
|||||||
@ -585,7 +585,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
|
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
|
||||||
|
|
||||||
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
||||||
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
|
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
|
||||||
$this->tva[$vatrate] += $tvaligne;
|
$this->tva[$vatrate] += $tvaligne;
|
||||||
|
|
||||||
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;
|
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;
|
||||||
|
|||||||
@ -135,10 +135,13 @@ class modDeplacement extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .=' AND d.entity IN ('.getEntity('deplacement',1).')';
|
$this->export_sql_end[$r] .=' AND d.entity IN ('.getEntity('deplacement',1).')';
|
||||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR d.fk_soc IS NULL)';
|
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR d.fk_soc IS NULL)';
|
||||||
|
|
||||||
$childids = $user->getAllChildIds();
|
if (! empty($user)) // Not defined during migration process
|
||||||
$childids[]=$user->id;
|
{
|
||||||
|
$childids = $user->getAllChildIds();
|
||||||
if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) $sql.=' AND d.fk_user IN ('.join(',',$childids).')';
|
$childids[]=$user->id;
|
||||||
|
|
||||||
|
if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) $sql.=' AND d.fk_user IN ('.join(',',$childids).')';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -371,7 +371,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
// End add extra fields line
|
// End add extra fields line
|
||||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
|
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||||
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
|
||||||
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f';
|
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)';
|
||||||
@ -381,7 +381,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
|
||||||
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn';
|
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn';
|
||||||
$this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')';
|
$this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')';
|
||||||
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
|
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||||
@ -435,7 +435,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
// End add extra fields object
|
// End add extra fields object
|
||||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
|
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||||
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
|
||||||
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f';
|
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)';
|
||||||
@ -444,7 +444,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid';
|
||||||
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid';
|
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid';
|
||||||
$this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')';
|
$this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')';
|
||||||
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
|
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
|
||||||
|
|
||||||
// Order
|
// Order
|
||||||
$r++;
|
$r++;
|
||||||
@ -541,7 +541,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
// End add extra fields line
|
// End add extra fields line
|
||||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
|
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||||
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
|
||||||
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande_fournisseur as f';
|
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande_fournisseur as f';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)';
|
||||||
@ -553,7 +553,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
|
||||||
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande';
|
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande';
|
||||||
$this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_order',1).')';
|
$this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_order',1).')';
|
||||||
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
|
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -151,7 +151,7 @@ class modProduct extends DolibarrModules
|
|||||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||||
$this->export_label[$r]="Products"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
$this->export_label[$r]="Products"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||||
$this->export_permission[$r]=array(array("produit","export"));
|
$this->export_permission[$r]=array(array("produit","export"));
|
||||||
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification');
|
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification');
|
||||||
if ($mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR';
|
if ($mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR';
|
||||||
if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock','p.seuil_stock_alerte'=>'StockLimit','p.desiredstock'=>'DesiredStock','p.pmp'=>'PMPValue'));
|
if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock','p.seuil_stock_alerte'=>'StockLimit','p.desiredstock'=>'DesiredStock','p.pmp'=>'PMPValue'));
|
||||||
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.barcode'=>'BarCode'));
|
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.barcode'=>'BarCode'));
|
||||||
@ -159,13 +159,13 @@ class modProduct extends DolibarrModules
|
|||||||
if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.cost_price'=>'CostPrice'));
|
if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.cost_price'=>'CostPrice'));
|
||||||
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('group_concat(cat.label)'=>'Categories'));
|
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('group_concat(cat.label)'=>'Categories'));
|
||||||
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote'));
|
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote'));
|
||||||
$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date');
|
$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date');
|
||||||
if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric'));
|
if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric'));
|
||||||
if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.barcode'=>'Text'));
|
if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.barcode'=>'Text'));
|
||||||
if (! empty($conf->fournisseur->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('s.nom'=>'Text','pf.ref_fourn'=>'Text','pf.unitprice'=>'Numeric'));
|
if (! empty($conf->fournisseur->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('s.nom'=>'Text','pf.ref_fourn'=>'Text','pf.unitprice'=>'Numeric'));
|
||||||
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('l.lang'=>'Text', 'l.label'=>'Text','l.description'=>'Text','l.note'=>'Text'));
|
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('l.lang'=>'Text', 'l.label'=>'Text','l.description'=>'Text','l.note'=>'Text'));
|
||||||
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array("group_concat(cat.label)"=>'Text'));
|
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array("group_concat(cat.label)"=>'Text'));
|
||||||
$this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.url'=>"product",'p.accountancy_code_sell'=>'product','p.accountancy_code_sell'=>'product','p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.customcode'=>'product','p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.tosell'=>"product",'p.tobuy'=>"product",'p.datec'=>"product",'p.tms'=>"product");
|
$this->export_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||||
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array("group_concat(cat.label)"=>'category'));
|
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array("group_concat(cat.label)"=>'category'));
|
||||||
if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.stock'=>'product','p.pmp'=>'product'));
|
if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.stock'=>'product','p.pmp'=>'product'));
|
||||||
if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.barcode'=>'product'));
|
if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.barcode'=>'product'));
|
||||||
|
|||||||
@ -281,7 +281,14 @@ class modSociete extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as payterm ON s.cond_reglement = payterm.rowid';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as payterm ON s.cond_reglement = payterm.rowid';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as paymode ON s.mode_reglement = paymode.id';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as paymode ON s.mode_reglement = paymode.id';
|
||||||
$this->export_sql_end[$r] .=' WHERE s.entity IN ('.getEntity('societe', 1).')';
|
$this->export_sql_end[$r] .=' WHERE s.entity IN ('.getEntity('societe', 1).')';
|
||||||
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
|
if (is_object($user) && empty($user->rights->societe->client->voir)) {
|
||||||
|
$this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' ';
|
||||||
|
if (! empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) {
|
||||||
|
$subordinatesids = $user->getAllChildIds();
|
||||||
|
$this->export_sql_end[$r] .=count($subronidatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subronidatesids).')' : '';
|
||||||
|
}
|
||||||
|
$this->export_sql_end[$r] .=')';
|
||||||
|
}
|
||||||
|
|
||||||
// Export list of contacts and attributes
|
// Export list of contacts and attributes
|
||||||
$r++;
|
$r++;
|
||||||
@ -306,12 +313,19 @@ class modSociete extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'socpeople as c';
|
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'socpeople as c';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON c.fk_soc = s.rowid';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON c.fk_soc = s.rowid';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extrasoc ON s.rowid = extrasoc.fk_object';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extrasoc ON s.rowid = extrasoc.fk_object';
|
||||||
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON c.fk_pays = co.rowid';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON c.fk_pays = co.rowid';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = c.rowid';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = c.rowid';
|
||||||
$this->export_sql_end[$r] .=' WHERE c.entity IN ('.getEntity("societe", 1).')';
|
$this->export_sql_end[$r] .=' WHERE c.entity IN ('.getEntity("societe", 1).')';
|
||||||
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
|
if (is_object($user) && empty($user->rights->societe->client->voir)) {
|
||||||
|
$this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' ';
|
||||||
|
if (! empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) {
|
||||||
|
$subordinatesids = $user->getAllChildIds();
|
||||||
|
$this->export_sql_end[$r] .=count($subronidatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subronidatesids).')' : '';
|
||||||
|
}
|
||||||
|
$this->export_sql_end[$r] .=')';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Imports
|
// Imports
|
||||||
|
|||||||
@ -223,7 +223,7 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$progress=$object->lines[$i]->progress.'%';
|
$progress=$object->lines[$i]->progress.'%';
|
||||||
$datestart=dol_print_date($object->lines[$i]->date_start,'day');
|
$datestart=dol_print_date($object->lines[$i]->date_start,'day');
|
||||||
$dateend=dol_print_date($object->lines[$i]->date_end,'day');
|
$dateend=dol_print_date($object->lines[$i]->date_end,'day');
|
||||||
$planned_workload=convertSecondToTime($object->lines[$i]->planned_workload,'allhourmin');
|
$planned_workload=convertSecondToTime((int) $object->lines[$i]->planned_workload,'allhourmin');
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
||||||
|
|
||||||
|
|||||||
@ -582,7 +582,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
|
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
|
||||||
|
|
||||||
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
||||||
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
|
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
|
||||||
$this->tva[$vatrate] += $tvaligne;
|
$this->tva[$vatrate] += $tvaligne;
|
||||||
|
|
||||||
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;
|
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;
|
||||||
|
|||||||
@ -170,7 +170,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$deja_regle = "";
|
$deja_regle = 0;
|
||||||
$amount_credit_notes_included = 0;
|
$amount_credit_notes_included = 0;
|
||||||
$amount_deposits_included = 0;
|
$amount_deposits_included = 0;
|
||||||
//$amount_credit_notes_included = $object->getSumCreditNotesUsed();
|
//$amount_credit_notes_included = $object->getSumCreditNotesUsed();
|
||||||
@ -466,7 +466,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
|
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
|
||||||
|
|
||||||
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
||||||
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
|
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
|
||||||
$this->tva[$vatrate] += $tvaligne;
|
$this->tva[$vatrate] += $tvaligne;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -489,7 +489,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
|
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
|
||||||
|
|
||||||
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
||||||
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
|
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
|
||||||
$this->tva[$vatrate] += $tvaligne;
|
$this->tva[$vatrate] += $tvaligne;
|
||||||
|
|
||||||
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;
|
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;
|
||||||
|
|||||||
@ -89,7 +89,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
<div id="login_right">
|
<div id="login_right">
|
||||||
|
|
||||||
<table class="left centpercent" title="Login pass">
|
<table class="left centpercent" title="<?php echo $langs->trans("EnterLoginDetail"); ?>">
|
||||||
<!-- Login -->
|
<!-- Login -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="nowrap center valignmiddle">
|
<td class="nowrap center valignmiddle">
|
||||||
|
|||||||
@ -225,7 +225,7 @@ $sql.=$hookmanager->resPrint;
|
|||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -113,7 +113,7 @@ if (trim($search_name) != '')
|
|||||||
if ($search_amount) $sql.= natural_search(array('d.amount'), price2num(trim($search_amount)), 1);
|
if ($search_amount) $sql.= natural_search(array('d.amount'), price2num(trim($search_amount)), 1);
|
||||||
|
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -238,7 +238,7 @@ $parameters=array();
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -342,11 +342,11 @@ if (empty($reshook))
|
|||||||
$filename=array(); $filedir=array(); $mimetype=array();
|
$filename=array(); $filedir=array(); $mimetype=array();
|
||||||
|
|
||||||
// SUBJECT
|
// SUBJECT
|
||||||
$subject = $langs->trans("ExpenseReportWaitingForApproval");
|
$subject = $langs->transnoentities("ExpenseReportWaitingForApproval");
|
||||||
|
|
||||||
// CONTENT
|
// CONTENT
|
||||||
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
||||||
$message = $langs->trans("ExpenseReportWaitingForApprovalMessage", $expediteur->getFullName($langs), get_date_range($object->date_debut,$object->date_fin,'',$langs), $link);
|
$message = $langs->transnoentities("ExpenseReportWaitingForApprovalMessage", $expediteur->getFullName($langs), get_date_range($object->date_debut,$object->date_fin,'',$langs), $link);
|
||||||
|
|
||||||
// Rebuild pdf
|
// Rebuild pdf
|
||||||
/*
|
/*
|
||||||
@ -436,74 +436,83 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition
|
// Send mail
|
||||||
{
|
|
||||||
// Send mail
|
// TO
|
||||||
|
$destinataire = new User($db);
|
||||||
|
$destinataire->fetch($object->fk_user_validator);
|
||||||
|
$emailTo = $destinataire->email;
|
||||||
|
|
||||||
// TO
|
if ($emailTo)
|
||||||
$destinataire = new User($db);
|
{
|
||||||
$destinataire->fetch($object->fk_user_validator);
|
// FROM
|
||||||
$emailTo = $destinataire->email;
|
$expediteur = new User($db);
|
||||||
|
$expediteur->fetch($object->fk_user_author);
|
||||||
|
$emailFrom = $expediteur->email;
|
||||||
|
|
||||||
|
// SUBJECT
|
||||||
|
$subject = $langs->transnoentities("ExpenseReportWaitingForReApproval");
|
||||||
|
|
||||||
if ($emailTo)
|
// CONTENT
|
||||||
|
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
||||||
|
$dateRefusEx = explode(" ",$object->date_refuse);
|
||||||
|
$message = $langs->transnoentities("ExpenseReportWaitingForReApprovalMessage", $dateRefusEx[0], $object->detail_refuse, $expediteur->getFullName($langs), $link);
|
||||||
|
|
||||||
|
// Rebuild pdf
|
||||||
|
/*
|
||||||
|
$object->setDocModel($user,"");
|
||||||
|
$resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
|
||||||
|
|
||||||
|
if($resultPDF)
|
||||||
|
{
|
||||||
|
// ATTACHMENT
|
||||||
|
$filename=array(); $filedir=array(); $mimetype=array();
|
||||||
|
array_push($filename,dol_sanitizeFileName($object->ref).".pdf");
|
||||||
|
array_push($filedir,$conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref) . "/" . dol_sanitizeFileName($object->ref_number).".pdf");
|
||||||
|
array_push($mimetype,"application/pdf");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// PREPARE SEND
|
||||||
|
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename);
|
||||||
|
|
||||||
|
if ($mailfile)
|
||||||
{
|
{
|
||||||
// FROM
|
// SEND
|
||||||
$expediteur = new User($db);
|
$result=$mailfile->sendfile();
|
||||||
$expediteur->fetch($object->fk_user_author);
|
if ($result)
|
||||||
$emailFrom = $expediteur->email;
|
|
||||||
|
|
||||||
// SUBJECT
|
|
||||||
$subject = "' ERP - Note de frais à re-approuver";
|
|
||||||
|
|
||||||
// CONTENT
|
|
||||||
$dateRefusEx = explode(" ",$object->date_refuse);
|
|
||||||
|
|
||||||
$message = "Bonjour {$destinataire->firstname},\n\n";
|
|
||||||
$message.= "Le {$dateRefusEx[0]} à {$dateRefusEx[1]} vous avez refusé d'approuver la note de frais \"{$object->ref}\". Vous aviez émis le motif suivant : {$object->detail_refuse}\n\n";
|
|
||||||
$message.= "L'auteur vient de modifier la note de frais, veuillez trouver la nouvelle version en pièce jointe.\n";
|
|
||||||
$message.= "- Déclarant : {$expediteur->firstname} {$expediteur->lastname}\n";
|
|
||||||
$message.= "- Période : du {$object->date_debut} au {$object->date_fin}\n";
|
|
||||||
$message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n";
|
|
||||||
$message.= "Bien cordialement,\n' SI";
|
|
||||||
|
|
||||||
// Génération du pdf avant attachement
|
|
||||||
$object->setDocModel($user,"");
|
|
||||||
$resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
|
|
||||||
|
|
||||||
if($resultPDF)
|
|
||||||
{
|
{
|
||||||
// ATTACHMENT
|
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($emailFrom,2),$mailfile->getValidAddress($emailTo,2));
|
||||||
$filename=array(); $filedir=array(); $mimetype=array();
|
setEventMessages($mesg, null, 'mesgs');
|
||||||
array_push($filename,dol_sanitizeFileName($object->ref).".pdf");
|
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||||
array_push($filedir,$conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref) . "/" . dol_sanitizeFileName($object->ref_number).".pdf");
|
exit;
|
||||||
array_push($mimetype,"application/pdf");
|
}
|
||||||
|
else
|
||||||
// PREPARE SEND
|
{
|
||||||
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename);
|
$langs->load("other");
|
||||||
|
if ($mailfile->error)
|
||||||
if (! $mailfile->error)
|
|
||||||
{
|
{
|
||||||
// SEND
|
$mesg='';
|
||||||
$result=$mailfile->sendfile();
|
$mesg.=$langs->trans('ErrorFailedToSendMail', $emailFrom, $emailTo);
|
||||||
if ($result)
|
$mesg.='<br>'.$mailfile->error;
|
||||||
{
|
setEventMessages($mesg, null, 'errors');
|
||||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$mesg=$mailfile->error;
|
|
||||||
setEventMessages($mesg, null, 'errors');
|
|
||||||
}
|
|
||||||
// END - Send mail
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db,$resultPDF);
|
setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings');
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($mailfile->error,$mailfile->errors,'errors');
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings');
|
||||||
|
$action='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -542,80 +551,89 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition
|
// Send mail
|
||||||
{
|
|
||||||
// Send mail
|
// TO
|
||||||
|
$destinataire = new User($db);
|
||||||
|
$destinataire->fetch($object->fk_user_author);
|
||||||
|
$emailTo = $destinataire->email;
|
||||||
|
|
||||||
|
// CC
|
||||||
|
$emailCC = $conf->global->NDF_CC_EMAILS;
|
||||||
|
|
||||||
|
// FROM
|
||||||
|
$expediteur = new User($db);
|
||||||
|
$expediteur->fetch($object->fk_user_valid);
|
||||||
|
$emailFrom = $expediteur->email;
|
||||||
|
|
||||||
|
// SUBJECT
|
||||||
|
$subject = $langs->transnoentities("ExpenseReportApproved");
|
||||||
|
|
||||||
|
// CONTENT
|
||||||
|
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
||||||
|
$message = $langs->transnoentities("ExpenseReportApprovedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link);
|
||||||
|
|
||||||
|
// Rebuilt pdf
|
||||||
|
/*
|
||||||
|
$object->setDocModel($user,"");
|
||||||
|
$resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
|
||||||
|
|
||||||
// TO
|
if($resultPDF
|
||||||
$destinataire = new User($db);
|
{
|
||||||
$destinataire->fetch($object->fk_user_author);
|
// ATTACHMENT
|
||||||
$emailTo = $destinataire->email;
|
$filename=array(); $filedir=array(); $mimetype=array();
|
||||||
|
array_push($filename,dol_sanitizeFileName($object->ref).".pdf");
|
||||||
// CC
|
array_push($filedir, $conf->expensereport->dir_output."/".dol_sanitizeFileName($object->ref)."/".dol_sanitizeFileName($object->ref).".pdf");
|
||||||
$emailCC = $conf->global->NDF_CC_EMAILS;
|
array_push($mimetype,"application/pdf");
|
||||||
|
}
|
||||||
// FROM
|
*/
|
||||||
$expediteur = new User($db);
|
|
||||||
$expediteur->fetch($object->fk_user_valid);
|
// PREPARE SEND
|
||||||
$emailFrom = $expediteur->email;
|
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename);
|
||||||
|
|
||||||
// SUBJECT
|
if ($mailfile)
|
||||||
$subject = "' ERP - Note de frais validée";
|
{
|
||||||
|
// SEND
|
||||||
// CONTENT
|
$result=$mailfile->sendfile();
|
||||||
$message = "Bonjour {$destinataire->firstname},\n\n";
|
if ($result)
|
||||||
$message.= "Votre note de frais \"{$object->ref}\" vient d'être approuvé!\n";
|
{
|
||||||
$message.= "- Approbateur : {$expediteur->firstname} {$expediteur->lastname}\n";
|
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($emailFrom,2),$mailfile->getValidAddress($emailTo,2));
|
||||||
$message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n";
|
setEventMessages($mesg, null, 'mesgs');
|
||||||
$message.= "Bien cordialement,\n' SI";
|
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||||
|
exit;
|
||||||
// Génération du pdf avant attachement
|
}
|
||||||
$object->setDocModel($user,"");
|
else
|
||||||
$resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
|
{
|
||||||
|
$langs->load("other");
|
||||||
if($resultPDF):
|
if ($mailfile->error)
|
||||||
// ATTACHMENT
|
{
|
||||||
$filename=array(); $filedir=array(); $mimetype=array();
|
$mesg='';
|
||||||
array_push($filename,dol_sanitizeFileName($object->ref).".pdf");
|
$mesg.=$langs->trans('ErrorFailedToSendMail', $emailFrom, $emailTo);
|
||||||
array_push($filedir, $conf->expensereport->dir_output.
|
$mesg.='<br>'.$mailfile->error;
|
||||||
"/".
|
setEventMessages($mesg, null, 'errors');
|
||||||
dol_sanitizeFileName($object->ref) .
|
}
|
||||||
"/".
|
else
|
||||||
dol_sanitizeFileName($object->ref).
|
{
|
||||||
".pdf"
|
setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings');
|
||||||
);
|
}
|
||||||
array_push($mimetype,"application/pdf");
|
}
|
||||||
|
}
|
||||||
// PREPARE SEND
|
else
|
||||||
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename,$emailCC);
|
{
|
||||||
|
setEventMessages($mailfile->error,$mailfile->errors,'errors');
|
||||||
if(!$mailfile->error):
|
$action='';
|
||||||
|
}
|
||||||
// SEND
|
}
|
||||||
$result=$mailfile->sendfile();
|
else
|
||||||
if ($result):
|
{
|
||||||
setEventMessages($langs->trans("MailSuccessfulySent",$emailFrom,$emailTo), null, 'mesgs');
|
setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings');
|
||||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
$action='';
|
||||||
exit;
|
}
|
||||||
else:
|
}
|
||||||
setEventMessages($langs->trans("ErrorFailedToSendMail",$emailFrom,$emailTo), null, 'errors');
|
else
|
||||||
endif;
|
{
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
else:
|
}
|
||||||
setEventMessages($langs->trans("ErrorFailedToSendMail",$emailFrom,$emailTo), null, 'errors');
|
|
||||||
endif;
|
|
||||||
// END - Send mail
|
|
||||||
else : // if ($resultPDF)
|
|
||||||
dol_print_error($db,$resultPDF);
|
|
||||||
exit;
|
|
||||||
endif;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user->rights->expensereport->approve)
|
if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user->rights->expensereport->approve)
|
||||||
{
|
{
|
||||||
@ -646,57 +664,86 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition
|
// Send mail
|
||||||
|
|
||||||
|
// TO
|
||||||
|
$destinataire = new User($db);
|
||||||
|
$destinataire->fetch($object->fk_user_author);
|
||||||
|
$emailTo = $destinataire->email;
|
||||||
|
|
||||||
|
// FROM
|
||||||
|
$expediteur = new User($db);
|
||||||
|
$expediteur->fetch($object->fk_user_refuse);
|
||||||
|
$emailFrom = $expediteur->email;
|
||||||
|
|
||||||
|
// SUBJECT
|
||||||
|
$subject = $langs->transnoentities("ExpenseReportRefused");
|
||||||
|
|
||||||
|
// CONTENT
|
||||||
|
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
||||||
|
$message = $langs->transnoentities("ExpenseReportRefusedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $_POST['detail_refuse'], $link);
|
||||||
|
|
||||||
|
// Rebuilt pdf
|
||||||
|
/*
|
||||||
|
$object->setDocModel($user,"");
|
||||||
|
$resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
|
||||||
|
|
||||||
|
if($resultPDF
|
||||||
|
{
|
||||||
|
// ATTACHMENT
|
||||||
|
$filename=array(); $filedir=array(); $mimetype=array();
|
||||||
|
array_push($filename,dol_sanitizeFileName($object->ref).".pdf");
|
||||||
|
array_push($filedir, $conf->expensereport->dir_output."/".dol_sanitizeFileName($object->ref)."/".dol_sanitizeFileName($object->ref).".pdf");
|
||||||
|
array_push($mimetype,"application/pdf");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// PREPARE SEND
|
||||||
|
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename);
|
||||||
|
|
||||||
|
if ($mailfile)
|
||||||
{
|
{
|
||||||
// Send mail
|
// SEND
|
||||||
|
$result=$mailfile->sendfile();
|
||||||
// TO
|
if ($result)
|
||||||
$destinataire = new User($db);
|
|
||||||
$destinataire->fetch($object->fk_user_author);
|
|
||||||
$emailTo = $destinataire->email;
|
|
||||||
|
|
||||||
// FROM
|
|
||||||
$expediteur = new User($db);
|
|
||||||
$expediteur->fetch($object->fk_user_refuse);
|
|
||||||
$emailFrom = $expediteur->email;
|
|
||||||
|
|
||||||
// SUBJECT
|
|
||||||
$subject = "' ERP - Note de frais refusée";
|
|
||||||
|
|
||||||
// CONTENT
|
|
||||||
$message = "Bonjour {$destinataire->firstname},\n\n";
|
|
||||||
$message.= "Votre note de frais \"{$object->ref}\" vient d'être refusée.\n";
|
|
||||||
$message.= "- Refuseur : {$expediteur->firstname} {$expediteur->lastname}\n";
|
|
||||||
$message.= "- Motif de refus : {$_POST['detail_refuse']}\n";
|
|
||||||
$message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n";
|
|
||||||
$message.= "Bien cordialement,\n' SI";
|
|
||||||
|
|
||||||
// PREPARE SEND
|
|
||||||
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message);
|
|
||||||
|
|
||||||
if(!$mailfile->error)
|
|
||||||
{
|
{
|
||||||
// SEND
|
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($emailFrom,2),$mailfile->getValidAddress($emailTo,2));
|
||||||
$result=$mailfile->sendfile();
|
setEventMessages($mesg, null, 'mesgs');
|
||||||
if ($result)
|
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$langs->load("other");
|
||||||
|
if ($mailfile->error)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("MailSuccessfulySent",$emailFrom,$emailTo), null, 'mesgs');
|
$mesg='';
|
||||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
$mesg.=$langs->trans('ErrorFailedToSendMail', $emailFrom, $emailTo);
|
||||||
exit;
|
$mesg.='<br>'.$mailfile->error;
|
||||||
|
setEventMessages($mesg, null, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorFailedToSendMail",$emailFrom,$emailTo), null, 'errors');
|
setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings');
|
||||||
}
|
}
|
||||||
// END - Send mail
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($mailfile->error,$mailfile->errors,'errors');
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings');
|
||||||
|
$action='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
//var_dump($user->id == $object->fk_user_validator);exit;
|
//var_dump($user->id == $object->fk_user_validator);exit;
|
||||||
if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_cancel') && $id > 0 && $user->rights->expensereport->creer)
|
if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_cancel') && $id > 0 && $user->rights->expensereport->creer)
|
||||||
@ -730,64 +777,85 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition
|
// Send mail
|
||||||
|
|
||||||
|
// TO
|
||||||
|
$destinataire = new User($db);
|
||||||
|
$destinataire->fetch($object->fk_user_author);
|
||||||
|
$emailTo = $destinataire->email;
|
||||||
|
|
||||||
|
// FROM
|
||||||
|
$expediteur = new User($db);
|
||||||
|
$expediteur->fetch($object->fk_user_cancel);
|
||||||
|
$emailFrom = $expediteur->email;
|
||||||
|
|
||||||
|
// SUBJECT
|
||||||
|
$subject = $langs->transnoentities("ExpenseReportCanceled");
|
||||||
|
|
||||||
|
// CONTENT
|
||||||
|
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
||||||
|
$message = $langs->transnoentities("ExpenseReportCanceledMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $_POST['detail_cancel'], $link);
|
||||||
|
|
||||||
|
// Rebuilt pdf
|
||||||
|
/*
|
||||||
|
$object->setDocModel($user,"");
|
||||||
|
$resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
|
||||||
|
|
||||||
|
if($resultPDF
|
||||||
|
{
|
||||||
|
// ATTACHMENT
|
||||||
|
$filename=array(); $filedir=array(); $mimetype=array();
|
||||||
|
array_push($filename,dol_sanitizeFileName($object->ref).".pdf");
|
||||||
|
array_push($filedir, $conf->expensereport->dir_output."/".dol_sanitizeFileName($object->ref)."/".dol_sanitizeFileName($object->ref).".pdf");
|
||||||
|
array_push($mimetype,"application/pdf");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// PREPARE SEND
|
||||||
|
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename);
|
||||||
|
|
||||||
|
if ($mailfile)
|
||||||
{
|
{
|
||||||
// Send mail
|
// SEND
|
||||||
|
$result=$mailfile->sendfile();
|
||||||
// TO
|
if ($result)
|
||||||
$destinataire = new User($db);
|
|
||||||
$destinataire->fetch($object->fk_user_author);
|
|
||||||
$emailTo = $destinataire->email;
|
|
||||||
|
|
||||||
// FROM
|
|
||||||
$expediteur = new User($db);
|
|
||||||
$expediteur->fetch($object->fk_user_cancel);
|
|
||||||
$emailFrom = $expediteur->email;
|
|
||||||
|
|
||||||
// SUBJECT
|
|
||||||
$subject = "' ERP - Note de frais annulée";
|
|
||||||
|
|
||||||
// CONTENT
|
|
||||||
$message = "Bonjour {$destinataire->firstname},\n\n";
|
|
||||||
$message.= "Votre note de frais \"{$object->ref}\" vient d'être annulée.\n";
|
|
||||||
$message.= "- Annuleur : {$expediteur->firstname} {$expediteur->lastname}\n";
|
|
||||||
$message.= "- Motif d'annulation : {$_POST['detail_cancel']}\n";
|
|
||||||
$message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n";
|
|
||||||
$message.= "Bien cordialement,\n' SI";
|
|
||||||
|
|
||||||
// PREPARE SEND
|
|
||||||
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message);
|
|
||||||
|
|
||||||
if(!$mailfile->error)
|
|
||||||
{
|
{
|
||||||
// SEND
|
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($emailFrom,2),$mailfile->getValidAddress($emailTo,2));
|
||||||
$result=$mailfile->sendfile();
|
setEventMessages($mesg, null, 'mesgs');
|
||||||
if ($result)
|
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||||
{
|
exit;
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$mesg="Impossible d'envoyer l'email.";
|
|
||||||
setEventMessages($mesg, null, 'errors');
|
|
||||||
}
|
|
||||||
// END - Send mail
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($mail->error, $mail->errors, 'errors');
|
$langs->load("other");
|
||||||
|
if ($mailfile->error)
|
||||||
|
{
|
||||||
|
$mesg='';
|
||||||
|
$mesg.=$langs->trans('ErrorFailedToSendMail', $emailFrom, $emailTo);
|
||||||
|
$mesg.='<br>'.$mailfile->error;
|
||||||
|
setEventMessages($mesg, null, 'errors');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($mailfile->error,$mailfile->errors,'errors');
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings');
|
||||||
|
$action='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($langs->transnoentitiesnoconv("OnlyOwnerCanCancel"), '', 'errors'); // Should not happened
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -864,68 +932,83 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition
|
// Send mail
|
||||||
|
|
||||||
|
// TO
|
||||||
|
$destinataire = new User($db);
|
||||||
|
$destinataire->fetch($object->fk_user_author);
|
||||||
|
$emailTo = $destinataire->email;
|
||||||
|
|
||||||
|
// FROM
|
||||||
|
$expediteur = new User($db);
|
||||||
|
$expediteur->fetch($user->id);
|
||||||
|
$emailFrom = $expediteur->email;
|
||||||
|
|
||||||
|
// SUBJECT
|
||||||
|
$subject = $langs->transnoentities("ExpenseReportPaid");
|
||||||
|
|
||||||
|
// CONTENT
|
||||||
|
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
||||||
|
$message = $langs->transnoentities("ExpenseReportPaidMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link);
|
||||||
|
|
||||||
|
// CONTENT
|
||||||
|
$message = "Bonjour {$destinataire->firstname},\n\n";
|
||||||
|
$message.= "Votre note de frais \"{$object->ref}\" vient d'être payée.\n";
|
||||||
|
$message.= "- Payeur : {$expediteur->firstname} {$expediteur->lastname}\n";
|
||||||
|
$message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n";
|
||||||
|
$message.= "Bien cordialement,\n' SI";
|
||||||
|
|
||||||
|
// Generate pdf before attachment
|
||||||
|
$object->setDocModel($user,"");
|
||||||
|
$resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
|
||||||
|
|
||||||
|
// PREPARE SEND
|
||||||
|
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename);
|
||||||
|
|
||||||
|
if ($mailfile)
|
||||||
{
|
{
|
||||||
// Send mail
|
|
||||||
|
|
||||||
// TO
|
|
||||||
$destinataire = new User($db);
|
|
||||||
$destinataire->fetch($object->fk_user_author);
|
|
||||||
$emailTo = $destinataire->email;
|
|
||||||
|
|
||||||
// FROM
|
|
||||||
$expediteur = new User($db);
|
|
||||||
$expediteur->fetch($user->id);
|
|
||||||
$emailFrom = $expediteur->email;
|
|
||||||
|
|
||||||
// SUBJECT
|
|
||||||
$subject = "'ERP - Note de frais payée";
|
|
||||||
|
|
||||||
// CONTENT
|
|
||||||
$message = "Bonjour {$destinataire->firstname},\n\n";
|
|
||||||
$message.= "Votre note de frais \"{$object->ref}\" vient d'être payée.\n";
|
|
||||||
$message.= "- Payeur : {$expediteur->firstname} {$expediteur->lastname}\n";
|
|
||||||
$message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n";
|
|
||||||
$message.= "Bien cordialement,\n' SI";
|
|
||||||
|
|
||||||
// Generate pdf before attachment
|
|
||||||
$object->setDocModel($user,"");
|
|
||||||
$resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
|
|
||||||
|
|
||||||
// PREPARE SEND
|
|
||||||
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message);
|
|
||||||
|
|
||||||
if(!$mailfile->error):
|
|
||||||
|
|
||||||
// SEND
|
// SEND
|
||||||
$result=$mailfile->sendfile();
|
$result=$mailfile->sendfile();
|
||||||
if ($result):
|
if ($result)
|
||||||
|
{
|
||||||
// Retour
|
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($emailFrom,2),$mailfile->getValidAddress($emailTo,2));
|
||||||
if($result):
|
setEventMessages($mesg, null, 'mesgs');
|
||||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||||
exit;
|
exit;
|
||||||
else:
|
}
|
||||||
dol_print_error($db);
|
else
|
||||||
endif;
|
{
|
||||||
|
$langs->load("other");
|
||||||
else:
|
if ($mailfile->error)
|
||||||
dol_print_error($db,$acct->error);
|
{
|
||||||
endif;
|
$mesg='';
|
||||||
|
$mesg.=$langs->trans('ErrorFailedToSendMail', $emailFrom, $emailTo);
|
||||||
else:
|
$mesg.='<br>'.$mailfile->error;
|
||||||
$mesg="Impossible d'envoyer l'email.";
|
setEventMessages($mesg, null, 'errors');
|
||||||
setEventMessages($mesg, null, 'errors');
|
}
|
||||||
endif;
|
else
|
||||||
// END - Send mail
|
{
|
||||||
|
setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($mailfile->error,$mailfile->errors,'errors');
|
||||||
|
$action='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings');
|
||||||
|
$action='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == "addline" && $user->rights->expensereport->creer)
|
if ($action == "addline" && $user->rights->expensereport->creer)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -1806,6 +1889,7 @@ else
|
|||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON fde.fk_c_type_fees=ctf.id';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON fde.fk_c_type_fees=ctf.id';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pjt ON fde.fk_projet=pjt.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pjt ON fde.fk_projet=pjt.rowid';
|
||||||
$sql.= ' WHERE fde.fk_expensereport = '.$object->id;
|
$sql.= ' WHERE fde.fk_expensereport = '.$object->id;
|
||||||
|
$sql.= ' ORDER BY fde.date ASC';
|
||||||
|
|
||||||
print '<div style="clear: both;">';
|
print '<div style="clear: both;">';
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
|
/* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
|
||||||
* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -830,6 +830,7 @@ class ExpenseReport extends CommonObject
|
|||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON de.fk_c_type_fees = ctf.id';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON de.fk_c_type_fees = ctf.id';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as p ON de.fk_projet = p.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as p ON de.fk_projet = p.rowid';
|
||||||
$sql.= ' WHERE de.'.$this->fk_element.' = '.$this->id;
|
$sql.= ' WHERE de.'.$this->fk_element.' = '.$this->id;
|
||||||
|
$sql.= ' ORDER BY de.date ASC';
|
||||||
|
|
||||||
dol_syslog('ExpenseReport::fetch_lines sql='.$sql, LOG_DEBUG);
|
dol_syslog('ExpenseReport::fetch_lines sql='.$sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|||||||
@ -266,7 +266,7 @@ $sql.=$hookmanager->resPrint;
|
|||||||
|
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -371,7 +371,7 @@ $sql.=$hookmanager->resPrint;
|
|||||||
|
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2015-2007 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Abbes Bahfir <bafbes@gmail.com>
|
* Copyright (C) 2015 Abbes Bahfir <bafbes@gmail.com>
|
||||||
* Copyright (C) 2015-2016 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2015-2016 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
@ -372,7 +372,7 @@ $sql.=$hookmanager->resPrint;
|
|||||||
|
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -434,6 +434,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||||
|
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" - $soc->name":""), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
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->name=$obj->name;
|
||||||
$thirdparty->client=$obj->client;
|
$thirdparty->client=$obj->client;
|
||||||
$thirdparty->code_client=$obj->code_client;
|
$thirdparty->code_client=$obj->code_client;
|
||||||
print $thirdparty->getNomUrl(1,'customer');
|
print $thirdparty->getNomUrl(1,'supplier');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -639,7 +639,7 @@ if (empty($action))
|
|||||||
if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user";
|
if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -120,7 +120,7 @@ if ($fourn_id > 0)
|
|||||||
$sql .= " AND ppf.fk_soc = ".$fourn_id;
|
$sql .= " AND ppf.fk_soc = ".$fourn_id;
|
||||||
}
|
}
|
||||||
// Count total nb of records without orderby and limit
|
// Count total nb of records without orderby and limit
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -127,7 +127,8 @@ class Holiday extends CommonObject
|
|||||||
// Check parameters
|
// Check parameters
|
||||||
if (empty($this->fk_user) || ! is_numeric($this->fk_user) || $this->fk_user < 0) { $this->error="ErrorBadParameter"; return -1; }
|
if (empty($this->fk_user) || ! is_numeric($this->fk_user) || $this->fk_user < 0) { $this->error="ErrorBadParameter"; return -1; }
|
||||||
if (empty($this->fk_validator) || ! is_numeric($this->fk_validator) || $this->fk_validator < 0) { $this->error="ErrorBadParameter"; return -1; }
|
if (empty($this->fk_validator) || ! is_numeric($this->fk_validator) || $this->fk_validator < 0) { $this->error="ErrorBadParameter"; return -1; }
|
||||||
|
if (empty($this->fk_type) || ! is_numeric($this->fk_type) || $this->fk_type < 0) { $this->error="ErrorBadParameter"; return -1; }
|
||||||
|
|
||||||
// Insert request
|
// Insert request
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday(";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday(";
|
||||||
$sql.= "fk_user,";
|
$sql.= "fk_user,";
|
||||||
@ -150,7 +151,7 @@ class Holiday extends CommonObject
|
|||||||
$sql.= " ".$this->halfday.",";
|
$sql.= " ".$this->halfday.",";
|
||||||
$sql.= " '1',";
|
$sql.= " '1',";
|
||||||
$sql.= " '".$this->fk_validator."',";
|
$sql.= " '".$this->fk_validator."',";
|
||||||
$sql.= " '".$this->fk_type."',";
|
$sql.= " ".$this->fk_type.",";
|
||||||
$sql.= " ".$user->id.",";
|
$sql.= " ".$user->id.",";
|
||||||
$sql.= " ".$conf->entity;
|
$sql.= " ".$conf->entity;
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
@ -281,7 +282,7 @@ class Holiday extends CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql.= " cp.rowid,";
|
$sql.= " cp.rowid,";
|
||||||
|
|
||||||
$sql.= " cp.fk_user,";
|
$sql.= " cp.fk_user,";
|
||||||
$sql.= " cp.date_create,";
|
$sql.= " cp.date_create,";
|
||||||
$sql.= " cp.description,";
|
$sql.= " cp.description,";
|
||||||
@ -868,7 +869,7 @@ class Holiday extends CommonObject
|
|||||||
{
|
{
|
||||||
$sql = "SELECT value";
|
$sql = "SELECT value";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_config";
|
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_config";
|
||||||
$sql.= " WHERE name = '".$name."'";
|
$sql.= " WHERE name = '".$this->db->escape($name)."'";
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::getConfCP name='.$name.' createifnotfound='.$createifnotfound, LOG_DEBUG);
|
dol_syslog(get_class($this).'::getConfCP name='.$name.' createifnotfound='.$createifnotfound, LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -882,7 +883,7 @@ class Holiday extends CommonObject
|
|||||||
if ($createifnotfound)
|
if ($createifnotfound)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_config(name, value)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_config(name, value)";
|
||||||
$sql.= " VALUES('".$name."', '".$createifnotfound."')";
|
$sql.= " VALUES('".$this->db->escape($name)."', '".$this->db->escape($createifnotfound)."')";
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
@ -947,7 +948,7 @@ class Holiday extends CommonObject
|
|||||||
$nbUser = count($users);
|
$nbUser = count($users);
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
|
||||||
$sql.= " value = '".$newdateforlastupdate."'";
|
$sql.= " value = '".$this->db->escape($newdateforlastupdate)."'";
|
||||||
$sql.= " WHERE name = 'lastUpdate'";
|
$sql.= " WHERE name = 'lastUpdate'";
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
@ -1634,6 +1635,7 @@ class Holiday extends CommonObject
|
|||||||
$this->date_fin=dol_now()+(24*3600);
|
$this->date_fin=dol_now()+(24*3600);
|
||||||
$this->fk_validator=1;
|
$this->fk_validator=1;
|
||||||
$this->halfday=0;
|
$this->halfday=0;
|
||||||
|
$this->fk_type=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -191,7 +191,7 @@ if (constant('DOL_DATA_ROOT') === null) {
|
|||||||
}
|
}
|
||||||
if (@file_exists($lockfile))
|
if (@file_exists($lockfile))
|
||||||
{
|
{
|
||||||
print 'Install pages have been disabled for security reason (by lock file install.lock into dolibarr root directory).<br>';
|
print 'Install pages have been disabled for security reason (by lock file install.lock into dolibarr documents directory).<br>';
|
||||||
if (! empty($dolibarr_main_url_root))
|
if (! empty($dolibarr_main_url_root))
|
||||||
{
|
{
|
||||||
print 'Click on following link. ';
|
print 'Click on following link. ';
|
||||||
|
|||||||
@ -48,6 +48,6 @@ create table llx_loan
|
|||||||
fk_projet integer DEFAULT NULL,
|
fk_projet integer DEFAULT NULL,
|
||||||
|
|
||||||
fk_user_author integer DEFAULT NULL,
|
fk_user_author integer DEFAULT NULL,
|
||||||
fk_user_modif integer DEFAULT NULL
|
fk_user_modif integer DEFAULT NULL,
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@ -586,7 +586,7 @@ Permission34=Delete products
|
|||||||
Permission36=See/manage hidden products
|
Permission36=See/manage hidden products
|
||||||
Permission38=Export 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)
|
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)
|
Permission44=Delete projects (shared project and projects i'm contact for)
|
||||||
Permission45=Export projects
|
Permission45=Export projects
|
||||||
Permission61=Read interventions
|
Permission61=Read interventions
|
||||||
@ -689,7 +689,7 @@ PermissionAdvanced253=Create/modify internal/external users and permissions
|
|||||||
Permission254=Create/modify external users only
|
Permission254=Create/modify external users only
|
||||||
Permission255=Modify other users password
|
Permission255=Modify other users password
|
||||||
Permission256=Delete or disable other users
|
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
|
Permission271=Read CA
|
||||||
Permission272=Read invoices
|
Permission272=Read invoices
|
||||||
Permission273=Issue invoices
|
Permission273=Issue invoices
|
||||||
|
|||||||
@ -179,6 +179,7 @@ ErrorModuleNotFound=File of module was not found.
|
|||||||
ErrorFieldAccountNotDefinedForBankLine=Value for Accounting account not defined for source bank line %s
|
ErrorFieldAccountNotDefinedForBankLine=Value for Accounting account not defined for source bank line %s
|
||||||
ErrorBankStatementNameMustFollowRegex=Error, bank statement name must follow the following syntax rule %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.
|
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
|
# 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.
|
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.
|
||||||
|
|||||||
@ -41,6 +41,7 @@ InterventionDeletedInDolibarr=Intervention %s deleted
|
|||||||
InterventionsArea=Interventions area
|
InterventionsArea=Interventions area
|
||||||
DraftFichinter=Draft interventions
|
DraftFichinter=Draft interventions
|
||||||
LastModifiedInterventions=Latest %s modified interventions
|
LastModifiedInterventions=Latest %s modified interventions
|
||||||
|
FichinterToProcess=Interventions to process
|
||||||
##### Types de contacts #####
|
##### Types de contacts #####
|
||||||
TypeContact_fichinter_external_CUSTOMER=Following-up customer contact
|
TypeContact_fichinter_external_CUSTOMER=Following-up customer contact
|
||||||
# Modele numérotation
|
# Modele numérotation
|
||||||
|
|||||||
@ -460,6 +460,7 @@ DeletePicture=Picture delete
|
|||||||
ConfirmDeletePicture=Confirm picture deletion?
|
ConfirmDeletePicture=Confirm picture deletion?
|
||||||
Login=Login
|
Login=Login
|
||||||
CurrentLogin=Current login
|
CurrentLogin=Current login
|
||||||
|
EnterLoginDetail=Enter login details
|
||||||
January=January
|
January=January
|
||||||
February=February
|
February=February
|
||||||
March=March
|
March=March
|
||||||
@ -788,8 +789,8 @@ SetRef=Set ref
|
|||||||
Select2ResultFoundUseArrows=Some results found. Use arrows to select.
|
Select2ResultFoundUseArrows=Some results found. Use arrows to select.
|
||||||
Select2NotFound=No result found
|
Select2NotFound=No result found
|
||||||
Select2Enter=Enter
|
Select2Enter=Enter
|
||||||
Select2MoreCharacter=or more characters<br /><br /><strong>SEARCH OPERANDS:</strong><br /><kbd><strong> |</strong></kbd><kbd> OR</kbd><br /><kbd><strong>*</strong></kbd><kbd> Any character</kbd><br /><kbd><strong>^</strong></kbd><kbd> Start with</kbd><br /><kbd><strong>$</strong></kbd><kbd> End with</kbd><br />
|
Select2MoreCharacter=or more characters<br /><br /><strong>Search syntax:</strong><br /><kbd><strong> |</strong></kbd><kbd> OR</kbd> (a|b)<br /><kbd><strong>*</strong></kbd><kbd> Any character</kbd> (a*b)<br /><kbd><strong>^</strong></kbd><kbd> Start with</kbd> (^ab)<br /><kbd><strong>$</strong></kbd><kbd> End with</kbd> (ab$)<br />
|
||||||
Select2MoreCharacters=or more characters<br /><br /><strong>SEARCH OPERANDS:</strong><br /><kbd><strong> |</strong></kbd><kbd> OR</kbd><br /><kbd><strong>*</strong></kbd><kbd> Any character</kbd><br /><kbd><strong>^</strong></kbd><kbd> Start with</kbd><br /><kbd><strong>$</strong></kbd><kbd> End with</kbd><br />
|
Select2MoreCharacters=or more characters<br /><br /><strong>Search syntax:</strong><br /><kbd><strong> |</strong></kbd><kbd> OR</kbd> (a|b)<br /><kbd><strong>*</strong></kbd><kbd> Any character</kbd> (a*b)<br /><kbd><strong>^</strong></kbd><kbd> Start with</kbd> (^ab)<br /><kbd><strong>$</strong></kbd><kbd> End with</kbd> (ab$)<br />
|
||||||
Select2LoadingMoreResults=Loading more results...
|
Select2LoadingMoreResults=Loading more results...
|
||||||
Select2SearchInProgress=Search in progress...
|
Select2SearchInProgress=Search in progress...
|
||||||
SearchIntoThirdparties=Thirdparties
|
SearchIntoThirdparties=Thirdparties
|
||||||
|
|||||||
@ -139,4 +139,5 @@ OptionMULTIPRICESIsOn=Option "several prices per segment" is on. It means a prod
|
|||||||
ProductStockWarehouseCreated=Stock limit for alert and desired optimal stock correctly created
|
ProductStockWarehouseCreated=Stock limit for alert and desired optimal stock correctly created
|
||||||
ProductStockWarehouseUpdated=Stock limit for alert and desired optimal stock correctly updated
|
ProductStockWarehouseUpdated=Stock limit for alert and desired optimal stock correctly updated
|
||||||
ProductStockWarehouseDeleted=Stock limit for alert and desired optimal stock correctly deleted
|
ProductStockWarehouseDeleted=Stock limit for alert and desired optimal stock correctly deleted
|
||||||
AddNewProductStockWarehouse=Set new limit for alert and desired optimal stock
|
AddNewProductStockWarehouse=Set new limit for alert and desired optimal stock
|
||||||
|
AddStockLocationLine=Decrease quantity then click to add another warehouse for this product
|
||||||
|
|||||||
@ -21,7 +21,17 @@ ListToApprove=Waiting for approval
|
|||||||
ExpensesArea=Expense reports area
|
ExpensesArea=Expense reports area
|
||||||
ClassifyRefunded=Classify 'Refunded'
|
ClassifyRefunded=Classify 'Refunded'
|
||||||
ExpenseReportWaitingForApproval=A new expense report has been submitted for approval
|
ExpenseReportWaitingForApproval=A new expense report has been submitted for approval
|
||||||
ExpenseReportWaitingForApprovalMessage=A new expense report has been submitted and is waiting for approval.\n- User: %s\n- Period: %s\nClick here to validate: %s
|
ExpenseReportWaitingForApprovalMessage=A new expense report has been submitted and is waiting for approval.\n - User: %s\n - Period: %s\nClick here to validate: %s
|
||||||
|
ExpenseReportWaitingForReApproval=An expense report has been submitted for re-approval
|
||||||
|
ExpenseReportWaitingForReApprovalMessage=An expense report has been submitted and is waiting for re-approval.\nThe %s, you refused to approve the expense report for this reason: %s.\nA new version has been proposed and waiting for your approval.\n - User: %s\n - Period: %s\nClick here to validate: %s
|
||||||
|
ExpenseReportApproved=An expense report was approved
|
||||||
|
ExpenseReportApprovedMessage=The expense report %s was approved.\n - User: %s\n - Approved by: %s\nClick here to show the expense report: %s
|
||||||
|
ExpenseReportRefused=An expense report was refused
|
||||||
|
ExpenseReportRefusedMessage=The expense report %s was refused.\n - User: %s\n - Refused by: %s\n - Motive for refusal: %s\nClick here to show the expense report: %s
|
||||||
|
ExpenseReportCanceled=An expense report was canceled
|
||||||
|
ExpenseReportCanceledMessage=The expense report %s was canceled.\n - User: %s\n - Canceled by: %s\n - Motive for cancellation: %s\nClick here to show the expense report: %s
|
||||||
|
ExpenseReportPaid=An expense report was paid
|
||||||
|
ExpenseReportPaidMessage=The expense report %s was paid.\n - User: %s\n - Paid by: %s\nClick here to show the expense report: %s
|
||||||
TripId=Id expense report
|
TripId=Id expense report
|
||||||
AnyOtherInThisListCanValidate=Person to inform for validation.
|
AnyOtherInThisListCanValidate=Person to inform for validation.
|
||||||
TripSociete=Information company
|
TripSociete=Information company
|
||||||
|
|||||||
@ -99,17 +99,7 @@ if (empty($reshook))
|
|||||||
$dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int'));
|
$dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int'));
|
||||||
$capital = price2num(GETPOST('capital'));
|
$capital = price2num(GETPOST('capital'));
|
||||||
|
|
||||||
if (! $datestart)
|
if (! $capital)
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateStart")), null, 'errors');
|
|
||||||
$action = 'create';
|
|
||||||
}
|
|
||||||
elseif (! $dateend)
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateEnd")), null, 'errors');
|
|
||||||
$action = 'create';
|
|
||||||
}
|
|
||||||
elseif (! $capital)
|
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("LoanCapital")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("LoanCapital")), null, 'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
@ -155,13 +145,31 @@ if (empty($reshook))
|
|||||||
if (! $cancel)
|
if (! $cancel)
|
||||||
{
|
{
|
||||||
$result = $object->fetch($id);
|
$result = $object->fetch($id);
|
||||||
if ($result > 0)
|
|
||||||
|
$datestart = dol_mktime(12, 0, 0, GETPOST('startmonth','int'), GETPOST('startday','int'), GETPOST('startyear','int'));
|
||||||
|
$dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int'));
|
||||||
|
$capital = price2num(GETPOST('capital'));
|
||||||
|
|
||||||
|
if (! $capital)
|
||||||
{
|
{
|
||||||
$object->datestart = dol_mktime(12, 0, 0, GETPOST('startmonth','int'), GETPOST('startday','int'), GETPOST('startyear','int'));
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("LoanCapital")), null, 'errors');
|
||||||
$object->dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int'));
|
$action = 'edit';
|
||||||
$object->capital = price2num(GETPOST("capital"));
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$object->datestart = $datestart;
|
||||||
|
$object->dateend = $dateend;
|
||||||
|
$object->capital = $capital;
|
||||||
$object->nbterm = GETPOST("nbterm");
|
$object->nbterm = GETPOST("nbterm");
|
||||||
$object->rate = GETPOST("rate");
|
$object->rate = GETPOST("rate");
|
||||||
|
|
||||||
|
$accountancy_account_capital = GETPOST('accountancy_account_capital');
|
||||||
|
$accountancy_account_insurance = GETPOST('accountancy_account_insurance');
|
||||||
|
$accountancy_account_interest = GETPOST('accountancy_account_interest');
|
||||||
|
|
||||||
|
if ($accountancy_account_capital <= 0) { $object->account_capital = ''; } else { $object->account_capital = $accountancy_account_capital; }
|
||||||
|
if ($accountancy_account_insurance <= 0) { $object->account_insurance = ''; } else { $object->account_insurance = $accountancy_account_insurance; }
|
||||||
|
if ($accountancy_account_interest <= 0) { $object->account_interest = ''; } else { $object->account_interest = $accountancy_account_interest; }
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $object->update($user);
|
$result = $object->update($user);
|
||||||
@ -255,21 +263,21 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Date Start
|
// Date Start
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td class="fieldrequired">'.$langs->trans("DateStart").'</td><td>';
|
print '<td>'.$langs->trans("DateStart").'</td><td>';
|
||||||
print $form->select_date($datestart?$datestart:-1,'start','','','','add',1,1,1);
|
print $form->select_date($datestart?$datestart:-1,'start','','','','add',1,1,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date End
|
// Date End
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td class="fieldrequired">'.$langs->trans("DateEnd").'</td><td>';
|
print '<td>'.$langs->trans("DateEnd").'</td><td>';
|
||||||
print $form->select_date($dateend?$dateend:-1,'end','','','','add',1,1,1);
|
print $form->select_date($dateend?$dateend:-1,'end','','','','add',1,1,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Number of terms
|
// Number of terms
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Nbterms").'</td><td><input name="nbterm" size="5" value="' . GETPOST('nbterm') . '"></td></tr>';
|
print '<tr><td>'.$langs->trans("Nbterms").'</td><td><input name="nbterm" size="5" value="' . GETPOST('nbterm') . '"></td></tr>';
|
||||||
|
|
||||||
// Rate
|
// Rate
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Rate").'</td><td><input name="rate" size="5" value="' . GETPOST("rate") . '"> %</td></tr>';
|
print '<tr><td>'.$langs->trans("Rate").'</td><td><input name="rate" size="5" value="' . GETPOST("rate") . '"> %</td></tr>';
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
@ -308,19 +316,19 @@ if ($action == 'create')
|
|||||||
if (! empty($conf->accounting->enabled))
|
if (! empty($conf->accounting->enabled))
|
||||||
{
|
{
|
||||||
// Accountancy_account_capital
|
// Accountancy_account_capital
|
||||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("LoanAccountancyCapitalCode").'</td>';
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("LoanAccountancyCapitalCode").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formaccountancy->select_account($object->accountancy_account_capital, 'accountancy_account_capital', 1, '', 0, 1);
|
print $formaccountancy->select_account($object->accountancy_account_capital, 'accountancy_account_capital', 1, '', 0, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Accountancy_account_insurance
|
// Accountancy_account_insurance
|
||||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("LoanAccountancyInsuranceCode").'</td>';
|
print '<tr><td>'.$langs->trans("LoanAccountancyInsuranceCode").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formaccountancy->select_account($object->accountancy_account_insurance, 'accountancy_account_insurance', 1, '', 0, 1);
|
print $formaccountancy->select_account($object->accountancy_account_insurance, 'accountancy_account_insurance', 1, '', 0, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Accountancy_account_interest
|
// Accountancy_account_interest
|
||||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("LoanAccountancyInterestCode").'</td>';
|
print '<tr><td>'.$langs->trans("LoanAccountancyInterestCode").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formaccountancy->select_account($object->accountancy_account_interest, 'accountancy_account_interest', 1, '', 0, 1);
|
print $formaccountancy->select_account($object->accountancy_account_interest, 'accountancy_account_interest', 1, '', 0, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -328,17 +336,17 @@ if ($action == 'create')
|
|||||||
else // For external software
|
else // For external software
|
||||||
{
|
{
|
||||||
// Accountancy_account_capital
|
// Accountancy_account_capital
|
||||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("LoanAccountancyCapitalCode").'</td>';
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("LoanAccountancyCapitalCode").'</td>';
|
||||||
print '<td><input name="accountancy_account_capital" size="16" value="'.$object->accountancy_account_capital.'">';
|
print '<td><input name="accountancy_account_capital" size="16" value="'.$object->accountancy_account_capital.'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Accountancy_account_insurance
|
// Accountancy_account_insurance
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("LoanAccountancyInsuranceCode").'</td>';
|
print '<tr><td>'.$langs->trans("LoanAccountancyInsuranceCode").'</td>';
|
||||||
print '<td><input name="accountancy_account_insurance" size="16" value="'.$object->accountancy_account_insurance.'">';
|
print '<td><input name="accountancy_account_insurance" size="16" value="'.$object->accountancy_account_insurance.'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Accountancy_account_interest
|
// Accountancy_account_interest
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("LoanAccountancyInterestCode").'</td>';
|
print '<tr><td>'.$langs->trans("LoanAccountancyInterestCode").'</td>';
|
||||||
print '<td><input name="accountancy_account_interest" size="16" value="'.$object->accountancy_account_interest.'">';
|
print '<td><input name="accountancy_account_interest" size="16" value="'.$object->accountancy_account_interest.'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -398,7 +406,7 @@ if ($id > 0)
|
|||||||
// Ref loan
|
// Ref loan
|
||||||
$morehtmlref.=$form->editfieldkey("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', 0, 1);
|
||||||
$morehtmlref.=$form->editfieldval("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', null, null, '', 1);
|
$morehtmlref.=$form->editfieldval("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', null, null, '', 1);
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
@ -442,29 +450,10 @@ if ($id > 0)
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
/*
|
|
||||||
// Ref
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
|
||||||
print $form->showrefnav($object,'id');
|
|
||||||
print "</td></tr>";
|
|
||||||
|
|
||||||
// Label
|
|
||||||
if ($action == 'edit')
|
|
||||||
{
|
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td>';
|
|
||||||
print '<input type="text" name="label" size="40" value="'.$object->label.'">';
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Capital
|
// Capital
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("LoanCapital").'</td><td>';
|
print '<tr><td class="fieldrequired titlefield">'.$langs->trans("LoanCapital").'</td><td>';
|
||||||
print '<input name="capital" size="10" value="' . $object->capital . '"></td></tr>';
|
print '<input name="capital" size="10" value="' . $object->capital . '"></td></tr>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -500,19 +489,53 @@ if ($id > 0)
|
|||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Nbterms
|
// Nbterms
|
||||||
print '<tr><td>'.$langs->trans("Nbterms").'</td><td>'.$object->nbterm.'</td></tr>';
|
print '<tr><td">'.$langs->trans("Nbterms").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
if ($action == 'edit')
|
||||||
|
{
|
||||||
|
print '<input name="nbterm" size="4" value="' . $object->nbterm . '">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $object->nbterm;
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Rate
|
// Rate
|
||||||
print '<tr><td>'.$langs->trans("Rate").'</td><td>'.$object->rate.' %</td></tr>';
|
print '<tr><td">'.$langs->trans("Rate").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
if ($action == 'edit')
|
||||||
|
{
|
||||||
|
print '<input name="rate" size="4" value="' . $object->rate . '">%';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $object->rate . '%';
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Accountancy account capital
|
// Accountancy account capital
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print $langs->trans("LoanAccountancyCapitalCode");
|
print $langs->trans("LoanAccountancyCapitalCode");
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if (! empty($conf->accounting->enabled)) {
|
if ($action == 'edit')
|
||||||
print length_accountg($object->account_capital);
|
{
|
||||||
} else {
|
if (! empty($conf->accounting->enabled))
|
||||||
print $object->account_capital;
|
{
|
||||||
|
print $formaccountancy->select_account($object->account_capital, 'accountancy_account_capital', 1, '', 0, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.'">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (! empty($conf->accounting->enabled)) {
|
||||||
|
print length_accountg($object->account_capital);
|
||||||
|
} else {
|
||||||
|
print $object->account_capital;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -520,10 +543,24 @@ if ($id > 0)
|
|||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print $langs->trans("LoanAccountancyInsuranceCode");
|
print $langs->trans("LoanAccountancyInsuranceCode");
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if (! empty($conf->accounting->enabled)) {
|
if ($action == 'edit')
|
||||||
print length_accountg($object->account_insurance);
|
{
|
||||||
} else {
|
if (! empty($conf->accounting->enabled))
|
||||||
print $object->account_insurance;
|
{
|
||||||
|
print $formaccountancy->select_account($object->account_insurance, 'accountancy_account_insurance', 1, '', 0, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.'">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (! empty($conf->accounting->enabled)) {
|
||||||
|
print length_accountg($object->account_insurance);
|
||||||
|
} else {
|
||||||
|
print $object->account_insurance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -531,17 +568,27 @@ if ($id > 0)
|
|||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print $langs->trans("LoanAccountancyInterestCode");
|
print $langs->trans("LoanAccountancyInterestCode");
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if (! empty($conf->accounting->enabled)) {
|
if ($action == 'edit')
|
||||||
print length_accountg($object->account_interest);
|
{
|
||||||
} else {
|
if (! empty($conf->accounting->enabled))
|
||||||
print $object->account_interest;
|
{
|
||||||
|
print $formaccountancy->select_account($object->account_interest, 'accountancy_account_interest', 1, '', 0, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.'">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (! empty($conf->accounting->enabled)) {
|
||||||
|
print length_accountg($object->account_interest);
|
||||||
|
} else {
|
||||||
|
print $object->account_interest;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
// Status
|
|
||||||
// print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4, $totalpaye).'</td></tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -86,7 +86,7 @@ if ($filtre) {
|
|||||||
$sql.= " GROUP BY l.rowid, l.label, l.capital, l.datestart, l.dateend";
|
$sql.= " GROUP BY l.rowid, l.label, l.capital, l.datestart, l.dateend";
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -139,7 +139,7 @@ if ($resql)
|
|||||||
print '<td class="liste_titre"><input class="flat" size="12" type="text" name="search_label" value="'.$search_label.'"></td>';
|
print '<td class="liste_titre"><input class="flat" size="12" type="text" name="search_label" value="'.$search_label.'"></td>';
|
||||||
print '<td class="liste_titre" align="right" ><input class="flat" size="8" type="text" name="search_amount" value="'.$search_amount.'"></td>';
|
print '<td class="liste_titre" align="right" ><input class="flat" size="8" type="text" name="search_amount" value="'.$search_amount.'"></td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td align="right" class="liste_titre">';
|
print '<td align="right" class="liste_titre">';
|
||||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||||
|
|||||||
@ -1025,7 +1025,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
print '<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>'."\n";
|
print '<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>'."\n";
|
||||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser')) print '<link rel="top" title="'.$langs->trans("Home").'" href="'.(DOL_URL_ROOT?DOL_URL_ROOT:'/').'">'."\n";
|
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser')) print '<link rel="top" title="'.$langs->trans("Home").'" href="'.(DOL_URL_ROOT?DOL_URL_ROOT:'/').'">'."\n";
|
||||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser')) print '<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1">'."\n";
|
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser')) print '<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1">'."\n";
|
||||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser')) print '<link rel="author" title="Dolibarr Development Team" href="http://www.dolibarr.org">'."\n";
|
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser')) print '<link rel="author" title="Dolibarr Development Team" href="https://www.dolibarr.org">'."\n";
|
||||||
|
|
||||||
// Displays title
|
// Displays title
|
||||||
$appli=constant('DOL_APPLICATION_TITLE');
|
$appli=constant('DOL_APPLICATION_TITLE');
|
||||||
@ -1935,11 +1935,11 @@ if (! function_exists("llxFooter"))
|
|||||||
var scrollBottom = $(window).scrollTop() + $(window).height();
|
var scrollBottom = $(window).scrollTop() + $(window).height();
|
||||||
//console.log(scrollBottom);
|
//console.log(scrollBottom);
|
||||||
diffoutsidebottom = (posbottom - scrollBottom);
|
diffoutsidebottom = (posbottom - scrollBottom);
|
||||||
console.log("diffoutsidebottom (positive = outside) = "+diffoutsidebottom);
|
console.log("heigthofcontent="+heigthofcontent+", diffoutsidebottom (posbottom="+posbottom+" - scrollBottom="+scrollBottom+") = "+diffoutsidebottom);
|
||||||
if (diffoutsidebottom > 0)
|
if (diffoutsidebottom > 0)
|
||||||
{
|
{
|
||||||
pix = "-"+diffoutsidebottom+"px";
|
pix = "-"+(diffoutsidebottom+8)+"px";
|
||||||
console.log(pix);
|
console.log("We reposition top by "+pix);
|
||||||
$(this).parent().parent().find(\'dd\').css("top", pix);
|
$(this).parent().parent().find(\'dd\').css("top", pix);
|
||||||
}
|
}
|
||||||
// $(".dropdown dd ul").slideToggle(\'fast\');
|
// $(".dropdown dd ul").slideToggle(\'fast\');
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user