Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into
dev_changelistchild Conflicts: htdocs/core/class/commonobject.class.php
This commit is contained in:
commit
d714a52f95
@ -12,6 +12,7 @@ php:
|
|||||||
- '5.5'
|
- '5.5'
|
||||||
- '5.6'
|
- '5.6'
|
||||||
- '7.0'
|
- '7.0'
|
||||||
|
- '7.1'
|
||||||
- nightly
|
- nightly
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
@ -50,6 +51,7 @@ env:
|
|||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
|
- php: 7.1
|
||||||
- php: nightly
|
- php: nightly
|
||||||
# FIXME
|
# FIXME
|
||||||
#- env: DB=postgresql
|
#- env: DB=postgresql
|
||||||
@ -96,7 +98,7 @@ install:
|
|||||||
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
|
||||||
composer -n require phpunit/phpunit ^4
|
composer -n require phpunit/phpunit ^4
|
||||||
fi
|
fi
|
||||||
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||||
composer -n require phpunit/phpunit ^5
|
composer -n require phpunit/phpunit ^5
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
@ -136,7 +138,7 @@ before_script:
|
|||||||
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||||
echo
|
echo
|
||||||
echo "Enabling Memcached for PHP <= 5.4"
|
echo "Enabling Memcached for PHP <= 5.4"
|
||||||
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly!
|
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1 and nightly!
|
||||||
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||||
fi
|
fi
|
||||||
phpenv rehash
|
phpenv rehash
|
||||||
@ -208,7 +210,7 @@ before_script:
|
|||||||
echo "Setting up Apache + FPM"
|
echo "Setting up Apache + FPM"
|
||||||
# enable php-fpm
|
# enable php-fpm
|
||||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
|
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
|
||||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||||
# Copy the included pool
|
# Copy the included pool
|
||||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf
|
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf
|
||||||
fi
|
fi
|
||||||
|
|||||||
158
ChangeLog
158
ChangeLog
@ -151,6 +151,55 @@ Dolibarr better:
|
|||||||
no more required, were also removed. Use this new one if you were using one of them.
|
no more required, were also removed. Use this new one if you were using one of them.
|
||||||
- The trigger that activate or close a contract line is run on a contract line, not on contract.
|
- The trigger that activate or close a contract line is run on a contract line, not on contract.
|
||||||
|
|
||||||
|
Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful on PHP 7.1 but we don't have enough
|
||||||
|
feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0.
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 4.0.3 to 4.0.2 *****
|
||||||
|
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||||
|
FIX: #5958 no discount on supplier command made by replenishment
|
||||||
|
FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them
|
||||||
|
FIX: #5972 #5734
|
||||||
|
FIX: #6007
|
||||||
|
FIX: #6010
|
||||||
|
FIX: #6029
|
||||||
|
FIX: #6043 - Payment mode not visible on supplier invoice list
|
||||||
|
FIX: #6051
|
||||||
|
FIX: #6062
|
||||||
|
FIX: #6088
|
||||||
|
FIX: A draft can be deleted by a user with create permission.
|
||||||
|
FIX: bad permission to see contract on home page
|
||||||
|
FIX: bad permission to see contract statistics
|
||||||
|
FIX: Bcc must not appears to recipient when using SMTPs lib
|
||||||
|
FIX: Consistent description for add or edit product
|
||||||
|
FIX: delete contract extrafields on contract deletion
|
||||||
|
FIX: Deposits and credit notes weren't added in the received and pending columns
|
||||||
|
FIX: export extrafields must not include separe type
|
||||||
|
FIX: Export of opportunity status must be code, not id.
|
||||||
|
FIX: False positive on services not activated
|
||||||
|
FIX: Filter was wrong or lost during navigation
|
||||||
|
FIX: HT and TTC price should always be displayed together
|
||||||
|
FIX: if a supplier price reference is changed after creating an order, we can't clone order.
|
||||||
|
FIX: in export. Error when using a separate extrafields.
|
||||||
|
FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email.
|
||||||
|
FIX: javascript error when using on mobile/smartphone
|
||||||
|
FIX: javascript xss injection and a translation
|
||||||
|
FIX: Label of project is in field title not label.
|
||||||
|
FIX: List of people able to validate an expense report was not complete.
|
||||||
|
FIX: Missing field
|
||||||
|
FIX: Module gravatar was not triggered on thirdparty and contact card
|
||||||
|
FIX: Must use external link into a forged email content.
|
||||||
|
FIX: Pb in management of date end of projects
|
||||||
|
FIX: Regression when deleting product
|
||||||
|
FIX: rendering of output of estimated amount on project overview page.
|
||||||
|
FIX: Sanitize title of ajax_dialog
|
||||||
|
FIX: Security to restrict email sending was not efficient
|
||||||
|
FIX: Setting supplier as client when accept a supplier proposal
|
||||||
|
FIX: Some statistics not compatible with multicompany module.
|
||||||
|
FIX: the time spent on project was not visible in its overwiew
|
||||||
|
FIX: Update intervention lline crash with PgSQL
|
||||||
|
FIX: wrong test on dict.php
|
||||||
|
FIX: wrong var name
|
||||||
|
|
||||||
***** ChangeLog for 4.0.2 compared to 4.0.1 *****
|
***** ChangeLog for 4.0.2 compared to 4.0.1 *****
|
||||||
FIX: #5340
|
FIX: #5340
|
||||||
@ -357,6 +406,115 @@ So if you included it into your module, change your code like this to be compati
|
|||||||
if (! $res) include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
if (! $res) include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 3.9.4 compared to 3.9.3 *****
|
||||||
|
FIX: #2853
|
||||||
|
FIX: #3128
|
||||||
|
FIX: #4447
|
||||||
|
FIX: #5128 if create method return duplicated code error not use GETPOST in order to get a new code
|
||||||
|
FIX: #5340
|
||||||
|
FIX: #5473
|
||||||
|
FIX: #5474 Country_id of "Don" object is still empty
|
||||||
|
FIX: #5534
|
||||||
|
FIX: #5535 bad dependency.
|
||||||
|
FIX: #5537 AJAX project search does not work properly
|
||||||
|
FIX: #5540 getFormMail is not registered as addReplace hook
|
||||||
|
FIX: #5544 Disabled Contact still appear in lists to send emails
|
||||||
|
FIX: #5549 getNomUrl tooltips show Order info even if user has no rights to read them
|
||||||
|
FIX: #5568
|
||||||
|
FIX: #5594
|
||||||
|
FIX: #5629 PgSQL Interger string stylish error
|
||||||
|
FIX: #5651
|
||||||
|
FIX: #5660
|
||||||
|
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||||
|
FIX: #5907
|
||||||
|
FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them
|
||||||
|
FIX: #6051
|
||||||
|
FIX: #6088
|
||||||
|
FIX: Can correct stock of lot using eatby or sell by date
|
||||||
|
FIX: Can make a movement on "out of sell" products
|
||||||
|
FIX: cannot update bank account on invoice if module order not activated
|
||||||
|
FIX: Can't create withdrawal document
|
||||||
|
FIX: delete contract extrafields on contract deletion
|
||||||
|
FIX: Direction of movement lost if an error occurs
|
||||||
|
FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is daughter of an already linked to object
|
||||||
|
FIX: export extrafields must not include separe type
|
||||||
|
FIX: External user must not be able to edit its discounts
|
||||||
|
FIX: Failed to export contact categories with contact extra fields
|
||||||
|
FIX: header title in commercial area
|
||||||
|
FIX: HT and TTC price should always be displayed together
|
||||||
|
FIX: incoterms
|
||||||
|
FIX: incoterms do not output into crabe invoice PDF
|
||||||
|
FIX: in PgSQL no quote "word style" is permitted around column name
|
||||||
|
FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email.
|
||||||
|
FIX: margin tab on customer card must filter on current entity invoices
|
||||||
|
FIX: missing column into SQL on thridparty list
|
||||||
|
FIX: only show projects of related third if external user
|
||||||
|
FIX: PgSQL Module Ressource list crash #5637
|
||||||
|
FIX: php Strict
|
||||||
|
FIX: Regression when deleting product
|
||||||
|
FIX: Security to restrict email sending was not efficient
|
||||||
|
FIX: tag for date rfc in odt substitution
|
||||||
|
FIX: Update intervention lline crash with PgSQL
|
||||||
|
FIX: update limit stock on product stock
|
||||||
|
FIX: vat dictionary should allow enter and edit multiple values for localtaxes, separated by: (ex -19:-15)
|
||||||
|
FIX: wrong test on dict.php
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 3.9.4 compared to 3.9.3 *****
|
||||||
|
FIX: #2853
|
||||||
|
FIX: #3128
|
||||||
|
FIX: #4447
|
||||||
|
FIX: #5128 if create method return duplicated code error not use GETPOST in order to get a new code
|
||||||
|
FIX: #5340
|
||||||
|
FIX: #5473
|
||||||
|
FIX: #5474 Country_id of "Don" object is still empty
|
||||||
|
FIX: #5534
|
||||||
|
FIX: #5535 bad dependency.
|
||||||
|
FIX: #5537 AJAX project search does not work properly
|
||||||
|
FIX: #5540 getFormMail is not registered as addReplace hook
|
||||||
|
FIX: #5544 Disabled Contact still appear in lists to send emails
|
||||||
|
FIX: #5549 getNomUrl tooltips show Order info even if user has no rights to read them
|
||||||
|
FIX: #5568
|
||||||
|
FIX: #5594
|
||||||
|
FIX: #5629 PgSQL Interger string stylish error
|
||||||
|
FIX: #5651
|
||||||
|
FIX: #5660
|
||||||
|
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||||
|
FIX: #5907
|
||||||
|
FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them
|
||||||
|
FIX: #6051
|
||||||
|
FIX: #6088
|
||||||
|
FIX: Can correct stock of lot using eatby or sell by date
|
||||||
|
FIX: Can make a movement on "out of sell" products
|
||||||
|
FIX: cannot update bank account on invoice if module order not activated
|
||||||
|
FIX: Can't create withdrawal document
|
||||||
|
FIX: delete contract extrafields on contract deletion
|
||||||
|
FIX: Direction of movement lost if an error occurs
|
||||||
|
FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is daughter of an already linked to object
|
||||||
|
FIX: export extrafields must not include separe type
|
||||||
|
FIX: External user must not be able to edit its discounts
|
||||||
|
FIX: Failed to export contact categories with contact extra fields
|
||||||
|
FIX: header title in commercial area
|
||||||
|
FIX: HT and TTC price should always be displayed together
|
||||||
|
FIX: incoterms
|
||||||
|
FIX: incoterms do not output into crabe invoice PDF
|
||||||
|
FIX: in PgSQL no quote "word style" is permitted around column name
|
||||||
|
FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email.
|
||||||
|
FIX: margin tab on customer card must filter on current entity invoices
|
||||||
|
FIX: missing column into SQL on thridparty list
|
||||||
|
FIX: only show projects of related third if external user
|
||||||
|
FIX: PgSQL Module Ressource list crash #5637
|
||||||
|
FIX: php Strict
|
||||||
|
FIX: Regression when deleting product
|
||||||
|
FIX: Security to restrict email sending was not efficient
|
||||||
|
FIX: tag for date rfc in odt substitution
|
||||||
|
FIX: Update intervention lline crash with PgSQL
|
||||||
|
FIX: update limit stock on product stock
|
||||||
|
FIX: vat dictionary should allow enter and edit multiple values for localtaxes, separated by: (ex -19:-15)
|
||||||
|
FIX: wrong test on dict.php
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 3.9.3 compared to 3.9.2 *****
|
***** ChangeLog for 3.9.3 compared to 3.9.2 *****
|
||||||
FIX: #4383 $userid not defined
|
FIX: #4383 $userid not defined
|
||||||
FIX: #4448 $filebonprev is not used, $this->filename now
|
FIX: #4448 $filebonprev is not used, $this->filename now
|
||||||
|
|||||||
19
README-FR.md
19
README-FR.md
@ -54,19 +54,10 @@ Pour mettre a jour Dolibarr depuis une vieille version vers celle ci:
|
|||||||
- Ecraser les vieux fichiers dans le vieux repertoire 'dolibarr' par les fichiers
|
- Ecraser les vieux fichiers dans le vieux repertoire 'dolibarr' par les fichiers
|
||||||
fournis dans ce nouveau package.
|
fournis dans ce nouveau package.
|
||||||
|
|
||||||
- Si vous venez d'une version x.y.z vers x.y.w (seul le 3eme chiffre varie),
|
- Au prochain accès, Dolibarr proposera la page de "mise a jour" des données (si necessaire).
|
||||||
il n'y a pas besoin de migration de données.
|
Si un fichier install.lock existe pour vérouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transféré sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")
|
||||||
|
|
||||||
- Si vous venez d'une beta ou d'un version x.y.z vers une autre ou les numeros x
|
|
||||||
ou y varient, vous devez appelez la page "install/" de migration dans votre
|
|
||||||
navigateur (ceci doit se faire automatiquement au premier accès de l'application).
|
|
||||||
Ce sera une URL du genre:
|
|
||||||
http://localhost/dolibarr/htdocs/install/index.php
|
|
||||||
ou
|
|
||||||
http://yourdolibarrhost/install/index.php
|
|
||||||
|
|
||||||
Ensuite, choisir l'option de "mise a jour" en rapport avec votre cas.
|
*Note: Le processus de migration peut etre lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
|
||||||
Note: Le processus de migration peut etre lance plusieurs fois sans risque.
|
|
||||||
|
|
||||||
|
|
||||||
## CE QUI EST NOUVEAU
|
## CE QUI EST NOUVEAU
|
||||||
@ -86,11 +77,13 @@ Voir fichier ChangeLog.
|
|||||||
- Gestion des factures clients/fournisseurs et paiements
|
- Gestion des factures clients/fournisseurs et paiements
|
||||||
- Gestion des virements bancaires SEPA
|
- Gestion des virements bancaires SEPA
|
||||||
- Gestion des comptes bancaires
|
- Gestion des comptes bancaires
|
||||||
- Agenda partagé
|
- Calendrier/Agenda partagé (avec export ical, vcal)
|
||||||
- Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...)
|
- Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...)
|
||||||
- Gestion de contrats de services
|
- Gestion de contrats de services
|
||||||
- Gestion de stock
|
- Gestion de stock
|
||||||
- Gestion des expéditions
|
- Gestion des expéditions
|
||||||
|
- Gestion des demandes de congès
|
||||||
|
- Gestion des notes de frais
|
||||||
- GED (Gestion Electronique de Documents)
|
- GED (Gestion Electronique de Documents)
|
||||||
- EMailings de masse
|
- EMailings de masse
|
||||||
- Réalisation de sondages
|
- Réalisation de sondages
|
||||||
|
|||||||
22
README.md
22
README.md
@ -26,6 +26,16 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git
|
|||||||
|
|
||||||
Releases can be downloaded from [official website](https://www.dolibarr.org/).
|
Releases can be downloaded from [official website](https://www.dolibarr.org/).
|
||||||
|
|
||||||
|
### Install from composer
|
||||||
|
If you do not already have Composer installed, you may do so by following the instructions at getcomposer.org. On Linux and Mac OS X, you'll run the following commands:
|
||||||
|
|
||||||
|
curl -sS https://getcomposer.org/installer | php
|
||||||
|
mv composer.phar /usr/local/bin/composer
|
||||||
|
|
||||||
|
On Windows, you'll download and run https://getcomposer.org/Composer-Setup.exe
|
||||||
|
|
||||||
|
composer create-project dolibarr/dolibarr erp
|
||||||
|
|
||||||
### Simple setup
|
### Simple setup
|
||||||
|
|
||||||
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in few clicks, you can use one of the packaged versions:
|
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in few clicks, you can use one of the packaged versions:
|
||||||
@ -60,10 +70,10 @@ You can use a Web server and a supported database (MariaDb, MySql or Postgresql)
|
|||||||
## UPGRADING
|
## UPGRADING
|
||||||
|
|
||||||
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
|
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
|
||||||
- If you're upgrading from version x.y.z to x.y.w (only third number differs), there is no need to run any migration process.
|
- At first next access, Dolibarr will redirect your to the "install/" page to make the upgrade process.
|
||||||
- If you're upgrading from a beta version or from any version x.y.z to any other where x or y number differs, you must call the Dolibarr "install/" page in your browser (this should be done automatically at first dolibarr access) and follow the upgrade process.
|
If a file install.lock exists to lock any run of upgrade process, the application will ask you to remove the file manually (you should find the install.lock file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "documents").
|
||||||
|
|
||||||
*Note: migration process can safely be done multiple times.*
|
*Note: migration process can safely be done multiple times by calling the page /install/index.php*
|
||||||
|
|
||||||
## WHAT'S NEW
|
## WHAT'S NEW
|
||||||
|
|
||||||
@ -80,17 +90,17 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Invoices and payment management
|
- Invoices and payment management
|
||||||
- Standing orders management (European SEPA)
|
- Standing orders management (European SEPA)
|
||||||
- Bank accounts management
|
- Bank accounts management
|
||||||
- Shared calendar
|
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||||
- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...)
|
- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...)
|
||||||
- Projects management
|
- Projects management
|
||||||
- Contracts management
|
- Contracts management
|
||||||
- Stock management
|
- Stock management
|
||||||
- Shipping management
|
- Shipping management
|
||||||
- Interventions management
|
- Interventions management
|
||||||
- Agenda with ical and vcal export for third party tools integration
|
- Employee's leave requests management
|
||||||
|
- Expense report management
|
||||||
- Electronic Document Management (EDM)
|
- Electronic Document Management (EDM)
|
||||||
- Foundations members management
|
- Foundations members management
|
||||||
- Employee's holidays management
|
|
||||||
- Mass emailing
|
- Mass emailing
|
||||||
- Surveys
|
- Surveys
|
||||||
- Point of Sale
|
- Point of Sale
|
||||||
|
|||||||
@ -320,8 +320,8 @@ x.y.z+dfsgw
|
|||||||
Note: If there was errors solved manually after get-orig-sources.sh, you may need to make a git commit
|
Note: If there was errors solved manually after get-orig-sources.sh, you may need to make a git commit
|
||||||
|
|
||||||
* Update/fix debian/* files used to build package.
|
* Update/fix debian/* files used to build package.
|
||||||
At least, add an entry into debian/changelog
|
At least, add an entry into debian/changelog with command
|
||||||
> dch -v x.y.z+dfsgw-v "My comment" will add entry.
|
> dch -v x.y.z+dfsgw-1 "My comment"
|
||||||
For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increased for each new import)
|
For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increased for each new import)
|
||||||
Then check/modify changelog to replace "version" or "unstable" with "UNRELEASED".
|
Then check/modify changelog to replace "version" or "unstable" with "UNRELEASED".
|
||||||
Then check/modify also the user/date signature:
|
Then check/modify also the user/date signature:
|
||||||
@ -332,7 +332,9 @@ Then check/modify also the user/date signature:
|
|||||||
To update dolibarr debian package when only files into debian has changed:
|
To update dolibarr debian package when only files into debian has changed:
|
||||||
|
|
||||||
* Change files and commit.
|
* Change files and commit.
|
||||||
* Add a tag debian/x.y.z+dfsgw-2 (increase the last 1 into 2, 3...)
|
* Add a line into changelog for version debian/x.y.z+dfsgw-v (increase the last v into 2, 3...)
|
||||||
|
> dch -v x.y.z+dfsgw-v "My comment"
|
||||||
|
* git tag will be added when package is pushed.
|
||||||
|
|
||||||
|
|
||||||
To update dolibarr debian package when only files not into debian has changed:
|
To update dolibarr debian package when only files not into debian has changed:
|
||||||
|
|||||||
@ -26,11 +26,11 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
|
|||||||
# Misc dependencies
|
# Misc dependencies
|
||||||
# fonts-dejavu-core | ttf-dejavu-core,
|
# fonts-dejavu-core | ttf-dejavu-core,
|
||||||
xdg-utils,
|
xdg-utils,
|
||||||
virtual-mysql-client,
|
mariadb-client | virtual-mysql-client,
|
||||||
${misc:Depends},
|
${misc:Depends},
|
||||||
${perl:Depends}
|
${perl:Depends}
|
||||||
Recommends: apache2 | lighttpd | httpd,
|
Recommends: apache2 | lighttpd | httpd,
|
||||||
virtual-mysql-server
|
mariadb-server | virtual-mysql-server
|
||||||
Suggests: www-browser, php5-geoip
|
Suggests: www-browser, php5-geoip
|
||||||
Description: Web based software to manage a company or foundation
|
Description: Web based software to manage a company or foundation
|
||||||
Dolibarr ERP & CRM is an easy to use open source/free software package for
|
Dolibarr ERP & CRM is an easy to use open source/free software package for
|
||||||
|
|||||||
22
build/generate_filelist_xml.php
Normal file → Executable file
22
build/generate_filelist_xml.php
Normal file → Executable file
@ -65,6 +65,8 @@ fputs($fp, '<checksum_list version="'.$release.'">'."\n");
|
|||||||
|
|
||||||
fputs($fp, '<dolibarr_htdocs_dir>'."\n");
|
fputs($fp, '<dolibarr_htdocs_dir>'."\n");
|
||||||
|
|
||||||
|
$checksumconcat=array();
|
||||||
|
|
||||||
$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
|
$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
|
||||||
$iterator1 = new RecursiveIteratorIterator($dir_iterator1);
|
$iterator1 = new RecursiveIteratorIterator($dir_iterator1);
|
||||||
// need to ignore document custom etc
|
// need to ignore document custom etc
|
||||||
@ -81,12 +83,22 @@ foreach ($files as $file) {
|
|||||||
$needtoclose=1;
|
$needtoclose=1;
|
||||||
}
|
}
|
||||||
if (filetype($file)=="file") {
|
if (filetype($file)=="file") {
|
||||||
fputs($fp, '<md5file name="'.basename($file).'">'.md5_file($file).'</md5file>'."\n");
|
$md5=md5_file($file);
|
||||||
|
$checksumconcat[]=$md5;
|
||||||
|
fputs($fp, '<md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fputs($fp, '</dir>'."\n");
|
fputs($fp, '</dir>'."\n");
|
||||||
fputs($fp, '</dolibarr_htdocs_dir>'."\n");
|
fputs($fp, '</dolibarr_htdocs_dir>'."\n");
|
||||||
|
|
||||||
|
asort($checksumconcat); // Sort list of checksum
|
||||||
|
//var_dump($checksumconcat);
|
||||||
|
fputs($fp, '<dolibarr_htdocs_dir_checksum>'."\n");
|
||||||
|
fputs($fp, md5(join(',',$checksumconcat))."\n");
|
||||||
|
fputs($fp, '</dolibarr_htdocs_dir_checksum>'."\n");
|
||||||
|
|
||||||
|
|
||||||
|
$checksumconcat=array();
|
||||||
|
|
||||||
fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n");
|
fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n");
|
||||||
|
|
||||||
@ -106,12 +118,18 @@ foreach ($files as $file) {
|
|||||||
$needtoclose=1;
|
$needtoclose=1;
|
||||||
}
|
}
|
||||||
if (filetype($file)=="file") {
|
if (filetype($file)=="file") {
|
||||||
fputs($fp, '<md5file name="'.basename($file).'">'.md5_file($file).'</md5file>'."\n");
|
$md5=md5_file($file);
|
||||||
|
$checksumconcat[]=$md5;
|
||||||
|
fputs($fp, '<md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fputs($fp, '</dir>'."\n");
|
fputs($fp, '</dir>'."\n");
|
||||||
fputs($fp, '</dolibarr_script_dir>'."\n");
|
fputs($fp, '</dolibarr_script_dir>'."\n");
|
||||||
|
|
||||||
|
asort($checksumconcat); // Sort list of checksum
|
||||||
|
fputs($fp, '<dolibarr_script_dir_checksum>'."\n");
|
||||||
|
fputs($fp, md5(join(',',$checksumconcat))."\n");
|
||||||
|
fputs($fp, '</dolibarr_script_dir_checksum>'."\n");
|
||||||
|
|
||||||
fputs($fp, '</checksum_list>'."\n");
|
fputs($fp, '</checksum_list>'."\n");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|||||||
@ -162,7 +162,7 @@ export res=$?
|
|||||||
|
|
||||||
|
|
||||||
# ---------------------------- copy demo files
|
# ---------------------------- copy demo files
|
||||||
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" `
|
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' `
|
||||||
if [ "x$documentdir" != "x" ]
|
if [ "x$documentdir" != "x" ]
|
||||||
then
|
then
|
||||||
echo cp -pr $mydir/documents_demo/* "$documentdir/"
|
echo cp -pr $mydir/documents_demo/* "$documentdir/"
|
||||||
@ -174,7 +174,7 @@ then
|
|||||||
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||||
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||||
else
|
else
|
||||||
echo Detection of documents directory failed so demo files were not copied.
|
echo Detection of documents directory $documentdir failed so demo files were not copied.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -303,7 +303,7 @@ foreach($property as $key => $prop)
|
|||||||
$varprop.="\$this->db->escape(\$this->".$prop['field'].")";
|
$varprop.="\$this->db->escape(\$this->".$prop['field'].")";
|
||||||
$varprop.=".\"'\")";
|
$varprop.=".\"'\")";
|
||||||
}
|
}
|
||||||
elseif ($prop['field']=='fk_user_mod' || $prop['field']=='fk_user_author')
|
elseif ($prop['field']=='fk_user_mod' || $prop['field']=='fk_user_m' || $prop['field']=='fk_user_author')
|
||||||
{
|
{
|
||||||
$varprop.="'.\$user->id";
|
$varprop.="'.\$user->id";
|
||||||
}
|
}
|
||||||
@ -367,7 +367,7 @@ foreach($property as $key => $prop)
|
|||||||
$varprop.=')."\'" : \'null\')';
|
$varprop.=')."\'" : \'null\')';
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif ($prop['field']=='fk_user_mod') {
|
elseif ($prop['field']=='fk_user_mod' || $prop['field']=='fk_user_m') {
|
||||||
$varprop.="'.\$user->id";
|
$varprop.="'.\$user->id";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -188,11 +188,13 @@ class Skeleton_Class extends CommonObject
|
|||||||
|
|
||||||
// Retrieve all extrafields for invoice
|
// Retrieve all extrafields for invoice
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
|
/*
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields=new ExtraFields($this->db);
|
$extrafields=new ExtraFields($this->db);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
|
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
|
||||||
$this->fetch_optionals($this->id,$extralabels);
|
$this->fetch_optionals($this->id,$extralabels);
|
||||||
|
*/
|
||||||
|
|
||||||
// $this->fetch_lines();
|
// $this->fetch_lines();
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
@ -251,23 +253,19 @@ class Skeleton_Class extends CommonObject
|
|||||||
$sql .= $this->db->order($sortfield,$sortorder);
|
$sql .= $this->db->order($sortfield,$sortorder);
|
||||||
}
|
}
|
||||||
if (!empty($limit)) {
|
if (!empty($limit)) {
|
||||||
$sql .= ' ' . $this->db->plimit($limit + 1, $offset);
|
$sql .= ' ' . $this->db->plimit($limit, $offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->lines = array();
|
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
|
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
$line = new Skeleton_ClassLine();
|
$line = new self($this->db);
|
||||||
|
|
||||||
$line->id = $obj->rowid;
|
$line->id = $obj->rowid;
|
||||||
$line->prop1 = $obj->field1;
|
$line->prop1 = $obj->field1;
|
||||||
$line->prop2 = $obj->field2;
|
$line->prop2 = $obj->field2;
|
||||||
|
|
||||||
$this->lines[$line->id] = $line;
|
|
||||||
//...
|
//...
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|||||||
@ -247,7 +247,7 @@ $sql.=$db->order($sortfield,$sortorder);
|
|||||||
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -42,11 +42,15 @@ then
|
|||||||
then
|
then
|
||||||
aaupper="US"
|
aaupper="US"
|
||||||
fi
|
fi
|
||||||
|
if [ $aaupper = "EL" ]
|
||||||
|
then
|
||||||
|
aaupper="GR"
|
||||||
|
fi
|
||||||
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
|
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
|
||||||
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
|
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
|
||||||
then
|
then
|
||||||
reflang="htdocs/langs/"$aa"_"$aaupper
|
reflang="htdocs/langs/"$aa"_"$aaupper
|
||||||
if [ -d $reflang ]
|
if [ -d $reflang -a $aa"_"$bb != $aa"_"$aaupper ]
|
||||||
then
|
then
|
||||||
echo "***** Process language "$aa"_"$bb" - Search original into "$reflang
|
echo "***** Process language "$aa"_"$bb" - Search original into "$reflang
|
||||||
echo $dirshort is an alternative language of $reflang
|
echo $dirshort is an alternative language of $reflang
|
||||||
|
|||||||
8
dev/tools/github_authors_peryear.sh
Executable file
8
dev/tools/github_authors_peryear.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
FROM=2016-01-01
|
||||||
|
TO=2016-12-31
|
||||||
|
|
||||||
|
echo "git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l"
|
||||||
|
git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l
|
||||||
|
|
||||||
15
dev/tools/github_commits_perversion.sh
Executable file
15
dev/tools/github_commits_perversion.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#/bin/bash
|
||||||
|
Releases=("3.8" "3.9" "4.0" "5.0", "develop")
|
||||||
|
Dates=("2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-07-01")
|
||||||
|
let "counter = 1"
|
||||||
|
|
||||||
|
for i in "${Releases[@]}"
|
||||||
|
do
|
||||||
|
git shortlog -s -n --after=${Dates[counter-1]} --before=${Dates[counter]}
|
||||||
|
echo -n "Total $i: "
|
||||||
|
git log --pretty=oneline --after=${Dates[counter-1]} --before=${Dates[counter]} | wc -l
|
||||||
|
echo "======================="
|
||||||
|
echo
|
||||||
|
let "counter +=1"
|
||||||
|
done
|
||||||
|
|
||||||
@ -39,8 +39,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!-- Password -->
|
<!-- Password -->
|
||||||
<tr><td valign="top" class="nowrap"> <strong><label for="password">Mot de passe</label></strong> </td>
|
<tr><td class="tdtop nowrap"> <strong><label for="password">Mot de passe</label></strong> </td>
|
||||||
<td valign="top" class="nowrap">
|
<td class="tdtop nowrap">
|
||||||
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="" tabindex="2" />
|
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="" tabindex="2" />
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
|
|||||||
14
dev/translation/erp_comparison_translation.txt
Normal file
14
dev/translation/erp_comparison_translation.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
Term Dolibarr SAP Odoo ...
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
Thirdparty Contact partner Partner/Contact (company)
|
||||||
|
Contact/address Contact person Partner/Contact (individual)
|
||||||
|
|
||||||
|
Financial ?? Invoicing
|
||||||
|
|
||||||
|
Income / Expense ?? Profit / Loss
|
||||||
|
Balance Net profit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ if (strlen(trim($search_pcgsubtype))) {
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|||||||
@ -888,18 +888,18 @@ if ($id)
|
|||||||
{
|
{
|
||||||
if ($value == 'country')
|
if ($value == 'country')
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($id == 4) print '<td></td>';
|
if ($id == 4) print '<td></td>';
|
||||||
print '<td></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre" colspan="2" align="right">';
|
print '<td class="liste_titre" colspan="2" align="right">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
|
|||||||
@ -90,7 +90,7 @@ $sql .= " WHERE f.entity = " . $conf->entity;
|
|||||||
$sql.=$db->order($sortfield,$sortorder);
|
$sql.=$db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -268,7 +268,7 @@ if ($action == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td valign="top">';
|
print '<tr><td class="tdtop">';
|
||||||
print $form->editfieldkey("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
|
print $form->editfieldkey("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
|
||||||
print '</td><td colspan="2">';
|
print '</td><td colspan="2">';
|
||||||
print $form->editfieldval("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
|
print $form->editfieldval("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
|
||||||
|
|||||||
@ -248,7 +248,7 @@ if (strlen(trim($search_desc))) {
|
|||||||
}
|
}
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -143,7 +143,7 @@ else {
|
|||||||
|
|
||||||
// List
|
// List
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
|
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
|
||||||
if ($nbtotalofrecords < 0) {
|
if ($nbtotalofrecords < 0) {
|
||||||
|
|||||||
@ -293,7 +293,7 @@ llxHeader('', $title_page);
|
|||||||
|
|
||||||
// List
|
// List
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
||||||
if ($nbtotalofrecords < 0) {
|
if ($nbtotalofrecords < 0) {
|
||||||
|
|||||||
@ -162,7 +162,7 @@ llxHeader('', $title_page);
|
|||||||
|
|
||||||
// List
|
// List
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
|
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
|
||||||
if ($nbtotalofrecords < 0) {
|
if ($nbtotalofrecords < 0) {
|
||||||
@ -235,9 +235,8 @@ print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60"
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="GET">';
|
print '<td class="liste_titre">' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . '</td>';
|
||||||
print '<td>' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . '</td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td></td>';
|
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
print $langs->trans('From') . ': ';
|
print $langs->trans('From') . ': ';
|
||||||
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
||||||
@ -247,10 +246,10 @@ print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_mvt_label" value="' . $search_mvt_label . '"/></td>';
|
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_mvt_label" value="' . $search_mvt_label . '"/></td>';
|
||||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_account" value="' . $search_label_account . '"/></td>';
|
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_account" value="' . $search_label_account . '"/></td>';
|
||||||
print '<td> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||||
print '<td align="right" colspan="2" class="liste_titre">';
|
print '<td class="liste_titre" align="right" colspan="2">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -158,7 +158,7 @@ if (! empty($search_code_journal)) {
|
|||||||
* Mode List
|
* Mode List
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0);
|
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0);
|
||||||
if ($nbtotalofrecords < 0) {
|
if ($nbtotalofrecords < 0) {
|
||||||
|
|||||||
@ -357,7 +357,7 @@ class AccountancyExport
|
|||||||
$Tab['libelle_ecriture'] = str_pad(self::trunc($data->doc_ref . ' ' . $data->label_compte, 20), 20);
|
$Tab['libelle_ecriture'] = str_pad(self::trunc($data->doc_ref . ' ' . $data->label_compte, 20), 20);
|
||||||
$Tab['sens'] = $data->sens; // C or D
|
$Tab['sens'] = $data->sens; // C or D
|
||||||
$Tab['signe_montant'] = '+';
|
$Tab['signe_montant'] = '+';
|
||||||
$Tab['montant'] = str_pad(abs($data->montant) * 100, 12, '0', STR_PAD_LEFT); // TODO manage negative amount
|
$Tab['montant'] = str_pad(abs($data->montant), 12, '0', STR_PAD_LEFT); // TODO manage negative amount
|
||||||
$Tab['contrepartie'] = str_repeat(' ', 8);
|
$Tab['contrepartie'] = str_repeat(' ', 8);
|
||||||
if (! empty($data->date_echeance))
|
if (! empty($data->date_echeance))
|
||||||
$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
|
$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||||
|
|||||||
@ -83,6 +83,8 @@ class FormVentilation extends Form
|
|||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
|
||||||
|
$out = '';
|
||||||
|
|
||||||
$options = array();
|
$options = array();
|
||||||
if ($usecache && ! empty($this->options_cache[$usecache]))
|
if ($usecache && ! empty($this->options_cache[$usecache]))
|
||||||
{
|
{
|
||||||
@ -109,7 +111,7 @@ class FormVentilation extends Form
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$out = ajax_combobox($htmlname, $event);
|
$out .= ajax_combobox($htmlname, $event);
|
||||||
|
|
||||||
$selected = 0;
|
$selected = 0;
|
||||||
while ($obj = $this->db->fetch_object($resql))
|
while ($obj = $this->db->fetch_object($resql))
|
||||||
|
|||||||
@ -29,6 +29,7 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
// Langs
|
// Langs
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
@ -179,7 +180,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<a class="butActionDelete" hr
|
|||||||
$sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
$sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||||
$sql .= " , " . MAIN_DB_PREFIX . "facture as f";
|
$sql .= " , " . MAIN_DB_PREFIX . "facture as f";
|
||||||
$sql .= " WHERE fd.fk_code_ventilation = 0";
|
$sql .= " WHERE fd.fk_code_ventilation = 0";
|
||||||
$sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;";
|
$sql .= " AND f.rowid = fd.fk_facture";
|
||||||
|
$sql .= " AND f.fk_statut > 0";
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -222,6 +230,11 @@ $sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'
|
|||||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
$sql .= " AND aa.account_number IS NULL";
|
$sql .= " AND aa.account_number IS NULL";
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
||||||
|
|
||||||
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||||
@ -273,6 +286,11 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid
|
|||||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
$sql .= " AND aa.account_number IS NOT NULL";
|
$sql .= " AND aa.account_number IS NOT NULL";
|
||||||
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
||||||
|
|
||||||
@ -301,97 +319,105 @@ print "</table>\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||||
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
|
||||||
|
print "<br>\n";
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
print "<br>\n";
|
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
|
||||||
print '<table class="noborder" width="100%">';
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
|
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
}
|
||||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
|
|
||||||
|
$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,";
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
|
}
|
||||||
|
$sql .= " SUM(fd.total_ht) as total";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||||
|
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
dol_syslog('htdocs/accountancy/customer/index.php');
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$i = 0;
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
while ($row = $db->fetch_row($resql)) {
|
||||||
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
$i ++;
|
||||||
|
}
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print $db->lasterror(); // Show last sql error
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
|
|
||||||
|
if (! empty($conf->margin->enabled)) {
|
||||||
|
print "<br>\n";
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre"><td width="400">' . $langs->trans("TotalMarge") . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
|
|
||||||
|
$sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,";
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
|
}
|
||||||
|
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||||
|
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
while ($row = $db->fetch_row($resql)) {
|
||||||
|
|
||||||
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td align="right">' . price(price2num($row[$i])) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right"><b>' . price(price2num($row[13])) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print $db->lasterror(); // Show last sql error
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,";
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
|
||||||
}
|
|
||||||
$sql .= " SUM(fd.total_ht) as total";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
|
||||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
|
||||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
|
||||||
|
|
||||||
dol_syslog('htdocs/accountancy/customer/index.php');
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$i = 0;
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
while ($row = $db->fetch_row($resql)) {
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
$i ++;
|
|
||||||
}
|
|
||||||
$db->free($resql);
|
|
||||||
} else {
|
|
||||||
print $db->lasterror(); // Show last sql error
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
if (! empty($conf->margin->enabled)) {
|
|
||||||
print "<br>\n";
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr class="liste_titre"><td width="400">' . $langs->trans("TotalMarge") . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,";
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
|
||||||
}
|
|
||||||
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
|
||||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
|
||||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
|
||||||
|
|
||||||
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
while ($row = $db->fetch_row($resql)) {
|
|
||||||
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td align="right">' . price(price2num($row[$i])) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td align="right"><b>' . price(price2num($row[13])) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
$db->free($resql);
|
|
||||||
} else {
|
|
||||||
print $db->lasterror(); // Show last sql error
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
print '</td></tr></table>';
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -200,7 +200,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -210,12 +210,17 @@ if (strlen(trim($search_account))) {
|
|||||||
if (strlen(trim($search_vat))) {
|
if (strlen(trim($search_vat))) {
|
||||||
$sql .= natural_search("l.tva_tx",$search_vat,1);
|
$sql .= natural_search("l.tva_tx",$search_vat,1);
|
||||||
}
|
}
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_STANDARD . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||||
|
}
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -290,55 +290,55 @@ print "</table>\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<br>';
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||||
print '<br>';
|
{
|
||||||
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
|
||||||
|
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||||
|
|
||||||
|
print "<br>\n";
|
||||||
print "<br>\n";
|
print '<table class="noborder" width="100%">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
}
|
||||||
|
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
|
|
||||||
|
$sql = "SELECT '" . $langs->trans("TotalExpenseReport") . "' AS label,";
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
|
}
|
||||||
|
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||||
|
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql .= " AND er.fk_statut > 0 ";
|
||||||
|
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
|
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
while ( $row = $db->fetch_row($resql)) {
|
||||||
|
|
||||||
|
|
||||||
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print $db->lasterror(); // Show last sql error
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
}
|
}
|
||||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("TotalExpenseReport") . "' AS label,";
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
|
||||||
}
|
|
||||||
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
|
||||||
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
|
||||||
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
|
||||||
$sql .= " AND er.fk_statut > 0 ";
|
|
||||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
|
||||||
|
|
||||||
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
while ( $row = $db->fetch_row($resql)) {
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->free($resql);
|
|
||||||
} else {
|
|
||||||
print $db->lasterror(); // Show last sql error
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -178,7 +178,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -208,7 +208,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -289,58 +289,56 @@ print "</table>\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||||
print '<br>';
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||||
|
|
||||||
|
print "<br>\n";
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
print "<br>\n";
|
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||||
print '<table class="noborder" width="100%">';
|
}
|
||||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,";
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||||
|
}
|
||||||
|
$sql .= " ROUND(SUM(ffd.total_ht),2) as total";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
||||||
|
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql .= " AND ff.fk_statut > 0 ";
|
||||||
|
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
|
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
while ( $row = $db->fetch_row($resql)) {
|
||||||
|
|
||||||
|
|
||||||
|
print '<tr><td>' . $row[0] . '</td>';
|
||||||
|
for($i = 1; $i <= 12; $i ++) {
|
||||||
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print $db->lasterror(); // Show last sql error
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
}
|
}
|
||||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,";
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
|
||||||
}
|
|
||||||
$sql .= " ROUND(SUM(ffd.total_ht),2) as total";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
|
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
|
||||||
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
|
||||||
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
|
||||||
$sql .= " AND ff.fk_statut > 0 ";
|
|
||||||
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
|
||||||
|
|
||||||
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
|
|
||||||
while ( $row = $db->fetch_row($resql)) {
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td>' . $row[0] . '</td>';
|
|
||||||
for($i = 1; $i <= 12; $i ++) {
|
|
||||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
|
||||||
}
|
|
||||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->free($resql);
|
|
||||||
} else {
|
|
||||||
print $db->lasterror(); // Show last sql error
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -182,7 +182,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -217,7 +217,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
|
|||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -108,7 +108,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top"><?php echo $langs->trans("Note"); ?></td>
|
<td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
|
||||||
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
|
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@ -117,7 +117,7 @@ echo $this->control->tpl['ajax_selectcountry'];
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top"><?php echo $langs->trans("Note"); ?></td>
|
<td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
|
||||||
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
|
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@ -102,7 +102,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top"><?php echo $langs->trans("Note"); ?></td>
|
<td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
|
||||||
<td colspan="3"><?php echo $this->control->tpl['note']; ?></td>
|
<td colspan="3"><?php echo $this->control->tpl['note']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@ -873,7 +873,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
print '<tr><td valign="top">'.$langs->trans("Address").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
|
||||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOST('address','alpha')?GETPOST('address','alpha'):$object->address).'</textarea>';
|
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOST('address','alpha')?GETPOST('address','alpha'):$object->address).'</textarea>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -1818,18 +1818,16 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
// Positionne le modele sur le nom du modele a utiliser
|
if (! dol_strlen($modele)) {
|
||||||
if (! dol_strlen($modele))
|
|
||||||
{
|
$modele = 'standard';
|
||||||
if (! empty($conf->global->ADHERENT_ADDON_PDF))
|
|
||||||
{
|
if ($this->modelpdf) {
|
||||||
$modele = $conf->global->ADHERENT_ADDON_PDF;
|
$modele = $this->modelpdf;
|
||||||
}
|
} elseif (! empty($conf->global->ADHERENT_ADDON_PDF)) {
|
||||||
else
|
$modele = $conf->global->ADHERENT_ADDON_PDF;
|
||||||
{
|
}
|
||||||
$modele = 'standard';
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$modelpath = "core/modules/member/doc/";
|
$modelpath = "core/modules/member/doc/";
|
||||||
|
|
||||||
|
|||||||
@ -250,7 +250,7 @@ $sql.=$hookmanager->resPrint;
|
|||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
// Count total nb of records with no order and no limits
|
// Count total nb of records with no order and no limits
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -375,7 +375,7 @@ if (! empty($moreforfilter))
|
|||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
||||||
|
|||||||
@ -1039,7 +1039,7 @@ if ($rowid > 0)
|
|||||||
//print '<tr><td colspan="2"><b>'.$langs->trans("Payment").'</b></td></tr>';
|
//print '<tr><td colspan="2"><b>'.$langs->trans("Payment").'</b></td></tr>';
|
||||||
|
|
||||||
// No more action
|
// No more action
|
||||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('MoreActions');
|
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('MoreActions');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice)?' checked':'').'> '.$langs->trans("None").'<br>';
|
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice)?' checked':'').'> '.$langs->trans("None").'<br>';
|
||||||
|
|||||||
@ -110,7 +110,7 @@ if ($search_account > 0) $sql.= " AND b.fk_account = ".$search_account;
|
|||||||
if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1);
|
if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1);
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -91,10 +91,10 @@ if ($action == 'add' && $user->rights->adherent->configurer)
|
|||||||
$object = new AdherentType($db);
|
$object = new AdherentType($db);
|
||||||
|
|
||||||
$object->libelle = trim($label);
|
$object->libelle = trim($label);
|
||||||
$object->subscription = trim($subscription);
|
$object->subscription = (int) trim($subscription);
|
||||||
$object->note = trim($comment);
|
$object->note = trim($comment);
|
||||||
$object->mail_valid = trim($mail_valid);
|
$object->mail_valid = (boolean) trim($mail_valid);
|
||||||
$object->vote = trim($vote);
|
$object->vote = (boolean) trim($vote);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
@ -129,10 +129,10 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
|||||||
$object = new AdherentType($db);
|
$object = new AdherentType($db);
|
||||||
$object->id = $rowid;
|
$object->id = $rowid;
|
||||||
$object->libelle = trim($label);
|
$object->libelle = trim($label);
|
||||||
$object->subscription = trim($subscription);
|
$object->subscription = (int) trim($subscription);
|
||||||
$object->note = trim($comment);
|
$object->note = trim($comment);
|
||||||
$object->mail_valid = trim($mail_valid);
|
$object->mail_valid = (boolean) trim($mail_valid);
|
||||||
$object->vote = trim($vote);
|
$object->vote = (boolean) trim($vote);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
@ -251,10 +251,10 @@ if ($action == 'create')
|
|||||||
print $form->selectyesno("vote",0,1);
|
print $form->selectyesno("vote",0,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
print '<textarea name="comment" wrap="soft" class="centpercent" rows="3"></textarea></td></tr>';
|
print '<textarea name="comment" wrap="soft" class="centpercent" rows="3"></textarea></td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,'90%');
|
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,'90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
@ -314,10 +314,10 @@ if ($rowid > 0)
|
|||||||
print yn($object->vote);
|
print yn($object->vote);
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
print nl2br($object->note)."</td></tr>";
|
print nl2br($object->note)."</td></tr>";
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||||
print nl2br($object->mail_valid)."</td></tr>";
|
print nl2br($object->mail_valid)."</td></tr>";
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
@ -407,7 +407,7 @@ if ($rowid > 0)
|
|||||||
$sql.=" AND datefin < '".$db->idate($now)."'";
|
$sql.=" AND datefin < '".$db->idate($now)."'";
|
||||||
}
|
}
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -647,10 +647,10 @@ if ($rowid > 0)
|
|||||||
print $form->selectyesno("vote",$object->vote,1);
|
print $form->selectyesno("vote",$object->vote,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
print '<textarea name="comment" wrap="soft" class="centpercent" rows="3">'.$object->note.'</textarea></td></tr>';
|
print '<textarea name="comment" wrap="soft" class="centpercent" rows="3">'.$object->note.'</textarea></td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,'90%');
|
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,'90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
*
|
*
|
||||||
@ -407,6 +407,37 @@ $tmplist=array('show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->tran
|
|||||||
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
|
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
|
// AGENDA NOTIFICATION
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'>'."\n";
|
||||||
|
print '<td>'.$langs->trans('AGENDA_NOTIFICATION').'</td>'."\n";
|
||||||
|
print '<td align="center"> </td>'."\n";
|
||||||
|
print '<td align="right">'."\n";
|
||||||
|
|
||||||
|
if (empty($conf->global->AGENDA_NOTIFICATION)) {
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_NOTIFICATION">'.img_picto($langs->trans('Disabled'),'switch_off').'</a>';
|
||||||
|
print '</td></tr>'."\n";
|
||||||
|
} else {
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_NOTIFICATION">'.img_picto($langs->trans('Enabled'),'switch_on').'</a>';
|
||||||
|
print '</td></tr>'."\n";
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'>'."\n";
|
||||||
|
print '<td>'.$langs->trans('AGENDA_NOTIFICATION_SOUND').'</td>'."\n";
|
||||||
|
print '<td align="center"> </td>'."\n";
|
||||||
|
print '<td align="right">'."\n";
|
||||||
|
|
||||||
|
if (empty($conf->global->AGENDA_NOTIFICATION_SOUND)) {
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_NOTIFICATION_SOUND">'.img_picto($langs->trans('Disabled'),'switch_off').'</a>';
|
||||||
|
} else {
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_NOTIFICATION_SOUND">'.img_picto($langs->trans('Enabled'),'switch_on').'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</td></tr>'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
@ -415,7 +446,6 @@ print '<div class="center"><input class="button" type="submit" name="save" value
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -329,7 +329,10 @@ print load_fiche_titre($langs->trans("BoxesAvailable"));
|
|||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
|
||||||
print '<input type="hidden" name="action" value="add">'."\n";
|
print '<input type="hidden" name="action" value="add">'."\n";
|
||||||
print '<table class="noborder" width="100%">'."\n";
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="tagtable liste centpercent">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="300">'.$langs->trans("Box").'</td>';
|
print '<td width="300">'.$langs->trans("Box").'</td>';
|
||||||
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
||||||
@ -375,6 +378,8 @@ foreach($boxtoadd as $box)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="right">';
|
print '<div class="right">';
|
||||||
print '<input type="submit" class="button"'.(count($boxtoadd)?'':' disabled').' value="'.$langs->trans("Activate").'">';
|
print '<input type="submit" class="button"'.(count($boxtoadd)?'':' disabled').' value="'.$langs->trans("Activate").'">';
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
@ -388,7 +393,9 @@ $boxactivated=InfoBox::listBoxes($db,'activated',-1,null);
|
|||||||
print "<br>\n\n";
|
print "<br>\n\n";
|
||||||
print load_fiche_titre($langs->trans("BoxesActivated"));
|
print load_fiche_titre($langs->trans("BoxesActivated"));
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="tagtable liste">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="300">'.$langs->trans("Box").'</td>';
|
print '<td width="300">'.$langs->trans("Box").'</td>';
|
||||||
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
||||||
@ -441,7 +448,9 @@ foreach($boxactivated as $key => $box)
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table><br>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
// Other parameters
|
// Other parameters
|
||||||
|
|||||||
@ -786,7 +786,7 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td valign="top">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '</td></tr>';
|
print '<tr '.$bc[$var].'><td class="tdtop">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
@ -952,7 +952,7 @@ else
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td valign="top">'.$langs->trans("CompanyObject").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '</td></tr>';
|
print '<tr '.$bc[$var].'><td class="tdtop">'.$langs->trans("CompanyObject").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -182,6 +182,7 @@ print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" id="action" name="action" value="">';
|
print '<input type="hidden" id="action" name="action" value="">';
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Name").'</td>';
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
@ -297,6 +298,7 @@ if ($result)
|
|||||||
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
@ -311,6 +313,7 @@ if ($conf->use_javascript_ajax)
|
|||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -557,6 +557,7 @@ if ($id == 25)
|
|||||||
if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder');
|
if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder');
|
||||||
if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice');
|
if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice');
|
||||||
if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty');
|
if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty');
|
||||||
|
if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract');
|
||||||
|
|
||||||
$parameters=array('elementList'=>$elementList);
|
$parameters=array('elementList'=>$elementList);
|
||||||
$reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
@ -1274,6 +1275,7 @@ if ($id)
|
|||||||
|
|
||||||
// Title line with search boxes
|
// Title line with search boxes
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
$filterfound=0;
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value)
|
||||||
{
|
{
|
||||||
$showfield=1; // By defaut
|
$showfield=1; // By defaut
|
||||||
@ -1284,21 +1286,25 @@ if ($id)
|
|||||||
{
|
{
|
||||||
if ($value == 'country')
|
if ($value == 'country')
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
$filterfound++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($id == 4) print '<td></td>';
|
if ($id == 4) print '<td></td>';
|
||||||
print '<td></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre" colspan="2" align="right">';
|
print '<td class="liste_titre" colspan="2" align="right">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
if ($filterfound)
|
||||||
print $searchpitco;
|
{
|
||||||
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
|
print $searchpitco;
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -1314,19 +1320,17 @@ if ($id)
|
|||||||
print '<tr '.$bc[$var].' id="rowid-'.$obj->rowid.'">';
|
print '<tr '.$bc[$var].' id="rowid-'.$obj->rowid.'">';
|
||||||
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
|
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
|
||||||
{
|
{
|
||||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
|
||||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
|
||||||
|
|
||||||
$tmpaction='edit';
|
$tmpaction='edit';
|
||||||
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||||
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
|
|
||||||
|
// Show fields
|
||||||
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
|
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
|
||||||
|
|
||||||
print '<td colspan="3" align="center">';
|
print '<td colspan="3" align="center">';
|
||||||
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||||
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||||
print '<div name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"></div>';
|
print '<div name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"></div>';
|
||||||
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
||||||
|
|||||||
@ -619,6 +619,12 @@ else
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||||
|
{
|
||||||
|
$text = $langs->trans("WarningPHPMail");
|
||||||
|
print info_admin($text);
|
||||||
|
}
|
||||||
|
|
||||||
// Run the test to connect
|
// Run the test to connect
|
||||||
if ($action == 'testconnect')
|
if ($action == 'testconnect')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -203,7 +203,7 @@ foreach ($modulesdir as $dir)
|
|||||||
}
|
}
|
||||||
ksort($arrayofnatures);
|
ksort($arrayofnatures);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define array $categ with categ with at least one qualified module
|
// Define array $categ with categ with at least one qualified module
|
||||||
if ($modulequalified > 0)
|
if ($modulequalified > 0)
|
||||||
{
|
{
|
||||||
@ -319,7 +319,7 @@ if ($mode != 'marketplace')
|
|||||||
$moreforfilter.= $langs->trans('Keyword') . ': <input type="text" name="search_keyword" value="'.dol_escape_htmltag($search_keyword).'">';
|
$moreforfilter.= $langs->trans('Keyword') . ': <input type="text" name="search_keyword" value="'.dol_escape_htmltag($search_keyword).'">';
|
||||||
$moreforfilter.= '</div>';
|
$moreforfilter.= '</div>';
|
||||||
$moreforfilter.='<div class="divsearchfield">';
|
$moreforfilter.='<div class="divsearchfield">';
|
||||||
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, $search_nature, 1);
|
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1);
|
||||||
$moreforfilter.= '</div>';
|
$moreforfilter.= '</div>';
|
||||||
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||||
{
|
{
|
||||||
@ -398,7 +398,7 @@ if ($mode != 'marketplace')
|
|||||||
if ($search_keyword)
|
if ($search_keyword)
|
||||||
{
|
{
|
||||||
$qualified=0;
|
$qualified=0;
|
||||||
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
|
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
|
||||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|
||||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|
||||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
|
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
|
||||||
@ -417,7 +417,7 @@ if ($mode != 'marketplace')
|
|||||||
{
|
{
|
||||||
//print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher());
|
//print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher());
|
||||||
$publisher=dol_escape_htmltag($objMod->getPublisher());
|
$publisher=dol_escape_htmltag($objMod->getPublisher());
|
||||||
if ($reg[1] && $reg[1] != $publisher) continue;
|
if ($reg[1] && dol_escape_htmltag($reg[1]) != $publisher) continue;
|
||||||
if (! $reg[1] && ! empty($publisher)) continue;
|
if (! $reg[1] && ! empty($publisher)) continue;
|
||||||
}
|
}
|
||||||
if ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue;
|
if ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue;
|
||||||
@ -485,22 +485,23 @@ if ($mode != 'marketplace')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
print '<td valign="top">'.$objMod->getName();
|
print '<td class="tdtop">'.$objMod->getName();
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Desc
|
// Desc
|
||||||
print '<td valign="top">';
|
print '<td class="tdtop">';
|
||||||
print nl2br($objMod->getDesc());
|
print nl2br($objMod->getDesc());
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Help
|
// Help
|
||||||
print '<td align="center" valign="top" class="nowrap" style="width: 82px;">';
|
print '<td align="center" valign="top" class="nowrap" style="width: 82px;">';
|
||||||
$text='';
|
$text='';
|
||||||
|
|
||||||
if ($objMod->getDescLong()) $text.='<div class="titre">'.$objMod->getDesc().'</div><br>'.$objMod->getDescLong().'<br>';
|
if ($objMod->getDescLong()) $text.='<div class="titre">'.$objMod->getDesc().'</div><br>'.$objMod->getDescLong().'<br>';
|
||||||
else $text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
|
else $text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
|
||||||
|
|
||||||
$textexternal='';
|
$textexternal='';
|
||||||
$imginfo="info";
|
$imginfo="info";
|
||||||
if ($objMod->isCoreOrExternalModule() == 'external')
|
if ($objMod->isCoreOrExternalModule() == 'external')
|
||||||
{
|
{
|
||||||
$imginfo="info_black";
|
$imginfo="info_black";
|
||||||
@ -647,6 +648,7 @@ if ($mode != 'marketplace')
|
|||||||
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
|
||||||
$text.=$langs->trans("DetectionNotPossible");
|
$text.=$langs->trans("DetectionNotPossible");
|
||||||
|
|
||||||
|
|
||||||
print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20');
|
print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20');
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -104,6 +104,11 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Define $urlwithroot
|
||||||
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||||
|
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||||
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
llxHeader('',$langs->trans("PrintingSetup"));
|
llxHeader('',$langs->trans("PrintingSetup"));
|
||||||
@ -127,70 +132,179 @@ if ($mode == 'setup' && $user->admin)
|
|||||||
if (in_array($key[0], array_keys($supportedoauth2array))) $supported=1;
|
if (in_array($key[0], array_keys($supportedoauth2array))) $supported=1;
|
||||||
if (! $supported) continue; // show only supported
|
if (! $supported) continue; // show only supported
|
||||||
|
|
||||||
|
|
||||||
|
$OAUTH_SERVICENAME='Unknown';
|
||||||
|
if ($key[0] == 'OAUTH_GITHUB_NAME')
|
||||||
|
{
|
||||||
|
$OAUTH_SERVICENAME='GitHub';
|
||||||
|
$urltorenew=$urlwithroot.'/core/modules/oauth/github_oauthcallback.php?state=user,public_repo&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
$urltodelete=$urlwithroot.'/core/modules/oauth/github_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
$urltocheckperms='https://github.com/settings/applications/';
|
||||||
|
}
|
||||||
|
if ($key[0] == 'OAUTH_GOOGLE_NAME')
|
||||||
|
{
|
||||||
|
$OAUTH_SERVICENAME='Google';
|
||||||
|
$urltorenew=$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?state=userinfo_email,userinfo_profile,cloud_print&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
$urltodelete=$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
$urltocheckperms='https://security.google.com/settings/security/permissions';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show value of token
|
||||||
|
$tokenobj=null;
|
||||||
|
// Token
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
|
||||||
|
// Dolibarr storage
|
||||||
|
$storage = new DoliStorage($db, $conf);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME);
|
||||||
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
|
// Return an error if token not found
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set other properties
|
||||||
|
$refreshtoken=false;
|
||||||
|
$expiredat='';
|
||||||
|
|
||||||
|
$expire = false;
|
||||||
|
// Is token expired or will token expire in the next 30 seconds
|
||||||
|
if (is_object($tokenobj)) {
|
||||||
|
$expire = ($tokenobj->getEndOfLife() !== $tokenobj::EOL_NEVER_EXPIRES && $tokenobj->getEndOfLife() !== $tokenobj::EOL_UNKNOWN && time() > ($tokenobj->getEndOfLife() - 30));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($key[1] != '' && $key[2] != '') {
|
||||||
|
if (is_object($tokenobj)) {
|
||||||
|
$refreshtoken = $tokenobj->getRefreshToken();
|
||||||
|
|
||||||
|
$endoflife = $tokenobj->getEndOfLife();
|
||||||
|
if ($endoflife == $tokenobj::EOL_NEVER_EXPIRES)
|
||||||
|
{
|
||||||
|
$expiredat = $langs->trans("Never");
|
||||||
|
}
|
||||||
|
elseif ($endoflife == $tokenobj::EOL_UNKNOWN)
|
||||||
|
{
|
||||||
|
$expiredat = $langs->trans("Unknown");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$expiredat=dol_print_date($endoflife, "dayhour");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$submit_enabled=0;
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=setup&driver='.$driver.'" autocomplete="off">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=setup&driver='.$driver.'" autocomplete="off">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="setconst">';
|
print '<input type="hidden" name="action" value="setconst">';
|
||||||
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">'."\n";
|
print '<table class="noborder" width="100%">'."\n";
|
||||||
$var=true;
|
|
||||||
|
$var=false;
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th>'.$langs->trans("Parameters").'</th>';
|
print '<th class="titlefieldcreate">'.$langs->trans($key[0]).'</th>';
|
||||||
print '<th>'.$langs->trans("Value").'</th>';
|
print '<th></th>';
|
||||||
print '<th> </th>';
|
print '<th></th>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$submit_enabled=0;
|
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td'.($key['required']?' class=required':'').'>'.$langs->trans($key['varname']).'</td>';
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
print '<td>'.$langs->trans($key['info']).'</td>';
|
//var_dump($key);
|
||||||
|
print $langs->trans("OAuthIDSecret").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $langs->trans("SeePreviousTab");
|
||||||
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($key['varname'] == 'PRINTGCP_TOKEN_ACCESS')
|
|
||||||
{
|
|
||||||
// Delete remote tokens
|
|
||||||
if (! empty($key['delete'])) print '<a class="button" href="'.$key['delete'].'">'.$langs->trans('DeleteAccess').'</a><br><br>';
|
|
||||||
// Request remote token
|
|
||||||
print '<a class="button" href="'.$key['renew'].'">'.$langs->trans('RequestAccess').'</a><br><br>';
|
|
||||||
// Check remote access
|
|
||||||
print $langs->trans("ToCheckDeleteTokenOnProvider", $OAUTH_SERVICENAME_GOOGLE).': <a href="https://security.google.com/settings/security/permissions" target="_google">https://security.google.com/settings/security/permissions</a>';
|
|
||||||
}
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// Show value of token
|
$var = ! $var;
|
||||||
if ($key['varname'] == 'PRINTGCP_TOKEN_ACCESS')
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("IsTokenGenerated");
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
if (is_object($tokenobj)) print $langs->trans("HasAccessToken");
|
||||||
|
else print $langs->trans("NoAccessToken");
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
// Links to delete/checks token
|
||||||
|
if (is_object($tokenobj))
|
||||||
{
|
{
|
||||||
// Token
|
//test on $storage->hasAccessToken($OAUTH_SERVICENAME) ?
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<a class="button" href="'.$urltodelete.'">'.$langs->trans('DeleteAccess').'</a><br><br>';
|
||||||
print '<td>'.$langs->trans("Token").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
// Dolibarr storage
|
|
||||||
$storage = new DoliStorage($db, $conf);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME_GOOGLE);
|
|
||||||
}
|
|
||||||
catch(Exception $e)
|
|
||||||
{
|
|
||||||
// Return an error if token not found
|
|
||||||
}
|
|
||||||
if (is_object($tokenobj))
|
|
||||||
{
|
|
||||||
//var_dump($tokenobj);
|
|
||||||
print $tokenobj->getAccessToken().'<br>';
|
|
||||||
//print 'Refresh: '.$tokenobj->getRefreshToken().'<br>';
|
|
||||||
//print 'EndOfLife: '.$tokenobj->getEndOfLife().'<br>';
|
|
||||||
//var_dump($tokenobj->getExtraParams());
|
|
||||||
/*print '<br>Extra: <br><textarea class="quatrevingtpercent">';
|
|
||||||
print ''.join(',',$tokenobj->getExtraParams());
|
|
||||||
print '</textarea>';*/
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>'."\n";
|
|
||||||
}
|
}
|
||||||
|
// Request remote token
|
||||||
|
print '<a class="button" href="'.$urltorenew.'">'.$langs->trans('RequestAccess').'</a><br><br>';
|
||||||
|
// Check remote access
|
||||||
|
if ($urltocheckperms)
|
||||||
|
{
|
||||||
|
print $langs->trans("ToCheckDeleteTokenOnProvider", $OAUTH_SERVICENAME).': <a href="'.$urltocheckperms.'" target="_'.strtolower($OAUTH_SERVICENAME).'">'.$urltocheckperms.'</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("Token").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
if (is_object($tokenobj))
|
||||||
|
{
|
||||||
|
//var_dump($tokenobj);
|
||||||
|
print $tokenobj->getAccessToken().'<br>';
|
||||||
|
//print 'Refresh: '.$tokenobj->getRefreshToken().'<br>';
|
||||||
|
//print 'EndOfLife: '.$tokenobj->getEndOfLife().'<br>';
|
||||||
|
//var_dump($tokenobj->getExtraParams());
|
||||||
|
/*print '<br>Extra: <br><textarea class="quatrevingtpercent">';
|
||||||
|
print ''.join(',',$tokenobj->getExtraParams());
|
||||||
|
print '</textarea>';*/
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
if (is_object($tokenobj))
|
||||||
|
{
|
||||||
|
// Token refresh
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("TOKEN_REFRESH").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print yn($refreshtoken);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Token expired
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("TOKEN_EXPIRED").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print yn($expire);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Token expired at
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td'.($key['required']?' class="required"':'').'>';
|
||||||
|
//var_dump($key);
|
||||||
|
print $langs->trans("TOKEN_EXPIRE_AT").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print $expiredat;
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
if (! empty($driver))
|
if (! empty($driver))
|
||||||
@ -199,7 +313,8 @@ if ($mode == 'setup' && $user->admin)
|
|||||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Modify")).'"></div>';
|
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Modify")).'"></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -124,7 +124,7 @@ dol_fiche_head($head, 'default', $langs->trans("Security"));
|
|||||||
// Show warning about external users
|
// Show warning about external users
|
||||||
print info_admin(showModulesExludedForExternal($modules)).'<br>'."\n";
|
print info_admin(showModulesExludedForExternal($modules)).'<br>'."\n";
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
// Affiche lignes des permissions
|
// Affiche lignes des permissions
|
||||||
@ -215,8 +215,9 @@ if ($result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -86,12 +86,12 @@ if ($sfurl)
|
|||||||
}
|
}
|
||||||
print ')';
|
print ')';
|
||||||
}
|
}
|
||||||
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>';
|
print ' ('.$langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b>)<br>';
|
||||||
}
|
}
|
||||||
|
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
|
||||||
|
|
||||||
|
|
||||||
print '</ul>';
|
print '</ul>';
|
||||||
|
|||||||
@ -48,6 +48,7 @@ $tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
|
|||||||
|
|
||||||
// Browser
|
// Browser
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -71,10 +72,10 @@ print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("Screen").'</td><td col
|
|||||||
print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
|
print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -81,7 +81,8 @@ else
|
|||||||
{
|
{
|
||||||
if ($base == 1)
|
if ($base == 1)
|
||||||
{
|
{
|
||||||
print '<table class="noborder">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TableName").'</td>';
|
print '<td>'.$langs->trans("TableName").'</td>';
|
||||||
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
||||||
@ -134,11 +135,13 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($base == 2)
|
if ($base == 2)
|
||||||
{
|
{
|
||||||
print '<table class="noborder">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TableName").'</td>';
|
print '<td>'.$langs->trans("TableName").'</td>';
|
||||||
print '<td>Nb of tuples</td>';
|
print '<td>Nb of tuples</td>';
|
||||||
@ -173,12 +176,14 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($base == 4)
|
if ($base == 4)
|
||||||
{
|
{
|
||||||
// Sqlite by PDO or by Sqlite3
|
// Sqlite by PDO or by Sqlite3
|
||||||
print '<table class="noborder">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TableName").'</td>';
|
print '<td>'.$langs->trans("TableName").'</td>';
|
||||||
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
||||||
@ -207,6 +212,8 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,7 @@ llxHeader();
|
|||||||
print load_fiche_titre($langs->trans("InfoDatabase"),'','title_setup');
|
print load_fiche_titre($langs->trans("InfoDatabase"),'','title_setup');
|
||||||
|
|
||||||
// Database
|
// Database
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Database").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Database").'</td></tr>'."\n";
|
||||||
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Version").'</td><td>'.$db::LABEL.' '.$db->getVersion().'</td></tr>'."\n";
|
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Version").'</td><td>'.$db::LABEL.' '.$db->getVersion().'</td></tr>'."\n";
|
||||||
@ -54,14 +55,16 @@ print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Password").'</td><td>'.pr
|
|||||||
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase().'</td></tr>'."\n";
|
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase().'</td></tr>'."\n";
|
||||||
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
|
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
// Tables
|
// Tables
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Tables").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Tables").'</td></tr>'."\n";
|
||||||
print '<tr '.$bc[0].'><td width="300"><a href="'.DOL_URL_ROOT.'/admin/system/database-tables.php?mainmenu=home">'.$langs->trans("List").'</a></td></tr>'."\n";
|
print '<tr '.$bc[0].'><td width="300"><a href="'.DOL_URL_ROOT.'/admin/system/database-tables.php?mainmenu=home">'.$langs->trans("List").'</a></td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
$listofvars=$db->getServerParametersValues();
|
$listofvars=$db->getServerParametersValues();
|
||||||
$listofstatus=$db->getServerStatusValues();
|
$listofstatus=$db->getServerStatusValues();
|
||||||
@ -76,6 +79,7 @@ else
|
|||||||
foreach($arraylist as $listname)
|
foreach($arraylist as $listname)
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="300">'.$langs->trans("Parameters").'</td>';
|
print '<td width="300">'.$langs->trans("Parameters").'</td>';
|
||||||
@ -120,6 +124,7 @@ else
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,7 @@ print load_fiche_titre($title,'','title_setup');
|
|||||||
|
|
||||||
// Version
|
// Version
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -69,10 +70,12 @@ else
|
|||||||
}
|
}
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Session
|
// Session
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -107,6 +110,7 @@ foreach($_SESSION as $key => $val)
|
|||||||
}
|
}
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
@ -116,6 +120,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
|||||||
$shmoparray=dol_listshmop();
|
$shmoparray=dol_listshmop();
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="titlefield">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
|
print '<td class="titlefield">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
|
||||||
@ -133,12 +138,14 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Localisation
|
// Localisation
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -234,6 +241,7 @@ if (! empty($conf->global->MAIN_FILESYSTEM_ENCODING)) $tmp=$conf->global->MAIN_F
|
|||||||
print '<tr '.$bc[$var].'><td> => '.$langs->trans("File encoding").'</td><td>'.$tmp.'</td></tr>'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
print '<tr '.$bc[$var].'><td> => '.$langs->trans("File encoding").'</td><td>'.$tmp.'</td></tr>'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
@ -292,6 +300,7 @@ $configfileparameters=array(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="titlefield">'.$langs->trans("Parameters").' ';
|
print '<td class="titlefield">'.$langs->trans("Parameters").' ';
|
||||||
@ -353,11 +362,13 @@ foreach($configfileparameters as $key => $value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Parameters in database
|
// Parameters in database
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
|
print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
|
||||||
@ -407,7 +418,7 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -75,33 +75,40 @@ $file_list = array('missing' => array(), 'updated' => array());
|
|||||||
|
|
||||||
// File to analyze
|
// File to analyze
|
||||||
//$xmlfile = DOL_DOCUMENT_ROOT.'/install/filelist-'.DOL_VERSION.'.xml';
|
//$xmlfile = DOL_DOCUMENT_ROOT.'/install/filelist-'.DOL_VERSION.'.xml';
|
||||||
$xmlshortfile = '/install/filelist-'.DOL_VERSION.'.xml';
|
$xmlshortfile = GETPOST('xmlshortfile')?GETPOST('xmlshortfile'):'/install/filelist-'.DOL_VERSION.'.xml';
|
||||||
$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
|
$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
|
||||||
$xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
|
$xmlremote = GETPOST('xmlremote')?GETPOST('xmlremote'):'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
|
||||||
|
|
||||||
|
|
||||||
// Test if remote test is ok
|
// Test if remote test is ok
|
||||||
$enableremotecheck = True;
|
$enableremotecheck = True;
|
||||||
if (preg_match('/beta|alpha/i', DOL_VERSION)) $enableremotecheck=False;
|
if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=False;
|
||||||
|
$enableremotecheck = true;
|
||||||
|
|
||||||
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
||||||
|
print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
|
||||||
if (dol_is_file($xmlfile))
|
if (dol_is_file($xmlfile))
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="local"'.((! GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"':'').'"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.'<br>';
|
print '<input type="radio" name="target" value="local"'.((! GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"':'').'"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.'<br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span><br>';
|
print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile;
|
||||||
|
if (! GETPOST('xmlshortfile')) print ' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span>';
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
|
||||||
if ($enableremotecheck)
|
if ($enableremotecheck)
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = '.$xmlremote.'<br>';
|
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = ';
|
||||||
|
print '<input name="xmlremote" class="flat quatrevingtpercent" value="'.$xmlremote.'"><br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote.' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span><br>';
|
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote;
|
||||||
|
if (! GETPOST('xmlremote')) print ' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span>';
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
print '<br><div class="center"><input type="submit" name="check" class="button" value="'.$langs->trans("Check").'"></div>';
|
print '<br><div class="center"><input type="submit" name="check" class="button" value="'.$langs->trans("Check").'"></div>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -128,7 +135,8 @@ if (GETPOST('target') == 'remote')
|
|||||||
if (! $xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404')
|
if (! $xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404')
|
||||||
{
|
{
|
||||||
$xmlfile = $xmlarray['content'];
|
$xmlfile = $xmlarray['content'];
|
||||||
$xml = simplexml_load_file($xmlfile);
|
//print "eee".$xmlfile."eee";
|
||||||
|
$xml = simplexml_load_string($xmlfile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -141,24 +149,33 @@ if (GETPOST('target') == 'remote')
|
|||||||
|
|
||||||
if ($xml)
|
if ($xml)
|
||||||
{
|
{
|
||||||
|
$checksumconcat = array();
|
||||||
|
|
||||||
|
// Scan htdocs
|
||||||
if (is_object($xml->dolibarr_htdocs_dir[0]))
|
if (is_object($xml->dolibarr_htdocs_dir[0]))
|
||||||
{
|
{
|
||||||
$file_list = array();
|
$file_list = array();
|
||||||
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0]); // Fill array $file_list
|
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', DOL_DOCUMENT_ROOT, $checksumconcat); // Fill array $file_list
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("FilesMissing"));
|
||||||
|
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>' . $langs->trans("FilesMissing") . '</td>';
|
print '<td>#</td>';
|
||||||
|
print '<td>' . $langs->trans("Filename") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
$var = true;
|
$var = true;
|
||||||
$tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
|
$tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
|
||||||
if (is_array($tmpfilelist) && count($tmpfilelist))
|
if (is_array($tmpfilelist) && count($tmpfilelist))
|
||||||
{
|
{
|
||||||
|
$i = 0;
|
||||||
foreach ($tmpfilelist as $file)
|
foreach ($tmpfilelist as $file)
|
||||||
{
|
{
|
||||||
|
$i++;
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
print '<tr ' . $bc[$var] . '>';
|
print '<tr ' . $bc[$var] . '>';
|
||||||
|
print '<td>'.$i.'</td>' . "\n";
|
||||||
print '<td>'.$file['filename'].'</td>' . "\n";
|
print '<td>'.$file['filename'].'</td>' . "\n";
|
||||||
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -166,28 +183,34 @@ if ($xml)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr ' . $bc[false] . '><td colspan="2" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
print '<tr ' . $bc[false] . '><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("FilesUpdated"));
|
||||||
|
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>' . $langs->trans("FilesUpdated") . '</td>';
|
print '<td>#</td>';
|
||||||
|
print '<td>' . $langs->trans("Filename") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("CurrentChecksum") . '</td>';
|
print '<td align="center">' . $langs->trans("CurrentChecksum") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("Size") . '</td>';
|
print '<td align="right">' . $langs->trans("Size") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("DateModification") . '</td>';
|
print '<td align="right">' . $langs->trans("DateModification") . '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
$var = true;
|
$var = true;
|
||||||
$tmpfilelist = dol_sort_array($file_list['updated'], 'filename');
|
$tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename');
|
||||||
if (is_array($tmpfilelist) && count($tmpfilelist))
|
if (is_array($tmpfilelist2) && count($tmpfilelist2))
|
||||||
{
|
{
|
||||||
foreach ($tmpfilelist as $file)
|
$i = 0;
|
||||||
|
foreach ($tmpfilelist2 as $file)
|
||||||
{
|
{
|
||||||
|
$i++;
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
print '<tr ' . $bc[$var] . '>';
|
print '<tr ' . $bc[$var] . '>';
|
||||||
|
print '<td>'.$i.'</td>' . "\n";
|
||||||
print '<td>'.$file['filename'].'</td>' . "\n";
|
print '<td>'.$file['filename'].'</td>' . "\n";
|
||||||
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
||||||
print '<td align="center">'.$file['md5'].'</td>' . "\n";
|
print '<td align="center">'.$file['md5'].'</td>' . "\n";
|
||||||
@ -201,12 +224,42 @@ if ($xml)
|
|||||||
print '<tr ' . $bc[false] . '><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
print '<tr ' . $bc[false] . '><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
if (empty($tmpfilelist) && empty($tmpfilelist2))
|
||||||
|
{
|
||||||
|
setEventMessage($langs->trans("FileIntegrityIsStrictlyConformedWithReference"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessage($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), 'warnings');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile;
|
print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Scan scripts
|
||||||
|
/*
|
||||||
|
if (is_object($xml->dolibarr_script_dir[0]))
|
||||||
|
{
|
||||||
|
$file_list = array();
|
||||||
|
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', ???, $checksumconcat); // Fill array $file_list
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
asort($checksumconcat); // Sort list of checksum
|
||||||
|
//var_dump($checksumconcat);
|
||||||
|
$checksumget = md5(join(',',$checksumconcat));
|
||||||
|
$checksumtoget = $xml->dolibarr_htdocs_dir_checksum;
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("GlobalChecksum")).'<br>';
|
||||||
|
print $langs->trans("ExpectedChecksum").' = '. ($checksumtoget ? $checksumtoget : $langs->trans("Unknown")) .'<br>';
|
||||||
|
print $langs->trans("CurrentChecksum").' = '.$checksumget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -223,12 +276,14 @@ exit($error);
|
|||||||
* Function to get list of updated or modified files.
|
* Function to get list of updated or modified files.
|
||||||
* $file_list is used as global variable
|
* $file_list is used as global variable
|
||||||
*
|
*
|
||||||
* @param array $file_list Array for response
|
* @param array $file_list Array for response
|
||||||
* @param SimpleXMLElement $dir SimpleXMLElement of files to test
|
* @param SimpleXMLElement $dir SimpleXMLElement of files to test
|
||||||
* @param string $path Path of file
|
* @param string $path Path of files relative to $pathref. We start with ''. Used by recursive calls.
|
||||||
* @return array Array of filenames
|
* @param string $pathref Path ref (DOL_DOCUMENT_ROOT)
|
||||||
|
* @param array $checksumconcat Array of checksum
|
||||||
|
* @return array Array of filenames
|
||||||
*/
|
*/
|
||||||
function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '')
|
function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathref = '', &$checksumconcat = array())
|
||||||
{
|
{
|
||||||
$exclude = 'install';
|
$exclude = 'install';
|
||||||
|
|
||||||
@ -236,20 +291,21 @@ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '')
|
|||||||
{
|
{
|
||||||
$filename = $path.$file['name'];
|
$filename = $path.$file['name'];
|
||||||
|
|
||||||
if (preg_match('#'.$exclude.'#', $filename)) continue;
|
//if (preg_match('#'.$exclude.'#', $filename)) continue;
|
||||||
|
|
||||||
if (!file_exists(DOL_DOCUMENT_ROOT.'/'.$filename))
|
if (!file_exists($pathref.'/'.$filename))
|
||||||
{
|
{
|
||||||
$file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file);
|
$file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$md5_local = md5_file(DOL_DOCUMENT_ROOT.'/'.$filename);
|
$md5_local = md5_file($pathref.'/'.$filename);
|
||||||
if ($md5_local != (string) $file) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file, 'md5'=>(string) $md5_local);
|
if ($md5_local != (string) $file) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file, 'md5'=>(string) $md5_local);
|
||||||
}
|
$checksumconcat[] = $md5_local;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($dir->dir as $subdir) getFilesUpdated($file_list, $subdir, $path.$subdir['name'].'/');
|
foreach ($dir->dir as $subdir) getFilesUpdated($file_list, $subdir, $path.$subdir['name'].'/', $pathref, $checksumconcat);
|
||||||
|
|
||||||
return $file_list;
|
return $file_list;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,6 +102,8 @@ foreach($modulesdir as $dir)
|
|||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Modules").'</td>';
|
print '<td>'.$langs->trans("Modules").'</td>';
|
||||||
@ -148,6 +150,7 @@ foreach($sortorder as $numero=>$name)
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
sort($rights_ids);
|
sort($rights_ids);
|
||||||
$old='';
|
$old='';
|
||||||
|
|||||||
@ -68,8 +68,8 @@ print '<br>';
|
|||||||
$phparray=phpinfo_array();
|
$phparray=phpinfo_array();
|
||||||
foreach($phparray as $key => $value)
|
foreach($phparray as $key => $value)
|
||||||
{
|
{
|
||||||
//print load_fiche_titre($key);
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
|
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
|
||||||
print '<td width="220px">'.$key.'</td>';
|
print '<td width="220px">'.$key.'</td>';
|
||||||
@ -114,7 +114,9 @@ foreach($phparray as $key => $value)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</table><br>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -145,7 +145,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
|
|||||||
?>
|
?>
|
||||||
<table class="centpercent">
|
<table class="centpercent">
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">
|
<td class="tdtop">
|
||||||
|
|
||||||
<div id="div_container_exportoptions">
|
<div id="div_container_exportoptions">
|
||||||
<fieldset id="exportoptions"><legend><?php echo $langs->trans("ExportMethod"); ?></legend>
|
<fieldset id="exportoptions"><legend><?php echo $langs->trans("ExportMethod"); ?></legend>
|
||||||
@ -179,7 +179,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td valign="top">
|
<td class="tdtop">
|
||||||
|
|
||||||
|
|
||||||
<div id="div_container_sub_exportoptions">
|
<div id="div_container_sub_exportoptions">
|
||||||
|
|||||||
@ -86,7 +86,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
|
|||||||
|
|
||||||
<?php print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b>'; ?><br><br>
|
<?php print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b>'; ?><br><br>
|
||||||
|
|
||||||
<table><tr><td valign="top">
|
<table><tr><td class="tdtop">
|
||||||
|
|
||||||
<?php if ($conf->use_javascript_ajax) { ?>
|
<?php if ($conf->use_javascript_ajax) { ?>
|
||||||
<div id="div_container_exportoptions">
|
<div id="div_container_exportoptions">
|
||||||
@ -120,7 +120,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
|
|||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</td><td valign="top">
|
</td><td class="tdtop">
|
||||||
|
|
||||||
|
|
||||||
<div id="div_container_sub_exportoptions">
|
<div id="div_container_sub_exportoptions">
|
||||||
|
|||||||
@ -174,6 +174,15 @@ if ($search_user) { $usefilter++; $sql.=natural_search("u.login", $search_user,
|
|||||||
if ($search_desc) { $usefilter++; $sql.=natural_search("e.description", $search_desc, 0); }
|
if ($search_desc) { $usefilter++; $sql.=natural_search("e.description", $search_desc, 0); }
|
||||||
if ($search_ua) { $usefilter++; $sql.=natural_search("e.user_agent", $search_ua, 0); }
|
if ($search_ua) { $usefilter++; $sql.=natural_search("e.user_agent", $search_ua, 0); }
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
|
// Count total nb of records
|
||||||
|
$nbtotalofrecords = '';
|
||||||
|
/*if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
|
{
|
||||||
|
$result = $db->query($sql);
|
||||||
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
|
}*/
|
||||||
|
|
||||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -195,7 +204,7 @@ if ($result)
|
|||||||
$center='<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("Purge").'</a>';
|
$center='<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("Purge").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print_barre_liste($langs->trans("ListOfSecurityEvents").' ('.$num.')', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, 0, 'setup');
|
print_barre_liste($langs->trans("ListOfSecurityEvents"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $nbtotalofrecords, 'setup');
|
||||||
|
|
||||||
if ($action == 'purge')
|
if ($action == 'purge')
|
||||||
{
|
{
|
||||||
@ -204,6 +213,8 @@ if ($result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="liste" width="100%">';
|
print '<table class="liste" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder);
|
||||||
@ -303,7 +314,10 @@ if ($result)
|
|||||||
if ($usefilter) print '<tr><td colspan="6">'.$langs->trans("NoEventFoundWithCriteria").'</td></tr>';
|
if ($usefilter) print '<tr><td colspan="6">'.$langs->trans("NoEventFoundWithCriteria").'</td></tr>';
|
||||||
else print '<tr><td colspan="6">'.$langs->trans("NoEventOrNoAuditSetup").'</td></tr>';
|
else print '<tr><td colspan="6">'.$langs->trans("NoEventOrNoAuditSetup").'</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table></form>";
|
print "</table>";
|
||||||
|
print "</div>";
|
||||||
|
|
||||||
|
print "</form>";
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -39,7 +39,7 @@ if (GETPOST('msg','alpha')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$urldolibarr='http://www.dolibarr.org/downloads/';
|
$urldolibarr='https://www.dolibarr.org/downloads/';
|
||||||
$urldolibarrmodules='https://www.dolistore.com/';
|
$urldolibarrmodules='https://www.dolistore.com/';
|
||||||
$urldolibarrthemes='https://www.dolistore.com/';
|
$urldolibarrthemes='https://www.dolistore.com/';
|
||||||
$dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT);
|
$dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT);
|
||||||
|
|||||||
@ -105,7 +105,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update'))
|
|||||||
}
|
}
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue) VALUE ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."')";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -52,6 +52,7 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/';
|
|||||||
$interfaces = new Interfaces($db);
|
$interfaces = new Interfaces($db);
|
||||||
$triggers = $interfaces->getTriggersList();
|
$triggers = $interfaces->getTriggersList();
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">
|
print '<table class="noborder">
|
||||||
<tr class="liste_titre">
|
<tr class="liste_titre">
|
||||||
<td colspan="2">'.$langs->trans("File").'</td>
|
<td colspan="2">'.$langs->trans("File").'</td>
|
||||||
@ -66,9 +67,9 @@ foreach ($triggers as $trigger)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td valign="top" width="14" align="center">'.$trigger['picto'].'</td>';
|
print '<td valign="top" width="14" align="center">'.$trigger['picto'].'</td>';
|
||||||
print '<td valign="top">'.$trigger['file'].'</td>';
|
print '<td class="tdtop">'.$trigger['file'].'</td>';
|
||||||
print '<td valign="top" align="center">'.$trigger['status'].'</td>';
|
print '<td valign="top" align="center">'.$trigger['status'].'</td>';
|
||||||
print '<td valign="top">';
|
print '<td class="tdtop">';
|
||||||
$text=$trigger['info'];
|
$text=$trigger['info'];
|
||||||
$text.="<br>\n<strong>".$langs->trans("File")."</strong>:<br>\n".$trigger['relpath'];
|
$text.="<br>\n<strong>".$langs->trans("File")."</strong>:<br>\n".$trigger['relpath'];
|
||||||
//$text.="\n".$langs->trans("ExternalModule",$trigger['isocreorexternal']);
|
//$text.="\n".$langs->trans("ExternalModule",$trigger['isocreorexternal']);
|
||||||
@ -78,6 +79,7 @@ foreach ($triggers as $trigger)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
|||||||
@ -76,12 +76,34 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
|
|
||||||
$userClass = Defaults::$userIdentifierClass;
|
$userClass = Defaults::$userIdentifierClass;
|
||||||
|
|
||||||
|
/*foreach ($_SERVER as $key => $val)
|
||||||
|
{
|
||||||
|
dol_syslog($key.' - '.$val);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// api key can be provided in url with parameter api_key=xxx or ni header with header DOLAPIKEY:xxx
|
||||||
|
$api_key = '';
|
||||||
if (isset($_GET['api_key']))
|
if (isset($_GET['api_key']))
|
||||||
|
{
|
||||||
|
// TODO Add option to disable use of api key on url. Return errors if used.
|
||||||
|
$api_key = $_GET['api_key']; // For backward compatibility
|
||||||
|
}
|
||||||
|
if (isset($_GET['DOLAPIKEY']))
|
||||||
|
{
|
||||||
|
// TODO Add option to disable use of api key on url. Return errors if used.
|
||||||
|
$api_key = $_GET['DOLAPIKEY']; // With GET method
|
||||||
|
}
|
||||||
|
if (isset($_SERVER['HTTP_DOLAPIKEY']))
|
||||||
|
{
|
||||||
|
$api_key = $_SERVER['HTTP_DOLAPIKEY']; // With header method (recommanded)
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($api_key)
|
||||||
{
|
{
|
||||||
$sql = "SELECT u.login, u.datec, u.api_key, ";
|
$sql = "SELECT u.login, u.datec, u.api_key, ";
|
||||||
$sql.= " u.tms as date_modification, u.entity";
|
$sql.= " u.tms as date_modification, u.entity";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql.= " WHERE u.api_key = '".$db->escape($_GET['api_key'])."'";
|
$sql.= " WHERE u.api_key = '".$db->escape($api_key)."'";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -97,8 +119,8 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
throw new RestException(503, 'Error when fetching user api_key :'.$db->error_msg);
|
throw new RestException(503, 'Error when fetching user api_key :'.$db->error_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($stored_key != $_GET['api_key']) {
|
if ($stored_key != $api_key) {
|
||||||
$userClass::setCacheIdentifier($_GET['api_key']);
|
$userClass::setCacheIdentifier($api_key);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +143,7 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new RestException(401, "Failed to login to API. No parameter 'api_key' provided");
|
throw new RestException(401, "Failed to login to API. No parameter 'DOLAPIKEY' on HTTP header (neither in URL).");
|
||||||
}
|
}
|
||||||
|
|
||||||
$userClass::setCacheIdentifier(static::$role);
|
$userClass::setCacheIdentifier(static::$role);
|
||||||
|
|||||||
@ -34,12 +34,14 @@ class Login
|
|||||||
/**
|
/**
|
||||||
* Login
|
* Login
|
||||||
*
|
*
|
||||||
* Log user with username and password
|
* Request the API token for a couple username / 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 into server log file).
|
||||||
* @param string $login Username
|
* Both method are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "api_key" into field at the top right of page (Note: "api_key" can be found/set on the user page).
|
||||||
|
*
|
||||||
|
* @param string $login User login
|
||||||
* @param string $password User password
|
* @param string $password User password
|
||||||
* @param int $entity Entity (when multicompany module is used). Empty means 1=first company.
|
* @param int $entity Entity (when multicompany module is used). Empty means 1=first company.
|
||||||
* @param int $reset Reset token (0=get current token, 1=ask a new token, meaning that all future access using current token will failed)
|
* @param int $reset Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access)
|
||||||
* @return array Response status and user token
|
* @return array Response status and user token
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
|
|||||||
@ -56,6 +56,16 @@ if (empty($conf->global->MAIN_MODULE_API))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test if explorer is not disabled
|
||||||
|
if (preg_match('/api\/index\.php\/explorer/', $_SERVER["PHP_SELF"]) && ! empty($conf->global->API_EXPLORER_DISABLED))
|
||||||
|
{
|
||||||
|
$langs->load("admin");
|
||||||
|
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
||||||
|
print $langs->trans("WarningAPIExplorerDisabled").'.<br><br>';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$api = new DolibarrApi($db);
|
$api = new DolibarrApi($db);
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ $userid=GETPOST("userid","int");
|
|||||||
$position=GETPOST("position","int");
|
$position=GETPOST("position","int");
|
||||||
$backtopage=GETPOST('backtopage','alpha');
|
$backtopage=GETPOST('backtopage','alpha');
|
||||||
|
|
||||||
$bookmark=new Bookmark($db);
|
$object=new Bookmark($db);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -69,14 +69,14 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'update') $bookmark->fetch(GETPOST("id",'int'));
|
if ($action == 'update') $object->fetch(GETPOST("id",'int'));
|
||||||
// Check if null because user not admin can't set an user and send empty value here.
|
// Check if null because user not admin can't set an user and send empty value here.
|
||||||
if(!empty($userid))
|
if(!empty($userid))
|
||||||
$bookmark->fk_user=$userid;
|
$object->fk_user=$userid;
|
||||||
$bookmark->title=$title;
|
$object->title=$title;
|
||||||
$bookmark->url=$url;
|
$object->url=$url;
|
||||||
$bookmark->target=$target;
|
$object->target=$target;
|
||||||
$bookmark->position=$position;
|
$object->position=$position;
|
||||||
|
|
||||||
if (! $title) {
|
if (! $title) {
|
||||||
$error++;
|
$error++;
|
||||||
@ -90,10 +90,10 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$bookmark->favicon='none';
|
$object->favicon='none';
|
||||||
|
|
||||||
if ($action == 'update') $res=$bookmark->update();
|
if ($action == 'update') $res=$object->update();
|
||||||
else $res=$bookmark->create();
|
else $res=$object->create();
|
||||||
|
|
||||||
if ($res > 0)
|
if ($res > 0)
|
||||||
{
|
{
|
||||||
@ -103,14 +103,14 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($bookmark->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
if ($object->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->transnoentities("WarningBookmarkAlreadyExists"), null, 'warnings');
|
setEventMessages($langs->transnoentities("WarningBookmarkAlreadyExists"), null, 'warnings');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($bookmark->error, $bookmark->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
$action = $invertedaction;
|
$action = $invertedaction;
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ $form=new Form($db);
|
|||||||
$head = array();
|
$head = array();
|
||||||
$h=1;
|
$h=1;
|
||||||
|
|
||||||
$head[$h][0] = $_SERVER["PHP_SELF"].($bookmark->id?'id='.$bookmark->id:'');
|
$head[$h][0] = $_SERVER["PHP_SELF"].($object->id?'id='.$object->id:'');
|
||||||
$head[$h][1] = $langs->trans("Card");
|
$head[$h][1] = $langs->trans("Card");
|
||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h++;
|
$h++;
|
||||||
@ -157,7 +157,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input class="flat" name="title" size="30" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
|
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input class="flat" name="title" size="30" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat" name="url" size="50" value="'.$url.'"></td><td class="hideonsmartphone">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat" name="url" size="50" value="'.$url.'"></td><td class="hideonsmartphone">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</td></tr>';
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Position
|
// Position
|
||||||
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
||||||
print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">';
|
print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$object->position).'">';
|
||||||
print '</td><td class="hideonsmartphone"> </td></tr>';
|
print '</td><td class="hideonsmartphone"> </td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -193,8 +193,9 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
/*
|
/*
|
||||||
* Fact bookmark mode or visually edition
|
* Fact bookmark mode or visually edition
|
||||||
*/
|
*/
|
||||||
$bookmark->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
|
$hselected = 'card';
|
||||||
$head = array(
|
$head = array(
|
||||||
array(
|
array(
|
||||||
'',
|
'',
|
||||||
@ -208,18 +209,22 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">';
|
print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="id" value="'.$bookmark->id.'">';
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
print '<input type="hidden" name="urlsource" value="'.DOL_URL_ROOT.'/bookmarks/card.php?id='.$bookmark->id.'">';
|
print '<input type="hidden" name="urlsource" value="'.DOL_URL_ROOT.'/bookmarks/card.php?id='.$object->id.'">';
|
||||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
|
|
||||||
|
|
||||||
|
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
|
||||||
|
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '' , '', 0, '', '', 0);
|
||||||
|
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bookmark->ref.'</td></tr>';
|
print '<tr><td class="titlefield">';
|
||||||
|
|
||||||
print '<tr><td>';
|
|
||||||
if ($action == 'edit') {
|
if ($action == 'edit') {
|
||||||
print '<span class="fieldrequired">';
|
print '<span class="fieldrequired">';
|
||||||
}
|
}
|
||||||
@ -231,8 +236,8 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'edit') print '<input class="flat minwidth200" name="title" value="'.(isset($_POST["title"])?GETPOST("title",'',2):$bookmark->title).'">';
|
if ($action == 'edit') print '<input class="flat minwidth200" name="title" value="'.(isset($_POST["title"])?GETPOST("title",'',2):$object->title).'">';
|
||||||
else print $bookmark->title;
|
else print $object->title;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
@ -244,34 +249,34 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
print '</span>';
|
print '</span>';
|
||||||
}
|
}
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$bookmark->url).'">';
|
if ($action == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$object->url).'">';
|
||||||
else print '<a href="'.(preg_match('/^http/i',$bookmark->url)?$bookmark->url:DOL_URL_ROOT.$bookmark->url).'"'.($bookmark->target?' target="_blank"':'').'>'.$bookmark->url.'</a>';
|
else print '<a href="'.(preg_match('/^http/i',$object->url)?$object->url:DOL_URL_ROOT.$object->url).'"'.($object->target?' target="_blank"':'').'>'.$object->url.'</a>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
$liste=array(1=>$langs->trans("OpenANewWindow"),0=>$langs->trans("ReplaceWindow"));
|
$liste=array(1=>$langs->trans("OpenANewWindow"),0=>$langs->trans("ReplaceWindow"));
|
||||||
print $form->selectarray('target',$liste,isset($_POST["target"])?$_POST["target"]:$bookmark->target);
|
print $form->selectarray('target',$liste,isset($_POST["target"])?$_POST["target"]:$object->target);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($bookmark->target == 0) print $langs->trans("ReplaceWindow");
|
if ($object->target == 0) print $langs->trans("ReplaceWindow");
|
||||||
if ($bookmark->target == 1) print $langs->trans("OpenANewWindow");
|
if ($object->target == 1) print $langs->trans("OpenANewWindow");
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
|
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
|
||||||
if ($action == 'edit' && $user->admin)
|
if ($action == 'edit' && $user->admin)
|
||||||
{
|
{
|
||||||
print $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:($bookmark->fk_user?$bookmark->fk_user:''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
print $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:($object->fk_user?$object->fk_user:''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($bookmark->fk_user)
|
if ($object->fk_user)
|
||||||
{
|
{
|
||||||
$fuser=new User($db);
|
$fuser=new User($db);
|
||||||
$fuser->fetch($bookmark->fk_user);
|
$fuser->fetch($object->fk_user);
|
||||||
print $fuser->getNomUrl(1);
|
print $fuser->getNomUrl(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -283,12 +288,12 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
|
|
||||||
// Position
|
// Position
|
||||||
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
||||||
if ($action == 'edit') print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">';
|
if ($action == 'edit') print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$object->position).'">';
|
||||||
else print $bookmark->position;
|
else print $object->position;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date creation
|
// Date creation
|
||||||
print '<tr><td>'.$langs->trans("DateCreation").'</td><td>'.dol_print_date($bookmark->datec,'dayhour').'</td></tr>';
|
print '<tr><td>'.$langs->trans("DateCreation").'</td><td>'.dol_print_date($object->datec,'dayhour').'</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
@ -308,13 +313,13 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
|||||||
// Edit
|
// Edit
|
||||||
if ($user->rights->bookmark->creer && $action != 'edit')
|
if ($user->rights->bookmark->creer && $action != 'edit')
|
||||||
{
|
{
|
||||||
print " <a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?id=".$bookmark->id."&action=edit\">".$langs->trans("Edit")."</a>\n";
|
print " <a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?id=".$object->id."&action=edit\">".$langs->trans("Edit")."</a>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove
|
// Remove
|
||||||
if ($user->rights->bookmark->supprimer && $action != 'edit')
|
if ($user->rights->bookmark->supprimer && $action != 'edit')
|
||||||
{
|
{
|
||||||
print " <a class=\"butActionDelete\" href=\"list.php?bid=".$bookmark->id."&action=delete\">".$langs->trans("Delete")."</a>\n";
|
print " <a class=\"butActionDelete\" href=\"list.php?bid=".$object->id."&action=delete\">".$langs->trans("Delete")."</a>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -26,8 +26,13 @@
|
|||||||
/**
|
/**
|
||||||
* Class to manage bookmarks
|
* Class to manage bookmarks
|
||||||
*/
|
*/
|
||||||
class Bookmark
|
class Bookmark extends CommonObject
|
||||||
{
|
{
|
||||||
|
public $element='bookmark';
|
||||||
|
public $table_element='bookmark';
|
||||||
|
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
|
public $picto = 'bookmark';
|
||||||
|
|
||||||
var $db;
|
var $db;
|
||||||
|
|
||||||
var $id;
|
var $id;
|
||||||
@ -228,4 +233,15 @@ class Bookmark
|
|||||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return label of contact status
|
||||||
|
*
|
||||||
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
|
* @return string Label of contact status
|
||||||
|
*/
|
||||||
|
function getLibStatut($mode)
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,6 +34,8 @@ if ( $_SESSION['uid'] <= 0 )
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$langs->load("companies");
|
||||||
|
$langs->load("compta");
|
||||||
$langs->load("cashdesk");
|
$langs->load("cashdesk");
|
||||||
|
|
||||||
|
|
||||||
@ -41,6 +43,8 @@ $langs->load("cashdesk");
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
//header("Content-type: text/html; charset=UTF-8");
|
//header("Content-type: text/html; charset=UTF-8");
|
||||||
//header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
//header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
||||||
|
|
||||||
|
|||||||
@ -22,8 +22,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
<!-- affPied.php -->
|
||||||
<div class="pied">
|
<div class="pied">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// Wrapper to show tooltips
|
||||||
|
if (! empty($conf->use_javascript_ajax) && empty($conf->dol_no_mouse_hover))
|
||||||
|
{
|
||||||
|
print "\n<!-- JS CODE TO ENABLE tipTip on all object with class classfortooltip -->\n";
|
||||||
|
print '<script type="text/javascript">
|
||||||
|
jQuery(document).ready(function () {
|
||||||
|
jQuery(".classfortooltip").tipTip({maxWidth: "'.dol_size(($conf->browser->layout == 'phone' ? 400 : 700),'width').'px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50});
|
||||||
|
});
|
||||||
|
</script>' . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
printCommonFooter('private');
|
printCommonFooter('private');
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class Facturation
|
|||||||
* int $prix => Prix HT du produit en cours
|
* int $prix => Prix HT du produit en cours
|
||||||
* int $tva => 'rowid' du taux de tva dans llx_c_tva
|
* int $tva => 'rowid' du taux de tva dans llx_c_tva
|
||||||
*/
|
*/
|
||||||
var $id;
|
public $id;
|
||||||
protected $ref;
|
protected $ref;
|
||||||
protected $qte;
|
protected $qte;
|
||||||
protected $stock;
|
protected $stock;
|
||||||
|
|||||||
@ -19,7 +19,6 @@ body {
|
|||||||
color: #333;
|
color: #333;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
@ -115,7 +114,7 @@ li.menu_choix0 {
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------- R<EFBFBD>capitulatif des articles ------------------- */
|
/* ------------------- Remind of products ------------------- */
|
||||||
.liste_articles {
|
.liste_articles {
|
||||||
min-width: 215px;
|
min-width: 215px;
|
||||||
float: right;
|
float: right;
|
||||||
@ -212,6 +211,10 @@ p.titre {
|
|||||||
max-width: 900px;
|
max-width: 900px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.blocksellfinished {
|
||||||
|
min-width: 215px;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
.titre1 {
|
.titre1 {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #ff9900;
|
color: #ff9900;
|
||||||
|
|||||||
61
htdocs/cashdesk/css/ticket.css
Normal file
61
htdocs/cashdesk/css/ticket.css
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* TPV ticket.css
|
||||||
|
*/
|
||||||
|
body {
|
||||||
|
font-size: 1.5em;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.entete { /* position: relative; */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.address { /* float: left; */
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date_heure {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infos {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.liste_articles {
|
||||||
|
width: 100%;
|
||||||
|
border-bottom: 1px solid #000;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.liste_articles tr.titres th {
|
||||||
|
border-bottom: 1px solid #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.liste_articles td.total {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totaux {
|
||||||
|
margin-top: 20px;
|
||||||
|
width: 30%;
|
||||||
|
float: right;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lien {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
.lien {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -28,11 +28,13 @@ require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
|
||||||
|
$action = GETPOST('action','alpha');
|
||||||
|
|
||||||
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
|
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
|
||||||
unset ($_SESSION['serObjFacturation']);
|
unset ($_SESSION['serObjFacturation']);
|
||||||
|
|
||||||
|
|
||||||
switch ( $_GET['action'] )
|
switch($action)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
if ( $_POST['hdnSource'] != 'NULL' )
|
if ( $_POST['hdnSource'] != 'NULL' )
|
||||||
@ -162,6 +164,16 @@ switch ( $_GET['action'] )
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'change_thirdparty': // We have clicked on button "Modify" a thirdparty
|
||||||
|
$newthirdpartyid = GETPOST('CASHDESK_ID_THIRDPARTY','int');
|
||||||
|
if ($newthirdpartyid > 0)
|
||||||
|
{
|
||||||
|
$_SESSION["CASHDESK_ID_THIRDPARTY"] = $newthirdpartyid;
|
||||||
|
}
|
||||||
|
|
||||||
|
$redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation';
|
||||||
|
break;
|
||||||
|
|
||||||
case 'ajout_article': // We have clicked on button "Add product"
|
case 'ajout_article': // We have clicked on button "Add product"
|
||||||
|
|
||||||
if (! empty($obj_facturation->id)) // A product was previously selected and stored in session, so we can add it
|
if (! empty($obj_facturation->id)) // A product was previously selected and stored in session, so we can add it
|
||||||
|
|||||||
@ -59,7 +59,18 @@ top_htmlhead('','',0,0,'',$arrayofcss);
|
|||||||
<div class="conteneur_img_droite">
|
<div class="conteneur_img_droite">
|
||||||
|
|
||||||
<div class="menu_principal hideonsmartphone">
|
<div class="menu_principal hideonsmartphone">
|
||||||
<div class="logo"><?php print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('/thumbs/'.$mysoc->logo_small).'">'; ?></div>
|
<div class="logo">
|
||||||
|
<?php
|
||||||
|
if (! empty($mysoc->logo_small))
|
||||||
|
{
|
||||||
|
print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('/thumbs/'.$mysoc->logo_small).'">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<div class="logopos">'.$mysoc->name.'</div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="contenu">
|
<div class="contenu">
|
||||||
|
|||||||
@ -106,23 +106,23 @@ $langs->load("cashdesk");
|
|||||||
<th><?php echo $langs->trans("VATRate"); ?></th>
|
<th><?php echo $langs->trans("VATRate"); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input class="texte1" type="text" id="txtQte" name="txtQte" value="1" onkeyup="javascript: modif();" onfocus="javascript: this.select();" />
|
<td><input class="texte1 maxwidth50onsmartphone" type="text" id="txtQte" name="txtQte" value="1" onkeyup="javascript: modif();" onfocus="javascript: this.select();" />
|
||||||
<?php print genkeypad("txtQte", "frmQte");?>
|
<?php print genkeypad("txtQte", "frmQte");?>
|
||||||
</td>
|
</td>
|
||||||
<!-- Affichage du stock pour l'article courant -->
|
<!-- Affichage du stock pour l'article courant -->
|
||||||
<td>
|
<td>
|
||||||
<input class="texte1_off" type="text" name="txtStock" value="<?php echo $obj_facturation->stock() ?>" disabled />
|
<input class="texte1_off maxwidth50onsmartphone" type="text" name="txtStock" value="<?php echo $obj_facturation->stock() ?>" disabled />
|
||||||
</td>
|
</td>
|
||||||
<!-- Show unit price -->
|
<!-- Show unit price -->
|
||||||
<?php // TODO Remove the disabled and use this value when adding product into cart ?>
|
<?php // TODO Remove the disabled and use this value when adding product into cart ?>
|
||||||
<td><input class="texte1_off" type="text" name="txtPrixUnit" value="<?php echo price2num($obj_facturation->prix(), 'MU'); ?>" onchange="javascript: modif();" disabled /></td>
|
<td><input class="texte1_off maxwidth50onsmartphone" type="text" name="txtPrixUnit" value="<?php echo price2num($obj_facturation->prix(), 'MU'); ?>" onchange="javascript: modif();" disabled /></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<!-- Choix de la remise -->
|
<!-- Choix de la remise -->
|
||||||
<td><input class="texte1" type="text" id="txtRemise" name="txtRemise" value="0" onkeyup="javascript: modif();" onfocus="javascript: this.select();"/>
|
<td><input class="texte1 maxwidth50onsmartphone" type="text" id="txtRemise" name="txtRemise" value="0" onkeyup="javascript: modif();" onfocus="javascript: this.select();"/>
|
||||||
<?php print genkeypad("txtRemise", "frmQte");?>
|
<?php print genkeypad("txtRemise", "frmQte");?>
|
||||||
</td>
|
</td>
|
||||||
<!-- Affichage du total HT -->
|
<!-- Affichage du total HT -->
|
||||||
<td><input class="texte1_off" type="text" name="txtTotal" value="" disabled /></td><td></td>
|
<td><input class="texte1_off maxwidth50onsmartphone" type="text" name="txtTotal" value="" disabled /></td><td></td>
|
||||||
<!-- Choix du taux de TVA -->
|
<!-- Choix du taux de TVA -->
|
||||||
<td class="select_tva">
|
<td class="select_tva">
|
||||||
<?php //var_dump($tab_tva); ?>
|
<?php //var_dump($tab_tva); ?>
|
||||||
@ -155,17 +155,17 @@ $langs->load("cashdesk");
|
|||||||
<input type="hidden" name="hdnChoix" value="" />
|
<input type="hidden" name="hdnChoix" value="" />
|
||||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
||||||
<fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Amount"); ?></legend>
|
<fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Amount"); ?></legend>
|
||||||
<table>
|
<table class="centpercent">
|
||||||
<tr><th class="label1"><?php echo $langs->trans("TotalTicket"); ?></th><th class="label1"><?php echo $langs->trans("Received"); ?></th><th class="label1"><?php echo $langs->trans("Change"); ?></th></tr>
|
<tr><th class="label1"><?php echo $langs->trans("TotalTicket"); ?></th><th class="label1"><?php echo $langs->trans("Received"); ?></th><th class="label1"><?php echo $langs->trans("Change"); ?></th></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<!-- Affichage du montant du -->
|
<!-- Affichage du montant du -->
|
||||||
<td><input class="texte2_off" type="text" name="txtDu" value="<?php echo price2num($obj_facturation->prixTotalTtc(), 'MT'); ?>" disabled /></td>
|
<td><input class="texte2_off maxwidthonsmartphone" type="text" name="txtDu" value="<?php echo price2num($obj_facturation->prixTotalTtc(), 'MT'); ?>" disabled /></td>
|
||||||
<!-- Choix du montant encaisse -->
|
<!-- Choix du montant encaisse -->
|
||||||
<td><input class="texte2" type="text" id="txtEncaisse" name="txtEncaisse" value="" onkeyup="javascript: verifDifference();" onfocus="javascript: this.select();" />
|
<td><input class="texte2 maxwidthonsmartphone" type="text" id="txtEncaisse" name="txtEncaisse" value="" onkeyup="javascript: verifDifference();" onfocus="javascript: this.select();" />
|
||||||
<?php print genkeypad("txtEncaisse", "frmDifference");?>
|
<?php print genkeypad("txtEncaisse", "frmDifference");?>
|
||||||
</td>
|
</td>
|
||||||
<!-- Affichage du montant rendu -->
|
<!-- Affichage du montant rendu -->
|
||||||
<td><input class="texte2_off" type="text" name="txtRendu" value="0" disabled /></td>
|
<td><input class="texte2_off maxwidthonsmartphone" type="text" name="txtRendu" value="0" disabled /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@ -23,12 +23,12 @@ include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||||
|
|
||||||
if (!empty($_SESSION["CASHDESK_ID_THIRDPARTY"]))
|
/*if (!empty($_SESSION["CASHDESK_ID_THIRDPARTY"]))
|
||||||
{
|
{
|
||||||
$company=new Societe($db);
|
$company=new Societe($db);
|
||||||
$company->fetch($_SESSION["CASHDESK_ID_THIRDPARTY"]);
|
$company->fetch($_SESSION["CASHDESK_ID_THIRDPARTY"]);
|
||||||
$companyLink = $company->getNomUrl(1);
|
$companyLink = $company->getNomUrl(1);
|
||||||
}
|
}*/
|
||||||
if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]))
|
if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]))
|
||||||
{
|
{
|
||||||
$bankcash=new Account($db);
|
$bankcash=new Account($db);
|
||||||
@ -59,6 +59,7 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)
|
|||||||
$langs->load("cashdesk");
|
$langs->load("cashdesk");
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
|
|
||||||
|
print "\n".'<!-- menu.tpl.php -->'."\n";
|
||||||
print '<div class="menu_bloc">';
|
print '<div class="menu_bloc">';
|
||||||
print '<ul class="menu">';
|
print '<ul class="menu">';
|
||||||
// Link to new sell
|
// Link to new sell
|
||||||
@ -68,7 +69,13 @@ print '<li class="menu_choix2"><a href=".." target="backoffice"><span class="hid
|
|||||||
// Disconnect
|
// Disconnect
|
||||||
print '<li class="menu_choix0">'.$langs->trans("User").': '.$_SESSION['firstname'].' '.$_SESSION['lastname'];
|
print '<li class="menu_choix0">'.$langs->trans("User").': '.$_SESSION['firstname'].' '.$_SESSION['lastname'];
|
||||||
print ' <a href="deconnexion.php">'.img_picto($langs->trans('Logout'), 'logout.png').'</a><br>';
|
print ' <a href="deconnexion.php">'.img_picto($langs->trans('Logout'), 'logout.png').'</a><br>';
|
||||||
print $langs->trans("CashDeskThirdParty").': '.$companyLink.'<br>';
|
print '<form id="frmThirdparty" class="formulaire1 inline-block" method="post" action="facturation_verif.php?action=change_thirdparty">';
|
||||||
|
print $langs->trans("CashDeskThirdParty").': ';
|
||||||
|
print $form->select_company($_SESSION["CASHDESK_ID_THIRDPARTY"], 'CASHDESK_ID_THIRDPARTY', 's.client IN (1,3)', '', 0, 0, null, 0, 'valignmiddle inline-block');
|
||||||
|
print '<input class="button bouton_change_thirdparty inline-block valignmiddle" type="submit" id="bouton_change_thirdparty" value="'.$langs->trans("Modify").'">';
|
||||||
|
//print $companyLink;
|
||||||
|
print '<br>';
|
||||||
|
print '</form>';
|
||||||
/*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'<br>';
|
/*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'<br>';
|
||||||
print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>';
|
print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>';
|
||||||
print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'<br>';*/
|
print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'<br>';*/
|
||||||
@ -78,3 +85,4 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)
|
|||||||
}
|
}
|
||||||
print '</li></ul>';
|
print '</li></ul>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
print "\n".'<!-- menu.tpl.php end -->'."\n";
|
||||||
|
|||||||
@ -28,130 +28,84 @@ $object->fetch($facid);
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title><?php echo $langs->trans('PrintTicket') ?></title>
|
<title><?php echo $langs->trans('PrintTicket') ?></title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo DOL_URL_ROOT;?>/cashdesk/css/ticket.css">
|
||||||
<style type="text/css">
|
|
||||||
body {
|
|
||||||
font-size: 1.5em;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.entete { /* position: relative; */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.address { /* float: left; */
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.date_heure {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.infos {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.liste_articles {
|
|
||||||
width: 100%;
|
|
||||||
border-bottom: 1px solid #000;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.liste_articles tr.titres th {
|
|
||||||
border-bottom: 1px solid #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.liste_articles td.total {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.totaux {
|
|
||||||
margin-top: 20px;
|
|
||||||
width: 30%;
|
|
||||||
float: right;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lien {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media print {
|
|
||||||
.lien {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="entete">
|
<div class="entete">
|
||||||
<div class="logo"><?php print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('/thumbs/'.$mysoc->logo_small).'">'; ?>
|
<div class="logo">
|
||||||
</div>
|
<?php print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('/thumbs/'.$mysoc->logo_small).'">'; ?>
|
||||||
<div class="infos">
|
</div>
|
||||||
<p class="address"><?php echo $mysoc->name; ?><br>
|
<div class="infos">
|
||||||
<?php print dol_nl2br(dol_format_address($mysoc)); ?><br>
|
<p class="address"><?php echo $mysoc->name; ?><br>
|
||||||
</p>
|
<?php print dol_nl2br(dol_format_address($mysoc)); ?><br>
|
||||||
|
</p>
|
||||||
|
|
||||||
<p class="date_heure"><?php
|
<p class="date_heure"><?php
|
||||||
// Recuperation et affichage de la date et de l'heure
|
// Recuperation et affichage de la date et de l'heure
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
print dol_print_date($now,'dayhourtext').'<br>';
|
print dol_print_date($now,'dayhourtext').'<br>';
|
||||||
print $object->ref;
|
print $object->ref;
|
||||||
?></p>
|
?></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<table class="liste_articles">
|
<table class="liste_articles">
|
||||||
|
<thead>
|
||||||
<tr class="titres">
|
<tr class="titres">
|
||||||
<th><?php print $langs->trans("Code"); ?></th>
|
<th><?php print $langs->trans("Code"); ?></th>
|
||||||
<th><?php print $langs->trans("Label"); ?></th>
|
<th><?php print $langs->trans("Label"); ?></th>
|
||||||
<th><?php print $langs->trans("Qty"); ?></th>
|
<th><?php print $langs->trans("Qty"); ?></th>
|
||||||
<th><?php print $langs->trans("Discount").' (%)'; ?></th>
|
<th><?php print $langs->trans("Discount").' (%)'; ?></th>
|
||||||
<th><?php print $langs->trans("TotalHT"); ?></th>
|
<th><?php print $langs->trans("TotalHT"); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
|
||||||
<?php
|
$tab=array();
|
||||||
|
|
||||||
$tab=array();
|
|
||||||
$tab = $_SESSION['poscart'];
|
$tab = $_SESSION['poscart'];
|
||||||
|
|
||||||
$tab_size=count($tab);
|
$tab_size=count($tab);
|
||||||
for($i=0;$i < $tab_size;$i++)
|
for($i=0;$i < $tab_size;$i++)
|
||||||
{
|
{
|
||||||
$remise = $tab[$i]['remise'];
|
$remise = $tab[$i]['remise'];
|
||||||
echo ('<tr><td>'.$tab[$i]['ref'].'</td><td>'.$tab[$i]['label'].'</td><td>'.$tab[$i]['qte'].'</td><td>'.$tab[$i]['remise_percent'].'</td><td class="total">'.price(price2num($tab[$i]['total_ht'],'MT'),0,$langs,0,0,-1,$conf->currency).'</td></tr>'."\n");
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo $tab[$i]['ref'];?></td>
|
||||||
|
<td><?php echo $tab[$i]['label'];?></td>
|
||||||
|
<td><?php echo $tab[$i]['qte'];?></td>
|
||||||
|
<td><?php echo $tab[$i]['remise_percent'];?></td>
|
||||||
|
<td class="total"><?php echo price(price2num($tab[$i]['total_ht'],'MT'),0,$langs,0,0,-1,$conf->currency);?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
?>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<table class="totaux">
|
<table class="totaux">
|
||||||
<?php
|
<tr>
|
||||||
echo '<tr><th class="nowrap">'.$langs->trans("TotalHT").'</th><td class="nowrap">'.price(price2num($obj_facturation->prixTotalHt(),'MT'),'',$langs,0,-1,-1,$conf->currency)."</td></tr>\n";
|
<th class="nowrap"><?php echo $langs->trans("TotalHT");?></th>
|
||||||
echo '<tr><th class="nowrap">'.$langs->trans("TotalVAT").'</th><td class="nowrap">'.price(price2num($obj_facturation->montantTva(),'MT'),'',$langs,0,-1,-1,$conf->currency)."</td></tr>\n";
|
<td class="nowrap"><?php echo price(price2num($obj_facturation->prixTotalHt(),'MT'),'',$langs,0,-1,-1,$conf->currency)."\n";?></td>
|
||||||
echo '<tr><th class="nowrap">'.$langs->trans("TotalTTC").'</th><td class="nowrap">'.price(price2num($obj_facturation->prixTotalTtc(),'MT'),'',$langs,0,-1,-1,$conf->currency)."</td></tr>\n";
|
</tr>
|
||||||
?>
|
<tr>
|
||||||
|
<th class="nowrap"><?php echo $langs->trans("TotalVAT").'</th><td class="nowrap">'.price(price2num($obj_facturation->montantTva(),'MT'),'',$langs,0,-1,-1,$conf->currency)."\n";?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="nowrap"><?php echo ''.$langs->trans("TotalTTC").'</th><td class="nowrap">'.price(price2num($obj_facturation->prixTotalTtc(),'MT'),'',$langs,0,-1,-1,$conf->currency)."\n";?></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.print();
|
window.print();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a class="lien" href="#"
|
<a class="lien" href="#" onclick="javascript: window.close(); return(false);"><?php echo $langs->trans("Close"); ?></a>
|
||||||
onclick="javascript: window.close(); return(false);"><?php echo $langs->trans("Close"); ?></a>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
$langs->load("banks");
|
||||||
|
|
||||||
// Object $form must de defined
|
// Object $form must de defined
|
||||||
|
|
||||||
|
|||||||
@ -22,9 +22,10 @@ $langs->load("bills");
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h3 class="titre1"><?php echo $langs->trans("SellFinished"); ?></h3><br>
|
<div class="blocksellfinished">
|
||||||
|
|
||||||
<div class="cadre_facturation">
|
<div class="cadre_facturation">
|
||||||
|
<h3 class="titre1"><?php echo $langs->trans("SellFinished"); ?></h3><br>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
@ -45,3 +46,6 @@ $langs->load("bills");
|
|||||||
<p><a class="lien1" href="#" onclick="Javascript: popupTicket(); return(false);"><?php echo $langs->trans("PrintTicket"); ?></a></p>
|
<p><a class="lien1" href="#" onclick="Javascript: popupTicket(); return(false);"><?php echo $langs->trans("PrintTicket"); ?></a></p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|||||||
@ -250,7 +250,7 @@ if ($user->rights->categorie->creer)
|
|||||||
print'</td></tr>';
|
print'</td></tr>';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$doleditor=new DolEditor('description',$description,'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,ROWS_6,'90%');
|
$doleditor=new DolEditor('description',$description,'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,ROWS_6,'90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
|
|||||||
@ -209,7 +209,7 @@ class Categories extends DolibarrApi
|
|||||||
$sql.= ' AND s.rowid = sub.fk_categorie';
|
$sql.= ' AND s.rowid = sub.fk_categorie';
|
||||||
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
|
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -124,7 +124,7 @@ class CategoryApi extends DolibarrApi
|
|||||||
$sql.= ' WHERE s.entity IN ('.getEntity('category', 1).')';
|
$sql.= ' WHERE s.entity IN ('.getEntity('category', 1).')';
|
||||||
$sql.= ' AND s.type='.array_search($type,CategoryApi::$TYPES);
|
$sql.= ' AND s.type='.array_search($type,CategoryApi::$TYPES);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -205,7 +205,7 @@ class CategoryApi extends DolibarrApi
|
|||||||
$sql.= ' AND s.rowid = sub.fk_categorie';
|
$sql.= ' AND s.rowid = sub.fk_categorie';
|
||||||
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
|
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -49,8 +49,10 @@ class Categorie extends CommonObject
|
|||||||
const TYPE_MEMBER = 3; // TODO Replace this value with 'member'
|
const TYPE_MEMBER = 3; // TODO Replace this value with 'member'
|
||||||
const TYPE_CONTACT = 4; // TODO Replace this value with 'contact'
|
const TYPE_CONTACT = 4; // TODO Replace this value with 'contact'
|
||||||
const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user'
|
const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user'
|
||||||
const TYPE_ACCOUNT = 5; // for bank account TODO Replace this value with 'account'
|
const TYPE_ACCOUNT = 5; // for bank account TODO Replace this value with 'account'
|
||||||
const TYPE_PROJECT = 6;
|
const TYPE_PROJECT = 6;
|
||||||
|
public $picto = 'category';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array ID mapping from type string
|
* @var array ID mapping from type string
|
||||||
@ -205,6 +207,7 @@ class Categorie extends CommonObject
|
|||||||
$res = $this->db->fetch_array($resql);
|
$res = $this->db->fetch_array($resql);
|
||||||
|
|
||||||
$this->id = $res['rowid'];
|
$this->id = $res['rowid'];
|
||||||
|
//$this->ref = $res['rowid'];
|
||||||
$this->fk_parent = $res['fk_parent'];
|
$this->fk_parent = $res['fk_parent'];
|
||||||
$this->label = $res['label'];
|
$this->label = $res['label'];
|
||||||
$this->description = $res['description'];
|
$this->description = $res['description'];
|
||||||
@ -1703,6 +1706,18 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return label of contact status
|
||||||
|
*
|
||||||
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
|
* @return string Label of contact status
|
||||||
|
*/
|
||||||
|
function getLibStatut($mode)
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise an instance with random values.
|
* Initialise an instance with random values.
|
||||||
* Used to build previews or test instances.
|
* Used to build previews or test instances.
|
||||||
|
|||||||
@ -36,8 +36,6 @@ $langs->load("categories");
|
|||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
|
|
||||||
$mesg = '';
|
|
||||||
|
|
||||||
$id=GETPOST('id','int');
|
$id=GETPOST('id','int');
|
||||||
$ref=GETPOST('ref');
|
$ref=GETPOST('ref');
|
||||||
$type=GETPOST('type');
|
$type=GETPOST('type');
|
||||||
@ -105,33 +103,38 @@ if ($object->id)
|
|||||||
else $title=$langs->trans("Category");
|
else $title=$langs->trans("Category");
|
||||||
|
|
||||||
$head = categories_prepare_head($object,$type);
|
$head = categories_prepare_head($object,$type);
|
||||||
dol_fiche_head($head, 'photos', $title, 0, 'category');
|
|
||||||
|
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'photos', $title, 0, 'category');
|
||||||
|
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$object->ref = $object->label;
|
||||||
|
$morehtmlref='<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
||||||
|
$ways = $object->print_all_ways(" >> ", '', 1);
|
||||||
|
foreach ($ways as $way)
|
||||||
|
{
|
||||||
|
$morehtmlref.=$way."<br>\n";
|
||||||
|
}
|
||||||
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la suppression de photo
|
* Confirmation de la suppression de photo
|
||||||
*/
|
*/
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
print($mesg);
|
print '<br>';
|
||||||
|
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Path of category
|
|
||||||
print '<tr><td class="titlefield notopnoleft">';
|
|
||||||
$ways = $object->print_all_ways(" >> ", '', 1);
|
|
||||||
print $langs->trans("Ref").'</td><td>';
|
|
||||||
print '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
|
||||||
foreach ($ways as $way)
|
|
||||||
{
|
|
||||||
print $way."<br>\n";
|
|
||||||
}
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr><td class="notopnoleft">';
|
print '<tr><td class="titlefield notopnoleft">';
|
||||||
print $langs->trans("Description").'</td><td>';
|
print $langs->trans("Description").'</td><td>';
|
||||||
print dol_htmlentitiesbr($object->description);
|
print dol_htmlentitiesbr($object->description);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -144,7 +147,7 @@ if ($object->id)
|
|||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print "</div>\n";
|
print dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2010-2012 Destailleur Laurent <eldy@users.sourceforge.net>
|
* Copyright (C) 2010-2016 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -156,25 +156,40 @@ elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCatego
|
|||||||
else $title=$langs->trans("Category");
|
else $title=$langs->trans("Category");
|
||||||
|
|
||||||
$head = categories_prepare_head($object,$type);
|
$head = categories_prepare_head($object,$type);
|
||||||
|
|
||||||
|
// Calculate $cnt_trans
|
||||||
|
$cnt_trans = 0;
|
||||||
|
if (! empty($object->multilangs))
|
||||||
|
{
|
||||||
|
foreach ($object->multilangs as $key => $value)
|
||||||
|
{
|
||||||
|
$cnt_trans++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dol_fiche_head($head, 'translation', $title, 0, 'category');
|
dol_fiche_head($head, 'translation', $title, 0, 'category');
|
||||||
|
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$object->ref = $object->label;
|
||||||
|
$morehtmlref='<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
||||||
|
$ways = $object->print_all_ways(" >> ", '', 1);
|
||||||
|
foreach ($ways as $way)
|
||||||
|
{
|
||||||
|
$morehtmlref.=$way."<br>\n";
|
||||||
|
}
|
||||||
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Reference
|
|
||||||
print '<tr>';
|
|
||||||
print '<td class="titlefield notopnoleft">';
|
|
||||||
$ways = $object->print_all_ways(" >> ", '', 1);
|
|
||||||
print $langs->trans("Ref").'</td><td>';
|
|
||||||
print '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
|
||||||
foreach ($ways as $way)
|
|
||||||
{
|
|
||||||
print $way."<br>\n";
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr><td class="notopnoleft tdtop">';
|
print '<tr><td class="titlefield notopnoleft">';
|
||||||
print $langs->trans("Description").'</td><td>';
|
print $langs->trans("Description").'</td><td>';
|
||||||
print dol_htmlentitiesbr($object->description);
|
print dol_htmlentitiesbr($object->description);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -187,6 +202,32 @@ print '</td></tr>';
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* Barre d'action */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
|
|
||||||
|
if ($action == '')
|
||||||
|
{
|
||||||
|
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'">'.$langs->trans("Add").'</a>';
|
||||||
|
if ($cnt_trans > 0) print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$object->id.'">'.$langs->trans("Update").'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print "\n</div>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
//WYSIWYG Editor
|
//WYSIWYG Editor
|
||||||
@ -201,9 +242,9 @@ if ($action == 'edit')
|
|||||||
{
|
{
|
||||||
foreach ($object->multilangs as $key => $value)
|
foreach ($object->multilangs as $key => $value)
|
||||||
{
|
{
|
||||||
print "<br><b><u>".$langs->trans('Language_'.$key)." :</u></b><br>";
|
print "<br><b><u>".$langs->trans('Language_'.$key)." :</u></b><br>";
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td class="fieldtitlecreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.$object->multilangs[$key]["label"].'"></td></tr>';
|
print '<tr><td class="titlefield fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.$object->multilangs[$key]["label"].'"></td></tr>';
|
||||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||||
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3,'90%');
|
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3,'90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
@ -213,7 +254,9 @@ if ($action == 'edit')
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
@ -223,46 +266,29 @@ if ($action == 'edit')
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else if ($action != 'add')
|
||||||
{
|
{
|
||||||
$cnt_trans = 0;
|
if ($cnt_trans) print '<div class="underbanner clearboth"></div>';
|
||||||
if (! empty($object->multilangs))
|
|
||||||
|
if (! empty($object->multilangs))
|
||||||
{
|
{
|
||||||
foreach ($object->multilangs as $key => $value)
|
foreach ($object->multilangs as $key => $value)
|
||||||
{
|
{
|
||||||
$cnt_trans++;
|
$s=picto_from_langcode($key);
|
||||||
$s=picto_from_langcode($key);
|
|
||||||
print "<br>".($s?$s.' ':'')." <b>".$langs->trans('Language_'.$key).":</b><br>";
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td class="fieldtitlecreate>'.$langs->trans('Label').'</td><td>'.$object->multilangs[$key]["label"].'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="2">'.($s?$s.' ':'')." <b>".$langs->trans('Language_'.$key).":</b> ".'<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&langtodelete='.$key.'">'.img_delete('', '').'</a></td></tr>';
|
||||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>'.$object->multilangs[$key]["description"].'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans('Label').'</td><td>'.$object->multilangs[$key]["label"].'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans('Note').'</td><td>'.$object->multilangs[$key]["note"].'</td></tr>';
|
print '<tr><td>'.$langs->trans('Description').'</td><td>'.$object->multilangs[$key]["description"].'</td></tr>';
|
||||||
|
if (! empty($conf->global->CATEGORY_USE_OTHER_FIELD_IN_TRANSLATION))
|
||||||
|
{
|
||||||
|
print '<tr><td>'.$langs->trans('Other').' ('.$langs->trans("NotUsed").')</td><td>'.$object->multilangs[$key]["other"].'</td></tr>';
|
||||||
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (! $cnt_trans) print '<br>'. $langs->trans('NoTranslation');
|
if (! $cnt_trans && $action != 'add') print '<div class="opacitymedium">'. $langs->trans('NoTranslation').'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</div>\n";
|
|
||||||
|
|
||||||
|
|
||||||
/* ************************************************************************** */
|
|
||||||
/* */
|
|
||||||
/* Barre d'action */
|
|
||||||
/* */
|
|
||||||
/* ************************************************************************** */
|
|
||||||
|
|
||||||
print "\n<div class=\"tabsAction\">\n";
|
|
||||||
|
|
||||||
if ($action == '')
|
|
||||||
if ($user->rights->produit->creer || $user->rights->service->creer)
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'">'.$langs->trans("Add").'</a>';
|
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$object->id.'">'.$langs->trans("Update").'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print "\n</div>\n";
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Form to add a new translation
|
* Form to add a new translation
|
||||||
@ -280,11 +306,11 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
|
|||||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td class="fieldtitlecreate fieldrequired">'.$langs->trans('Translation').'</td><td>';
|
print '<tr><td class="titlefield fieldrequired">'.$langs->trans('Translation').'</td><td>';
|
||||||
print $formadmin->select_language('','forcelangprod',0,$object->multilangs);
|
print $formadmin->select_language('','forcelangprod',0,$object->multilangs);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" size="40"></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" size="40"></td></tr>';
|
||||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
print '<tr><td>'.$langs->trans('Description').'</td><td>';
|
||||||
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3,'90%');
|
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3,'90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -68,6 +68,7 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('categorycard'));
|
$hookmanager->initHooks(array('categorycard'));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -190,8 +191,22 @@ else $title=$langs->trans("Category");
|
|||||||
|
|
||||||
$head = categories_prepare_head($object,$type);
|
$head = categories_prepare_head($object,$type);
|
||||||
|
|
||||||
|
|
||||||
dol_fiche_head($head, 'card', $title, 0, 'category');
|
dol_fiche_head($head, 'card', $title, 0, 'category');
|
||||||
|
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$object->ref = $object->label;
|
||||||
|
$morehtmlref='<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
||||||
|
$ways = $object->print_all_ways(" >> ", '', 1);
|
||||||
|
foreach ($ways as $way)
|
||||||
|
{
|
||||||
|
$morehtmlref.=$way."<br>\n";
|
||||||
|
}
|
||||||
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation suppression
|
* Confirmation suppression
|
||||||
@ -202,21 +217,13 @@ if ($action == 'delete')
|
|||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type, $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type, $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table width="100%" class="border">';
|
print '<table width="100%" class="border">';
|
||||||
|
|
||||||
// Path of category
|
|
||||||
print '<tr><td class="titlefield notopnoleft">';
|
|
||||||
$ways = $object->print_all_ways(" >> ", '', 1);
|
|
||||||
print $langs->trans("Ref").'</td><td>';
|
|
||||||
print '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
|
||||||
foreach ($ways as $way)
|
|
||||||
{
|
|
||||||
print $way."<br>\n";
|
|
||||||
}
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr><td class="notopnoleft">';
|
print '<tr><td class="titlefield notopnoleft">';
|
||||||
print $langs->trans("Description").'</td><td>';
|
print $langs->trans("Description").'</td><td>';
|
||||||
print dol_htmlentitiesbr($object->description);
|
print dol_htmlentitiesbr($object->description);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -359,7 +366,7 @@ if ($object->type == Categorie::TYPE_PRODUCT)
|
|||||||
print '<td class="nowrap" valign="top">';
|
print '<td class="nowrap" valign="top">';
|
||||||
print $prod->getNomUrl(1);
|
print $prod->getNomUrl(1);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td valign="top">'.$prod->label."</td>\n";
|
print '<td class="tdtop">'.$prod->label."</td>\n";
|
||||||
// Link to delete from category
|
// Link to delete from category
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
$typeid=$object->type;
|
$typeid=$object->type;
|
||||||
@ -520,8 +527,8 @@ if ($object->type == Categorie::TYPE_MEMBER)
|
|||||||
$member->ref=$member->login;
|
$member->ref=$member->login;
|
||||||
print $member->getNomUrl(1,0);
|
print $member->getNomUrl(1,0);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td valign="top">'.$member->lastname."</td>\n";
|
print '<td class="tdtop">'.$member->lastname."</td>\n";
|
||||||
print '<td valign="top">'.$member->firstname."</td>\n";
|
print '<td class="tdtop">'.$member->firstname."</td>\n";
|
||||||
// Link to delete from category
|
// Link to delete from category
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
$typeid=$object->type;
|
$typeid=$object->type;
|
||||||
@ -628,8 +635,8 @@ if ($object->type == Categorie::TYPE_ACCOUNT)
|
|||||||
print '<td class="nowrap" valign="top">';
|
print '<td class="nowrap" valign="top">';
|
||||||
print $account->getNomUrl(1,0);
|
print $account->getNomUrl(1,0);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td valign="top">'.$account->bank."</td>\n";
|
print '<td class="tdtop">'.$account->bank."</td>\n";
|
||||||
print '<td valign="top">'.$account->number."</td>\n";
|
print '<td class="tdtop">'.$account->number."</td>\n";
|
||||||
// Link to delete from category
|
// Link to delete from category
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
$typeid=$object->type;
|
$typeid=$object->type;
|
||||||
@ -683,8 +690,8 @@ if ($object->type == Categorie::TYPE_PROJECT)
|
|||||||
print '<td class="nowrap" valign="top">';
|
print '<td class="nowrap" valign="top">';
|
||||||
print $project->getNomUrl(1,0);
|
print $project->getNomUrl(1,0);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td valign="top">'.$project->ref."</td>\n";
|
print '<td class="tdtop">'.$project->ref."</td>\n";
|
||||||
print '<td valign="top">'.$project->title."</td>\n";
|
print '<td class="tdtop">'.$project->title."</td>\n";
|
||||||
// Link to delete from category
|
// Link to delete from category
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
$typeid=$object->type;
|
$typeid=$object->type;
|
||||||
|
|||||||
@ -278,7 +278,7 @@ if ($action == 'add')
|
|||||||
if (GETPOST("doneby") > 0) $object->userdoneid = GETPOST("doneby","int");
|
if (GETPOST("doneby") > 0) $object->userdoneid = GETPOST("doneby","int");
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->note = trim($_POST["note"]);
|
$object->note = trim(GETPOST("note"));
|
||||||
|
|
||||||
if (isset($_POST["contactid"])) $object->contact = $contact;
|
if (isset($_POST["contactid"])) $object->contact = $contact;
|
||||||
|
|
||||||
@ -290,11 +290,6 @@ if ($action == 'add')
|
|||||||
$object->societe = $object->thirdparty; // For backward compatibility
|
$object->societe = $object->thirdparty; // For backward compatibility
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special for module webcal and phenix
|
|
||||||
// TODO external modules
|
|
||||||
if (! empty($conf->webcalendar->enabled) && GETPOST('add_webcal') == 'on') $object->use_webcal=1;
|
|
||||||
if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $object->use_phenix=1;
|
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (empty($object->userownerid) && empty($_SESSION['assignedtouser']))
|
if (empty($object->userownerid) && empty($_SESSION['assignedtouser']))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -245,7 +245,7 @@ if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AN
|
|||||||
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
|
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -656,7 +656,7 @@ foreach ($typeofevents as $typeofevent)
|
|||||||
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1;
|
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1;
|
||||||
if ($today) $style='cal_today_peruser';
|
if ($today) $style='cal_today_peruser';
|
||||||
|
|
||||||
show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype, $var);
|
show_day_events_pertype($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype, $var);
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -756,7 +756,7 @@ $db->close();
|
|||||||
* @param bool $var true or false for alternat style on tr/td
|
* @param bool $var true or false for alternat style on tr/td
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)
|
function show_day_events_pertype($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
global $user, $conf, $langs, $hookmanager, $action;
|
global $user, $conf, $langs, $hookmanager, $action;
|
||||||
|
|||||||
@ -85,7 +85,7 @@ $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
|
|||||||
$sql.= " GROUP BY year, month, df";
|
$sql.= " GROUP BY year, month, df";
|
||||||
$sql.= " ORDER BY year DESC, month DESC, df DESC";
|
$sql.= " ORDER BY year DESC, month DESC, df DESC";
|
||||||
|
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@ -253,7 +253,7 @@ if ($action == 'create')
|
|||||||
print '<tr><td class="fieldrequired">'.$langs->trans('Label').'</td><td><input type="text" size="30" name="label" id="label" value="'.($object->label?$object->label:$langs->trans('RequiredField')).'"></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Label').'</td><td><input type="text" size="30" name="label" id="label" value="'.($object->label?$object->label:$langs->trans('RequiredField')).'"></td></tr>';
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans('Name').'</td><td><input type="text" size="30" name="name" id="name" value="'.($object->name?$object->name:$langs->trans('RequiredField')).'"></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Name').'</td><td><input type="text" size="30" name="name" id="name" value="'.($object->name?$object->name:$langs->trans('RequiredField')).'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" class="quatrevingtpercent" rows="3" wrap="soft">';
|
print '<tr><td class="tdtop">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" class="quatrevingtpercent" rows="3" wrap="soft">';
|
||||||
print $object->address;
|
print $object->address;
|
||||||
print '</textarea></td></tr>';
|
print '</textarea></td></tr>';
|
||||||
|
|
||||||
@ -353,7 +353,7 @@ elseif ($action == 'edit')
|
|||||||
print '<tr><td>'.$langs->trans('AddressLabel').'</td><td colspan="3"><input type="text" size="40" name="label" value="'.$object->label.'"></td></tr>';
|
print '<tr><td>'.$langs->trans('AddressLabel').'</td><td colspan="3"><input type="text" size="40" name="label" value="'.$object->label.'"></td></tr>';
|
||||||
print '<tr><td>'.$langs->trans('Name').'</td><td colspan="3"><input type="text" size="40" name="name" value="'.$object->name.'"></td></tr>';
|
print '<tr><td>'.$langs->trans('Name').'</td><td colspan="3"><input type="text" size="40" name="name" value="'.$object->name.'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" class="quatrevingtpercent" rows="3" wrap="soft">';
|
print '<tr><td class="tdtop">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" class="quatrevingtpercent" rows="3" wrap="soft">';
|
||||||
print $object->address;
|
print $object->address;
|
||||||
print '</textarea></td></tr>';
|
print '</textarea></td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -366,6 +366,21 @@ if ($id > 0)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Max outstanding bill
|
||||||
|
if ($object->client)
|
||||||
|
{
|
||||||
|
print '<tr class="nowrap">';
|
||||||
|
print '<td>';
|
||||||
|
print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer);
|
||||||
|
print '</td><td>';
|
||||||
|
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
|
||||||
|
print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
|
||||||
|
//if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Multiprice level
|
// Multiprice level
|
||||||
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
{
|
{
|
||||||
@ -493,48 +508,92 @@ if ($id > 0)
|
|||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
|
||||||
|
$boxstat = '';
|
||||||
|
|
||||||
// Nbre max d'elements des petites listes
|
// Nbre max d'elements des petites listes
|
||||||
$MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
|
$MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
|
||||||
|
|
||||||
// Lien recap
|
// Lien recap
|
||||||
$outstandingBills = $object->get_OutstandingBill();
|
$boxstat.='<div class="box">';
|
||||||
$warn = '';
|
$boxstat.='<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable" width="100%">';
|
||||||
if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingBills)
|
$boxstat.='<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
|
||||||
|
|
||||||
|
if ($conf->propal->enabled)
|
||||||
{
|
{
|
||||||
$warn = img_warning($langs->trans("OutstandingBillReached"));
|
// Box proposals
|
||||||
|
$tmp = $object->getOutstandingProposals();
|
||||||
|
$outstandingOpened=$tmp['opened'];
|
||||||
|
$outstandingTotal=$tmp['total_ht'];
|
||||||
|
$outstandingTotalIncTax=$tmp['total_ttc'];
|
||||||
|
$text=$langs->trans("OverAllProposals");
|
||||||
|
$link='';
|
||||||
|
$icon='bill';
|
||||||
|
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||||
|
$boxstat.='<div class="boxstats">';
|
||||||
|
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
|
||||||
|
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||||
|
$boxstat.='</div>';
|
||||||
|
if ($link) $boxstat.='</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($conf->commande->enabled)
|
||||||
|
{
|
||||||
|
// Box proposals
|
||||||
|
$tmp = $object->getOutstandingOrders();
|
||||||
|
$outstandingOpened=$tmp['opened'];
|
||||||
|
$outstandingTotal=$tmp['total_ht'];
|
||||||
|
$outstandingTotalIncTax=$tmp['total_ttc'];
|
||||||
|
$text=$langs->trans("OverAllOrders");
|
||||||
|
$link='';
|
||||||
|
$icon='bill';
|
||||||
|
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||||
|
$boxstat.='<div class="boxstats">';
|
||||||
|
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
|
||||||
|
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||||
|
$boxstat.='</div>';
|
||||||
|
if ($link) $boxstat.='</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
if ($conf->facture->enabled)
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td>'.$langs->trans("Summary").'</td>';
|
|
||||||
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id.'">'.$langs->trans("ShowCustomerPreview").'</a></td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Max outstanding bill
|
|
||||||
if ($object->client)
|
|
||||||
{
|
{
|
||||||
print '<tr class="impair">';
|
$tmp = $object->getOutstandingBills();
|
||||||
print '<td>';
|
$outstandingOpened=$tmp['opened'];
|
||||||
print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer);
|
$outstandingTotal=$tmp['total_ht'];
|
||||||
print '</td><td>';
|
$outstandingTotalIncTax=$tmp['total_ttc'];
|
||||||
$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) : ''));
|
$text=$langs->trans("OverAllInvoices");
|
||||||
//if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
|
$link='';
|
||||||
|
$icon='bill';
|
||||||
print '</td>';
|
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||||
print '</tr>';
|
$boxstat.='<div class="boxstats">';
|
||||||
|
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
|
||||||
|
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||||
|
$boxstat.='</div>';
|
||||||
|
if ($link) $boxstat.='</a>';
|
||||||
|
|
||||||
|
// Box outstanding bill
|
||||||
|
$warn = '';
|
||||||
|
if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingOpened)
|
||||||
|
{
|
||||||
|
$warn = img_warning($langs->trans("OutstandingBillReached"));
|
||||||
|
}
|
||||||
|
$text=$langs->trans("CurrentOutstandingBill");
|
||||||
|
$link=DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id;
|
||||||
|
$icon='bill';
|
||||||
|
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||||
|
$boxstat.='<div class="boxstats">';
|
||||||
|
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
|
||||||
|
$boxstat.='<span class="boxstatsindicator'.($outstandingOpened>0?' amountremaintopay':'').'">'.price($outstandingOpened).$warn.'</span>';
|
||||||
|
$boxstat.='</div>';
|
||||||
|
if ($link) $boxstat.='</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Outstanding bill
|
$boxstat.='</td></tr>';
|
||||||
print '<tr class="pair">';
|
$boxstat.='</table>';
|
||||||
print '<td>'.$langs->trans("CurrentOutstandingBill").'</td>';
|
$boxstat.='</div>';
|
||||||
print '<td>'.price($outstandingBills).$warn.'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
print $boxstat;
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -776,7 +835,9 @@ if ($id > 0)
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="6"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).'</td>';
|
print '<td colspan="6"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).'</td>';
|
||||||
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' <span class="badge">'.$num.'</span></a></td></tr></table></td>';
|
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' <span class="badge">'.$num.'</span></a></td>';
|
||||||
|
//print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/contract/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||||
|
print '</tr></table></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -837,7 +898,9 @@ if ($id > 0)
|
|||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fichinter/list.php?socid='.$object->id.'">'.$langs->trans("AllInterventions").' <span class="badge">'.$num.'</span></td></tr></table></td>';
|
print '<td colspan="3"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fichinter/list.php?socid='.$object->id.'">'.$langs->trans("AllInterventions").' <span class="badge">'.$num.'</span></td>';
|
||||||
|
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/fichinter/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||||
|
print '</tr></table></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
}
|
}
|
||||||
@ -1007,7 +1070,15 @@ if ($id > 0)
|
|||||||
|
|
||||||
if (! empty($conf->facture->enabled))
|
if (! empty($conf->facture->enabled))
|
||||||
{
|
{
|
||||||
if ($user->rights->facture->creer && $object->status==1)
|
if (empty($user->rights->facture->creer))
|
||||||
|
{
|
||||||
|
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||||
|
}
|
||||||
|
else if ($object->status != 1)
|
||||||
|
{
|
||||||
|
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
@ -1022,10 +1093,6 @@ if ($id > 0)
|
|||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -756,8 +756,9 @@ else
|
|||||||
$sendingmode=$conf->global->MAIN_MAIL_SENDMODE;
|
$sendingmode=$conf->global->MAIN_MAIL_SENDMODE;
|
||||||
if (empty($sendingmode)) $sendingmode='mail'; // If not defined, we use php mail function
|
if (empty($sendingmode)) $sendingmode='mail'; // If not defined, we use php mail function
|
||||||
|
|
||||||
// MAILING_NO_USING_PHPMAIL may be defined or not
|
// MAILING_NO_USING_PHPMAIL may be defined or not.
|
||||||
// MAILING_LIMIT_SENDBYWEB is always defined to something != 0, MAILING_LIMIT_SENDBYCLI may be defined ot not.
|
// MAILING_LIMIT_SENDBYWEB is always defined to something != 0 (-1=forbidden).
|
||||||
|
// MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0 or undefined=no limit).
|
||||||
if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
|
if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
|
||||||
{
|
{
|
||||||
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
|
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
|
||||||
@ -771,8 +772,8 @@ else
|
|||||||
}
|
}
|
||||||
else if ($conf->global->MAILING_LIMIT_SENDBYWEB == '-1')
|
else if ($conf->global->MAILING_LIMIT_SENDBYWEB == '-1')
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
|
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
|
||||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
|
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
|
||||||
|
|
||||||
// The feature is forbidden from GUI, we show just message to use from command line.
|
// The feature is forbidden from GUI, we show just message to use from command line.
|
||||||
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
|
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
|
||||||
@ -785,8 +786,8 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
|
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
|
||||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
|
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
|
||||||
|
|
||||||
$text='';
|
$text='';
|
||||||
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)
|
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)
|
||||||
@ -797,7 +798,7 @@ else
|
|||||||
}
|
}
|
||||||
$text.=$langs->trans('ConfirmSendingEmailing').'<br>';
|
$text.=$langs->trans('ConfirmSendingEmailing').'<br>';
|
||||||
$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||||
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,270);
|
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -844,23 +845,28 @@ else
|
|||||||
print $langs->trans("TotalNbOfDistinctRecipients");
|
print $langs->trans("TotalNbOfDistinctRecipients");
|
||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
$nbemail = ($object->nbemail?$object->nbemail:img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>');
|
$nbemail = ($object->nbemail?$object->nbemail:img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>');
|
||||||
if ($object->statut != 3 && !empty($conf->global->MAILING_LIMIT_SENDBYWEB) && is_numeric($nbemail) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail)
|
if ($object->statut != 3 && is_numeric($nbemail))
|
||||||
{
|
{
|
||||||
if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0)
|
$text='';
|
||||||
{
|
if (! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail)
|
||||||
$text=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
{
|
||||||
print $form->textwithpicto($nbemail,$text,1,'warning');
|
if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0)
|
||||||
}
|
{
|
||||||
else
|
$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||||
{
|
}
|
||||||
$text=$langs->trans('NotEnoughPermissions');
|
else
|
||||||
print $form->textwithpicto($nbemail,$text,1,'warning');
|
{
|
||||||
}
|
$text.=$langs->trans('NotEnoughPermissions');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
if ($text)
|
||||||
{
|
{
|
||||||
print $nbemail;
|
print $form->textwithpicto($nbemail,$text,1,'warning');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $nbemail;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -412,7 +412,7 @@ if ($object->fetch($id) >= 0)
|
|||||||
$sql .= $db->order($sortfield,$sortorder);
|
$sql .= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = -1;
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user