mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +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.6'
|
||||
- '7.0'
|
||||
- '7.1'
|
||||
- nightly
|
||||
|
||||
addons:
|
||||
@@ -50,6 +51,7 @@ env:
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- php: 7.1
|
||||
- php: nightly
|
||||
# FIXME
|
||||
#- env: DB=postgresql
|
||||
@@ -96,7 +98,7 @@ install:
|
||||
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
|
||||
composer -n require phpunit/phpunit ^4
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
composer -n require phpunit/phpunit ^5
|
||||
fi
|
||||
echo
|
||||
@@ -136,7 +138,7 @@ before_script:
|
||||
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
echo
|
||||
echo "Enabling Memcached for PHP <= 5.4"
|
||||
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly!
|
||||
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1 and nightly!
|
||||
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
fi
|
||||
phpenv rehash
|
||||
@@ -208,7 +210,7 @@ before_script:
|
||||
echo "Setting up Apache + FPM"
|
||||
# enable php-fpm
|
||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
# Copy the included pool
|
||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf
|
||||
fi
|
||||
|
||||
@@ -151,6 +151,9 @@ Dolibarr better:
|
||||
no more required, were also removed. Use this new one if you were using one of them.
|
||||
- The trigger that activate or close a contract line is run on a contract line, not on contract.
|
||||
|
||||
Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful on PHP 7.1 but we don't have enough
|
||||
feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0.
|
||||
|
||||
|
||||
***** ChangeLog for 4.0.3 to 4.0.2 *****
|
||||
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||
|
||||
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
|
||||
fournis dans ce nouveau package.
|
||||
|
||||
- Si vous venez d'une version x.y.z vers x.y.w (seul le 3eme chiffre varie),
|
||||
il n'y a pas besoin de migration de données.
|
||||
- Au prochain accès, Dolibarr proposera la page de "mise a jour" des données (si necessaire).
|
||||
Si un fichier install.lock existe pour vérouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transféré sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")
|
||||
|
||||
- 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 lance plusieurs fois sans risque.
|
||||
*Note: Le processus de migration peut etre lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
|
||||
|
||||
|
||||
## CE QUI EST NOUVEAU
|
||||
@@ -86,11 +77,13 @@ Voir fichier ChangeLog.
|
||||
- Gestion des factures clients/fournisseurs et paiements
|
||||
- Gestion des virements bancaires SEPA
|
||||
- Gestion des comptes bancaires
|
||||
- Agenda partagé
|
||||
- Calendrier/Agenda partagé (avec export ical, vcal)
|
||||
- Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...)
|
||||
- Gestion de contrats de services
|
||||
- Gestion de stock
|
||||
- Gestion des expéditions
|
||||
- Gestion des demandes de congès
|
||||
- Gestion des notes de frais
|
||||
- GED (Gestion Electronique de Documents)
|
||||
- EMailings de masse
|
||||
- Réalisation de sondages
|
||||
|
||||
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
|
||||
|
||||
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
|
||||
- If you're upgrading from version x.y.z to x.y.w (only third number differs), there is no need to run any migration process.
|
||||
- If you're upgrading from a beta version or from any version x.y.z to any other where x or y number differs, you must call the Dolibarr "install/" page in your browser (this should be done automatically at first dolibarr access) and follow the upgrade process.
|
||||
- At first next access, Dolibarr will redirect your to the "install/" page to make the upgrade process.
|
||||
If a file install.lock exists to lock any run of upgrade process, the application will ask you to remove the file manually (you should find the install.lock file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "documents").
|
||||
|
||||
*Note: migration process can safely be done multiple times.*
|
||||
*Note: migration process can safely be done multiple times by calling the page /install/index.php*
|
||||
|
||||
## WHAT'S NEW
|
||||
|
||||
@@ -80,17 +80,17 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
- Invoices and payment management
|
||||
- Standing orders management (European SEPA)
|
||||
- Bank accounts management
|
||||
- Shared calendar
|
||||
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||
- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...)
|
||||
- Projects management
|
||||
- Contracts management
|
||||
- Stock management
|
||||
- Shipping management
|
||||
- Interventions management
|
||||
- Agenda with ical and vcal export for third party tools integration
|
||||
- Employee's leave requests management
|
||||
- Expense report management
|
||||
- Electronic Document Management (EDM)
|
||||
- Foundations members management
|
||||
- Employee's holidays management
|
||||
- Mass emailing
|
||||
- Surveys
|
||||
- Point of Sale
|
||||
|
||||
@@ -26,11 +26,11 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
|
||||
# Misc dependencies
|
||||
# fonts-dejavu-core | ttf-dejavu-core,
|
||||
xdg-utils,
|
||||
virtual-mysql-client,
|
||||
mariadb-client | virtual-mysql-client,
|
||||
${misc:Depends},
|
||||
${perl:Depends}
|
||||
Recommends: apache2 | lighttpd | httpd,
|
||||
virtual-mysql-server
|
||||
mariadb-server | virtual-mysql-server
|
||||
Suggests: www-browser, php5-geoip
|
||||
Description: Web based software to manage a company or foundation
|
||||
Dolibarr ERP & CRM is an easy to use open source/free software package for
|
||||
|
||||
@@ -162,7 +162,7 @@ export res=$?
|
||||
|
||||
|
||||
# ---------------------------- copy demo files
|
||||
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" `
|
||||
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' `
|
||||
if [ "x$documentdir" != "x" ]
|
||||
then
|
||||
echo cp -pr $mydir/documents_demo/* "$documentdir/"
|
||||
@@ -174,7 +174,7 @@ then
|
||||
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||
else
|
||||
echo Detection of documents directory failed so demo files were not copied.
|
||||
echo Detection of documents directory $documentdir failed so demo files were not copied.
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ $sql.=$db->order($sortfield,$sortorder);
|
||||
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -172,7 +172,7 @@ if (strlen(trim($search_pcgsubtype))) {
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@@ -888,18 +888,18 @@ if ($id)
|
||||
{
|
||||
if ($value == 'country')
|
||||
{
|
||||
print '<td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre"></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">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
|
||||
@@ -90,7 +90,7 @@ $sql .= " WHERE f.entity = " . $conf->entity;
|
||||
$sql.=$db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -248,7 +248,7 @@ if (strlen(trim($search_desc))) {
|
||||
}
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -143,7 +143,7 @@ else {
|
||||
|
||||
// List
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
|
||||
@@ -293,7 +293,7 @@ llxHeader('', $title_page);
|
||||
|
||||
// List
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
|
||||
@@ -162,7 +162,7 @@ llxHeader('', $title_page);
|
||||
|
||||
// List
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
@@ -235,9 +235,8 @@ print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60"
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="GET">';
|
||||
print '<td>' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre">' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . '</td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $langs->trans('From') . ': ';
|
||||
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 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> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td 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"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||
print '<td class="liste_titre" align="right" colspan="2">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
print '</td>';
|
||||
|
||||
@@ -158,7 +158,7 @@ if (! empty($search_code_journal)) {
|
||||
* Mode List
|
||||
*/
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
require '../../main.inc.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 . '/compta/facture/class/facture.class.php';
|
||||
|
||||
// Langs
|
||||
$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 .= " , " . MAIN_DB_PREFIX . "facture as f";
|
||||
$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);
|
||||
$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.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
$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";
|
||||
|
||||
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 .= " 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 . ")";
|
||||
}
|
||||
$sql .= " AND aa.account_number IS NOT NULL";
|
||||
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
||||
|
||||
@@ -301,37 +319,40 @@ 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_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
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("TotalVente") . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</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>';
|
||||
}
|
||||
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 = "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
|
||||
}
|
||||
$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) {
|
||||
dol_syslog('htdocs/accountancy/customer/index.php');
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
@@ -345,12 +366,12 @@ if ($resql) {
|
||||
$i ++;
|
||||
}
|
||||
$db->free($resql);
|
||||
} else {
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
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>';
|
||||
@@ -369,6 +390,11 @@ if (! empty($conf->margin->enabled)) {
|
||||
$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);
|
||||
@@ -389,9 +415,9 @@ if (! empty($conf->margin->enabled)) {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
}
|
||||
}
|
||||
print "</table>\n";
|
||||
print '</td></tr></table>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -200,7 +200,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -210,12 +210,17 @@ if (strlen(trim($search_account))) {
|
||||
if (strlen(trim($search_vat))) {
|
||||
$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 .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -290,37 +290,36 @@ print "</table>\n";
|
||||
|
||||
|
||||
|
||||
print '<br>';
|
||||
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_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 '<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 '<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>';
|
||||
}
|
||||
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 = "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
|
||||
}
|
||||
$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) {
|
||||
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)) {
|
||||
@@ -335,10 +334,11 @@ if ($resql) {
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
} else {
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -178,7 +178,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -208,7 +208,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -289,40 +289,36 @@ 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 '<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 '<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>';
|
||||
}
|
||||
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 = "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
|
||||
}
|
||||
$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) {
|
||||
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)) {
|
||||
@@ -337,10 +333,12 @@ if ($resql) {
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
} else {
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -182,7 +182,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -217,7 +217,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -250,7 +250,7 @@ $sql.=$hookmanager->resPrint;
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records with no order and no limits
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$resql = $db->query($sql);
|
||||
@@ -375,7 +375,7 @@ if (! empty($moreforfilter))
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$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 '<tr class="liste_titre">';
|
||||
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);
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -407,7 +407,7 @@ if ($rowid > 0)
|
||||
$sql.=" AND datefin < '".$db->idate($now)."'";
|
||||
}
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$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 '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\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 '<td width="300">'.$langs->trans("Box").'</td>';
|
||||
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
||||
@@ -375,6 +378,8 @@ foreach($boxtoadd as $box)
|
||||
}
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
|
||||
print '<div class="right">';
|
||||
print '<input type="submit" class="button"'.(count($boxtoadd)?'':' disabled').' value="'.$langs->trans("Activate").'">';
|
||||
print '</div>'."\n";
|
||||
@@ -388,7 +393,9 @@ $boxactivated=InfoBox::listBoxes($db,'activated',-1,null);
|
||||
print "<br>\n\n";
|
||||
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 '<td width="300">'.$langs->trans("Box").'</td>';
|
||||
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
||||
@@ -441,7 +448,9 @@ foreach($boxactivated as $key => $box)
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
|
||||
print '</table><br>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
// 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" id="action" name="action" value="">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
@@ -297,6 +298,7 @@ if ($result)
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
@@ -311,6 +313,7 @@ if ($conf->use_javascript_ajax)
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -319,7 +319,7 @@ if ($mode != 'marketplace')
|
||||
$moreforfilter.= $langs->trans('Keyword') . ': <input type="text" name="search_keyword" value="'.dol_escape_htmltag($search_keyword).'">';
|
||||
$moreforfilter.= '</div>';
|
||||
$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>';
|
||||
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||
{
|
||||
@@ -417,7 +417,7 @@ if ($mode != 'marketplace')
|
||||
{
|
||||
//print $reg[1].'-'.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 ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue;
|
||||
@@ -496,6 +496,7 @@ if ($mode != 'marketplace')
|
||||
// Help
|
||||
print '<td align="center" valign="top" class="nowrap" style="width: 82px;">';
|
||||
$text='';
|
||||
|
||||
if ($objMod->getDescLong()) $text.='<div class="titre">'.$objMod->getDesc().'</div><br>'.$objMod->getDescLong().'<br>';
|
||||
else $text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
|
||||
|
||||
@@ -647,6 +648,7 @@ if ($mode != 'marketplace')
|
||||
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
|
||||
$text.=$langs->trans("DetectionNotPossible");
|
||||
|
||||
|
||||
print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20');
|
||||
|
||||
print '</td>';
|
||||
|
||||
@@ -104,6 +104,11 @@ if ($action == 'setvalue' && $user->admin)
|
||||
* 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);
|
||||
|
||||
llxHeader('',$langs->trans("PrintingSetup"));
|
||||
@@ -127,53 +132,129 @@ if ($mode == 'setup' && $user->admin)
|
||||
if (in_array($key[0], array_keys($supportedoauth2array))) $supported=1;
|
||||
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 '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setconst">';
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
$var=true;
|
||||
|
||||
$var=false;
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("Parameters").'</th>';
|
||||
print '<th>'.$langs->trans("Value").'</th>';
|
||||
print '<th> </th>';
|
||||
print '<th class="titlefieldcreate">'.$langs->trans($key[0]).'</th>';
|
||||
print '<th></th>';
|
||||
print '<th></th>';
|
||||
print "</tr>\n";
|
||||
$submit_enabled=0;
|
||||
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td'.($key['required']?' class=required':'').'>'.$langs->trans($key['varname']).'</td>';
|
||||
print '<td>'.$langs->trans($key['info']).'</td>';
|
||||
print '<td'.($key['required']?' class="required"':'').'>';
|
||||
//var_dump($key);
|
||||
print $langs->trans("OAuthIDSecret").'</td>';
|
||||
print '<td>';
|
||||
print $langs->trans("SeePreviousTab");
|
||||
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 '</tr>'."\n";
|
||||
|
||||
// Show value of token
|
||||
if ($key['varname'] == 'PRINTGCP_TOKEN_ACCESS')
|
||||
{
|
||||
// Token
|
||||
$var = ! $var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("Token").'</td>';
|
||||
print '<td'.($key['required']?' class="required"':'').'>';
|
||||
//var_dump($key);
|
||||
print $langs->trans("IsTokenGenerated");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
// Dolibarr storage
|
||||
$storage = new DoliStorage($db, $conf);
|
||||
try
|
||||
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))
|
||||
{
|
||||
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME_GOOGLE);
|
||||
//test on $storage->hasAccessToken($OAUTH_SERVICENAME) ?
|
||||
print '<a class="button" href="'.$urltodelete.'">'.$langs->trans('DeleteAccess').'</a><br><br>';
|
||||
}
|
||||
catch(Exception $e)
|
||||
// Request remote token
|
||||
print '<a class="button" href="'.$urltorenew.'">'.$langs->trans('RequestAccess').'</a><br><br>';
|
||||
// Check remote access
|
||||
if ($urltocheckperms)
|
||||
{
|
||||
// Return an error if token not found
|
||||
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);
|
||||
@@ -186,9 +267,42 @@ if ($mode == 'setup' && $user->admin)
|
||||
print '</textarea>';*/
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
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>';
|
||||
@@ -200,6 +314,7 @@ if ($mode == 'setup' && $user->admin)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ dol_fiche_head($head, 'default', $langs->trans("Security"));
|
||||
// Show warning about external users
|
||||
print info_admin(showModulesExludedForExternal($modules)).'<br>'."\n";
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// Affiche lignes des permissions
|
||||
@@ -215,8 +215,9 @@ if ($result)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -86,12 +86,12 @@ if ($sfurl)
|
||||
}
|
||||
print ')';
|
||||
}
|
||||
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
|
||||
}
|
||||
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>';
|
||||
|
||||
@@ -48,6 +48,7 @@ $tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
|
||||
|
||||
// Browser
|
||||
$var=true;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
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";
|
||||
$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 '</td></tr>'."\n";
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -81,6 +81,7 @@ else
|
||||
{
|
||||
if ($base == 1)
|
||||
{
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
@@ -134,10 +135,12 @@ else
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if ($base == 2)
|
||||
{
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
@@ -173,11 +176,13 @@ else
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if ($base == 4)
|
||||
{
|
||||
// Sqlite by PDO or by Sqlite3
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
@@ -207,6 +212,8 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ llxHeader();
|
||||
print load_fiche_titre($langs->trans("InfoDatabase"),'','title_setup');
|
||||
|
||||
// Database
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
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";
|
||||
@@ -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[0].'><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
// Tables
|
||||
print '<br>';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
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 '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
$listofvars=$db->getServerParametersValues();
|
||||
$listofstatus=$db->getServerStatusValues();
|
||||
@@ -76,6 +79,7 @@ else
|
||||
foreach($arraylist as $listname)
|
||||
{
|
||||
print '<br>';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="300">'.$langs->trans("Parameters").'</td>';
|
||||
@@ -120,6 +124,7 @@ else
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ print load_fiche_titre($title,'','title_setup');
|
||||
|
||||
// Version
|
||||
$var=true;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
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";
|
||||
$var=!$var;
|
||||
@@ -69,10 +70,12 @@ else
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
// Session
|
||||
$var=true;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
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";
|
||||
$var=!$var;
|
||||
@@ -107,6 +110,7 @@ foreach($_SESSION as $key => $val)
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
@@ -116,6 +120,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
||||
$shmoparray=dol_listshmop();
|
||||
|
||||
$var=true;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
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 '</div>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
// Localisation
|
||||
$var=true;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
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";
|
||||
$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 '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
@@ -292,6 +300,7 @@ $configfileparameters=array(
|
||||
);
|
||||
|
||||
$var=true;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("Parameters").' ';
|
||||
@@ -353,11 +362,13 @@ foreach($configfileparameters as $key => $value)
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
// Parameters in database
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
|
||||
@@ -407,7 +418,7 @@ if ($resql)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -82,8 +82,8 @@ $xmlremote = GETPOST('xmlremote')?GETPOST('xmlremote'):'https://www.dolibarr.org
|
||||
|
||||
// Test if remote test is ok
|
||||
$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 $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
||||
@@ -101,7 +101,8 @@ else
|
||||
print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
|
||||
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
|
||||
{
|
||||
@@ -156,19 +157,25 @@ if ($xml)
|
||||
$file_list = array();
|
||||
$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 '<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 '</tr>'."\n";
|
||||
$var = true;
|
||||
$tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
|
||||
if (is_array($tmpfilelist) && count($tmpfilelist))
|
||||
{
|
||||
$i = 0;
|
||||
foreach ($tmpfilelist as $file)
|
||||
{
|
||||
$i++;
|
||||
$var = !$var;
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td>'.$i.'</td>' . "\n";
|
||||
print '<td>'.$file['filename'].'</td>' . "\n";
|
||||
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
||||
print "</tr>\n";
|
||||
@@ -176,15 +183,18 @@ if ($xml)
|
||||
}
|
||||
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 '<br>';
|
||||
|
||||
print_fiche_titre($langs->trans("FilesUpdated"));
|
||||
|
||||
print '<table class="noborder">';
|
||||
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("CurrentChecksum") . '</td>';
|
||||
print '<td align="right">' . $langs->trans("Size") . '</td>';
|
||||
@@ -194,10 +204,13 @@ if ($xml)
|
||||
$tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename');
|
||||
if (is_array($tmpfilelist2) && count($tmpfilelist2))
|
||||
{
|
||||
$i = 0;
|
||||
foreach ($tmpfilelist2 as $file)
|
||||
{
|
||||
$i++;
|
||||
$var = !$var;
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td>'.$i.'</td>' . "\n";
|
||||
print '<td>'.$file['filename'].'</td>' . "\n";
|
||||
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
||||
print '<td align="center">'.$file['md5'].'</td>' . "\n";
|
||||
@@ -241,14 +254,12 @@ if ($xml)
|
||||
//var_dump($checksumconcat);
|
||||
$checksumget = md5(join(',',$checksumconcat));
|
||||
$checksumtoget = $xml->dolibarr_htdocs_dir_checksum;
|
||||
if ($checksumtoget)
|
||||
{
|
||||
print '<br>';
|
||||
print '<strong>'.$langs->trans("GlobalChecksum").'</strong><br>';
|
||||
print $langs->trans("ExpectedChecksum").' = '.$checksumtoget.'<br>';
|
||||
print $langs->trans("CurrentChecksum").' = '.$checksumget;
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
print_fiche_titre($langs->trans("GlobalChecksum")).'<br>';
|
||||
print $langs->trans("ExpectedChecksum").' = '. ($checksumtoget ? $checksumtoget : $langs->trans("Unknown")) .'<br>';
|
||||
print $langs->trans("CurrentChecksum").' = '.$checksumget;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -102,6 +102,8 @@ foreach($modulesdir as $dir)
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Modules").'</td>';
|
||||
@@ -148,6 +150,7 @@ foreach($sortorder as $numero=>$name)
|
||||
print "</tr>\n";
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
sort($rights_ids);
|
||||
$old='';
|
||||
|
||||
@@ -68,7 +68,7 @@ print '<br>';
|
||||
$phparray=phpinfo_array();
|
||||
foreach($phparray as $key => $value)
|
||||
{
|
||||
//print load_fiche_titre($key);
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
|
||||
@@ -114,7 +114,9 @@ foreach($phparray as $key => $value)
|
||||
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_ua) { $usefilter++; $sql.=natural_search("e.user_agent", $search_ua, 0); }
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
/*if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}*/
|
||||
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
//print $sql;
|
||||
$result = $db->query($sql);
|
||||
@@ -195,7 +204,7 @@ if ($result)
|
||||
$center='<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')
|
||||
{
|
||||
@@ -204,6 +213,8 @@ if ($result)
|
||||
}
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
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>';
|
||||
else print '<tr><td colspan="6">'.$langs->trans("NoEventOrNoAuditSetup").'</td></tr>';
|
||||
}
|
||||
print "</table></form>";
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
|
||||
print "</form>";
|
||||
$db->free($result);
|
||||
}
|
||||
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/';
|
||||
$urldolibarrthemes='https://www.dolistore.com/';
|
||||
$dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT);
|
||||
|
||||
@@ -52,6 +52,7 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/';
|
||||
$interfaces = new Interfaces($db);
|
||||
$triggers = $interfaces->getTriggersList();
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">
|
||||
<tr class="liste_titre">
|
||||
<td colspan="2">'.$langs->trans("File").'</td>
|
||||
@@ -78,6 +79,7 @@ foreach ($triggers as $trigger)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class 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 $password User password
|
||||
|
||||
@@ -115,7 +115,7 @@ li.menu_choix0 {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* ------------------- R<EFBFBD>capitulatif des articles ------------------- */
|
||||
/* ------------------- Remind of products ------------------- */
|
||||
.liste_articles {
|
||||
min-width: 215px;
|
||||
float: right;
|
||||
@@ -212,6 +212,10 @@ p.titre {
|
||||
max-width: 900px;
|
||||
}
|
||||
|
||||
.blocksellfinished {
|
||||
min-width: 215px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.titre1 {
|
||||
font-weight: bold;
|
||||
color: #ff9900;
|
||||
|
||||
@@ -106,23 +106,23 @@ $langs->load("cashdesk");
|
||||
<th><?php echo $langs->trans("VATRate"); ?></th>
|
||||
</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");?>
|
||||
</td>
|
||||
<!-- Affichage du stock pour l'article courant -->
|
||||
<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>
|
||||
<!-- Show unit price -->
|
||||
<?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>
|
||||
<!-- 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");?>
|
||||
</td>
|
||||
<!-- 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 -->
|
||||
<td class="select_tva">
|
||||
<?php //var_dump($tab_tva); ?>
|
||||
@@ -155,17 +155,17 @@ $langs->load("cashdesk");
|
||||
<input type="hidden" name="hdnChoix" value="" />
|
||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
||||
<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>
|
||||
<!-- 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 -->
|
||||
<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");?>
|
||||
</td>
|
||||
<!-- 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>
|
||||
</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">
|
||||
<h3 class="titre1"><?php echo $langs->trans("SellFinished"); ?></h3><br>
|
||||
|
||||
<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>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ class Categories extends DolibarrApi
|
||||
$sql.= ' AND s.rowid = sub.fk_categorie';
|
||||
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -124,7 +124,7 @@ class CategoryApi extends DolibarrApi
|
||||
$sql.= ' WHERE s.entity IN ('.getEntity('category', 1).')';
|
||||
$sql.= ' AND s.type='.array_search($type,CategoryApi::$TYPES);
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
@@ -205,7 +205,7 @@ class CategoryApi extends DolibarrApi
|
||||
$sql.= ' AND s.rowid = sub.fk_categorie';
|
||||
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -245,7 +245,7 @@ if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AN
|
||||
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -85,7 +85,7 @@ $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
|
||||
$sql.= " GROUP BY year, month, df";
|
||||
$sql.= " ORDER BY year DESC, month DESC, df DESC";
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -366,6 +366,21 @@ if ($id > 0)
|
||||
print '</td>';
|
||||
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
|
||||
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 '</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
|
||||
print '<tr class="pair">';
|
||||
print '<tr class="impair">';
|
||||
print '<td>'.$langs->trans("CurrentOutstandingBill").'</td>';
|
||||
print '<td>'.price($outstandingBills).$warn.'</td>';
|
||||
print '</tr>';
|
||||
@@ -776,7 +776,9 @@ if ($id > 0)
|
||||
|
||||
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 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>';
|
||||
}
|
||||
$i = 0;
|
||||
@@ -837,7 +839,9 @@ if ($id > 0)
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
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>';
|
||||
$var=!$var;
|
||||
}
|
||||
@@ -1007,7 +1011,15 @@ if ($id > 0)
|
||||
|
||||
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("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("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -758,7 +758,7 @@ else
|
||||
|
||||
// MAILING_NO_USING_PHPMAIL may be defined or not.
|
||||
// MAILING_LIMIT_SENDBYWEB is always defined to something != 0 (-1=forbidden).
|
||||
// MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0=no limit).
|
||||
// MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0 or undefined=no limit).
|
||||
if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
|
||||
{
|
||||
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
|
||||
@@ -772,8 +772,8 @@ else
|
||||
}
|
||||
else if ($conf->global->MAILING_LIMIT_SENDBYWEB == '-1')
|
||||
{
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
|
||||
|
||||
// The feature is forbidden from GUI, we show just message to use from command line.
|
||||
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
|
||||
@@ -786,8 +786,8 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
|
||||
|
||||
$text='';
|
||||
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)
|
||||
|
||||
@@ -412,7 +412,7 @@ if ($object->fetch($id) >= 0)
|
||||
$sql .= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -333,7 +333,7 @@ $sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.=', p.ref DESC';
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -139,7 +139,7 @@ class CommandeApi extends DolibarrApi
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
@@ -194,7 +194,7 @@ class CommandeApi extends DolibarrApi
|
||||
* @return array Array of order objects
|
||||
*/
|
||||
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);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -182,6 +182,7 @@ if ($id > 0 || ! empty($ref))
|
||||
else
|
||||
{
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -560,7 +560,7 @@ $sql.=$hookmanager->resPrint;
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -188,7 +188,7 @@ print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>';
|
||||
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>';
|
||||
|
||||
@@ -196,7 +196,7 @@ print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
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>';
|
||||
|
||||
@@ -218,7 +218,7 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print '<td align="right" width="10%"> ';
|
||||
print '<td align="right" class="borderrightlight" width="10%"> ';
|
||||
if ($encaiss[$case]>0)
|
||||
{
|
||||
print price($encaiss[$case]);
|
||||
|
||||
@@ -54,6 +54,7 @@ $langs->load("loan");
|
||||
$langs->load("donations");
|
||||
$langs->load("trips");
|
||||
$langs->load("members");
|
||||
$langs->load("compta");
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
$ref = GETPOST('ref','alpha');
|
||||
@@ -501,7 +502,7 @@ $sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
$nbtotalofpages = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
@@ -620,7 +621,7 @@ if ($resql)
|
||||
$last_ok=1;
|
||||
}
|
||||
$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;
|
||||
print $liste;
|
||||
@@ -1207,7 +1208,7 @@ if ($resql)
|
||||
{
|
||||
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')
|
||||
{
|
||||
@@ -1223,7 +1224,7 @@ if ($resql)
|
||||
// Transaction reconciliated or edit link
|
||||
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 '</a>';
|
||||
}
|
||||
@@ -1231,13 +1232,13 @@ if ($resql)
|
||||
{
|
||||
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 '</a>';
|
||||
}
|
||||
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 '</a>';
|
||||
}
|
||||
@@ -1251,7 +1252,7 @@ if ($resql)
|
||||
print ' ';
|
||||
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 '</a>';
|
||||
}
|
||||
|
||||
@@ -662,7 +662,7 @@ class Account extends CommonObject
|
||||
*
|
||||
* @param User $user Object user making action
|
||||
* @param int $notrigger 1=Disable triggers
|
||||
* @return int <0 si ko, >0 si ok
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update(User $user = null, $notrigger = 0)
|
||||
{
|
||||
|
||||
@@ -81,59 +81,13 @@ if ($id)
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Envoi fichier
|
||||
if ($_POST["sendit"] && !empty($conf->global->MAIN_UPLOAD_DOC)) {
|
||||
if ($object->fetch($id)) {
|
||||
|
||||
$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>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
$upload_dir = $conf->bank->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
}
|
||||
|
||||
// Delete
|
||||
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;
|
||||
}
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
|
||||
|
||||
|
||||
/*
|
||||
@@ -182,30 +136,12 @@ if ($id > 0 || !empty($ref)) {
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
dol_htmloutput_mesg($mesg, $mesgs);
|
||||
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
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
|
||||
$modulepart = 'bank';
|
||||
$permission = $user->rights->banque->modifier;
|
||||
$permtoedit = $user->rights->banque->modifier;
|
||||
$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 {
|
||||
dol_print_error($db);
|
||||
|
||||
@@ -175,7 +175,7 @@ $sql.=$hookmanager->resPrint;
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
@@ -449,7 +449,7 @@ foreach ($accounts as $key=>$type)
|
||||
// Ref
|
||||
if (! empty($arrayfields['b.ref']['checked']))
|
||||
{
|
||||
print '<td class="titlefield">'.$acc->getNomUrl(1).'</td>';
|
||||
print '<td>'.$acc->getNomUrl(1).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
@@ -299,6 +299,7 @@ else
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td align="center">'.$langs->trans("DateOperationShort").'</td>';
|
||||
@@ -348,8 +349,10 @@ else
|
||||
$i = 0;
|
||||
|
||||
// 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 "<td align=\"right\" colspan=\"2\"><b>".$langs->trans("InitialBankBalance")." :</b></td><td align=\"right\"><b>".price($total)."</b></td><td> </td></tr>\n";
|
||||
print "<tr ".$bc[$var]."><td colspan=\"3\"></td>";
|
||||
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)
|
||||
{
|
||||
@@ -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>";
|
||||
|
||||
// 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 "</table></form>\n";
|
||||
print "\n<tr><td align=\"right\" colspan=\"3\"> </td><td colspan=\"3\"><b>".$langs->trans("EndBankBalance")." :</b></td>";
|
||||
print "<td align=\"right\"><b>".price($total)."</b></td><td> </td>";
|
||||
print "</tr>\n";
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -93,14 +93,13 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
$head=bank_prepare_head($object);
|
||||
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>';
|
||||
|
||||
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();
|
||||
|
||||
print '<br>';
|
||||
|
||||
$solde = $object->solde(0);
|
||||
|
||||
|
||||
@@ -3736,6 +3736,8 @@ else if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
else // Credit note
|
||||
{
|
||||
$cssforamountpaymentcomplete='';
|
||||
|
||||
// Total already paid back
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
print $langs->trans('AlreadyPaidBack');
|
||||
@@ -3751,7 +3753,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
else
|
||||
print $langs->trans('ExcessPaydBack');
|
||||
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>';
|
||||
|
||||
// Sold credit note
|
||||
|
||||
@@ -138,7 +138,7 @@ class InvoiceApi extends DolibarrApi
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -1575,7 +1575,7 @@ else
|
||||
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($year_date_when,1,false))."' AND '".$db->idate(dol_get_last_day($year_date_when,12,false))."'";
|
||||
}
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -402,7 +402,7 @@ $listfield=explode(',',$sortfield);
|
||||
foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.',';
|
||||
$sql.= ' f.rowid DESC ';
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -112,7 +112,7 @@ else if ($year > 0)
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -186,7 +186,7 @@ else
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -1272,7 +1272,7 @@ class BonPrelevement extends CommonObject
|
||||
* 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";
|
||||
$resql=$this->db->query($sql);
|
||||
@@ -1280,9 +1280,7 @@ class BonPrelevement extends CommonObject
|
||||
while ($objfac = $this->db->fetch_object($resql)) {
|
||||
$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.= " 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)
|
||||
{
|
||||
$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;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ if ($action == 'create')
|
||||
$mesg='';
|
||||
$mesg=$langs->trans("NoInvoiceCouldBeWithdrawed");
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
$mesg.='<br>'."\n";
|
||||
foreach($bprev->invoice_in_error as $key => $val)
|
||||
{
|
||||
$mesg.=$val."<br>\n";
|
||||
|
||||
@@ -521,9 +521,6 @@ if ($id > 0)
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Status
|
||||
//print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4, $totalpaye).'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
@@ -548,6 +545,8 @@ if ($id > 0)
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$totalpaye = 0;
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0; $total = 0;
|
||||
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>';
|
||||
}
|
||||
|
||||
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("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 '<td align="right"'.($resteapayer?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>'.price($resteapayer)."</td></tr>\n";
|
||||
}
|
||||
//}
|
||||
print "</table>";
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
@@ -131,6 +131,7 @@ class Contact extends CommonObject
|
||||
$clause = "AND";
|
||||
}
|
||||
$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;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
@@ -365,7 +365,7 @@ else
|
||||
}
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -693,8 +693,8 @@ class Contrat extends CommonObject
|
||||
// fetch optionals attributes and labels
|
||||
$line->fetch_optionals($line->id,$extralabelsline);
|
||||
|
||||
$this->lines[] = $line;
|
||||
$this->lines_id_index_mapper[$line->id] = key($this->lines);
|
||||
$this->lines[$i] = $line;
|
||||
$this->lines_id_index_mapper[$line->id] = $i;
|
||||
|
||||
//dol_syslog("1 ".$line->desc);
|
||||
//dol_syslog("2 ".$line->product_desc);
|
||||
|
||||
@@ -288,7 +288,7 @@ if ($result)
|
||||
$totalnboflines = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -236,7 +236,7 @@ if (! empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql.= " A
|
||||
if (! empty($filter_opcloture) && $filter_opcloture != -1 && $filter_datecloture != '') $sql.= " AND cd.date_cloture ".$filter_opcloture." '".$db->idate($filter_datecloture)."'";
|
||||
$sql .= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -337,6 +337,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
}
|
||||
|
||||
// Initialisation of datas
|
||||
if (is_object($object))
|
||||
{
|
||||
$object->socid = $sendtosocid; // To link to a company
|
||||
$object->sendtoid = $sendtoid; // To link to a contact/address
|
||||
$object->actiontypecode = $actiontypecode;
|
||||
@@ -354,6 +356,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$error++; $errors=$interface->errors;
|
||||
}
|
||||
// End call of triggers
|
||||
}
|
||||
|
||||
if ($error)
|
||||
{
|
||||
|
||||
@@ -210,6 +210,7 @@ class CMailFile
|
||||
$this->addr_bcc = $addr_bcc;
|
||||
$this->deliveryreceipt = $deliveryreceipt;
|
||||
$this->trackid = $trackid;
|
||||
|
||||
$smtp_headers = $this->write_smtpheaders();
|
||||
if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n
|
||||
|
||||
@@ -272,6 +273,7 @@ class CMailFile
|
||||
$smtps->setFrom($this->getValidAddress($from,0,1));
|
||||
$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
|
||||
|
||||
if (! empty($moreinheader)) $smtps->setMoreInHeader($moreinheader);
|
||||
|
||||
if (! empty($this->html))
|
||||
@@ -370,6 +372,8 @@ class CMailFile
|
||||
// Use Swift Mailer library
|
||||
// ------------------------------------------
|
||||
|
||||
$host = dol_getprefix('email');
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php';
|
||||
// Create the message
|
||||
$this->message = Swift_Message::newInstance();
|
||||
@@ -377,7 +381,7 @@ class CMailFile
|
||||
// Adding a trackid header to a message
|
||||
$headers = $this->message->getHeaders();
|
||||
$headers->addTextHeader('X-Dolibarr-TRACKID', $trackid);
|
||||
$headerID = time() . '.swiftmailer-dolibarr-' . $trackid . '@' . $conf->global->MAIN_MAIL_SMTP_SERVER;
|
||||
$headerID = time() . '.swiftmailer-dolibarr-' . $trackid . '@' . $host;
|
||||
$msgid = $headers->get('Message-ID');
|
||||
$msgid->setId($headerID);
|
||||
$headers->addIdHeader('References', $headerID);
|
||||
@@ -487,7 +491,7 @@ class CMailFile
|
||||
}
|
||||
|
||||
// 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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
if (count($tmparray3) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)
|
||||
{
|
||||
@@ -509,6 +515,7 @@ class CMailFile
|
||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||
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)
|
||||
{
|
||||
$this->error = 'Too much recipients in to:, cc:, bcc:';
|
||||
@@ -516,7 +523,6 @@ class CMailFile
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Action according to choosed sending method
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||
{
|
||||
@@ -558,6 +564,7 @@ class CMailFile
|
||||
{
|
||||
$additionnalparam .= ($additionnalparam?' ':'').'-ba';
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -881,7 +888,7 @@ class CMailFile
|
||||
|
||||
// Receiver
|
||||
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
|
||||
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 $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 int $type Type facture
|
||||
* @param int $type Type invoice
|
||||
* @return string Libelle du statut
|
||||
*/
|
||||
function LibStatut($paye,$status,$mode=0,$alreadypaid=-1,$type=0)
|
||||
@@ -255,8 +255,8 @@ abstract class CommonInvoice extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($type == 2) return $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted');
|
||||
elseif ($type == 3) return $langs->trans('Bill'.$prefix.'StatusConverted');
|
||||
if ($type == 2) return $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted'); // credit note
|
||||
elseif ($type == 3) return $langs->trans('Bill'.$prefix.'StatusConverted'); // deposit invoice
|
||||
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 == 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 ($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');
|
||||
}
|
||||
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
|
||||
* Possible usage for parameters:
|
||||
* - 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
|
||||
* - one couple id+type is provided and other type is provided -> this will set $justsource or $justtarget + criteria on other type
|
||||
*
|
||||
* - source id+type -> will get target list linked to source
|
||||
* - 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 string $sourcetype Object source type (if not defined, element name of object)
|
||||
@@ -2553,9 +2554,9 @@ abstract class CommonObject
|
||||
|
||||
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;
|
||||
if ($objecttype != 'supplier_proposal' && $objecttype != 'order_supplier' && $objecttype != 'invoice_supplier'
|
||||
&& preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs))
|
||||
@@ -2620,7 +2621,7 @@ abstract class CommonObject
|
||||
if ($conf->$module->enabled && (($element != $this->element) || $alsosametype))
|
||||
{
|
||||
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
|
||||
//print '/'.$classpath.'/'.$classfile.'.class.php';
|
||||
//print '/'.$classpath.'/'.$classfile.'.class.php '.class_exists($classname);
|
||||
if (class_exists($classname))
|
||||
{
|
||||
foreach($objectids as $i => $objectid) // $i is rowid into llx_element_element
|
||||
@@ -3016,9 +3017,16 @@ abstract class CommonObject
|
||||
|
||||
foreach ($this->lines as $line)
|
||||
{
|
||||
|
||||
if (isset($line->qty_asked))
|
||||
{
|
||||
if (empty($totalOrdered)) $totalOrdered=0; // Avoid warning because $totalOrdered is ''
|
||||
$totalOrdered+=$line->qty_asked; // defined for shipment only
|
||||
}
|
||||
if (isset($line->qty_shipped))
|
||||
{
|
||||
if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is ''
|
||||
$totalToShip+=$line->qty_shipped; // defined for shipment only
|
||||
}
|
||||
|
||||
// Define qty, weight, volume, weight_units, volume_units
|
||||
if ($this->element == 'shipping') $qty=$line->qty_shipped; // for shipments
|
||||
@@ -3033,8 +3041,11 @@ abstract class CommonObject
|
||||
if (! empty($weight_units)) $weightUnit = $weight_units;
|
||||
if (! empty($volume_units)) $volumeUnit = $volume_units;
|
||||
|
||||
if (empty($totalWeight)) $totalWeight=0; // Avoid warning because $totalWeight is ''
|
||||
if (empty($totalVolume)) $totalVolume=0; // Avoid warning because $totalVolume is ''
|
||||
|
||||
//var_dump($line->volume_units);
|
||||
if ($weight_units < 50) // >50 means a standard unit (power of 10 of official unit) > 50 means an exotic unit (like inch)
|
||||
if ($weight_units < 50) // >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
|
||||
{
|
||||
$trueWeightUnit=pow(10, $weightUnit);
|
||||
$totalWeight += $weight * $qty * $trueWeightUnit;
|
||||
@@ -3043,7 +3054,7 @@ abstract class CommonObject
|
||||
{
|
||||
$totalWeight += $weight * $qty; // This may be wrong if we mix different units
|
||||
}
|
||||
if ($volume_units < 50) // >50 means a standard unit (power of 10 of official unit) > 50 means an exotic unit (like inch)
|
||||
if ($volume_units < 50) // >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
|
||||
{
|
||||
//print $line->volume."x".$line->volume_units."x".($line->volume_units < 50)."x".$volumeUnit;
|
||||
$trueVolumeUnit=pow(10, $volumeUnit);
|
||||
|
||||
@@ -771,7 +771,7 @@ class ExtraFields
|
||||
}
|
||||
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')))
|
||||
{
|
||||
|
||||
@@ -118,7 +118,7 @@ class HookManager
|
||||
* @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.
|
||||
* 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.
|
||||
*/
|
||||
function executeHooks($method, $parameters=false, &$object='', &$action='')
|
||||
@@ -172,11 +172,11 @@ class HookManager
|
||||
'printObjectSubLine',
|
||||
'createDictionaryFieldList',
|
||||
'editDictionaryFieldlist',
|
||||
'getFormMail'
|
||||
'getFormMail',
|
||||
'showLinkToObjectBlock'
|
||||
)
|
||||
)) $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')
|
||||
{
|
||||
$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;
|
||||
$noMoreLinkedObjectBlockAfter=1;
|
||||
}
|
||||
|
||||
$res=@include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
|
||||
if ($res)
|
||||
{
|
||||
@@ -5440,6 +5441,26 @@ class Form
|
||||
'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)
|
||||
{
|
||||
@@ -5451,6 +5472,7 @@ class Form
|
||||
{
|
||||
print '<div id="'.$key.'list"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>';
|
||||
$sql = $possiblelink['sql'];
|
||||
|
||||
$resqllist = $this->db->query($sql);
|
||||
if ($resqllist)
|
||||
{
|
||||
@@ -5466,7 +5488,7 @@ class Form
|
||||
print '<td class="nowrap"></td>';
|
||||
print '<td align="center">' . $langs->trans("Ref") . '</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 '</tr>';
|
||||
while ($i < $num)
|
||||
@@ -5480,7 +5502,7 @@ class Form
|
||||
print '</td>';
|
||||
print '<td align="center">' . $objp->ref . '</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 '</tr>';
|
||||
$i++;
|
||||
@@ -5658,10 +5680,15 @@ class Form
|
||||
//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);
|
||||
|
||||
//$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>':'';
|
||||
//$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>':'';
|
||||
$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>';
|
||||
$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 = $_SERVER["PHP_SELF"];
|
||||
// Special case for project/task page
|
||||
if ($paramid == 'project_ref')
|
||||
{
|
||||
$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;
|
||||
$ret.='<!-- Start banner content --><div style="vertical-align: middle">';
|
||||
@@ -5876,7 +5903,7 @@ class Form
|
||||
*/
|
||||
global $dolibarr_main_url_root;
|
||||
$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
|
||||
{
|
||||
|
||||
@@ -1018,10 +1018,11 @@ class FormFile
|
||||
$minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original
|
||||
if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension
|
||||
//print $file['path'].'/'.$minifile.'<br>';
|
||||
|
||||
$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 '<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>';
|
||||
}
|
||||
else print ' ';
|
||||
|
||||
@@ -294,8 +294,8 @@ class Notify
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
// Define some vars
|
||||
$application = $mysoc->name;
|
||||
//if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $application = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
$application = 'Dolibarr';
|
||||
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $application = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
$replyto = $conf->notification->email_from;
|
||||
$filename = basename($file);
|
||||
$mimefile = dol_mimetype($file);
|
||||
@@ -321,18 +321,7 @@ class Notify
|
||||
|
||||
// Check notification per user
|
||||
$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.= " a.rowid as adid, a.label, a.code, n.rowid, n.type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as c,";
|
||||
@@ -367,6 +356,8 @@ class Notify
|
||||
$outputlangs->setDefaultLang($obj->default_lang);
|
||||
}
|
||||
|
||||
$subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification");
|
||||
|
||||
switch ($notifcode) {
|
||||
case 'BILL_VALIDATE':
|
||||
$link='/compta/facture.php?facid='.$object->id;
|
||||
@@ -446,8 +437,6 @@ class Notify
|
||||
$filepdf = $pdf_path;
|
||||
}
|
||||
|
||||
$subject = '['.$application.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification");
|
||||
|
||||
$message = $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification",$application,$mysoc->name)."\n";
|
||||
$message.= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n";
|
||||
$message.= "\n";
|
||||
@@ -535,6 +524,8 @@ class Notify
|
||||
$link = '';
|
||||
$num++;
|
||||
|
||||
$subject = '['.$mysoc->name.'] '.$langs->transnoentitiesnoconv("DolibarrNotification");
|
||||
|
||||
switch ($notifcode) {
|
||||
case 'BILL_VALIDATE':
|
||||
$link='/compta/facture.php?facid='.$object->id;
|
||||
@@ -622,8 +613,6 @@ class Notify
|
||||
$filepdf = $pdf_path;
|
||||
}
|
||||
|
||||
$subject = '['.$application.'] '.$langs->transnoentitiesnoconv("DolibarrNotification");
|
||||
|
||||
$message = $langs->transnoentities("YouReceiveMailBecauseOfNotification",$application,$mysoc->name)."\n";
|
||||
$message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n";
|
||||
$message.= "\n";
|
||||
|
||||
@@ -1217,7 +1217,7 @@ class SMTPs
|
||||
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
|
||||
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
|
||||
|
||||
$host=dol_getprefix('email').'-'.$host;
|
||||
$host=dol_getprefix('email');
|
||||
|
||||
//NOTE: Message-ID should probably contain the username of the user who sent the msg
|
||||
$_header .= 'Subject: ' . $this->getSubject() . "\r\n";
|
||||
|
||||
@@ -29,17 +29,16 @@
|
||||
*/
|
||||
class Translate
|
||||
{
|
||||
var $dir; // Directories that contains /langs subdirectory
|
||||
public $dir; // Directories that contains /langs subdirectory
|
||||
|
||||
var $defaultlang; // Current language for current user
|
||||
var $direction = 'ltr'; // Left to right or Right to left
|
||||
var $charset_output='UTF-8'; // Codage used by "trans" method outputs
|
||||
public $defaultlang; // Current language for current user
|
||||
public $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
|
||||
|
||||
var $cache_labels=array(); // Cache for labels return by getLabelFromKey method
|
||||
var $cache_currencies=array(); // Cache to store currency symbols
|
||||
public $cache_labels=array(); // Cache for labels return by getLabelFromKey method
|
||||
public $cache_currencies=array(); // Cache to store currency symbols
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -197,9 +197,10 @@ function checkBanForAccount($account)
|
||||
$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789");
|
||||
// Separation du rib en 3 groupes de 7 + 1 groupe de 2.
|
||||
// Multiplication de chaque groupe par les coef du tableau
|
||||
|
||||
for ($i = 0, $s = 0; $i < 3; $i++) {
|
||||
$code = substr($rib, 7 * $i, 7);
|
||||
$s += (0 + $code) * $coef[$i];
|
||||
$s += (0 + (int) $code) * $coef[$i];
|
||||
}
|
||||
// Soustraction du modulo 97 de $s a 97 pour obtenir la cle
|
||||
$cle_rib = 97 - ($s % 97);
|
||||
|
||||
@@ -92,12 +92,14 @@ function dol_print_cron_urls()
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
// Cron launch
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
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;
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
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';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
$logintouse = 'firstadmin';
|
||||
@@ -110,6 +112,8 @@ function dol_print_cron_urls()
|
||||
print '<br>';
|
||||
|
||||
// Add note
|
||||
if (empty($conf->global->CRON_DISABLE_TUTORIAL_CRON))
|
||||
{
|
||||
$linuxlike=1;
|
||||
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
|
||||
if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
|
||||
@@ -124,6 +128,7 @@ function dol_print_cron_urls()
|
||||
{
|
||||
print $langs->trans("CronExplainHowToRunWin");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -171,11 +171,11 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
|
||||
|
||||
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='';
|
||||
$sDay=0;
|
||||
$sWeek='';
|
||||
$sWeek=0;
|
||||
|
||||
if ($iSecond >= $lengthOfDay)
|
||||
{
|
||||
|
||||
@@ -1091,7 +1091,6 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
||||
|
||||
}
|
||||
} elseif ($link) {
|
||||
if (dol_mkdir($upload_dir) >= 0) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
|
||||
$linkObject = new Link($db);
|
||||
$linkObject->entity = $conf->entity;
|
||||
@@ -1107,7 +1106,6 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
||||
setEventMessages($langs->trans("ErrorFileNotLinked"), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
|
||||
@@ -967,7 +967,7 @@ function dol_get_fiche_end($notab=0)
|
||||
* @param int $nodbprefix Do not include DB prefix to forge table name
|
||||
* @param string $morehtmlleft More html code to show before ref
|
||||
* @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
|
||||
* @return void
|
||||
*/
|
||||
@@ -2504,7 +2504,7 @@ function img_edit($titlealt = 'default', $float = 0, $other = '')
|
||||
|
||||
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 $center String in the middle ('' by default). We often find here string $massaction comming from $form->selectMassAction()
|
||||
* @param int $num Number of records found by select with limit+1
|
||||
* @param int $totalnboflines Total number of records/lines for all pages (if known). Use a negative value to not show number.
|
||||
* @param int|string $totalnboflines Total number of records/lines for all pages (if known). Use a negative value of number to not show number. Use '' if unknown.
|
||||
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
|
||||
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
|
||||
* @param string $morehtml More html to show
|
||||
@@ -3193,7 +3193,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
|
||||
* @param int $hideselectlimit Force to hide select limit
|
||||
* @return void
|
||||
*/
|
||||
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=-1, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
|
||||
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@@ -3223,7 +3223,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
||||
print '<td class="nobordernopadding valignmiddle">';
|
||||
if ($picto && $titre) print img_picto('', $picto, 'class="hideonsmartphone valignmiddle" id="pictotitle"', $pictoisfullpath);
|
||||
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>';
|
||||
|
||||
// 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;
|
||||
|
||||
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);
|
||||
$tmpkey=$limit.':'.$limit;
|
||||
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 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 $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
|
||||
*/
|
||||
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*\|\s*/','|', $value);
|
||||
|
||||
$crits = explode(' ', $value);
|
||||
$res = '';
|
||||
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('/\{yy\}/i', date("y",$date)+$yearoffset, $numFinal);
|
||||
$numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),2,1)+$yearoffset, $numFinal);
|
||||
$numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),1,1)+$yearoffset, $numFinal);
|
||||
}
|
||||
else // we want yyyy to be current year
|
||||
{
|
||||
$numFinal = preg_replace('/\{yyyy\}/i',date("Y",$date), $numFinal);
|
||||
$numFinal = preg_replace('/\{yy\}/i', date("y",$date), $numFinal);
|
||||
$numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),2,1), $numFinal);
|
||||
$numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),1,1), $numFinal);
|
||||
}
|
||||
$numFinal = preg_replace('/\{mm\}/i', date("m",$date), $numFinal);
|
||||
$numFinal = preg_replace('/\{dd\}/i', date("d",$date), $numFinal);
|
||||
|
||||
@@ -74,16 +74,18 @@ function dol_getImageSize($file, $url = false)
|
||||
|
||||
if (image_format_supported($file) < 0) return $ret;
|
||||
|
||||
$fichier = $file;
|
||||
$filetoread = $file;
|
||||
if (!$url)
|
||||
{
|
||||
$fichier = realpath($file); // Chemin canonique absolu de l'image
|
||||
$dir = dirname($file); // Chemin du dossier contenant l'image
|
||||
$filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image
|
||||
}
|
||||
|
||||
$infoImg = getimagesize($fichier); // Recuperation des infos de l'image
|
||||
if ($filetoread)
|
||||
{
|
||||
$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;
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
$fichier = realpath($file); // Chemin canonique absolu de l'image
|
||||
$dir = dirname($file); // Chemin du dossier contenant l'image
|
||||
$filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de 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
|
||||
$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])
|
||||
{
|
||||
case 1: // Gif
|
||||
$img = imagecreatefromgif($fichier);
|
||||
$img = imagecreatefromgif($filetoread);
|
||||
$extImg = '.gif'; // File name extension of image
|
||||
$newquality='NU'; // Quality is not used for this format
|
||||
break;
|
||||
case 2: // Jpg
|
||||
$img = imagecreatefromjpeg($fichier);
|
||||
$img = imagecreatefromjpeg($filetoread);
|
||||
$extImg = '.jpg';
|
||||
$newquality=100; // % quality maximum
|
||||
break;
|
||||
case 3: // Png
|
||||
$img = imagecreatefrompng($fichier);
|
||||
$img = imagecreatefrompng($filetoread);
|
||||
$extImg = '.png';
|
||||
$newquality=0; // No compression (0-9)
|
||||
break;
|
||||
case 4: // Bmp
|
||||
$img = imagecreatefromwbmp($fichier);
|
||||
$img = imagecreatefromwbmp($filetoread);
|
||||
$extImg = '.bmp';
|
||||
$newquality='NU'; // Quality is not used for this format
|
||||
break;
|
||||
@@ -383,10 +384,9 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
|
||||
return 'Error: Wrong value for parameter maxHeight';
|
||||
}
|
||||
|
||||
$fichier = realpath($file); // Chemin canonique absolu de l'image
|
||||
$dir = dirname($file); // Chemin du dossier contenant l'image
|
||||
$filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de 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
|
||||
$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
|
||||
$dirthumb = $dir.($outdir?'/'.$outdir:''); // Chemin du dossier contenant les vignettes
|
||||
$dirthumb = dirname($file).($outdir?'/'.$outdir:''); // Chemin du dossier contenant les vignettes
|
||||
dol_mkdir($dirthumb);
|
||||
|
||||
// Initialisation des variables selon l'extension de l'image
|
||||
switch($infoImg[2])
|
||||
{
|
||||
case IMAGETYPE_GIF: // 1
|
||||
$img = imagecreatefromgif($fichier);
|
||||
$img = imagecreatefromgif($filetoread);
|
||||
$extImg = '.gif'; // Extension de l'image
|
||||
break;
|
||||
case IMAGETYPE_JPEG: // 2
|
||||
$img = imagecreatefromjpeg($fichier);
|
||||
$img = imagecreatefromjpeg($filetoread);
|
||||
$extImg = (preg_match('/\.jpeg$/',$file)?'.jpeg':'.jpg'); // Extension de l'image
|
||||
break;
|
||||
case IMAGETYPE_PNG: // 3
|
||||
$img = imagecreatefrompng($fichier);
|
||||
$img = imagecreatefrompng($filetoread);
|
||||
$extImg = '.png';
|
||||
break;
|
||||
case IMAGETYPE_BMP: // 6
|
||||
@@ -453,7 +453,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
|
||||
$extImg = '.bmp';
|
||||
break;
|
||||
case IMAGETYPE_WBMP: // 15
|
||||
$img = imagecreatefromwbmp($fichier);
|
||||
$img = imagecreatefromwbmp($filetoread);
|
||||
$extImg = '.bmp';
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -26,9 +26,13 @@
|
||||
// Supported OAUTH (a provider is supported when a file xxx_oauthcallback.php is available into htdocs/core/modules/oauth)
|
||||
$supportedoauth2array=array(
|
||||
'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
|
||||
$list = array (
|
||||
array(
|
||||
@@ -264,7 +268,7 @@ function oauthadmin_prepare_head()
|
||||
$h++;
|
||||
|
||||
$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';
|
||||
$h++;
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
||||
$result=array();
|
||||
|
||||
// Clean parameters
|
||||
if (empty($info_bits)) $info_bits=0;
|
||||
if (empty($txtva)) $txtva=0;
|
||||
if (empty($seller) || ! is_object($seller))
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user