mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 17:48:25 +01:00
Compare commits
137 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8a80f9311 | ||
|
|
3a2d9c8610 | ||
|
|
f03ad00466 | ||
|
|
e6697c32c4 | ||
|
|
1add34b451 | ||
|
|
fc4aa96cd7 | ||
|
|
eb09519a26 | ||
|
|
9ebe383beb | ||
|
|
0a4b29e1c4 | ||
|
|
f23f2e61f5 | ||
|
|
5715233fb0 | ||
|
|
a47f3cb0e5 | ||
|
|
ac32161711 | ||
|
|
2f4ff66c43 | ||
|
|
b4733e043c | ||
|
|
9bb9d4d36e | ||
|
|
2cedcfece2 | ||
|
|
4047de82bd | ||
|
|
8ec1784e41 | ||
|
|
a944c82d86 | ||
|
|
03c1521cde | ||
|
|
9d6f84c3a0 | ||
|
|
3336943ff2 | ||
|
|
d48f2507b5 | ||
|
|
ddbb7ee1f4 | ||
|
|
b6383399aa | ||
|
|
8f577b0754 | ||
|
|
6f3677a322 | ||
|
|
c8957a9184 | ||
|
|
82492dc023 | ||
|
|
bb95f139a8 | ||
|
|
13d01a7010 | ||
|
|
7a0d388073 | ||
|
|
86e690a064 | ||
|
|
ec5c4ebf6b | ||
|
|
16779be162 | ||
|
|
c9ca35ebd1 | ||
|
|
ce37a855ce | ||
|
|
1ded1bd52a | ||
|
|
d21bb1e6b1 | ||
|
|
7ebb5f7d92 | ||
|
|
fdbe4051f1 | ||
|
|
c1d6ad90b3 | ||
|
|
43cb9c30b2 | ||
|
|
c01baf1223 | ||
|
|
4f949bea29 | ||
|
|
983f707553 | ||
|
|
9c60474953 | ||
|
|
d2b766f9f4 | ||
|
|
f36dea5be7 | ||
|
|
ac80d4057d | ||
|
|
3dd160c663 | ||
|
|
36bd63c1a7 | ||
|
|
a05132d26e | ||
|
|
10a10f459c | ||
|
|
a07a77e323 | ||
|
|
f5458b4337 | ||
|
|
9f17e56923 | ||
|
|
25958c241b | ||
|
|
ed6e3fe8a0 | ||
|
|
6903acfe1c | ||
|
|
0671f75417 | ||
|
|
0fe844aa00 | ||
|
|
54a974cb5c | ||
|
|
d14e4dbaba | ||
|
|
f9ed1592e1 | ||
|
|
c3997194b2 | ||
|
|
fd4a19855d | ||
|
|
1fd9f5e1fb | ||
|
|
6aa26e0f62 | ||
|
|
29f07d3e89 | ||
|
|
55c0a99bce | ||
|
|
487b5b25db | ||
|
|
31818e8816 | ||
|
|
a90ec7a8c7 | ||
|
|
3a2f44adac | ||
|
|
380b61a0e9 | ||
|
|
edb79de54e | ||
|
|
1886e68731 | ||
|
|
307c06dfc3 | ||
|
|
32a453e8e6 | ||
|
|
f185a09693 | ||
|
|
8d5c853267 | ||
|
|
13787881d4 | ||
|
|
e82aa97d0e | ||
|
|
c42b48636a | ||
|
|
762dd8030e | ||
|
|
7476a3c8ae | ||
|
|
e802ff3385 | ||
|
|
5e71ff816f | ||
|
|
351c416ed8 | ||
|
|
721534d676 | ||
|
|
f408c886b6 | ||
|
|
3d8c5b377b | ||
|
|
46e330f749 | ||
|
|
7a8a95c815 | ||
|
|
4ea78d20f0 | ||
|
|
749f8cf252 | ||
|
|
94f14f529b | ||
|
|
bcba4a1a38 | ||
|
|
ac58fd91af | ||
|
|
eb2ea07c76 | ||
|
|
5898d27609 | ||
|
|
5553be4aa9 | ||
|
|
2c2bb366bd | ||
|
|
cb7cd3baaf | ||
|
|
1559c45a61 | ||
|
|
70e6c2d41f | ||
|
|
decbda3e23 | ||
|
|
a9354e5f27 | ||
|
|
8ab0ad3b72 | ||
|
|
03aa8343fd | ||
|
|
62a668d899 | ||
|
|
a583fd7a3b | ||
|
|
dba777c57b | ||
|
|
1856b5cfb8 | ||
|
|
913df73ed9 | ||
|
|
41832a0c26 | ||
|
|
dc605c915a | ||
|
|
76a53dfb7d | ||
|
|
2c1477ecea | ||
|
|
5c76229cdf | ||
|
|
3bb1756a13 | ||
|
|
37d158f159 | ||
|
|
6585431849 | ||
|
|
fba7d73052 | ||
|
|
71d8a81751 | ||
|
|
7f8d4deb59 | ||
|
|
e6cdcfca00 | ||
|
|
8ee838c9c4 | ||
|
|
b21998d506 | ||
|
|
358616cda2 | ||
|
|
680c48d90a | ||
|
|
005a40c105 | ||
|
|
9cfc8d4095 | ||
|
|
4002ec9fd5 | ||
|
|
eb62c1eb0d |
@@ -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
|
||||||
|
|||||||
19
README-FR.md
19
README-FR.md
@@ -54,19 +54,10 @@ Pour mettre a jour Dolibarr depuis une vieille version vers celle ci:
|
|||||||
- Ecraser les vieux fichiers dans le vieux repertoire 'dolibarr' par les fichiers
|
- Ecraser les vieux fichiers dans le vieux repertoire 'dolibarr' par les fichiers
|
||||||
fournis dans ce nouveau package.
|
fournis dans ce nouveau package.
|
||||||
|
|
||||||
- Si vous venez d'une version x.y.z vers x.y.w (seul le 3eme chiffre varie),
|
- Au prochain accès, Dolibarr proposera la page de "mise a jour" des données (si necessaire).
|
||||||
il n'y a pas besoin de migration de données.
|
Si un fichier install.lock existe pour vérouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transféré sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")
|
||||||
|
|
||||||
- Si vous venez d'une beta ou d'un version x.y.z vers une autre ou les numeros x
|
|
||||||
ou y varient, vous devez appelez la page "install/" de migration dans votre
|
|
||||||
navigateur (ceci doit se faire automatiquement au premier accès de l'application).
|
|
||||||
Ce sera une URL du genre:
|
|
||||||
http://localhost/dolibarr/htdocs/install/index.php
|
|
||||||
ou
|
|
||||||
http://yourdolibarrhost/install/index.php
|
|
||||||
|
|
||||||
Ensuite, choisir l'option de "mise a jour" en rapport avec votre cas.
|
*Note: Le processus de migration peut etre lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
|
||||||
Note: Le processus de migration peut etre lance plusieurs fois sans risque.
|
|
||||||
|
|
||||||
|
|
||||||
## CE QUI EST NOUVEAU
|
## CE QUI EST NOUVEAU
|
||||||
@@ -86,11 +77,13 @@ Voir fichier ChangeLog.
|
|||||||
- Gestion des factures clients/fournisseurs et paiements
|
- Gestion des factures clients/fournisseurs et paiements
|
||||||
- Gestion des virements bancaires SEPA
|
- Gestion des virements bancaires SEPA
|
||||||
- Gestion des comptes bancaires
|
- Gestion des comptes bancaires
|
||||||
- Agenda partagé
|
- Calendrier/Agenda partagé (avec export ical, vcal)
|
||||||
- Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...)
|
- Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...)
|
||||||
- Gestion de contrats de services
|
- Gestion de contrats de services
|
||||||
- Gestion de stock
|
- Gestion de stock
|
||||||
- Gestion des expéditions
|
- Gestion des expéditions
|
||||||
|
- Gestion des demandes de congès
|
||||||
|
- Gestion des notes de frais
|
||||||
- GED (Gestion Electronique de Documents)
|
- GED (Gestion Electronique de Documents)
|
||||||
- EMailings de masse
|
- EMailings de masse
|
||||||
- Réalisation de sondages
|
- Réalisation de sondages
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -60,10 +60,10 @@ You can use a Web server and a supported database (MariaDb, MySql or Postgresql)
|
|||||||
## UPGRADING
|
## UPGRADING
|
||||||
|
|
||||||
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
|
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
|
||||||
- If you're upgrading from version x.y.z to x.y.w (only third number differs), there is no need to run any migration process.
|
- At first next access, Dolibarr will redirect your to the "install/" page to make the upgrade process.
|
||||||
- If you're upgrading from a beta version or from any version x.y.z to any other where x or y number differs, you must call the Dolibarr "install/" page in your browser (this should be done automatically at first dolibarr access) and follow the upgrade process.
|
If a file install.lock exists to lock any run of upgrade process, the application will ask you to remove the file manually (you should find the install.lock file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "documents").
|
||||||
|
|
||||||
*Note: migration process can safely be done multiple times.*
|
*Note: migration process can safely be done multiple times by calling the page /install/index.php*
|
||||||
|
|
||||||
## WHAT'S NEW
|
## WHAT'S NEW
|
||||||
|
|
||||||
@@ -80,17 +80,17 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Invoices and payment management
|
- Invoices and payment management
|
||||||
- Standing orders management (European SEPA)
|
- Standing orders management (European SEPA)
|
||||||
- Bank accounts management
|
- Bank accounts management
|
||||||
- Shared calendar
|
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||||
- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...)
|
- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...)
|
||||||
- Projects management
|
- Projects management
|
||||||
- Contracts management
|
- Contracts management
|
||||||
- Stock management
|
- Stock management
|
||||||
- Shipping management
|
- Shipping management
|
||||||
- Interventions management
|
- Interventions management
|
||||||
- Agenda with ical and vcal export for third party tools integration
|
- Employee's leave requests management
|
||||||
|
- Expense report management
|
||||||
- Electronic Document Management (EDM)
|
- Electronic Document Management (EDM)
|
||||||
- Foundations members management
|
- Foundations members management
|
||||||
- Employee's holidays management
|
|
||||||
- Mass emailing
|
- Mass emailing
|
||||||
- Surveys
|
- Surveys
|
||||||
- Point of Sale
|
- Point of Sale
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -888,18 +888,18 @@ if ($id)
|
|||||||
{
|
{
|
||||||
if ($value == 'country')
|
if ($value == 'country')
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($id == 4) print '<td></td>';
|
if ($id == 4) print '<td></td>';
|
||||||
print '<td></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre" colspan="2" align="right">';
|
print '<td class="liste_titre" colspan="2" align="right">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
|
|||||||
@@ -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) {
|
||||||
@@ -235,9 +235,8 @@ print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60"
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="GET">';
|
print '<td class="liste_titre">' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . '</td>';
|
||||||
print '<td>' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . '</td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td></td>';
|
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
print $langs->trans('From') . ': ';
|
print $langs->trans('From') . ': ';
|
||||||
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
||||||
@@ -247,10 +246,10 @@ print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_mvt_label" value="' . $search_mvt_label . '"/></td>';
|
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_mvt_label" value="' . $search_mvt_label . '"/></td>';
|
||||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_account" value="' . $search_label_account . '"/></td>';
|
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_account" value="' . $search_label_account . '"/></td>';
|
||||||
print '<td> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||||
print '<td align="right" colspan="2" class="liste_titre">';
|
print '<td class="liste_titre" align="right" colspan="2">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
// Langs
|
// Langs
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
@@ -179,7 +180,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<a class="butActionDelete" hr
|
|||||||
$sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
$sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||||
$sql .= " , " . MAIN_DB_PREFIX . "facture as f";
|
$sql .= " , " . MAIN_DB_PREFIX . "facture as f";
|
||||||
$sql .= " WHERE fd.fk_code_ventilation = 0";
|
$sql .= " WHERE fd.fk_code_ventilation = 0";
|
||||||
$sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;";
|
$sql .= " AND f.rowid = fd.fk_facture";
|
||||||
|
$sql .= " AND f.fk_statut > 0";
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@@ -222,6 +230,11 @@ $sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'
|
|||||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
$sql .= " AND aa.account_number IS NULL";
|
$sql .= " AND aa.account_number IS NULL";
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
||||||
|
|
||||||
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||||
@@ -273,6 +286,11 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid
|
|||||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
$sql .= " AND aa.account_number IS NOT NULL";
|
$sql .= " AND aa.account_number IS NOT NULL";
|
||||||
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
||||||
|
|
||||||
@@ -301,97 +319,105 @@ print "</table>\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||||
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
|
||||||
|
print "<br>\n";
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
print "<br>\n";
|
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
|
||||||
print '<table class="noborder" width="100%">';
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
|
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
}
|
||||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
|
|
||||||
|
$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,";
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
|
}
|
||||||
|
$sql .= " SUM(fd.total_ht) as total";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||||
|
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
dol_syslog('htdocs/accountancy/customer/index.php');
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$i = 0;
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
while ($row = $db->fetch_row($resql)) {
|
||||||
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
$i ++;
|
||||||
|
}
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print $db->lasterror(); // Show last sql error
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
|
|
||||||
|
if (! empty($conf->margin->enabled)) {
|
||||||
|
print "<br>\n";
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre"><td width="400">' . $langs->trans("TotalMarge") . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
|
|
||||||
|
$sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,";
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
|
}
|
||||||
|
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||||
|
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
while ($row = $db->fetch_row($resql)) {
|
||||||
|
|
||||||
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td align="right">' . price(price2num($row[$i])) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right"><b>' . price(price2num($row[13])) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print $db->lasterror(); // Show last sql error
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,";
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
|
||||||
}
|
|
||||||
$sql .= " SUM(fd.total_ht) as total";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
|
||||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
|
||||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
|
||||||
|
|
||||||
dol_syslog('htdocs/accountancy/customer/index.php');
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$i = 0;
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
while ($row = $db->fetch_row($resql)) {
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
$i ++;
|
|
||||||
}
|
|
||||||
$db->free($resql);
|
|
||||||
} else {
|
|
||||||
print $db->lasterror(); // Show last sql error
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
if (! empty($conf->margin->enabled)) {
|
|
||||||
print "<br>\n";
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr class="liste_titre"><td width="400">' . $langs->trans("TotalMarge") . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,";
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
|
||||||
}
|
|
||||||
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
|
||||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
|
||||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
|
||||||
|
|
||||||
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
while ($row = $db->fetch_row($resql)) {
|
|
||||||
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td align="right">' . price(price2num($row[$i])) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td align="right"><b>' . price(price2num($row[13])) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
$db->free($resql);
|
|
||||||
} else {
|
|
||||||
print $db->lasterror(); // Show last sql error
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
print '</td></tr></table>';
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -210,12 +210,17 @@ if (strlen(trim($search_account))) {
|
|||||||
if (strlen(trim($search_vat))) {
|
if (strlen(trim($search_vat))) {
|
||||||
$sql .= natural_search("l.tva_tx",$search_vat,1);
|
$sql .= natural_search("l.tva_tx",$search_vat,1);
|
||||||
}
|
}
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_STANDARD . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
$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);
|
||||||
|
|||||||
@@ -290,55 +290,55 @@ print "</table>\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<br>';
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||||
print '<br>';
|
{
|
||||||
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
|
||||||
|
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||||
|
|
||||||
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print '<table class="noborder" width="100%">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
}
|
||||||
|
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
|
|
||||||
|
$sql = "SELECT '" . $langs->trans("TotalExpenseReport") . "' AS label,";
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
|
}
|
||||||
|
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||||
|
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql .= " AND er.fk_statut > 0 ";
|
||||||
|
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
|
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
while ( $row = $db->fetch_row($resql)) {
|
||||||
|
|
||||||
|
|
||||||
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print $db->lasterror(); // Show last sql error
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
}
|
}
|
||||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("TotalExpenseReport") . "' AS label,";
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
|
||||||
}
|
|
||||||
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
|
||||||
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
|
||||||
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
|
||||||
$sql .= " AND er.fk_statut > 0 ";
|
|
||||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
|
||||||
|
|
||||||
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
while ( $row = $db->fetch_row($resql)) {
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->free($resql);
|
|
||||||
} else {
|
|
||||||
print $db->lasterror(); // Show last sql error
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -289,58 +289,56 @@ print "</table>\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||||
print '<br>';
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||||
|
|
||||||
|
print "<br>\n";
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
print "<br>\n";
|
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
print '<table class="noborder" width="100%">';
|
}
|
||||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,";
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
|
}
|
||||||
|
$sql .= " ROUND(SUM(ffd.total_ht),2) as total";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
||||||
|
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql .= " AND ff.fk_statut > 0 ";
|
||||||
|
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
|
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
while ( $row = $db->fetch_row($resql)) {
|
||||||
|
|
||||||
|
|
||||||
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print $db->lasterror(); // Show last sql error
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
}
|
}
|
||||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,";
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
|
||||||
}
|
|
||||||
$sql .= " ROUND(SUM(ffd.total_ht),2) as total";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
|
||||||
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
|
||||||
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
|
||||||
$sql .= " AND ff.fk_statut > 0 ";
|
|
||||||
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
|
||||||
|
|
||||||
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
while ( $row = $db->fetch_row($resql)) {
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->free($resql);
|
|
||||||
} else {
|
|
||||||
print $db->lasterror(); // Show last sql error
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@@ -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);
|
||||||
@@ -375,7 +375,7 @@ if (! empty($moreforfilter))
|
|||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -329,7 +329,10 @@ print load_fiche_titre($langs->trans("BoxesAvailable"));
|
|||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
|
||||||
print '<input type="hidden" name="action" value="add">'."\n";
|
print '<input type="hidden" name="action" value="add">'."\n";
|
||||||
print '<table class="noborder" width="100%">'."\n";
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="tagtable liste centpercent">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="300">'.$langs->trans("Box").'</td>';
|
print '<td width="300">'.$langs->trans("Box").'</td>';
|
||||||
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
||||||
@@ -375,6 +378,8 @@ foreach($boxtoadd as $box)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="right">';
|
print '<div class="right">';
|
||||||
print '<input type="submit" class="button"'.(count($boxtoadd)?'':' disabled').' value="'.$langs->trans("Activate").'">';
|
print '<input type="submit" class="button"'.(count($boxtoadd)?'':' disabled').' value="'.$langs->trans("Activate").'">';
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
@@ -388,7 +393,9 @@ $boxactivated=InfoBox::listBoxes($db,'activated',-1,null);
|
|||||||
print "<br>\n\n";
|
print "<br>\n\n";
|
||||||
print load_fiche_titre($langs->trans("BoxesActivated"));
|
print load_fiche_titre($langs->trans("BoxesActivated"));
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="tagtable liste">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="300">'.$langs->trans("Box").'</td>';
|
print '<td width="300">'.$langs->trans("Box").'</td>';
|
||||||
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
||||||
@@ -441,7 +448,9 @@ foreach($boxactivated as $key => $box)
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table><br>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
// Other parameters
|
// Other parameters
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" id="action" name="action" value="">';
|
print '<input type="hidden" id="action" name="action" value="">';
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Name").'</td>';
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
@@ -297,6 +298,7 @@ if ($result)
|
|||||||
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
@@ -311,6 +313,7 @@ if ($conf->use_javascript_ajax)
|
|||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@@ -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>';
|
||||||
|
|||||||
@@ -104,6 +104,11 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Define $urlwithroot
|
||||||
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||||
|
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||||
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
llxHeader('',$langs->trans("PrintingSetup"));
|
llxHeader('',$langs->trans("PrintingSetup"));
|
||||||
@@ -127,70 +132,179 @@ if ($mode == 'setup' && $user->admin)
|
|||||||
if (in_array($key[0], array_keys($supportedoauth2array))) $supported=1;
|
if (in_array($key[0], array_keys($supportedoauth2array))) $supported=1;
|
||||||
if (! $supported) continue; // show only supported
|
if (! $supported) continue; // show only supported
|
||||||
|
|
||||||
|
|
||||||
|
$OAUTH_SERVICENAME='Unknown';
|
||||||
|
if ($key[0] == 'OAUTH_GITHUB_NAME')
|
||||||
|
{
|
||||||
|
$OAUTH_SERVICENAME='GitHub';
|
||||||
|
$urltorenew=$urlwithroot.'/core/modules/oauth/github_oauthcallback.php?state=user,public_repo&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
$urltodelete=$urlwithroot.'/core/modules/oauth/github_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
$urltocheckperms='https://github.com/settings/applications/';
|
||||||
|
}
|
||||||
|
if ($key[0] == 'OAUTH_GOOGLE_NAME')
|
||||||
|
{
|
||||||
|
$OAUTH_SERVICENAME='Google';
|
||||||
|
$urltorenew=$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?state=userinfo_email,userinfo_profile,cloud_print&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
$urltodelete=$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
$urltocheckperms='https://security.google.com/settings/security/permissions';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show value of token
|
||||||
|
$tokenobj=null;
|
||||||
|
// Token
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
|
||||||
|
// Dolibarr storage
|
||||||
|
$storage = new DoliStorage($db, $conf);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME);
|
||||||
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
|
// Return an error if token not found
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set other properties
|
||||||
|
$refreshtoken=false;
|
||||||
|
$expiredat='';
|
||||||
|
|
||||||
|
$expire = false;
|
||||||
|
// Is token expired or will token expire in the next 30 seconds
|
||||||
|
if (is_object($tokenobj)) {
|
||||||
|
$expire = ($tokenobj->getEndOfLife() !== $tokenobj::EOL_NEVER_EXPIRES && $tokenobj->getEndOfLife() !== $tokenobj::EOL_UNKNOWN && time() > ($tokenobj->getEndOfLife() - 30));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($key[1] != '' && $key[2] != '') {
|
||||||
|
if (is_object($tokenobj)) {
|
||||||
|
$refreshtoken = $tokenobj->getRefreshToken();
|
||||||
|
|
||||||
|
$endoflife = $tokenobj->getEndOfLife();
|
||||||
|
if ($endoflife == $tokenobj::EOL_NEVER_EXPIRES)
|
||||||
|
{
|
||||||
|
$expiredat = $langs->trans("Never");
|
||||||
|
}
|
||||||
|
elseif ($endoflife == $tokenobj::EOL_UNKNOWN)
|
||||||
|
{
|
||||||
|
$expiredat = $langs->trans("Unknown");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$expiredat=dol_print_date($endoflife, "dayhour");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$submit_enabled=0;
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=setup&driver='.$driver.'" autocomplete="off">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=setup&driver='.$driver.'" autocomplete="off">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="setconst">';
|
print '<input type="hidden" name="action" value="setconst">';
|
||||||
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">'."\n";
|
print '<table class="noborder" width="100%">'."\n";
|
||||||
$var=true;
|
|
||||||
|
$var=false;
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th>'.$langs->trans("Parameters").'</th>';
|
print '<th class="titlefieldcreate">'.$langs->trans($key[0]).'</th>';
|
||||||
print '<th>'.$langs->trans("Value").'</th>';
|
print '<th></th>';
|
||||||
print '<th> </th>';
|
print '<th></th>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$submit_enabled=0;
|
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td'.($key['required']?' class=required':'').'>'.$langs->trans($key['varname']).'</td>';
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
print '<td>'.$langs->trans($key['info']).'</td>';
|
//var_dump($key);
|
||||||
|
print $langs->trans("OAuthIDSecret").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $langs->trans("SeePreviousTab");
|
||||||
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($key['varname'] == 'PRINTGCP_TOKEN_ACCESS')
|
|
||||||
{
|
|
||||||
// Delete remote tokens
|
|
||||||
if (! empty($key['delete'])) print '<a class="button" href="'.$key['delete'].'">'.$langs->trans('DeleteAccess').'</a><br><br>';
|
|
||||||
// Request remote token
|
|
||||||
print '<a class="button" href="'.$key['renew'].'">'.$langs->trans('RequestAccess').'</a><br><br>';
|
|
||||||
// Check remote access
|
|
||||||
print $langs->trans("ToCheckDeleteTokenOnProvider", $OAUTH_SERVICENAME_GOOGLE).': <a href="https://security.google.com/settings/security/permissions" target="_google">https://security.google.com/settings/security/permissions</a>';
|
|
||||||
}
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// Show value of token
|
$var = ! $var;
|
||||||
if ($key['varname'] == 'PRINTGCP_TOKEN_ACCESS')
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("IsTokenGenerated");
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
if (is_object($tokenobj)) print $langs->trans("HasAccessToken");
|
||||||
|
else print $langs->trans("NoAccessToken");
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
// Links to delete/checks token
|
||||||
|
if (is_object($tokenobj))
|
||||||
{
|
{
|
||||||
// Token
|
//test on $storage->hasAccessToken($OAUTH_SERVICENAME) ?
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<a class="button" href="'.$urltodelete.'">'.$langs->trans('DeleteAccess').'</a><br><br>';
|
||||||
print '<td>'.$langs->trans("Token").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
// Dolibarr storage
|
|
||||||
$storage = new DoliStorage($db, $conf);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME_GOOGLE);
|
|
||||||
}
|
|
||||||
catch(Exception $e)
|
|
||||||
{
|
|
||||||
// Return an error if token not found
|
|
||||||
}
|
|
||||||
if (is_object($tokenobj))
|
|
||||||
{
|
|
||||||
//var_dump($tokenobj);
|
|
||||||
print $tokenobj->getAccessToken().'<br>';
|
|
||||||
//print 'Refresh: '.$tokenobj->getRefreshToken().'<br>';
|
|
||||||
//print 'EndOfLife: '.$tokenobj->getEndOfLife().'<br>';
|
|
||||||
//var_dump($tokenobj->getExtraParams());
|
|
||||||
/*print '<br>Extra: <br><textarea class="quatrevingtpercent">';
|
|
||||||
print ''.join(',',$tokenobj->getExtraParams());
|
|
||||||
print '</textarea>';*/
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>'."\n";
|
|
||||||
}
|
}
|
||||||
|
// Request remote token
|
||||||
|
print '<a class="button" href="'.$urltorenew.'">'.$langs->trans('RequestAccess').'</a><br><br>';
|
||||||
|
// Check remote access
|
||||||
|
if ($urltocheckperms)
|
||||||
|
{
|
||||||
|
print $langs->trans("ToCheckDeleteTokenOnProvider", $OAUTH_SERVICENAME).': <a href="'.$urltocheckperms.'" target="_'.strtolower($OAUTH_SERVICENAME).'">'.$urltocheckperms.'</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("Token").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
if (is_object($tokenobj))
|
||||||
|
{
|
||||||
|
//var_dump($tokenobj);
|
||||||
|
print $tokenobj->getAccessToken().'<br>';
|
||||||
|
//print 'Refresh: '.$tokenobj->getRefreshToken().'<br>';
|
||||||
|
//print 'EndOfLife: '.$tokenobj->getEndOfLife().'<br>';
|
||||||
|
//var_dump($tokenobj->getExtraParams());
|
||||||
|
/*print '<br>Extra: <br><textarea class="quatrevingtpercent">';
|
||||||
|
print ''.join(',',$tokenobj->getExtraParams());
|
||||||
|
print '</textarea>';*/
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
if (is_object($tokenobj))
|
||||||
|
{
|
||||||
|
// Token refresh
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("TOKEN_REFRESH").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print yn($refreshtoken);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Token expired
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("TOKEN_EXPIRED").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print yn($expire);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Token expired at
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("TOKEN_EXPIRE_AT").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print $expiredat;
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
if (! empty($driver))
|
if (! empty($driver))
|
||||||
@@ -199,7 +313,8 @@ if ($mode == 'setup' && $user->admin)
|
|||||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Modify")).'"></div>';
|
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Modify")).'"></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ dol_fiche_head($head, 'default', $langs->trans("Security"));
|
|||||||
// Show warning about external users
|
// Show warning about external users
|
||||||
print info_admin(showModulesExludedForExternal($modules)).'<br>'."\n";
|
print info_admin(showModulesExludedForExternal($modules)).'<br>'."\n";
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
// Affiche lignes des permissions
|
// Affiche lignes des permissions
|
||||||
@@ -215,8 +215,9 @@ if ($result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@@ -86,12 +86,12 @@ if ($sfurl)
|
|||||||
}
|
}
|
||||||
print ')';
|
print ')';
|
||||||
}
|
}
|
||||||
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>';
|
print ' ('.$langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b>)<br>';
|
||||||
}
|
}
|
||||||
|
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
|
||||||
|
|
||||||
|
|
||||||
print '</ul>';
|
print '</ul>';
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ $tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
|
|||||||
|
|
||||||
// Browser
|
// Browser
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@@ -71,10 +72,10 @@ print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("Screen").'</td><td col
|
|||||||
print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
|
print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ else
|
|||||||
{
|
{
|
||||||
if ($base == 1)
|
if ($base == 1)
|
||||||
{
|
{
|
||||||
print '<table class="noborder">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TableName").'</td>';
|
print '<td>'.$langs->trans("TableName").'</td>';
|
||||||
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
||||||
@@ -134,11 +135,13 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($base == 2)
|
if ($base == 2)
|
||||||
{
|
{
|
||||||
print '<table class="noborder">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TableName").'</td>';
|
print '<td>'.$langs->trans("TableName").'</td>';
|
||||||
print '<td>Nb of tuples</td>';
|
print '<td>Nb of tuples</td>';
|
||||||
@@ -173,12 +176,14 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($base == 4)
|
if ($base == 4)
|
||||||
{
|
{
|
||||||
// Sqlite by PDO or by Sqlite3
|
// Sqlite by PDO or by Sqlite3
|
||||||
print '<table class="noborder">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TableName").'</td>';
|
print '<td>'.$langs->trans("TableName").'</td>';
|
||||||
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
||||||
@@ -207,6 +212,8 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ llxHeader();
|
|||||||
print load_fiche_titre($langs->trans("InfoDatabase"),'','title_setup');
|
print load_fiche_titre($langs->trans("InfoDatabase"),'','title_setup');
|
||||||
|
|
||||||
// Database
|
// Database
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Database").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Database").'</td></tr>'."\n";
|
||||||
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Version").'</td><td>'.$db::LABEL.' '.$db->getVersion().'</td></tr>'."\n";
|
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Version").'</td><td>'.$db::LABEL.' '.$db->getVersion().'</td></tr>'."\n";
|
||||||
@@ -54,14 +55,16 @@ print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Password").'</td><td>'.pr
|
|||||||
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase().'</td></tr>'."\n";
|
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase().'</td></tr>'."\n";
|
||||||
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
|
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
// Tables
|
// Tables
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Tables").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Tables").'</td></tr>'."\n";
|
||||||
print '<tr '.$bc[0].'><td width="300"><a href="'.DOL_URL_ROOT.'/admin/system/database-tables.php?mainmenu=home">'.$langs->trans("List").'</a></td></tr>'."\n";
|
print '<tr '.$bc[0].'><td width="300"><a href="'.DOL_URL_ROOT.'/admin/system/database-tables.php?mainmenu=home">'.$langs->trans("List").'</a></td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
$listofvars=$db->getServerParametersValues();
|
$listofvars=$db->getServerParametersValues();
|
||||||
$listofstatus=$db->getServerStatusValues();
|
$listofstatus=$db->getServerStatusValues();
|
||||||
@@ -76,6 +79,7 @@ else
|
|||||||
foreach($arraylist as $listname)
|
foreach($arraylist as $listname)
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="300">'.$langs->trans("Parameters").'</td>';
|
print '<td width="300">'.$langs->trans("Parameters").'</td>';
|
||||||
@@ -120,6 +124,7 @@ else
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ print load_fiche_titre($title,'','title_setup');
|
|||||||
|
|
||||||
// Version
|
// Version
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@@ -69,10 +70,12 @@ else
|
|||||||
}
|
}
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Session
|
// Session
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@@ -107,6 +110,7 @@ foreach($_SESSION as $key => $val)
|
|||||||
}
|
}
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
@@ -116,6 +120,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
|||||||
$shmoparray=dol_listshmop();
|
$shmoparray=dol_listshmop();
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="titlefield">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
|
print '<td class="titlefield">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
|
||||||
@@ -133,12 +138,14 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Localisation
|
// Localisation
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@@ -234,6 +241,7 @@ if (! empty($conf->global->MAIN_FILESYSTEM_ENCODING)) $tmp=$conf->global->MAIN_F
|
|||||||
print '<tr '.$bc[$var].'><td> => '.$langs->trans("File encoding").'</td><td>'.$tmp.'</td></tr>'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
print '<tr '.$bc[$var].'><td> => '.$langs->trans("File encoding").'</td><td>'.$tmp.'</td></tr>'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
@@ -292,6 +300,7 @@ $configfileparameters=array(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="titlefield">'.$langs->trans("Parameters").' ';
|
print '<td class="titlefield">'.$langs->trans("Parameters").' ';
|
||||||
@@ -353,11 +362,13 @@ foreach($configfileparameters as $key => $value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Parameters in database
|
// Parameters in database
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
|
print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
|
||||||
@@ -407,7 +418,7 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ $xmlremote = GETPOST('xmlremote')?GETPOST('xmlremote'):'https://www.dolibarr.org
|
|||||||
|
|
||||||
// Test if remote test is ok
|
// Test if remote test is ok
|
||||||
$enableremotecheck = True;
|
$enableremotecheck = True;
|
||||||
if (preg_match('/beta|alpha/i', DOL_VERSION)) $enableremotecheck=False;
|
if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=False;
|
||||||
|
$enableremotecheck = true;
|
||||||
|
|
||||||
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
||||||
@@ -101,7 +101,8 @@ else
|
|||||||
print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
|
print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
|
||||||
if ($enableremotecheck)
|
if ($enableremotecheck)
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = '.$xmlremote.'<br>';
|
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = ';
|
||||||
|
print '<input name="xmlremote" class="flat quatrevingtpercent" value="'.$xmlremote.'"><br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -156,19 +157,25 @@ if ($xml)
|
|||||||
$file_list = array();
|
$file_list = array();
|
||||||
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', DOL_DOCUMENT_ROOT, $checksumconcat); // Fill array $file_list
|
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', DOL_DOCUMENT_ROOT, $checksumconcat); // Fill array $file_list
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("FilesMissing"));
|
||||||
|
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>' . $langs->trans("FilesMissing") . '</td>';
|
print '<td>#</td>';
|
||||||
|
print '<td>' . $langs->trans("Filename") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
$var = true;
|
$var = true;
|
||||||
$tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
|
$tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
|
||||||
if (is_array($tmpfilelist) && count($tmpfilelist))
|
if (is_array($tmpfilelist) && count($tmpfilelist))
|
||||||
{
|
{
|
||||||
|
$i = 0;
|
||||||
foreach ($tmpfilelist as $file)
|
foreach ($tmpfilelist as $file)
|
||||||
{
|
{
|
||||||
|
$i++;
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
print '<tr ' . $bc[$var] . '>';
|
print '<tr ' . $bc[$var] . '>';
|
||||||
|
print '<td>'.$i.'</td>' . "\n";
|
||||||
print '<td>'.$file['filename'].'</td>' . "\n";
|
print '<td>'.$file['filename'].'</td>' . "\n";
|
||||||
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@@ -176,15 +183,18 @@ if ($xml)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr ' . $bc[false] . '><td colspan="2" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
print '<tr ' . $bc[false] . '><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("FilesUpdated"));
|
||||||
|
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>' . $langs->trans("FilesUpdated") . '</td>';
|
print '<td>#</td>';
|
||||||
|
print '<td>' . $langs->trans("Filename") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("CurrentChecksum") . '</td>';
|
print '<td align="center">' . $langs->trans("CurrentChecksum") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("Size") . '</td>';
|
print '<td align="right">' . $langs->trans("Size") . '</td>';
|
||||||
@@ -194,10 +204,13 @@ if ($xml)
|
|||||||
$tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename');
|
$tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename');
|
||||||
if (is_array($tmpfilelist2) && count($tmpfilelist2))
|
if (is_array($tmpfilelist2) && count($tmpfilelist2))
|
||||||
{
|
{
|
||||||
|
$i = 0;
|
||||||
foreach ($tmpfilelist2 as $file)
|
foreach ($tmpfilelist2 as $file)
|
||||||
{
|
{
|
||||||
|
$i++;
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
print '<tr ' . $bc[$var] . '>';
|
print '<tr ' . $bc[$var] . '>';
|
||||||
|
print '<td>'.$i.'</td>' . "\n";
|
||||||
print '<td>'.$file['filename'].'</td>' . "\n";
|
print '<td>'.$file['filename'].'</td>' . "\n";
|
||||||
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
||||||
print '<td align="center">'.$file['md5'].'</td>' . "\n";
|
print '<td align="center">'.$file['md5'].'</td>' . "\n";
|
||||||
@@ -241,14 +254,12 @@ if ($xml)
|
|||||||
//var_dump($checksumconcat);
|
//var_dump($checksumconcat);
|
||||||
$checksumget = md5(join(',',$checksumconcat));
|
$checksumget = md5(join(',',$checksumconcat));
|
||||||
$checksumtoget = $xml->dolibarr_htdocs_dir_checksum;
|
$checksumtoget = $xml->dolibarr_htdocs_dir_checksum;
|
||||||
if ($checksumtoget)
|
|
||||||
{
|
print '<br>';
|
||||||
print '<br>';
|
|
||||||
print '<strong>'.$langs->trans("GlobalChecksum").'</strong><br>';
|
print_fiche_titre($langs->trans("GlobalChecksum")).'<br>';
|
||||||
print $langs->trans("ExpectedChecksum").' = '.$checksumtoget.'<br>';
|
print $langs->trans("ExpectedChecksum").' = '. ($checksumtoget ? $checksumtoget : $langs->trans("Unknown")) .'<br>';
|
||||||
print $langs->trans("CurrentChecksum").' = '.$checksumget;
|
print $langs->trans("CurrentChecksum").' = '.$checksumget;
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ foreach($modulesdir as $dir)
|
|||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Modules").'</td>';
|
print '<td>'.$langs->trans("Modules").'</td>';
|
||||||
@@ -148,6 +150,7 @@ foreach($sortorder as $numero=>$name)
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
sort($rights_ids);
|
sort($rights_ids);
|
||||||
$old='';
|
$old='';
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ print '<br>';
|
|||||||
$phparray=phpinfo_array();
|
$phparray=phpinfo_array();
|
||||||
foreach($phparray as $key => $value)
|
foreach($phparray as $key => $value)
|
||||||
{
|
{
|
||||||
//print load_fiche_titre($key);
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
|
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
|
||||||
print '<td width="220px">'.$key.'</td>';
|
print '<td width="220px">'.$key.'</td>';
|
||||||
@@ -114,7 +114,9 @@ foreach($phparray as $key => $value)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table><br>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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')
|
||||||
{
|
{
|
||||||
@@ -204,6 +213,8 @@ if ($result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="liste" width="100%">';
|
print '<table class="liste" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder);
|
||||||
@@ -303,7 +314,10 @@ if ($result)
|
|||||||
if ($usefilter) print '<tr><td colspan="6">'.$langs->trans("NoEventFoundWithCriteria").'</td></tr>';
|
if ($usefilter) print '<tr><td colspan="6">'.$langs->trans("NoEventFoundWithCriteria").'</td></tr>';
|
||||||
else print '<tr><td colspan="6">'.$langs->trans("NoEventOrNoAuditSetup").'</td></tr>';
|
else print '<tr><td colspan="6">'.$langs->trans("NoEventOrNoAuditSetup").'</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table></form>";
|
print "</table>";
|
||||||
|
print "</div>";
|
||||||
|
|
||||||
|
print "</form>";
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ if (GETPOST('msg','alpha')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$urldolibarr='http://www.dolibarr.org/downloads/';
|
$urldolibarr='https://www.dolibarr.org/downloads/';
|
||||||
$urldolibarrmodules='https://www.dolistore.com/';
|
$urldolibarrmodules='https://www.dolistore.com/';
|
||||||
$urldolibarrthemes='https://www.dolistore.com/';
|
$urldolibarrthemes='https://www.dolistore.com/';
|
||||||
$dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT);
|
$dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT);
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/';
|
|||||||
$interfaces = new Interfaces($db);
|
$interfaces = new Interfaces($db);
|
||||||
$triggers = $interfaces->getTriggersList();
|
$triggers = $interfaces->getTriggersList();
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">
|
print '<table class="noborder">
|
||||||
<tr class="liste_titre">
|
<tr class="liste_titre">
|
||||||
<td colspan="2">'.$langs->trans("File").'</td>
|
<td colspan="2">'.$langs->trans("File").'</td>
|
||||||
@@ -78,6 +79,7 @@ foreach ($triggers as $trigger)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class Login
|
|||||||
/**
|
/**
|
||||||
* Login
|
* Login
|
||||||
*
|
*
|
||||||
* Log user with username and password
|
* Log user with username and password. Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass)
|
||||||
*
|
*
|
||||||
* @param string $login Username
|
* @param string $login Username
|
||||||
* @param string $password User password
|
* @param string $password User password
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -366,6 +366,21 @@ if ($id > 0)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Max outstanding bill
|
||||||
|
if ($object->client)
|
||||||
|
{
|
||||||
|
print '<tr class="nowrap">';
|
||||||
|
print '<td>';
|
||||||
|
print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer);
|
||||||
|
print '</td><td>';
|
||||||
|
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
|
||||||
|
print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
|
||||||
|
//if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Multiprice level
|
// Multiprice level
|
||||||
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
{
|
{
|
||||||
@@ -511,23 +526,8 @@ if ($id > 0)
|
|||||||
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id.'">'.$langs->trans("ShowCustomerPreview").'</a></td>';
|
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id.'">'.$langs->trans("ShowCustomerPreview").'</a></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Max outstanding bill
|
|
||||||
if ($object->client)
|
|
||||||
{
|
|
||||||
print '<tr class="impair">';
|
|
||||||
print '<td>';
|
|
||||||
print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer);
|
|
||||||
print '</td><td>';
|
|
||||||
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
|
|
||||||
print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
|
|
||||||
//if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
|
|
||||||
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Outstanding bill
|
// Outstanding bill
|
||||||
print '<tr class="pair">';
|
print '<tr class="impair">';
|
||||||
print '<td>'.$langs->trans("CurrentOutstandingBill").'</td>';
|
print '<td>'.$langs->trans("CurrentOutstandingBill").'</td>';
|
||||||
print '<td>'.price($outstandingBills).$warn.'</td>';
|
print '<td>'.price($outstandingBills).$warn.'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@@ -776,7 +776,9 @@ if ($id > 0)
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="6"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).'</td>';
|
print '<td colspan="6"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).'</td>';
|
||||||
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' <span class="badge">'.$num.'</span></a></td></tr></table></td>';
|
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' <span class="badge">'.$num.'</span></a></td>';
|
||||||
|
//print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/contract/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||||
|
print '</tr></table></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@@ -837,7 +839,9 @@ if ($id > 0)
|
|||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fichinter/list.php?socid='.$object->id.'">'.$langs->trans("AllInterventions").' <span class="badge">'.$num.'</span></td></tr></table></td>';
|
print '<td colspan="3"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fichinter/list.php?socid='.$object->id.'">'.$langs->trans("AllInterventions").' <span class="badge">'.$num.'</span></td>';
|
||||||
|
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/fichinter/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||||
|
print '</tr></table></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
}
|
}
|
||||||
@@ -1007,7 +1011,15 @@ if ($id > 0)
|
|||||||
|
|
||||||
if (! empty($conf->facture->enabled))
|
if (! empty($conf->facture->enabled))
|
||||||
{
|
{
|
||||||
if ($user->rights->facture->creer && $object->status==1)
|
if (empty($user->rights->facture->creer))
|
||||||
|
{
|
||||||
|
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||||
|
}
|
||||||
|
else if ($object->status != 1)
|
||||||
|
{
|
||||||
|
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
@@ -1022,10 +1034,6 @@ if ($id > 0)
|
|||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ print '<table class="noborder" width="100%">';
|
|||||||
print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>';
|
print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>';
|
||||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||||
{
|
{
|
||||||
print '<td align="center" width="20%" colspan="2">'.$annee.'</td>';
|
print '<td align="center" width="20%" colspan="2" class="liste_titre borderrightlight">'.$annee.'</td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ print '<tr class="liste_titre">';
|
|||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||||
{
|
{
|
||||||
print '<td align="right">'.$langs->trans("Debit").'</td><td align="right">'.$langs->trans("Credit").'</td>';
|
print '<td class="liste_titre" align="center">'.$langs->trans("Debit").'</td><td class="liste_titre" align="center">'.$langs->trans("Credit").'</td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
|
|||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print '<td align="right" width="10%"> ';
|
print '<td align="right" class="borderrightlight" width="10%"> ';
|
||||||
if ($encaiss[$case]>0)
|
if ($encaiss[$case]>0)
|
||||||
{
|
{
|
||||||
print price($encaiss[$case]);
|
print price($encaiss[$case]);
|
||||||
|
|||||||
@@ -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))
|
||||||
{
|
{
|
||||||
@@ -620,7 +621,7 @@ if ($resql)
|
|||||||
$last_ok=1;
|
$last_ok=1;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
$liste='<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?account='.$acct->id.'&num='.$objr->num_releve.'">'.$objr->num_releve.'</a> '.$liste;
|
$liste='<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?account='.$id.'&num='.$objr->num_releve.'">'.$objr->num_releve.'</a> '.$liste;
|
||||||
}
|
}
|
||||||
if ($numr >= $nbmax) $liste="... ".$liste;
|
if ($numr >= $nbmax) $liste="... ".$liste;
|
||||||
print $liste;
|
print $liste;
|
||||||
@@ -1207,7 +1208,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
if ($objp->rappro) // If line not conciliated and account can be conciliated
|
if ($objp->rappro) // If line not conciliated and account can be conciliated
|
||||||
{
|
{
|
||||||
print '<a href="releve.php?num='.$objp->num_releve.'&account='.$object->id.'">'.$objp->num_releve.'</a>';
|
print '<a href="releve.php?num='.$objp->num_releve.'&account='.$objp->bankid.'">'.$objp->num_releve.'</a>';
|
||||||
}
|
}
|
||||||
else if ($action == 'reconcile')
|
else if ($action == 'reconcile')
|
||||||
{
|
{
|
||||||
@@ -1223,7 +1224,7 @@ if ($resql)
|
|||||||
// Transaction reconciliated or edit link
|
// Transaction reconciliated or edit link
|
||||||
if ($objp->rappro && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
|
if ($objp->rappro && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$object->id.'&page='.$page.'">';
|
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$objp->bankid.'&page='.$page.'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
@@ -1231,13 +1232,13 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$object->id.'&page='.$page.'">';
|
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$objp->bankid.'&page='.$page.'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$object->id.'&page='.$page.'">';
|
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$objp->bankid.'&page='.$page.'">';
|
||||||
print img_view();
|
print img_view();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
@@ -1251,7 +1252,7 @@ if ($resql)
|
|||||||
print ' ';
|
print ' ';
|
||||||
if ($user->rights->banque->modifier)
|
if ($user->rights->banque->modifier)
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete&rowid='.$objp->rowid.'&id='.$object->id.'&page='.$page.'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete&rowid='.$objp->rowid.'&id='.$objp->bankid.'&page='.$page.'">';
|
||||||
print img_delete();
|
print img_delete();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -81,59 +81,13 @@ if ($id)
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Envoi fichier
|
if ($object->id > 0)
|
||||||
if ($_POST["sendit"] && !empty($conf->global->MAIN_UPLOAD_DOC)) {
|
{
|
||||||
if ($object->fetch($id)) {
|
$object->fetch_thirdparty();
|
||||||
|
$upload_dir = $conf->bank->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||||
$upload_dir = $conf->bank->dir_output . "/" . $object->ref;
|
|
||||||
|
|
||||||
if (dol_mkdir($upload_dir) >= 0) {
|
|
||||||
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'],
|
|
||||||
$upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),
|
|
||||||
0, 0, $_FILES['userfile']['error']);
|
|
||||||
if (is_numeric($resupload) && $resupload > 0) {
|
|
||||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
|
||||||
{
|
|
||||||
// Create thumbs
|
|
||||||
$object->addThumbs($upload_dir . "/" . $_FILES['userfile']['name']);
|
|
||||||
}
|
|
||||||
$mesg = '<div class="ok">' . $langs->trans("FileTransferComplete") . '</div>';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$langs->load("errors");
|
|
||||||
if ($resupload < 0) { // Unknown error
|
|
||||||
$mesg = '<div class="error">' . $langs->trans("ErrorFileNotUploaded") . '</div>';
|
|
||||||
}
|
|
||||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',
|
|
||||||
$resupload)) { // Files infected by a virus
|
|
||||||
$mesg = '<div class="error">' . $langs->trans("ErrorFileIsInfectedWithAVirus") . '</div>';
|
|
||||||
}
|
|
||||||
else { // Known error
|
|
||||||
$mesg = '<div class="error">' . $langs->trans($resupload) . '</div>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete
|
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
|
||||||
else if ($action == 'confirm_deletefile' && $confirm == 'yes') {
|
|
||||||
if ($object->fetch($id)) {
|
|
||||||
|
|
||||||
$upload_dir = $conf->bank->dir_output;
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
|
|
||||||
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
|
||||||
if ($ret) {
|
|
||||||
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
|
||||||
} else {
|
|
||||||
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
|
||||||
}
|
|
||||||
|
|
||||||
Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -182,30 +136,12 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
dol_htmloutput_mesg($mesg, $mesgs);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
$modulepart = 'bank';
|
||||||
* Confirmation suppression fichier
|
$permission = $user->rights->banque->modifier;
|
||||||
*/
|
$permtoedit = $user->rights->banque->modifier;
|
||||||
if ($action == 'delete') {
|
|
||||||
$ret = $form->form_confirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode($_GET["urlfile"]),
|
|
||||||
$langs->trans('DeleteFile'),
|
|
||||||
$langs->trans('ConfirmDeleteFile'), 'confirm_deletefile',
|
|
||||||
'', 0, 1);
|
|
||||||
if ($ret == 'html')
|
|
||||||
print '<br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Affiche formulaire upload
|
|
||||||
$formfile = new FormFile($db);
|
|
||||||
$formfile->form_attach_new_file(DOL_URL_ROOT . '/compta/bank/document.php?id=' . $object->id,
|
|
||||||
'', 0, 0, $user->rights->banque, 50, $object);
|
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$param = '&id=' . $object->id;
|
$param = '&id=' . $object->id;
|
||||||
$formfile->list_of_documents($filearray, $object, 'bank', $param);
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
|
|||||||
@@ -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']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -299,6 +299,7 @@ else
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td align="center">'.$langs->trans("DateOperationShort").'</td>';
|
print '<td align="center">'.$langs->trans("DateOperationShort").'</td>';
|
||||||
@@ -348,8 +349,10 @@ else
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
// Ligne Solde debut releve
|
// Ligne Solde debut releve
|
||||||
print "<tr ".$bc[$var]."><td colspan=\"4\"><a href=\"releve.php?num=$num&ve=1&rel=$rel&account=".$object->id."\"> </a></td>";
|
print "<tr ".$bc[$var]."><td colspan=\"3\"></td>";
|
||||||
print "<td align=\"right\" colspan=\"2\"><b>".$langs->trans("InitialBankBalance")." :</b></td><td align=\"right\"><b>".price($total)."</b></td><td> </td></tr>\n";
|
print "<td colspan=\"3\"><b>".$langs->trans("InitialBankBalance")." :</b></td>";
|
||||||
|
print '<td align="right"><b>'.price($total).'</b></td><td> </td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
while ($i < $numrows)
|
while ($i < $numrows)
|
||||||
{
|
{
|
||||||
@@ -552,8 +555,13 @@ else
|
|||||||
print "\n".'<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("Total")." :</td><td align=\"right\">".price($totald)."</td><td align=\"right\">".price($totalc)."</td><td> </td><td> </td></tr>";
|
print "\n".'<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("Total")." :</td><td align=\"right\">".price($totald)."</td><td align=\"right\">".price($totalc)."</td><td> </td><td> </td></tr>";
|
||||||
|
|
||||||
// Line Balance
|
// Line Balance
|
||||||
print "\n<tr><td align=\"right\" colspan=\"4\"> </td><td align=\"right\" colspan=\"2\"><b>".$langs->trans("EndBankBalance")." :</b></td><td align=\"right\"><b>".price($total)."</b></td><td> </td></tr>\n";
|
print "\n<tr><td align=\"right\" colspan=\"3\"> </td><td colspan=\"3\"><b>".$langs->trans("EndBankBalance")." :</b></td>";
|
||||||
print "</table></form>\n";
|
print "<td align=\"right\"><b>".price($total)."</b></td><td> </td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
print "</table>";
|
||||||
|
print "</div>";
|
||||||
|
|
||||||
|
print "</form>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -93,15 +93,14 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
$head=bank_prepare_head($object);
|
$head=bank_prepare_head($object);
|
||||||
dol_fiche_head($head,'cash',$langs->trans("FinancialAccount"),0,'account');
|
dol_fiche_head($head,'cash',$langs->trans("FinancialAccount"),0,'account');
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
$solde = $object->solde(0);
|
$solde = $object->solde(0);
|
||||||
|
|
||||||
// Show next coming entries
|
// Show next coming entries
|
||||||
|
|||||||
@@ -3736,6 +3736,8 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
else // Credit note
|
else // Credit note
|
||||||
{
|
{
|
||||||
|
$cssforamountpaymentcomplete='';
|
||||||
|
|
||||||
// Total already paid back
|
// Total already paid back
|
||||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||||
print $langs->trans('AlreadyPaidBack');
|
print $langs->trans('AlreadyPaidBack');
|
||||||
@@ -3751,7 +3753,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
else
|
else
|
||||||
print $langs->trans('ExcessPaydBack');
|
print $langs->trans('ExcessPaydBack');
|
||||||
print ' :</td>';
|
print ' :</td>';
|
||||||
print '<td align="right" bgcolor="#f0f0f0"><b>' . price($sign * $resteapayeraffiche) . '</b></td>';
|
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopayback"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>';
|
||||||
print '<td class="nowrap"> </td></tr>';
|
print '<td class="nowrap"> </td></tr>';
|
||||||
|
|
||||||
// Sold credit note
|
// Sold credit note
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -813,7 +813,7 @@ class BonPrelevement extends CommonObject
|
|||||||
dol_syslog(__METHOD__."::Read invoices error ".$this->db->error(), LOG_ERR);
|
dol_syslog(__METHOD__."::Read invoices error ".$this->db->error(), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
|
||||||
@@ -834,7 +834,7 @@ class BonPrelevement extends CommonObject
|
|||||||
{
|
{
|
||||||
$bac = new CompanyBankAccount($this->db);
|
$bac = new CompanyBankAccount($this->db);
|
||||||
$bac->fetch(0,$soc->id);
|
$bac->fetch(0,$soc->id);
|
||||||
|
|
||||||
if ($bac->verif() >= 1)
|
if ($bac->verif() >= 1)
|
||||||
//if (true)
|
//if (true)
|
||||||
{
|
{
|
||||||
@@ -867,7 +867,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ok=0;
|
$ok=0;
|
||||||
|
|
||||||
// Withdraw invoices in factures_prev array
|
// Withdraw invoices in factures_prev array
|
||||||
$out=count($factures_prev)." invoices will be withdrawn.";
|
$out=count($factures_prev)." invoices will be withdrawn.";
|
||||||
//print $out."\n";
|
//print $out."\n";
|
||||||
@@ -1272,7 +1272,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* section Debiteur (sepa Debiteurs bloc lines)
|
* section Debiteur (sepa Debiteurs bloc lines)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$tmp_invoices = array();
|
/*$tmp_invoices = array();
|
||||||
|
|
||||||
$sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_country as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1";
|
$sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_country as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1";
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
@@ -1280,9 +1280,7 @@ class BonPrelevement extends CommonObject
|
|||||||
while ($objfac = $this->db->fetch_object($resql)) {
|
while ($objfac = $this->db->fetch_object($resql)) {
|
||||||
$tmp_invoices[] = $objfac->fac;
|
$tmp_invoices[] = $objfac->fac;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
$ListOfFactures = implode($tmp_invoices);
|
|
||||||
|
|
||||||
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,";
|
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,";
|
||||||
$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
|
$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
|
||||||
@@ -1310,7 +1308,7 @@ class BonPrelevement extends CommonObject
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum);
|
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum);
|
||||||
$this->total = $this->total + $obj->somme;
|
$this->total = $this->total + $obj->somme;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ if ($action == 'create')
|
|||||||
$mesg='';
|
$mesg='';
|
||||||
$mesg=$langs->trans("NoInvoiceCouldBeWithdrawed");
|
$mesg=$langs->trans("NoInvoiceCouldBeWithdrawed");
|
||||||
setEventMessages($mesg, null, 'errors');
|
setEventMessages($mesg, null, 'errors');
|
||||||
|
$mesg.='<br>'."\n";
|
||||||
foreach($bprev->invoice_in_error as $key => $val)
|
foreach($bprev->invoice_in_error as $key => $val)
|
||||||
{
|
{
|
||||||
$mesg.=$val."<br>\n";
|
$mesg.=$val."<br>\n";
|
||||||
|
|||||||
@@ -521,9 +521,6 @@ if ($id > 0)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status
|
|
||||||
//print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4, $totalpaye).'</td></tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@@ -548,6 +545,8 @@ if ($id > 0)
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
$totalpaye = 0;
|
||||||
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0; $total = 0;
|
$i = 0; $total = 0;
|
||||||
print '<table class="noborder paymenttable">';
|
print '<table class="noborder paymenttable">';
|
||||||
@@ -582,8 +581,8 @@ if ($id > 0)
|
|||||||
print '<tr '.$bc[$var].'><td colspan="'.$nbcols.'" class="opacitymedium">'.$langs->trans("None").'</td><td></td><td></td><td></td></tr>';
|
print '<tr '.$bc[$var].'><td colspan="'.$nbcols.'" class="opacitymedium">'.$langs->trans("None").'</td><td></td><td></td><td></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->paye == 0)
|
//if ($object->status == ChargeSociales::STATUS_DRAFT)
|
||||||
{
|
//{
|
||||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\">".price($totalpaye)."</td></tr>\n";
|
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\">".price($totalpaye)."</td></tr>\n";
|
||||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\">".price($object->amount)."</td></tr>\n";
|
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\">".price($object->amount)."</td></tr>\n";
|
||||||
|
|
||||||
@@ -592,7 +591,7 @@ if ($id > 0)
|
|||||||
|
|
||||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
|
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
|
||||||
print '<td align="right"'.($resteapayer?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>'.price($resteapayer)."</td></tr>\n";
|
print '<td align="right"'.($resteapayer?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>'.price($resteapayer)."</td></tr>\n";
|
||||||
}
|
//}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -693,8 +693,8 @@ class Contrat extends CommonObject
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$line->fetch_optionals($line->id,$extralabelsline);
|
$line->fetch_optionals($line->id,$extralabelsline);
|
||||||
|
|
||||||
$this->lines[] = $line;
|
$this->lines[$i] = $line;
|
||||||
$this->lines_id_index_mapper[$line->id] = key($this->lines);
|
$this->lines_id_index_mapper[$line->id] = $i;
|
||||||
|
|
||||||
//dol_syslog("1 ".$line->desc);
|
//dol_syslog("1 ".$line->desc);
|
||||||
//dol_syslog("2 ".$line->product_desc);
|
//dol_syslog("2 ".$line->product_desc);
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -337,24 +337,27 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialisation of datas
|
// Initialisation of datas
|
||||||
$object->socid = $sendtosocid; // To link to a company
|
if (is_object($object))
|
||||||
$object->sendtoid = $sendtoid; // To link to a contact/address
|
{
|
||||||
$object->actiontypecode = $actiontypecode;
|
$object->socid = $sendtosocid; // To link to a company
|
||||||
$object->actionmsg = $actionmsg; // Long text
|
$object->sendtoid = $sendtoid; // To link to a contact/address
|
||||||
$object->actionmsg2 = $actionmsg2; // Short text
|
$object->actiontypecode = $actiontypecode;
|
||||||
$object->trackid = $trackid;
|
$object->actionmsg = $actionmsg; // Long text
|
||||||
$object->fk_element = $object->id;
|
$object->actionmsg2 = $actionmsg2; // Short text
|
||||||
$object->elementtype = $object->element;
|
$object->trackid = $trackid;
|
||||||
|
$object->fk_element = $object->id;
|
||||||
// Call of triggers
|
$object->elementtype = $object->element;
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
|
||||||
$interface=new Interfaces($db);
|
// Call of triggers
|
||||||
$result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf);
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
if ($result < 0) {
|
$interface=new Interfaces($db);
|
||||||
$error++; $errors=$interface->errors;
|
$result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++; $errors=$interface->errors;
|
||||||
|
}
|
||||||
|
// End call of triggers
|
||||||
}
|
}
|
||||||
// End call of triggers
|
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
* @param int $status Id status
|
* @param int $status Id status
|
||||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto
|
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto
|
||||||
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
||||||
* @param int $type Type facture
|
* @param int $type Type invoice
|
||||||
* @return string Libelle du statut
|
* @return string Libelle du statut
|
||||||
*/
|
*/
|
||||||
function LibStatut($paye,$status,$mode=0,$alreadypaid=-1,$type=0)
|
function LibStatut($paye,$status,$mode=0,$alreadypaid=-1,$type=0)
|
||||||
@@ -255,8 +255,8 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($type == 2) return $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted');
|
if ($type == 2) return $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted'); // credit note
|
||||||
elseif ($type == 3) return $langs->trans('Bill'.$prefix.'StatusConverted');
|
elseif ($type == 3) return $langs->trans('Bill'.$prefix.'StatusConverted'); // deposit invoice
|
||||||
else return $langs->trans('Bill'.$prefix.'StatusPaid');
|
else return $langs->trans('Bill'.$prefix.'StatusPaid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -340,7 +340,11 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
if ($status == 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusDraft').' </span>'.img_picto($langs->trans('BillStatusDraft'),'statut0');
|
if ($status == 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusDraft').' </span>'.img_picto($langs->trans('BillStatusDraft'),'statut0');
|
||||||
if (($status == 3 || $status == 2) && $alreadypaid <= 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusCanceled').' </span>'.img_picto($langs->trans('BillStatusCanceled'),'statut5');
|
if (($status == 3 || $status == 2) && $alreadypaid <= 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusCanceled').' </span>'.img_picto($langs->trans('BillStatusCanceled'),'statut5');
|
||||||
if (($status == 3 || $status == 2) && $alreadypaid > 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' </span>'.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7');
|
if (($status == 3 || $status == 2) && $alreadypaid > 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' </span>'.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7');
|
||||||
if ($alreadypaid <= 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusNotPaid').' </span>'.img_picto($langs->trans('BillStatusNotPaid'),'statut1');
|
if ($alreadypaid <= 0)
|
||||||
|
{
|
||||||
|
if ($type == 2) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusNotRefunded').' </span>'.img_picto($langs->trans('StatusNotRefunded'),'statut1');
|
||||||
|
return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusNotPaid').' </span>'.img_picto($langs->trans('BillStatusNotPaid'),'statut1');
|
||||||
|
}
|
||||||
return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusStarted').' </span>'.img_picto($langs->trans('BillStatusStarted'),'statut3');
|
return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusStarted').' </span>'.img_picto($langs->trans('BillStatusStarted'),'statut3');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -2445,9 +2445,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)
|
||||||
@@ -2553,9 +2554,9 @@ abstract class CommonObject
|
|||||||
|
|
||||||
if (! empty($this->linkedObjectsIds))
|
if (! empty($this->linkedObjectsIds))
|
||||||
{
|
{
|
||||||
foreach($this->linkedObjectsIds as $objecttype => $objectids)
|
foreach($this->linkedObjectsIds as $objecttype => $objectids) // $objecttype is a module name ('facture', 'mymodule', ...) or a module name with a suffix ('project_task', 'mymodule_myobj', ...)
|
||||||
{
|
{
|
||||||
// Parse element/subelement (ex: project_task)
|
// Parse element/subelement (ex: project_task, cabinetmed_consultation, ...)
|
||||||
$module = $element = $subelement = $objecttype;
|
$module = $element = $subelement = $objecttype;
|
||||||
if ($objecttype != 'supplier_proposal' && $objecttype != 'order_supplier' && $objecttype != 'invoice_supplier'
|
if ($objecttype != 'supplier_proposal' && $objecttype != 'order_supplier' && $objecttype != 'invoice_supplier'
|
||||||
&& preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs))
|
&& preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs))
|
||||||
@@ -2620,7 +2621,7 @@ abstract class CommonObject
|
|||||||
if ($conf->$module->enabled && (($element != $this->element) || $alsosametype))
|
if ($conf->$module->enabled && (($element != $this->element) || $alsosametype))
|
||||||
{
|
{
|
||||||
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
|
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
|
||||||
//print '/'.$classpath.'/'.$classfile.'.class.php';
|
//print '/'.$classpath.'/'.$classfile.'.class.php '.class_exists($classname);
|
||||||
if (class_exists($classname))
|
if (class_exists($classname))
|
||||||
{
|
{
|
||||||
foreach($objectids as $i => $objectid) // $i is rowid into llx_element_element
|
foreach($objectids as $i => $objectid) // $i is rowid into llx_element_element
|
||||||
@@ -3016,9 +3017,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
|
||||||
@@ -3033,8 +3041,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;
|
||||||
@@ -3043,7 +3054,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);
|
||||||
|
|||||||
@@ -771,7 +771,7 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
elseif ($type == 'varchar')
|
elseif ($type == 'varchar')
|
||||||
{
|
{
|
||||||
$out='<input type="text" class="flat '.$showsize.' maxwidthonsmartphone" name="'.$keysuffix.'options_'.$key.$keyprefix.'" maxlength="'.$size.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
|
$out='<input type="text" class="flat '.$showsize.' maxwidthonsmartphone" name="'.$keysuffix.'options_'.$key.$keyprefix.'" maxlength="'.$size.'" value="'.dol_escape_htmltag($value).'"'.($moreparam?$moreparam:'').'>';
|
||||||
}
|
}
|
||||||
elseif (in_array($type, array('mail', 'phone', 'url')))
|
elseif (in_array($type, array('mail', 'phone', 'url')))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class HookManager
|
|||||||
* @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 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 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 and set into ->resArray.
|
||||||
* All types can also return some values into an array ->results.
|
* All types can also return some values into an array ->results that will be finaly merged into this->resArray for caller.
|
||||||
* $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.
|
||||||
*/
|
*/
|
||||||
function executeHooks($method, $parameters=false, &$object='', &$action='')
|
function executeHooks($method, $parameters=false, &$object='', &$action='')
|
||||||
@@ -172,11 +172,11 @@ class HookManager
|
|||||||
'printObjectSubLine',
|
'printObjectSubLine',
|
||||||
'createDictionaryFieldList',
|
'createDictionaryFieldList',
|
||||||
'editDictionaryFieldlist',
|
'editDictionaryFieldlist',
|
||||||
'getFormMail'
|
'getFormMail',
|
||||||
|
'showLinkToObjectBlock'
|
||||||
)
|
)
|
||||||
)) $hooktype='addreplace';
|
)) $hooktype='addreplace';
|
||||||
// Deprecated hook types ('returnvalue')
|
|
||||||
//if (preg_match('/^pdf_/',$method) && $method != 'pdf_writelinedesc') $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are 'returnvalue' hooks. When there is 2 hooks of this type, only last one win. TODO Move them into 'output' or 'addreplace' hooks.
|
|
||||||
if ($method == 'insertExtraFields')
|
if ($method == 'insertExtraFields')
|
||||||
{
|
{
|
||||||
$hooktype='returnvalue'; // deprecated. TODO Remove all code with "executeHooks('insertExtraFields'" as soon as there is a trigger available.
|
$hooktype='returnvalue'; // deprecated. TODO Remove all code with "executeHooks('insertExtraFields'" as soon as there is a trigger available.
|
||||||
|
|||||||
@@ -5391,6 +5391,7 @@ class Form
|
|||||||
global $noMoreLinkedObjectBlockAfter;
|
global $noMoreLinkedObjectBlockAfter;
|
||||||
$noMoreLinkedObjectBlockAfter=1;
|
$noMoreLinkedObjectBlockAfter=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$res=@include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
|
$res=@include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
|
||||||
if ($res)
|
if ($res)
|
||||||
{
|
{
|
||||||
@@ -5439,7 +5440,27 @@ class Form
|
|||||||
'order_supplier'=>array('enabled'=>$conf->fournisseur->commande->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
|
'order_supplier'=>array('enabled'=>$conf->fournisseur->commande->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
|
||||||
'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id)
|
'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
global $action;
|
||||||
|
|
||||||
|
// Can complet the possiblelink array
|
||||||
|
$hookmanager->initHooks(array('commonobject'));
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('showLinkToObjectBlock',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
|
if (is_array($hookmanager->resArray) && count($hookmanager->resArray))
|
||||||
|
{
|
||||||
|
$possiblelinks=array_merge($possiblelinks, $hookmanager->resArray);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ($reshook > 0)
|
||||||
|
{
|
||||||
|
if (is_array($hookmanager->resArray) && count($hookmanager->resArray))
|
||||||
|
{
|
||||||
|
$possiblelinks=$hookmanager->resArray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach($possiblelinks as $key => $possiblelink)
|
foreach($possiblelinks as $key => $possiblelink)
|
||||||
{
|
{
|
||||||
@@ -5451,6 +5472,7 @@ class Form
|
|||||||
{
|
{
|
||||||
print '<div id="'.$key.'list"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>';
|
print '<div id="'.$key.'list"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>';
|
||||||
$sql = $possiblelink['sql'];
|
$sql = $possiblelink['sql'];
|
||||||
|
|
||||||
$resqllist = $this->db->query($sql);
|
$resqllist = $this->db->query($sql);
|
||||||
if ($resqllist)
|
if ($resqllist)
|
||||||
{
|
{
|
||||||
@@ -5466,7 +5488,7 @@ class Form
|
|||||||
print '<td class="nowrap"></td>';
|
print '<td class="nowrap"></td>';
|
||||||
print '<td align="center">' . $langs->trans("Ref") . '</td>';
|
print '<td align="center">' . $langs->trans("Ref") . '</td>';
|
||||||
print '<td align="left">' . $langs->trans("RefCustomer") . '</td>';
|
print '<td align="left">' . $langs->trans("RefCustomer") . '</td>';
|
||||||
print '<td align="left">' . $langs->trans("AmountHTShort") . '</td>';
|
print '<td align="right">' . $langs->trans("AmountHTShort") . '</td>';
|
||||||
print '<td align="left">' . $langs->trans("Company") . '</td>';
|
print '<td align="left">' . $langs->trans("Company") . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
@@ -5480,7 +5502,7 @@ class Form
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center">' . $objp->ref . '</td>';
|
print '<td align="center">' . $objp->ref . '</td>';
|
||||||
print '<td>' . $objp->ref_client . '</td>';
|
print '<td>' . $objp->ref_client . '</td>';
|
||||||
print '<td>' . price($objp->total_ht) . '</td>';
|
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||||
print '<td>' . $objp->name . '</td>';
|
print '<td>' . $objp->name . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
@@ -5658,10 +5680,15 @@ class Form
|
|||||||
//print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
|
//print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
|
||||||
$object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid,$nodbprefix);
|
$object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid,$nodbprefix);
|
||||||
|
|
||||||
//$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):' ').'</a>':'';
|
$navurl = $_SERVER["PHP_SELF"];
|
||||||
//$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):' ').'</a>':'';
|
// Special case for project/task page
|
||||||
$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(($conf->dol_use_jmobile != 4)?'<':' ').'</a>':'<span class="inactive">'.(($conf->dol_use_jmobile != 4)?'<':' ').'</span>';
|
if ($paramid == 'project_ref')
|
||||||
$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(($conf->dol_use_jmobile != 4)?'>':' ').'</a>':'<span class="inactive">'.(($conf->dol_use_jmobile != 4)?'>':' ').'</span>';
|
{
|
||||||
|
$navurl = preg_replace('/\/tasks\/(task|contact|time|note|document).php/','/tasks.php',$navurl);
|
||||||
|
$paramid='ref';
|
||||||
|
}
|
||||||
|
$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(($conf->dol_use_jmobile != 4)?'<':' ').'</a>':'<span class="inactive">'.(($conf->dol_use_jmobile != 4)?'<':' ').'</span>';
|
||||||
|
$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(($conf->dol_use_jmobile != 4)?'>':' ').'</a>':'<span class="inactive">'.(($conf->dol_use_jmobile != 4)?'>':' ').'</span>';
|
||||||
|
|
||||||
//print "xx".$previous_ref."x".$next_ref;
|
//print "xx".$previous_ref."x".$next_ref;
|
||||||
$ret.='<!-- Start banner content --><div style="vertical-align: middle">';
|
$ret.='<!-- Start banner content --><div style="vertical-align: middle">';
|
||||||
@@ -5876,7 +5903,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))
|
||||||
{
|
{
|
||||||
@@ -1018,10 +1018,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 ' ';
|
||||||
|
|||||||
@@ -294,8 +294,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 +321,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 +356,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,8 +437,6 @@ 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";
|
||||||
@@ -535,7 +524,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 +613,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";
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|||||||
@@ -29,17 +29,16 @@
|
|||||||
*/
|
*/
|
||||||
class Translate
|
class Translate
|
||||||
{
|
{
|
||||||
var $dir; // Directories that contains /langs subdirectory
|
public $dir; // Directories that contains /langs subdirectory
|
||||||
|
|
||||||
var $defaultlang; // Current language for current user
|
public $defaultlang; // Current language for current user
|
||||||
var $direction = 'ltr'; // Left to right or Right to left
|
public $charset_output='UTF-8'; // Codage used by "trans" method outputs
|
||||||
var $charset_output='UTF-8'; // Codage used by "trans" method outputs
|
|
||||||
|
|
||||||
var $tab_translate=array(); // Array of all translations key=>value
|
public $tab_translate=array(); // Array of all translations key=>value
|
||||||
private $_tab_loaded=array(); // Array to store result after loading each language file
|
private $_tab_loaded=array(); // Array to store result after loading each language file
|
||||||
|
|
||||||
var $cache_labels=array(); // Cache for labels return by getLabelFromKey method
|
public $cache_labels=array(); // Cache for labels return by getLabelFromKey method
|
||||||
var $cache_currencies=array(); // Cache to store currency symbols
|
public $cache_currencies=array(); // Cache to store currency symbols
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
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);
|
||||||
|
|||||||
@@ -92,14 +92,16 @@ function dol_print_cron_urls()
|
|||||||
//$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
|
||||||
|
|
||||||
// Cron launch
|
// Cron launch
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<u>'.$langs->trans("URLToLaunchCronJobs").':</u><br>';
|
print '<u>'.$langs->trans("URLToLaunchCronJobs").':</u><br>';
|
||||||
$url=$urlwithroot.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login;
|
$url=$urlwithroot.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login;
|
||||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
print ' '.$langs->trans("OrToLaunchASpecificJob").'<br>';
|
print ' '.$langs->trans("OrToLaunchASpecificJob").'<br>';
|
||||||
$url=$urlwithroot.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid';
|
$url=$urlwithroot.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid';
|
||||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
print '<br>';
|
print '</div>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
$logintouse = 'firstadmin';
|
$logintouse = 'firstadmin';
|
||||||
if ($user->admin) $logintouse = $user->login;
|
if ($user->admin) $logintouse = $user->login;
|
||||||
|
|
||||||
@@ -110,21 +112,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,11 +171,11 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
|
|||||||
|
|
||||||
if ($format == 'all' || $format == 'allwithouthour' || $format == 'allhour' || $format == 'allhourmin')
|
if ($format == 'all' || $format == 'allwithouthour' || $format == 'allhour' || $format == 'allhourmin')
|
||||||
{
|
{
|
||||||
if ($iSecond === 0) return '0'; // This is to avoid having 0 return a 12:00 AM for en_US
|
if ((int) $iSecond === 0) return '0'; // This is to avoid having 0 return a 12:00 AM for en_US
|
||||||
|
|
||||||
$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')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1091,21 +1091,19 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
|||||||
|
|
||||||
}
|
}
|
||||||
} elseif ($link) {
|
} elseif ($link) {
|
||||||
if (dol_mkdir($upload_dir) >= 0) {
|
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
|
$linkObject = new Link($db);
|
||||||
$linkObject = new Link($db);
|
$linkObject->entity = $conf->entity;
|
||||||
$linkObject->entity = $conf->entity;
|
$linkObject->url = $link;
|
||||||
$linkObject->url = $link;
|
$linkObject->objecttype = GETPOST('objecttype', 'alpha');
|
||||||
$linkObject->objecttype = GETPOST('objecttype', 'alpha');
|
$linkObject->objectid = GETPOST('objectid', 'int');
|
||||||
$linkObject->objectid = GETPOST('objectid', 'int');
|
$linkObject->label = GETPOST('label', 'alpha');
|
||||||
$linkObject->label = GETPOST('label', 'alpha');
|
$res = $linkObject->create($user);
|
||||||
$res = $linkObject->create($user);
|
$langs->load('link');
|
||||||
$langs->load('link');
|
if ($res > 0) {
|
||||||
if ($res > 0) {
|
setEventMessages($langs->trans("LinkComplete"), null, 'mesgs');
|
||||||
setEventMessages($langs->trans("LinkComplete"), null, 'mesgs');
|
} else {
|
||||||
} else {
|
setEventMessages($langs->trans("ErrorFileNotLinked"), null, 'errors');
|
||||||
setEventMessages($langs->trans("ErrorFileNotLinked"), null, 'errors');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -967,7 +967,7 @@ function dol_get_fiche_end($notab=0)
|
|||||||
* @param int $nodbprefix Do not include DB prefix to forge table name
|
* @param int $nodbprefix Do not include DB prefix to forge table name
|
||||||
* @param string $morehtmlleft More html code to show before ref
|
* @param string $morehtmlleft More html code to show before ref
|
||||||
* @param string $morehtmlstatus More html code to show under navigation arrows
|
* @param string $morehtmlstatus More html code to show under navigation arrows
|
||||||
* @param int $onlybanner Put this to 1, if the card will contains only a banner
|
* @param int $onlybanner Put this to 1, if the card will contains only a banner (add css 'arearefnobottom' on div)
|
||||||
* @param string $morehtmlright More html code to show before navigation arrows
|
* @param string $morehtmlright More html code to show before navigation arrows
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@@ -2504,7 +2504,7 @@ function img_edit($titlealt = 'default', $float = 0, $other = '')
|
|||||||
|
|
||||||
if ($titlealt == 'default') $titlealt = $langs->trans('Modify');
|
if ($titlealt == 'default') $titlealt = $langs->trans('Modify');
|
||||||
|
|
||||||
return img_picto($titlealt, 'edit.png', ($float ? 'style="float: right"' : $other));
|
return img_picto($titlealt, 'edit.png', ($float ? 'style="float: '.($langs->tab_translate["DIRECTION"] == 'rtl'?'left':'right').'"' : $other));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -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
|
||||||
@@ -3316,7 +3316,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee
|
|||||||
if (! empty($conf->global->MAIN_PAGESIZE_CHOICES)) $pagesizechoices=$conf->global->MAIN_PAGESIZE_CHOICES;
|
if (! empty($conf->global->MAIN_PAGESIZE_CHOICES)) $pagesizechoices=$conf->global->MAIN_PAGESIZE_CHOICES;
|
||||||
|
|
||||||
print '<li class="pagination">';
|
print '<li class="pagination">';
|
||||||
print '<select class="flat selectlimit" name="limit">';
|
print '<select class="flat selectlimit" name="limit" title="'.dol_escape_htmltag($langs->trans("MaxNbOfRecordPerPage")).'">';
|
||||||
$tmpchoice=explode(',',$pagesizechoices);
|
$tmpchoice=explode(',',$pagesizechoices);
|
||||||
$tmpkey=$limit.':'.$limit;
|
$tmpkey=$limit.':'.$limit;
|
||||||
if (! in_array($tmpkey, $tmpchoice)) $tmpchoice[]=$tmpkey;
|
if (! in_array($tmpkey, $tmpchoice)) $tmpchoice[]=$tmpkey;
|
||||||
@@ -5677,7 +5677,7 @@ function dol_getmypid()
|
|||||||
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000"
|
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000"
|
||||||
* If param $mode is 2, can contains a list of id separated by comma like "1,3,4"
|
* If param $mode is 2, can contains a list of id separated by comma like "1,3,4"
|
||||||
* @param integer $mode 0=value is list of keywords, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
|
* @param integer $mode 0=value is list of keywords, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
|
||||||
* @param integer $nofirstand 1=Do now output the first 'AND'
|
* @param integer $nofirstand 1=Do not output the first 'AND'
|
||||||
* @return string $res The statement to append to the SQL query
|
* @return string $res The statement to append to the SQL query
|
||||||
*/
|
*/
|
||||||
function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
||||||
@@ -5692,6 +5692,9 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
|||||||
{
|
{
|
||||||
$value=preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'\-])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
|
$value=preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'\-])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$value = preg_replace('/\s*\|\s*/','|', $value);
|
||||||
|
|
||||||
$crits = explode(' ', $value);
|
$crits = explode(' ', $value);
|
||||||
$res = '';
|
$res = '';
|
||||||
if (! is_array($fields)) $fields = array($fields);
|
if (! is_array($fields)) $fields = array($fields);
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -74,17 +74,19 @@ function dol_getImageSize($file, $url = false)
|
|||||||
|
|
||||||
if (image_format_supported($file) < 0) return $ret;
|
if (image_format_supported($file) < 0) return $ret;
|
||||||
|
|
||||||
$fichier = $file;
|
$filetoread = $file;
|
||||||
if (!$url)
|
if (!$url)
|
||||||
{
|
{
|
||||||
$fichier = realpath($file); // Chemin canonique absolu de l'image
|
$filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image
|
||||||
$dir = dirname($file); // Chemin du dossier contenant l'image
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$infoImg = getimagesize($fichier); // Recuperation des infos de l'image
|
if ($filetoread)
|
||||||
$ret['width']=$infoImg[0]; // Largeur de l'image
|
{
|
||||||
$ret['height']=$infoImg[1]; // Hauteur de l'image
|
$infoImg = getimagesize($filetoread); // Recuperation des infos de l'image
|
||||||
|
$ret['width']=$infoImg[0]; // Largeur de l'image
|
||||||
|
$ret['height']=$infoImg[1]; // Hauteur de l'image
|
||||||
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,10 +141,9 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x=0, $s
|
|||||||
return 'Both newHeight or newWidth must be defined for croping';
|
return 'Both newHeight or newWidth must be defined for croping';
|
||||||
}
|
}
|
||||||
|
|
||||||
$fichier = realpath($file); // Chemin canonique absolu de l'image
|
$filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image
|
||||||
$dir = dirname($file); // Chemin du dossier contenant l'image
|
|
||||||
|
|
||||||
$infoImg = getimagesize($fichier); // Recuperation des infos de l'image
|
$infoImg = getimagesize($filetoread); // Recuperation des infos de l'image
|
||||||
$imgWidth = $infoImg[0]; // Largeur de l'image
|
$imgWidth = $infoImg[0]; // Largeur de l'image
|
||||||
$imgHeight = $infoImg[1]; // Hauteur de l'image
|
$imgHeight = $infoImg[1]; // Hauteur de l'image
|
||||||
|
|
||||||
@@ -187,22 +188,22 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x=0, $s
|
|||||||
switch($infoImg[2])
|
switch($infoImg[2])
|
||||||
{
|
{
|
||||||
case 1: // Gif
|
case 1: // Gif
|
||||||
$img = imagecreatefromgif($fichier);
|
$img = imagecreatefromgif($filetoread);
|
||||||
$extImg = '.gif'; // File name extension of image
|
$extImg = '.gif'; // File name extension of image
|
||||||
$newquality='NU'; // Quality is not used for this format
|
$newquality='NU'; // Quality is not used for this format
|
||||||
break;
|
break;
|
||||||
case 2: // Jpg
|
case 2: // Jpg
|
||||||
$img = imagecreatefromjpeg($fichier);
|
$img = imagecreatefromjpeg($filetoread);
|
||||||
$extImg = '.jpg';
|
$extImg = '.jpg';
|
||||||
$newquality=100; // % quality maximum
|
$newquality=100; // % quality maximum
|
||||||
break;
|
break;
|
||||||
case 3: // Png
|
case 3: // Png
|
||||||
$img = imagecreatefrompng($fichier);
|
$img = imagecreatefrompng($filetoread);
|
||||||
$extImg = '.png';
|
$extImg = '.png';
|
||||||
$newquality=0; // No compression (0-9)
|
$newquality=0; // No compression (0-9)
|
||||||
break;
|
break;
|
||||||
case 4: // Bmp
|
case 4: // Bmp
|
||||||
$img = imagecreatefromwbmp($fichier);
|
$img = imagecreatefromwbmp($filetoread);
|
||||||
$extImg = '.bmp';
|
$extImg = '.bmp';
|
||||||
$newquality='NU'; // Quality is not used for this format
|
$newquality='NU'; // Quality is not used for this format
|
||||||
break;
|
break;
|
||||||
@@ -383,10 +384,9 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
|
|||||||
return 'Error: Wrong value for parameter maxHeight';
|
return 'Error: Wrong value for parameter maxHeight';
|
||||||
}
|
}
|
||||||
|
|
||||||
$fichier = realpath($file); // Chemin canonique absolu de l'image
|
$filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image
|
||||||
$dir = dirname($file); // Chemin du dossier contenant l'image
|
|
||||||
|
|
||||||
$infoImg = getimagesize($fichier); // Recuperation des infos de l'image
|
$infoImg = getimagesize($filetoread); // Recuperation des infos de l'image
|
||||||
$imgWidth = $infoImg[0]; // Largeur de l'image
|
$imgWidth = $infoImg[0]; // Largeur de l'image
|
||||||
$imgHeight = $infoImg[1]; // Hauteur de l'image
|
$imgHeight = $infoImg[1]; // Hauteur de l'image
|
||||||
|
|
||||||
@@ -430,22 +430,22 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
|
|||||||
}
|
}
|
||||||
|
|
||||||
// On cree le repertoire contenant les vignettes
|
// On cree le repertoire contenant les vignettes
|
||||||
$dirthumb = $dir.($outdir?'/'.$outdir:''); // Chemin du dossier contenant les vignettes
|
$dirthumb = dirname($file).($outdir?'/'.$outdir:''); // Chemin du dossier contenant les vignettes
|
||||||
dol_mkdir($dirthumb);
|
dol_mkdir($dirthumb);
|
||||||
|
|
||||||
// Initialisation des variables selon l'extension de l'image
|
// Initialisation des variables selon l'extension de l'image
|
||||||
switch($infoImg[2])
|
switch($infoImg[2])
|
||||||
{
|
{
|
||||||
case IMAGETYPE_GIF: // 1
|
case IMAGETYPE_GIF: // 1
|
||||||
$img = imagecreatefromgif($fichier);
|
$img = imagecreatefromgif($filetoread);
|
||||||
$extImg = '.gif'; // Extension de l'image
|
$extImg = '.gif'; // Extension de l'image
|
||||||
break;
|
break;
|
||||||
case IMAGETYPE_JPEG: // 2
|
case IMAGETYPE_JPEG: // 2
|
||||||
$img = imagecreatefromjpeg($fichier);
|
$img = imagecreatefromjpeg($filetoread);
|
||||||
$extImg = (preg_match('/\.jpeg$/',$file)?'.jpeg':'.jpg'); // Extension de l'image
|
$extImg = (preg_match('/\.jpeg$/',$file)?'.jpeg':'.jpg'); // Extension de l'image
|
||||||
break;
|
break;
|
||||||
case IMAGETYPE_PNG: // 3
|
case IMAGETYPE_PNG: // 3
|
||||||
$img = imagecreatefrompng($fichier);
|
$img = imagecreatefrompng($filetoread);
|
||||||
$extImg = '.png';
|
$extImg = '.png';
|
||||||
break;
|
break;
|
||||||
case IMAGETYPE_BMP: // 6
|
case IMAGETYPE_BMP: // 6
|
||||||
@@ -453,7 +453,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
|
|||||||
$extImg = '.bmp';
|
$extImg = '.bmp';
|
||||||
break;
|
break;
|
||||||
case IMAGETYPE_WBMP: // 15
|
case IMAGETYPE_WBMP: // 15
|
||||||
$img = imagecreatefromwbmp($fichier);
|
$img = imagecreatefromwbmp($filetoread);
|
||||||
$extImg = '.bmp';
|
$extImg = '.bmp';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,9 +26,13 @@
|
|||||||
// Supported OAUTH (a provider is supported when a file xxx_oauthcallback.php is available into htdocs/core/modules/oauth)
|
// Supported OAUTH (a provider is supported when a file xxx_oauthcallback.php is available into htdocs/core/modules/oauth)
|
||||||
$supportedoauth2array=array(
|
$supportedoauth2array=array(
|
||||||
'OAUTH_GOOGLE_NAME'=>'google',
|
'OAUTH_GOOGLE_NAME'=>'google',
|
||||||
'OAUTH_GITHUB_NAME'=>'github'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||||
|
{
|
||||||
|
$supportedoauth2array['OAUTH_GITHUB_NAME']='github';
|
||||||
|
}
|
||||||
|
$supportedoauth2array['OAUTH_GITHUB_NAME']='github';
|
||||||
// API access parameters OAUTH
|
// API access parameters OAUTH
|
||||||
$list = array (
|
$list = array (
|
||||||
array(
|
array(
|
||||||
@@ -264,7 +268,7 @@ function oauthadmin_prepare_head()
|
|||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = dol_buildpath('/admin/oauthlogintokens.php', 1);
|
$head[$h][0] = dol_buildpath('/admin/oauthlogintokens.php', 1);
|
||||||
$head[$h][1] = $langs->trans("ManualTokenGeneration");
|
$head[$h][1] = $langs->trans("TokenManager");
|
||||||
$head[$h][2] = 'tokengeneration';
|
$head[$h][2] = 'tokengeneration';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user