Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into new_modimport_update_option
@ -287,10 +287,13 @@ script:
|
|||||||
php upgrade.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400.log
|
php upgrade.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400.log
|
||||||
php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade390400-2.log
|
php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade390400-2.log
|
||||||
php step5.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-3.log
|
php step5.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-3.log
|
||||||
|
php upgrade.php 4.0.0 5.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade400500.log
|
||||||
|
php upgrade2.php 4.0.0 5.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade400500-2.log
|
||||||
|
php step5.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-3.log
|
||||||
cd -
|
cd -
|
||||||
set +e
|
set +e
|
||||||
echo
|
echo
|
||||||
#cat $TRAVIS_BUILD_DIR/upgrade390400-2.log
|
#cat $TRAVIS_BUILD_DIR/upgrade400500-2.log
|
||||||
#cat /tmp/dolibarr_install.log
|
#cat /tmp/dolibarr_install.log
|
||||||
|
|
||||||
- |
|
- |
|
||||||
|
|||||||
@ -52,7 +52,7 @@ jQuery Mobile 1.3.0 GPL and MIT License Yes
|
|||||||
jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows)
|
jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows)
|
||||||
jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker
|
jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker
|
||||||
jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips
|
jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips
|
||||||
jsGantt 1.2 BSD License Yes JS library (to build Gantt reports)
|
jsGanttImproved 1.7.5.2 BSD License Yes JS library (to build Gantt reports)
|
||||||
JsTimezoneDetect 1.0.6 MIT License Yes JS library to detect user timezone
|
JsTimezoneDetect 1.0.6 MIT License Yes JS library to detect user timezone
|
||||||
|
|
||||||
For licenses compatibility informations:
|
For licenses compatibility informations:
|
||||||
|
|||||||
116
ChangeLog
@ -12,9 +12,23 @@ Upgrading to any other version or any other database system is abolutely require
|
|||||||
make a Dolibarr upgrade.
|
make a Dolibarr upgrade.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 5.0.0 compared to 4.0.* *****
|
||||||
|
For users:
|
||||||
|
...
|
||||||
|
|
||||||
|
WARNING:
|
||||||
|
|
||||||
|
Following changes may create regression for some external modules, but were necessary to make
|
||||||
|
Dolibarr better:
|
||||||
|
- Function delete of class Facture (invoice) need the object $user as first parameter. Also you must
|
||||||
|
check you make a fetch on object before calling the delete.
|
||||||
|
- The old driver of "mysql" has been removed. Dolibarr use the new one (mysqli) by default.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 4.0.0 compared to 3.9.* *****
|
***** ChangeLog for 4.0.0 compared to 3.9.* *****
|
||||||
For users:
|
For users:
|
||||||
|
|
||||||
NEW: Add reccuring invoice feature and automatic generation of invoices.
|
NEW: Add reccuring invoice feature and automatic generation of invoices.
|
||||||
NEW: Add module "Loan" as stable.
|
NEW: Add module "Loan" as stable.
|
||||||
NEW: Add module "Supplier commercial proposal" (price request) is set to stable status.
|
NEW: Add module "Supplier commercial proposal" (price request) is set to stable status.
|
||||||
@ -120,7 +134,6 @@ NEW: When creating a template invoice from a draft invoice, if there is link to
|
|||||||
NEW: When emailing is not sent completely, show progression.
|
NEW: When emailing is not sent completely, show progression.
|
||||||
|
|
||||||
For developers:
|
For developers:
|
||||||
|
|
||||||
NEW: Add a css class style called 'reposition', so when clicking on a link with this class will move scrollbarr to be placed at same page location.
|
NEW: Add a css class style called 'reposition', so when clicking on a link with this class will move scrollbarr to be placed at same page location.
|
||||||
NEW: TimeZone can be supplied to mktime
|
NEW: TimeZone can be supplied to mktime
|
||||||
NEW: hook in shipment card
|
NEW: hook in shipment card
|
||||||
@ -161,7 +174,41 @@ 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.3 compared to 3.9.2 *****
|
||||||
|
FIX: #4383 $userid not defined
|
||||||
|
FIX: #4448 $filebonprev is not used, $this->filename now
|
||||||
|
FIX: #4455
|
||||||
|
FIX: #4749
|
||||||
|
FIX: #4756
|
||||||
|
FIX: #4828
|
||||||
|
FIX: #4926
|
||||||
|
FIX: #4964 buyprice in customer from shipping buyprice wasn't load in expedition::fetch_lines
|
||||||
|
FIX: #5004
|
||||||
|
FIX: #5068
|
||||||
|
FIX: #5170 tva sign with INVOICE_POSITIVE_CREDIT_NOTE option
|
||||||
|
FIX: #5338 use of not initialized var $aphour, $apmin, etc
|
||||||
|
FIX: #5343
|
||||||
|
FIX: #5380
|
||||||
|
FIX: #5383 bad object id on don delete
|
||||||
|
FIX: #5414
|
||||||
|
FIX: #5470 User of expense report in bank transactions page is not correct
|
||||||
|
FIX: a case of corrupted ODT by Word that insert <text:s> when it should not.
|
||||||
|
FIX: Can't create thirdparty or validate invoice if profid is mandatory and profid does not exists for other countries
|
||||||
|
FIX: dasboard wrong for late invoice
|
||||||
|
FIX: duplicate jquery.js files
|
||||||
|
FIX: extrafield cloned on project clone
|
||||||
|
FIX: Failed to open file
|
||||||
|
FIX: Filter on opportunity amount and budget
|
||||||
|
FIX: form_confirm to delete payment on supplier invoice
|
||||||
|
FIX: javascript error with german-switzerland language
|
||||||
|
FIX: large expense note
|
||||||
|
FIX: Missing original .js file (license violation if sources are not provided)
|
||||||
|
FIX: Option strict mode compatibility
|
||||||
|
FIX: product stats all bloc module without enbaled test
|
||||||
|
FIX: receiving link never works
|
||||||
|
FIX: task ODT company object not correctly retrieved
|
||||||
|
FIX: Translate group perms as it is done into user perms
|
||||||
|
FIX: We must take the last recent defined price when using price level
|
||||||
|
|
||||||
***** ChangeLog for 3.9.2 compared to 3.9.1 *****
|
***** ChangeLog for 3.9.2 compared to 3.9.1 *****
|
||||||
FIX: #4813 Won translation for the key OppStatusWON instead OppStatusWIN
|
FIX: #4813 Won translation for the key OppStatusWON instead OppStatusWIN
|
||||||
@ -426,6 +473,67 @@ This is list of hooks modified:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 3.8.5 compared to 3.8.4 *****
|
||||||
|
FIX: #3815 Call to undefined function local_by_date().
|
||||||
|
FIX: #4424 Missing email of user popup in supplier orders area
|
||||||
|
FIX: #4442 Missing translation in Banks menu
|
||||||
|
FIX: #4448 $filebonprev is not used, $this->filename now
|
||||||
|
FIX: #4455
|
||||||
|
FIX: #4737 Bank transacion type selector translation is cropped
|
||||||
|
FIX: #4742 Able to delete a supplier invoice with a registered payment
|
||||||
|
FIX: #4743 UI glitch in project summary page
|
||||||
|
FIX: #4747 Missing UI background when registering a supplier invoice payment
|
||||||
|
FIX: #4748 Supplier invoice payment confirmation amount is not translated
|
||||||
|
FIX: #4749
|
||||||
|
FIX: #4756
|
||||||
|
FIX: #4766 VAT not shown in supplier invoice popup
|
||||||
|
FIX: #4809 - Duplicate functions with different content
|
||||||
|
FIX: #4851 Project selector in supplier invoices shows the project label twice
|
||||||
|
FIX: #4870
|
||||||
|
FIX: #5008 SQL error when editing the reference of a supplier invoice that already exists
|
||||||
|
FIX: #5048 Product supplier list display only one produc
|
||||||
|
FIX: #5170 tva sign with INVOICE_POSITIVE_CREDIT_NOTE option
|
||||||
|
FIX: #5203
|
||||||
|
FIX: #5207
|
||||||
|
FIX: #5338 use of not initialized var $aphour, $apmin, etc
|
||||||
|
FIX: #5380
|
||||||
|
FIX: #5383 bad object id on don delete
|
||||||
|
FIX: #5474 Country_id of "Don" object is still empty
|
||||||
|
FIX: Accountancy - 3.8 - Chart of accounts are limited on only one country
|
||||||
|
FIX: Bad include and param for project numbering module call
|
||||||
|
FIX: Box disabled because bugged
|
||||||
|
FIX: bug on email template
|
||||||
|
FIX: Can correct stock of lot using eatby or sell by date
|
||||||
|
FIX: Can make a movement on "out of sell" products
|
||||||
|
FIX: Can't create thirdparty or validate invoice if profid is mandatory and profid does not exists for other countries
|
||||||
|
FIX: can't fetch by siret or siren because of first "if"
|
||||||
|
FIX: Check stock of product by warehouse if $entrepot_id defined on shippings
|
||||||
|
FIX: correct display of minimum buying price
|
||||||
|
FIX: Creation of thumb image for size "small" was not done.
|
||||||
|
FIX: Direction of movement lost if an error occurs
|
||||||
|
FIX: dont retrieve new buying price on margin display
|
||||||
|
FIX: Duplicate records into export
|
||||||
|
FIX: Email templates not compatible with Multicompany
|
||||||
|
FIX: end of select when no fournprice
|
||||||
|
FIX: finished parameters not used
|
||||||
|
FIX: hook on group card called but not initialized
|
||||||
|
FIX: It doesn't check if there is enough stock to update the lines of orders/invoices
|
||||||
|
FIX: large expense note
|
||||||
|
FIX: missing column when module was installed before standard integration
|
||||||
|
FIX: Missing database escaping on supplier price insert/update
|
||||||
|
FIX: Not filtering correctly when come from dashboard
|
||||||
|
FIX: PROPAL_MERGE_PDF with PRODUCT_USE_OLD_PATH
|
||||||
|
FIX: real min buying price
|
||||||
|
FIX: receiving link never works
|
||||||
|
FIX: same page added several times on mergepropal option
|
||||||
|
FIX: search on date into supplier invoice list dont work because of status -1
|
||||||
|
FIX: Search supplier ref on contract
|
||||||
|
FIX: SQL error function on getAvailableDiscounts function, on bill create mode if socid is empty
|
||||||
|
FIX: systematic rounding causes prices to be updated without reason
|
||||||
|
FIX: task ODT company object not correctly retrieved
|
||||||
|
FIX: Template email must take care of positino column
|
||||||
|
FIX: VAT rate can be negative. Example spain selling to morroco.
|
||||||
|
|
||||||
***** ChangeLog for 3.8.4 compared to 3.8.3 *****
|
***** ChangeLog for 3.8.4 compared to 3.8.3 *****
|
||||||
FIX: #3694
|
FIX: #3694
|
||||||
FIX: #3798 #2519 Cron jobs would never be executed
|
FIX: #3798 #2519 Cron jobs would never be executed
|
||||||
@ -838,7 +946,7 @@ NEW: add hook in send mail
|
|||||||
NEW: Add hooks on list of members to allow an external module to add more fields into list view.
|
NEW: Add hooks on list of members to allow an external module to add more fields into list view.
|
||||||
NEW: Add hooks to allow an external module to complete list of events into calendar views.
|
NEW: Add hooks to allow an external module to complete list of events into calendar views.
|
||||||
NEW: Add opportunity amount on project card.
|
NEW: Add opportunity amount on project card.
|
||||||
NEW: Add option THEME_ELDY_DISABLE_IMAGE to disable images into menu eldy.
|
NEW: Add option THEME_TOPMENU_DISABLE_IMAGE to disable images into menu eldy.
|
||||||
NEW: add PDF icon on linked element into project
|
NEW: add PDF icon on linked element into project
|
||||||
NEW: add "productpricecard" hook and uniformize code
|
NEW: add "productpricecard" hook and uniformize code
|
||||||
NEW: Add ref and label of project into export
|
NEW: Add ref and label of project into export
|
||||||
|
|||||||
11
Dockerfile
@ -1,14 +1,19 @@
|
|||||||
FROM php:5.6-apache
|
FROM php:5.6-apache
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev \
|
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
|
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
|
||||||
&& docker-php-ext-install gd
|
&& docker-php-ext-install gd
|
||||||
|
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
|
||||||
RUN docker-php-ext-install mysqli
|
&& docker-php-ext-install ldap \
|
||||||
|
&& docker-php-ext-install mysqli \
|
||||||
|
&& apt-get purge -y libpng12-dev libjpeg-dev libldap2-dev
|
||||||
|
|
||||||
COPY htdocs/ /var/www/html/
|
COPY htdocs/ /var/www/html/
|
||||||
|
|
||||||
RUN chown -hR www-data:www-data /var/www/html
|
RUN chown -hR www-data:www-data /var/www/html
|
||||||
|
|
||||||
|
VOLUME /var/www/html/conf
|
||||||
|
VOLUME /var/www/html/documents
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
@ -3,7 +3,7 @@
|
|||||||
Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans).
|
Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans).
|
||||||
Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...).
|
Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ Ubuntu) ou DoliRpm (la version tout-en-un de Dolibarr pour Fedora, Redhat,
|
|||||||
OpenSuse, Mandriva ou Mageia).
|
OpenSuse, Mandriva ou Mageia).
|
||||||
|
|
||||||
Vous pouvez les télécharger depuis la rubrique *download* du portail officiel:
|
Vous pouvez les télécharger depuis la rubrique *download* du portail officiel:
|
||||||
http://www.dolibarr.org/
|
https://www.dolibarr.org/
|
||||||
|
|
||||||
Si vous avez déjà installé un serveur Web avec PHP et une base de donnée (Mysql),
|
Si vous avez déjà installé un serveur Web avec PHP et une base de donnée (Mysql),
|
||||||
vous pouvez installer Dolibarr avec cette version de la manière suivante:
|
vous pouvez installer Dolibarr avec cette version de la manière suivante:
|
||||||
@ -139,13 +139,13 @@ Suivez le projet Dolibarr project sur les réseaux francophones
|
|||||||
|
|
||||||
- Facebook: <https://www.facebook.com/dolibarr.fr>
|
- Facebook: <https://www.facebook.com/dolibarr.fr>
|
||||||
- Google+: <https://plus.google.com/+DolibarrFrance>
|
- Google+: <https://plus.google.com/+DolibarrFrance>
|
||||||
- Twitter: <http://www.twitter.com/dolibarr_france>
|
- Twitter: <https://www.twitter.com/dolibarr_france>
|
||||||
|
|
||||||
ou sur les réseaux anglophones
|
ou sur les réseaux anglophones
|
||||||
|
|
||||||
- [Facebook](https://www.facebook.com/dolibarr)
|
- [Facebook](https://www.facebook.com/dolibarr)
|
||||||
- [Google+](https://plus.google.com/+DolibarrOrg)
|
- [Google+](https://plus.google.com/+DolibarrOrg)
|
||||||
- [Twitter](http://www.twitter.com/dolibarr)
|
- [Twitter](https://www.twitter.com/dolibarr)
|
||||||
- [LinkedIn](https://www.linkedin.com/company/association-dolibarr)
|
- [LinkedIn](https://www.linkedin.com/company/association-dolibarr)
|
||||||
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
|
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
|
||||||
- [GitHub](https://github.com/Dolibarr/dolibarr)
|
- [GitHub](https://github.com/Dolibarr/dolibarr)
|
||||||
|
|||||||
12
README.md
@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
 
|
 
|
||||||
|
|
||||||
Dolibarr ERP & CRM is a modern software to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).
|
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).
|
||||||
|
|
||||||
It's an Open Source software (wrote in PHP language) designed for small and medium companies, foundation and freelances.
|
It's an Open Source software (wrote in PHP language) designed for small, medium or large companies, foundations and freelances.
|
||||||
|
|
||||||
You can freely use, study, modify or distribute it according to its Free Software licence.
|
You can freely use, study, modify or distribute it according to its Free Software licence.
|
||||||
|
|
||||||
You can use it as a standalone application or as a web application to be able to access it from the Internet or a LAN.
|
You can use it as a standalone application or as a web application to be able to access it from the Internet or a LAN.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## LICENSE
|
## LICENSE
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git
|
|||||||
|
|
||||||
### Download
|
### Download
|
||||||
|
|
||||||
Releases can be downloaded from [official website](http://www.dolibarr.org/).
|
Releases can be downloaded from [official website](https://www.dolibarr.org/).
|
||||||
|
|
||||||
### Simple setup
|
### Simple setup
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
|
|
||||||
### Extending
|
### Extending
|
||||||
|
|
||||||
Dolibarr can be extended with a lot of other external modules from third party developers available at the [DoliStore](http://www.dolistore.com).
|
Dolibarr can be extended with a lot of other external modules from third party developers available at the [DoliStore](https://www.dolistore.com).
|
||||||
|
|
||||||
## FUTURE
|
## FUTURE
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ Follow Dolibarr project on:
|
|||||||
|
|
||||||
- [Facebook](https://www.facebook.com/dolibarr)
|
- [Facebook](https://www.facebook.com/dolibarr)
|
||||||
- [Google+](https://plus.google.com/+DolibarrOrg)
|
- [Google+](https://plus.google.com/+DolibarrOrg)
|
||||||
- [Twitter](http://www.twitter.com/dolibarr)
|
- [Twitter](https://www.twitter.com/dolibarr)
|
||||||
- [LinkedIn](https://www.linkedin.com/company/association-dolibarr)
|
- [LinkedIn](https://www.linkedin.com/company/association-dolibarr)
|
||||||
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
|
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
|
||||||
- [GitHub](https://github.com/Dolibarr/dolibarr)
|
- [GitHub](https://github.com/Dolibarr/dolibarr)
|
||||||
|
|||||||
@ -288,11 +288,11 @@ from origin/upstream and origin/pristine.
|
|||||||
> debian/get-orig-source.sh
|
> debian/get-orig-source.sh
|
||||||
If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VERIFY_HOSTNAME=0" to solve this.
|
If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VERIFY_HOSTNAME=0" to solve this.
|
||||||
|
|
||||||
* Edit tgz file to remove
|
* Edit orig.tar.gz file to remove
|
||||||
|
- debian
|
||||||
- htdocs/includes/ckeditor
|
- htdocs/includes/ckeditor
|
||||||
- htdocs/includes/jquery/plugins/datatables/extras/TableTools/swf
|
- htdocs/includes/phpexcel or htdocs/includes/phpoffice
|
||||||
- htdocs/includes/phpexcel
|
- htdocs/includes/tcpdf or htdocs/includes/tecnickom
|
||||||
- htdocs/includes/tcpdf
|
|
||||||
And rename file into
|
And rename file into
|
||||||
dolibarr-x.y.z+dfsgw.tgz
|
dolibarr-x.y.z+dfsgw.tgz
|
||||||
(x.y.z = version, w start from 1 and is increased for each new git-import-orig already done)
|
(x.y.z = version, w start from 1 and is increased for each new git-import-orig already done)
|
||||||
|
|||||||
@ -100,9 +100,8 @@ $dolibarr_main_db_pass='';
|
|||||||
# This parameter contains the name of the driver used to access your
|
# This parameter contains the name of the driver used to access your
|
||||||
# Dolibarr database.
|
# Dolibarr database.
|
||||||
# Default value: none
|
# Default value: none
|
||||||
# Possible values: mysql, mysqli, pgsql
|
# Possible values: mysqli, pgsql
|
||||||
# Examples:
|
# Examples:
|
||||||
# $dolibarr_main_db_type='mysql';
|
|
||||||
# $dolibarr_main_db_type='mysqli';
|
# $dolibarr_main_db_type='mysqli';
|
||||||
# $dolibarr_main_db_type='pgsql';
|
# $dolibarr_main_db_type='pgsql';
|
||||||
#
|
#
|
||||||
|
|||||||
@ -13,7 +13,7 @@ Architecture: all
|
|||||||
Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5,
|
Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5,
|
||||||
php5-cli,
|
php5-cli,
|
||||||
# Required PHP extensions
|
# Required PHP extensions
|
||||||
php5-mysql | php5-mysqli, php5-curl, php5-gd, php5-ldap, php5-geoip,
|
php5-mysql | php5-mysqli, php5-curl, php5-gd, php5-ldap,
|
||||||
# Required PHP libraries
|
# Required PHP libraries
|
||||||
php-pear, php-mail-mime,
|
php-pear, php-mail-mime,
|
||||||
# php-tcpdf, libfpdi-php,
|
# php-tcpdf, libfpdi-php,
|
||||||
@ -31,10 +31,10 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
|
|||||||
${misc:Depends},
|
${misc:Depends},
|
||||||
${perl:Depends}
|
${perl:Depends}
|
||||||
Recommends: apache2 | lighttpd | httpd
|
Recommends: apache2 | lighttpd | httpd
|
||||||
Suggests: www-browser
|
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 for small
|
Dolibarr ERP & CRM is an easy to use open source/free software package for
|
||||||
and medium companies, foundations or freelances. It includes different
|
companies, foundations or freelances. It includes different
|
||||||
features for Enterprise Resource Planning (ERP) and Customer Relationship
|
features for Enterprise Resource Planning (ERP) and Customer Relationship
|
||||||
Management (CRM) but also for different other activities.
|
Management (CRM) but also for different other activities.
|
||||||
.
|
.
|
||||||
|
|||||||
@ -1,2 +1 @@
|
|||||||
README.md
|
README.md
|
||||||
README-FR.md
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
# Remove warning, we want to keep both standard and minified sources.
|
# Remove warning, we want to keep both standard and minified sources.
|
||||||
dolibarr: source-contains-prebuilt-javascript-object htdocs/includes/jsgantt/*
|
dolibarr: source-contains-prebuilt-javascript-object htdocs/includes/jsgantt/*
|
||||||
dolibarr: source-contains-prebuilt-javascript-object htdocs/includes/jquery/*
|
dolibarr: source-contains-prebuilt-javascript-object htdocs/includes/jquery/*
|
||||||
|
# This is a textual data file
|
||||||
|
source-is-missing htdocs/includes/mobiledetect/mobiledetectlib/Mobile_Detect.json
|
||||||
@ -2,4 +2,4 @@
|
|||||||
version=3
|
version=3
|
||||||
|
|
||||||
#http://sf.net/dolibarr/dolibarr-(.+)\.tgz
|
#http://sf.net/dolibarr/dolibarr-(.+)\.tgz
|
||||||
http://www.dolibarr.org/files/stable/standard/dolibarr-(.+)\.tgz
|
http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_(.+)\.orig\.tar\.gz
|
||||||
|
|||||||
@ -4,17 +4,14 @@ File added into doxygen generated documentation
|
|||||||
|
|
||||||
|
|
||||||
<!-- Google analytics -->
|
<!-- Google analytics -->
|
||||||
<script type="text/javascript">
|
<script>
|
||||||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
|
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
var _gaq = _gaq || [];
|
ga('create', 'UA-9049390-16', 'auto');
|
||||||
_gaq.push(['_setAccount', 'UA-9049390-1']);
|
ga('send', 'pageview');
|
||||||
_gaq.push(['_trackPageview']);
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
|
||||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
|
||||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
|
||||||
})();
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<!-- End google analytics -->
|
<!-- End google analytics -->
|
||||||
@ -22,7 +19,7 @@ File added into doxygen generated documentation
|
|||||||
|
|
||||||
<hr class="footer" />
|
<hr class="footer" />
|
||||||
<address class="footer"><small>Generated on $datetime
|
<address class="footer"><small>Generated on $datetime
|
||||||
for <a href="http://www.dolibarr.org">$projectname</a> by Doxygen $doxygenversion </small></address>
|
for <a href="https://www.dolibarr.org">$projectname</a> by Doxygen $doxygenversion </small></address>
|
||||||
|
|
||||||
|
|
||||||
<!-- Google AdSense -->
|
<!-- Google AdSense -->
|
||||||
@ -35,11 +32,20 @@ google_ad_width = 468;
|
|||||||
google_ad_height = 60;
|
google_ad_height = 60;
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
|
<script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
|
||||||
</div>
|
</div>
|
||||||
<!-- End google adsense -->
|
<!-- End google adsense -->
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Twitter ad collector -->
|
||||||
|
<script src="//platform.twitter.com/oct.js" type="text/javascript"></script>
|
||||||
|
<script type="text/javascript">twttr.conversion.trackPid('ntm4n', { tw_sale_amount: 0, tw_order_quantity: 0 });</script>
|
||||||
|
<noscript>
|
||||||
|
<img height="1" width="1" style="display:none;" alt="" src="https://analytics.twitter.com/i/adsct?txn_id=ntm4n&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0" />
|
||||||
|
<img height="1" width="1" style="display:none;" alt="" src="//t.co/i/adsct?txn_id=ntm4n&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0" />
|
||||||
|
</noscript>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@ -1,6 +1,4 @@
|
|||||||
<!--
|
<!-- File added into doxygen generated documentation -->
|
||||||
File added into doxygen generated documentation
|
|
||||||
-->
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
@ -14,7 +12,23 @@ File added into doxygen generated documentation
|
|||||||
<link href="tabs.css" rel="stylesheet" type="text/css" />
|
<link href="tabs.css" rel="stylesheet" type="text/css" />
|
||||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
<!-- End from dolibarr.org -->
|
<!-- End from dolibarr.org -->
|
||||||
|
|
||||||
|
<!-- Facebook Pixel Code -->
|
||||||
|
<script>
|
||||||
|
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
||||||
|
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
|
||||||
|
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
|
||||||
|
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
|
||||||
|
document,'script','//connect.facebook.net/en_US/fbevents.js');
|
||||||
|
|
||||||
|
fbq('init', '1998533953704960');
|
||||||
|
fbq('track', "PageView");</script>
|
||||||
|
<noscript><img height="1" width="1" style="display:none"
|
||||||
|
src="https://www.facebook.com/tr?id=1998533953704960&ev=PageView&noscript=1"
|
||||||
|
/></noscript>
|
||||||
|
<!-- End Facebook Pixel Code -->
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="top">
|
<div id="top">
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ DoYouWantToStart=Vol iniciar el proc
|
|||||||
TechnicalParameters=Paràmetres tècnics
|
TechnicalParameters=Paràmetres tècnics
|
||||||
IfFirstInstall=Si es tracta de la primera instal lació, haurà d'especificar alguns paràmetres tècnics. Si no els entén, no sabeu o va a procedir a una actualització, deixi els camps amb els valors proposats per defecte.
|
IfFirstInstall=Si es tracta de la primera instal lació, haurà d'especificar alguns paràmetres tècnics. Si no els entén, no sabeu o va a procedir a una actualització, deixi els camps amb els valors proposats per defecte.
|
||||||
|
|
||||||
; WARNING !!! STRINGS HERE MUST BE LOWER THAN 60 CHARACTERS
|
; WARNING !!! STRINGS HERE MUST BE LOWER THAN 70 CHARACTERS
|
||||||
SMTPServer=Servidor SMTP (El seu o el del seu ISP, únicament primera instal.lació) :
|
SMTPServer=Servidor SMTP (El seu o el del seu ISP, únicament primera instal.lació) :
|
||||||
ApachePort=Puerto Apache (únicament primera instal.lació, normalment és el 80) :
|
ApachePort=Puerto Apache (únicament primera instal.lació, normalment és el 80) :
|
||||||
MySqlPort=Puerto Mysql (únicament primera instal.lació, normalment és el 3306) :
|
MySqlPort=Puerto Mysql (únicament primera instal.lació, normalment és el 3306) :
|
||||||
@ -31,6 +31,7 @@ FailedToDeleteLock=FailedToDeleteLock=Error en l'eliminaci
|
|||||||
PortAlreadyInUse=Sembla que el port %1 ja està sent utilitzat. Es recomana cancel·lar, tornar enrere i especificar un altre valor per al port% 2. Cancel·lar i escollir un altre valor?
|
PortAlreadyInUse=Sembla que el port %1 ja està sent utilitzat. Es recomana cancel·lar, tornar enrere i especificar un altre valor per al port% 2. Cancel·lar i escollir un altre valor?
|
||||||
|
|
||||||
FirefoxDetected=S'ha detectat Firefox al seu ordinador. Voleu activar per defecte com a navegador per Dolibarr?
|
FirefoxDetected=S'ha detectat Firefox al seu ordinador. Voleu activar per defecte com a navegador per Dolibarr?
|
||||||
|
ChromeDetected=S'ha detectat Chrome al seu ordinador. Voleu activar per defecte com a navegador per Dolibarr?
|
||||||
ChooseDefaultBrowser=Esculli el seu navegador per defecte. Si no està segur, simplement feu clic a Obrir:
|
ChooseDefaultBrowser=Esculli el seu navegador per defecte. Si no està segur, simplement feu clic a Obrir:
|
||||||
|
|
||||||
LaunchNow=Llançar ara Dolibarr
|
LaunchNow=Llançar ara Dolibarr
|
||||||
|
|||||||
@ -31,6 +31,7 @@ FailedToDeleteLock=Failed to delete the file %1/www/dolibarr/install.lock. You c
|
|||||||
PortAlreadyInUse=Port %1 seems to be already in use. You should cancel to go back and choose another value for %2 port. Cancel choice and choose another value ?
|
PortAlreadyInUse=Port %1 seems to be already in use. You should cancel to go back and choose another value for %2 port. Cancel choice and choose another value ?
|
||||||
|
|
||||||
FirefoxDetected=Firefox has been detected on your computer. Would you like to use it as the default browser for Dolibarr ?
|
FirefoxDetected=Firefox has been detected on your computer. Would you like to use it as the default browser for Dolibarr ?
|
||||||
|
ChromeDetected=Chrome has been detected on your computer. Would you like to use it as the default browser for Dolibarr ?
|
||||||
ChooseDefaultBrowser=Please choose your default browser. If you are not sure, just click Open :
|
ChooseDefaultBrowser=Please choose your default browser. If you are not sure, just click Open :
|
||||||
|
|
||||||
LaunchNow=Launch Dolibarr now
|
LaunchNow=Launch Dolibarr now
|
||||||
|
|||||||
@ -32,6 +32,7 @@ FailedToDeleteLock=Echec de la suppression du fichier %1/www/dolibarr/install.lo
|
|||||||
PortAlreadyInUse=Le port %1 semble déjà utilisé. Il est recommandé d'annuler pour revenir en arrière et spécifier une autre valeur pour le port %2. Annuler le choix et choisir une autre valeur ?
|
PortAlreadyInUse=Le port %1 semble déjà utilisé. Il est recommandé d'annuler pour revenir en arrière et spécifier une autre valeur pour le port %2. Annuler le choix et choisir une autre valeur ?
|
||||||
|
|
||||||
FirefoxDetected=Firefox a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ?
|
FirefoxDetected=Firefox a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ?
|
||||||
|
ChromeDetected=Chrome a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ?
|
||||||
ChooseDefaultBrowser=Merci de choisir votre navigateur par défaut. Si vous n'êtes pas sûr, cliquez simplement sur Ouvrir :
|
ChooseDefaultBrowser=Merci de choisir votre navigateur par défaut. Si vous n'êtes pas sûr, cliquez simplement sur Ouvrir :
|
||||||
|
|
||||||
LaunchNow=Lancer Dolibarr maintenant
|
LaunchNow=Lancer Dolibarr maintenant
|
||||||
|
|||||||
@ -20,7 +20,7 @@ DoYouWantToStart=
|
|||||||
TechnicalParameters=Parámetros técnicos
|
TechnicalParameters=Parámetros técnicos
|
||||||
IfFirstInstall=Si se trata de la primera instalación, deberá especificar algunos parámetros técnicos. Si no los entiende, no está seguro o va a proceder a una actualización, deje los campos con los valores propuestos por defecto.
|
IfFirstInstall=Si se trata de la primera instalación, deberá especificar algunos parámetros técnicos. Si no los entiende, no está seguro o va a proceder a una actualización, deje los campos con los valores propuestos por defecto.
|
||||||
|
|
||||||
; WARNING !!! STRINGS HERE MUST BE LOWER THAN 60 CHARACTERS
|
; WARNING !!! STRINGS HERE MUST BE LOWER THAN 70 CHARACTERS
|
||||||
SMTPServer=Servidor SMTP (El suyo o el de su ISP, únicamente primera instalación) :
|
SMTPServer=Servidor SMTP (El suyo o el de su ISP, únicamente primera instalación) :
|
||||||
ApachePort=Puerto Apache (únicamente primera instalación, normalmente es el 80) :
|
ApachePort=Puerto Apache (únicamente primera instalación, normalmente es el 80) :
|
||||||
MySqlPort=Puerto Mysql (únicamente primera instalación, normalmente es el 3306) :
|
MySqlPort=Puerto Mysql (únicamente primera instalación, normalmente es el 3306) :
|
||||||
@ -31,6 +31,7 @@ FailedToDeleteLock=Error en la eliminaci
|
|||||||
PortAlreadyInUse=Parece que el puerto %1 ya esta siendo usado. Se recomienda cancelar, volver atras y especificar otro valor para el puerto %2. ¿Cancelar y escojer otro valor?
|
PortAlreadyInUse=Parece que el puerto %1 ya esta siendo usado. Se recomienda cancelar, volver atras y especificar otro valor para el puerto %2. ¿Cancelar y escojer otro valor?
|
||||||
|
|
||||||
FirefoxDetected=Se ha detectado Firefox en su ordenador. Desea activarlo por defecto como navegador para Dolibarr ?
|
FirefoxDetected=Se ha detectado Firefox en su ordenador. Desea activarlo por defecto como navegador para Dolibarr ?
|
||||||
|
ChromeDetected=Se ha detectado Chrome en su ordenador. Desea activarlo por defecto como navegador para Dolibarr ?
|
||||||
ChooseDefaultBrowser=Escoja su navegador por defecto. Si no está seguro, simplementa haga clic en Abrir :
|
ChooseDefaultBrowser=Escoja su navegador por defecto. Si no está seguro, simplementa haga clic en Abrir :
|
||||||
|
|
||||||
LaunchNow=Lanzar ahora Dolibarr
|
LaunchNow=Lanzar ahora Dolibarr
|
||||||
|
|||||||
@ -15,10 +15,7 @@ Alias /dolibarr "WAMPROOT/www/dolibarr/htdocs/"
|
|||||||
# NOTE FOR APACHE 2.3:
|
# NOTE FOR APACHE 2.3:
|
||||||
# To restrict access to dolibarr from outside set lines
|
# To restrict access to dolibarr from outside set lines
|
||||||
#
|
#
|
||||||
# <RequireAny>
|
# Require local
|
||||||
# Require ip 127.0.0.1
|
|
||||||
# Require host localhost
|
|
||||||
# <RequireAny>
|
|
||||||
#
|
#
|
||||||
# instead of
|
# instead of
|
||||||
#
|
#
|
||||||
|
|||||||
@ -42,6 +42,7 @@ SolidCompression=yes
|
|||||||
WizardImageFile=build\exe\doliwamp\doliwamp.bmp
|
WizardImageFile=build\exe\doliwamp\doliwamp.bmp
|
||||||
WizardSmallImageFile=build\exe\doliwamp\doliwampsmall.bmp
|
WizardSmallImageFile=build\exe\doliwamp\doliwampsmall.bmp
|
||||||
SetupIconFile=doc\images\dolibarr.ico
|
SetupIconFile=doc\images\dolibarr.ico
|
||||||
|
;To say the installer must be ran as admin
|
||||||
PrivilegesRequired=admin
|
PrivilegesRequired=admin
|
||||||
DisableProgramGroupPage=yes
|
DisableProgramGroupPage=yes
|
||||||
ChangesEnvironment=no
|
ChangesEnvironment=no
|
||||||
@ -148,8 +149,12 @@ Name: "{userdesktop}\Dolibarr Help center"; Filename: "{app}\rundolihelp.bat"; W
|
|||||||
|
|
||||||
[Registry]
|
[Registry]
|
||||||
; Add "run as admin" flag. Same than command line: reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "<Path to your exe>" /t REG_SZ /d RUNASADMIN
|
; Add "run as admin" flag. Same than command line: reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "<Path to your exe>" /t REG_SZ /d RUNASADMIN
|
||||||
Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\"; ValueType: String; ValueName: "{app}\startdoliwamp.bat"; ValueData: "RUNASADMIN"; Flags: uninsdeletekeyifempty uninsdeletevalue;
|
Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\startdoliwamp.bat"; ValueData: "RUNASADMIN";
|
||||||
Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\"; ValueType: String; ValueName: "{app}\stopdoliwamp.bat"; ValueData: "RUNASADMIN"; Flags: uninsdeletekeyifempty uninsdeletevalue;
|
Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\stopdoliwamp.bat"; ValueData: "RUNASADMIN";
|
||||||
|
Root: "HKLM32"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\startdoliwamp.bat"; ValueData: "RUNASADMIN";
|
||||||
|
Root: "HKLM32"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\stopdoliwamp.bat"; ValueData: "RUNASADMIN";
|
||||||
|
Root: "HKLM64"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\startdoliwamp.bat"; ValueData: "RUNASADMIN"; Check: IsWin64
|
||||||
|
Root: "HKLM64"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\stopdoliwamp.bat"; ValueData: "RUNASADMIN"; Check: IsWin64
|
||||||
|
|
||||||
|
|
||||||
[Code]
|
[Code]
|
||||||
@ -239,9 +244,9 @@ begin
|
|||||||
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\MSCRM','SMTPServer', value) then
|
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\MSCRM','SMTPServer', value) then
|
||||||
begin
|
begin
|
||||||
if value <> '' then smtpServer:=value;
|
if value <> '' then smtpServer:=value;
|
||||||
end
|
end;
|
||||||
end
|
end;
|
||||||
end
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','apachePort', value) then
|
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\NLTechno\DoliWamp','apachePort', value) then
|
||||||
@ -419,7 +424,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
themessage := FmtMessage(CustomMessage('FailedToDeleteLock'),[pathWithSlashes]);
|
themessage := FmtMessage(CustomMessage('FailedToDeleteLock'),[pathWithSlashes]);
|
||||||
MsgBox(themessage,mbInformation,MB_OK);
|
MsgBox(themessage,mbInformation,MB_OK);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
// Check if parameters already defined in conf.php file
|
// Check if parameters already defined in conf.php file
|
||||||
@ -540,13 +545,29 @@ begin
|
|||||||
begin
|
begin
|
||||||
//navigateur
|
//navigateur
|
||||||
browser := 'iexplore.exe';
|
browser := 'iexplore.exe';
|
||||||
if FileExists (pfPath+'/Mozilla Firefox/firefox.exe') then
|
|
||||||
|
if browser = 'iexplore.exe' then
|
||||||
begin
|
begin
|
||||||
if MsgBox(CustomMessage('FirefoxDetected'),mbConfirmation,MB_YESNO) = IDYES then
|
if FileExists (pfPath+'/Google/Chrome/Application/chrome.exe') then
|
||||||
begin
|
begin
|
||||||
browser := pfPath+'/Mozilla Firefox/firefox.exe';
|
if MsgBox(CustomMessage('ChromeDetected'),mbConfirmation,MB_YESNO) = IDYES then
|
||||||
|
begin
|
||||||
|
browser := pfPath+'/Google/Chrome/Application/chrome.exe';
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if browser = 'iexplore.exe' then
|
||||||
|
begin
|
||||||
|
if FileExists (pfPath+'/Mozilla Firefox/firefox.exe') then
|
||||||
|
begin
|
||||||
|
if MsgBox(CustomMessage('FirefoxDetected'),mbConfirmation,MB_YESNO) = IDYES then
|
||||||
|
begin
|
||||||
|
browser := pfPath+'/Mozilla Firefox/firefox.exe';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
if browser = 'iexplore.exe' then
|
if browser = 'iexplore.exe' then
|
||||||
begin
|
begin
|
||||||
if FileExists (pfPath+'/Internet Explorer/iexplore.exe') then
|
if FileExists (pfPath+'/Internet Explorer/iexplore.exe') then
|
||||||
@ -576,7 +597,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
|
StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
|
||||||
StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
|
StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
|
||||||
SaveStringToFile(destFileA,srcContents, False);
|
SaveStringToFile(destFileA,srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
if MsgBox(CustomMessage('DoliWampWillStartApacheMysql'),mbConfirmation,MB_YESNO) = IDYES then
|
if MsgBox(CustomMessage('DoliWampWillStartApacheMysql'),mbConfirmation,MB_YESNO) = IDYES then
|
||||||
@ -599,7 +620,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPPHPMYADMINVERSION', phpmyadminVersion, True);
|
StringChangeEx (srcContents, 'WAMPPHPMYADMINVERSION', phpmyadminVersion, True);
|
||||||
|
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
end
|
end;
|
||||||
DeleteFile(srcFile);
|
DeleteFile(srcFile);
|
||||||
|
|
||||||
|
|
||||||
@ -611,15 +632,29 @@ begin
|
|||||||
destFile := pathWithSlashes+'/alias/dolibarr.conf';
|
destFile := pathWithSlashes+'/alias/dolibarr.conf';
|
||||||
srcFile := pathWithSlashes+'/alias/dolibarr.conf.install';
|
srcFile := pathWithSlashes+'/alias/dolibarr.conf.install';
|
||||||
|
|
||||||
if not FileExists (destFile) and FileExists(srcFile) then
|
if FileExists(srcFile) then
|
||||||
begin
|
begin
|
||||||
LoadStringFromFile (srcFile, srcContents);
|
if not FileExists (destFile) then
|
||||||
|
begin
|
||||||
|
LoadStringFromFile (srcFile, srcContents);
|
||||||
|
|
||||||
StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
|
StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
|
||||||
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
|
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
|
||||||
|
|
||||||
SaveStringToFile(destFile, srcContents, False);
|
SaveStringToFile(destFile, srcContents, False);
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
// We must replace to use format 2.4 of apache
|
||||||
|
DeleteFile(destFile);
|
||||||
|
LoadStringFromFile (srcFile, srcContents);
|
||||||
|
|
||||||
|
StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True);
|
||||||
|
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
|
||||||
|
|
||||||
|
SaveStringToFile(destFile, srcContents, False);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
DeleteFile(srcFile);
|
DeleteFile(srcFile);
|
||||||
|
|
||||||
|
|
||||||
@ -632,14 +667,25 @@ begin
|
|||||||
destFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php';
|
destFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php';
|
||||||
srcFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php.install';
|
srcFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php.install';
|
||||||
|
|
||||||
if not FileExists (destFile) and FileExists (srcFile) then
|
if FileExists(srcFile) then
|
||||||
begin
|
begin
|
||||||
// sinon on prends le fichier par defaut
|
if not FileExists (destFile) then
|
||||||
LoadStringFromFile (srcFile, srcContents);
|
begin
|
||||||
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
|
LoadStringFromFile (srcFile, srcContents);
|
||||||
StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
|
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
|
||||||
end
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
// We must replace to use format 2.4 of apache
|
||||||
|
DeleteFile(destFile);
|
||||||
|
LoadStringFromFile (srcFile, srcContents);
|
||||||
|
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
|
||||||
|
StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
|
||||||
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -662,7 +708,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
|
StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
|
||||||
|
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -684,7 +730,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
|
StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True);
|
||||||
|
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -716,7 +762,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
|
StringChangeEx (srcContents, 'WAMPAPACHEPORT', myporta, True);
|
||||||
StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
|
StringChangeEx (srcContents, 'WAMPAPACHEPSSL', myportas, True);
|
||||||
SaveStringToFile(destFile, srcContents, False);
|
SaveStringToFile(destFile, srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -739,7 +785,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
|
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
|
||||||
|
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -760,7 +806,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
|
StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
|
||||||
|
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -781,7 +827,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
|
StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
|
||||||
|
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -802,7 +848,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
|
StringChangeEx (srcContents, 'WAMPMYSQLNEWPASSWORD', mypass, True);
|
||||||
|
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------
|
//----------------------------------------------
|
||||||
@ -823,7 +869,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
|
StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
|
||||||
|
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------
|
//----------------------------------------------
|
||||||
@ -844,7 +890,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
|
StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True);
|
||||||
|
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------
|
//----------------------------------------------
|
||||||
@ -863,7 +909,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
|
StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True);
|
||||||
|
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------
|
//----------------------------------------------
|
||||||
@ -880,7 +926,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPSMTP', mysmtp, True);
|
StringChangeEx (srcContents, 'WAMPSMTP', mysmtp, True);
|
||||||
StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
|
StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
//----------------------------------------------
|
//----------------------------------------------
|
||||||
// Create file php.ini in apache (if not exists)
|
// Create file php.ini in apache (if not exists)
|
||||||
@ -896,7 +942,7 @@ begin
|
|||||||
StringChangeEx (srcContents, 'WAMPSMTP', mysmtp, True);
|
StringChangeEx (srcContents, 'WAMPSMTP', mysmtp, True);
|
||||||
StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
|
StringChangeEx (srcContents, 'WAMPPHPVERSION', phpVersion, True);
|
||||||
SaveStringToFile(destFile,srcContents, False);
|
SaveStringToFile(destFile,srcContents, False);
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -938,7 +984,7 @@ begin
|
|||||||
|
|
||||||
res := False;
|
res := False;
|
||||||
|
|
||||||
end
|
end;
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -948,9 +994,9 @@ begin
|
|||||||
|
|
||||||
res := False;
|
res := False;
|
||||||
|
|
||||||
end
|
end;
|
||||||
|
|
||||||
end
|
end;
|
||||||
|
|
||||||
|
|
||||||
Result := res;
|
Result := res;
|
||||||
|
|||||||
@ -255,6 +255,9 @@ KeepAliveTimeout 30
|
|||||||
# Controls who can get stuff from this server.
|
# Controls who can get stuff from this server.
|
||||||
#
|
#
|
||||||
# onlineoffline tag - don't remove
|
# onlineoffline tag - don't remove
|
||||||
|
|
||||||
|
Require all granted
|
||||||
|
|
||||||
<RequireAny>
|
<RequireAny>
|
||||||
Require ip 127.0.0.1
|
Require ip 127.0.0.1
|
||||||
Require host localhost
|
Require host localhost
|
||||||
|
|||||||
@ -19,17 +19,11 @@ Alias /phpmyadmin "WAMPROOT/apps/phpmyadminWAMPPHPMYADMINVERSION/"
|
|||||||
#
|
#
|
||||||
# instead of
|
# instead of
|
||||||
#
|
#
|
||||||
# <RequireAny>
|
# Require local
|
||||||
# Require ip 127.0.0.1
|
|
||||||
# Require host localhost
|
|
||||||
# <RequireAny>
|
|
||||||
#
|
#
|
||||||
|
|
||||||
<Directory "WAMPROOT/apps/phpmyadminWAMPPHPMYADMINVERSION/">
|
<Directory "WAMPROOT/apps/phpmyadminWAMPPHPMYADMINVERSION/">
|
||||||
Options Indexes FollowSymLinks MultiViews
|
Options Indexes FollowSymLinks MultiViews
|
||||||
AllowOverride all
|
AllowOverride all
|
||||||
<RequireAny>
|
Require local
|
||||||
Require ip 127.0.0.1
|
|
||||||
Require host localhost
|
|
||||||
</RequireAny>
|
|
||||||
</Directory>
|
</Directory>
|
||||||
@ -173,6 +173,7 @@ $build =~ s/-.*$//g;
|
|||||||
# now build is 0+nmu1 for example
|
# now build is 0+nmu1 for example
|
||||||
$FILENAMEDEBNATIVE="${PROJECT}_${MAJOR}.${MINOR}.${build}";
|
$FILENAMEDEBNATIVE="${PROJECT}_${MAJOR}.${MINOR}.${build}";
|
||||||
$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${newbuild}";
|
$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${newbuild}";
|
||||||
|
$FILENAMEDEBSHORT="${PROJECT}_${MAJOR}.${MINOR}.${build}";
|
||||||
|
|
||||||
|
|
||||||
my $copyalreadydone=0;
|
my $copyalreadydone=0;
|
||||||
@ -389,10 +390,15 @@ if ($nboftargetok) {
|
|||||||
{
|
{
|
||||||
print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
|
print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
|
||||||
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
|
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
|
||||||
|
print 'Run git push -f --tags'."\n";
|
||||||
|
$ret=`git push -f --tags`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print 'Run git push --tags'."\n";
|
else
|
||||||
$ret=`git push --tags`;
|
{
|
||||||
|
print 'Run git push --tags'."\n";
|
||||||
|
$ret=`git push --tags`;
|
||||||
|
}
|
||||||
chdir("$olddir");
|
chdir("$olddir");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -824,7 +830,7 @@ if ($nboftargetok) {
|
|||||||
$ret=`$cmd`;
|
$ret=`$cmd`;
|
||||||
|
|
||||||
print "Remove other files\n";
|
print "Remove other files\n";
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/README-FR`;
|
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/README-FR.md`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README`;
|
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README-FR`;
|
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README-FR`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/aps`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/aps`;
|
||||||
@ -1111,6 +1117,7 @@ if ($nboftargetok) {
|
|||||||
print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
|
print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
|
||||||
$ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`;
|
$ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`;
|
||||||
|
|
||||||
|
print "Remove tmp file $SOURCE/build/exe/doliwamp/doliwamp.tmp.iss\n";
|
||||||
$ret=`rm "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
|
$ret=`rm "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
|
||||||
|
|
||||||
next;
|
next;
|
||||||
@ -1127,6 +1134,7 @@ if ($nboftargetok) {
|
|||||||
%filestoscansf=(
|
%filestoscansf=(
|
||||||
"$DESTI/package_rpm_generic/$FILENAMERPM"=>'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)',
|
"$DESTI/package_rpm_generic/$FILENAMERPM"=>'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)',
|
||||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
|
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
|
||||||
|
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none',
|
||||||
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
|
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
|
||||||
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
|
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
|
||||||
"$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM'
|
"$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM'
|
||||||
@ -1134,6 +1142,7 @@ if ($nboftargetok) {
|
|||||||
%filestoscanstableasso=(
|
%filestoscanstableasso=(
|
||||||
"$DESTI/package_rpm_generic/$FILENAMERPM"=>'package_rpm_generic',
|
"$DESTI/package_rpm_generic/$FILENAMERPM"=>'package_rpm_generic',
|
||||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu',
|
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu',
|
||||||
|
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
|
||||||
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
|
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
|
||||||
"$DESTI/standard/$FILENAMETGZ.tgz"=>'standard',
|
"$DESTI/standard/$FILENAMETGZ.tgz"=>'standard',
|
||||||
"$DESTI/standard/$FILENAMETGZ.zip"=>'standard'
|
"$DESTI/standard/$FILENAMETGZ.zip"=>'standard'
|
||||||
@ -1195,7 +1204,7 @@ if ($nboftargetok) {
|
|||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
if ($target eq 'SF') {
|
if ($target eq 'SF' && $filestoscan{$file} ne 'none') {
|
||||||
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
|
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
|
||||||
}
|
}
|
||||||
elsif ($target eq 'ASSO' and $NEWPUBLISH =~ /stable/) {
|
elsif ($target eq 'ASSO' and $NEWPUBLISH =~ /stable/) {
|
||||||
|
|||||||
@ -30,7 +30,8 @@
|
|||||||
"jakub-onderka/php-parallel-lint": "^0",
|
"jakub-onderka/php-parallel-lint": "^0",
|
||||||
"jakub-onderka/php-console-highlighter": "^0",
|
"jakub-onderka/php-console-highlighter": "^0",
|
||||||
"phpunit/phpunit": "^4",
|
"phpunit/phpunit": "^4",
|
||||||
"squizlabs/php_codesniffer": "^2"
|
"squizlabs/php_codesniffer": "^2",
|
||||||
|
"phpunit/phpunit-selenium": "^2"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-mysqlnd": "To use with MySQL or MariaDB",
|
"ext-mysqlnd": "To use with MySQL or MariaDB",
|
||||||
|
|||||||
@ -187,7 +187,9 @@
|
|||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.ClassComment.MissingTag" />
|
<rule ref="PEAR.Commenting.ClassComment.MissingTag">
|
||||||
|
<severity>0</severity>
|
||||||
|
</rule>
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.ClassComment.MissingAuthorTag">
|
<rule ref="PEAR.Commenting.ClassComment.MissingAuthorTag">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
|
|||||||
@ -2,4 +2,4 @@ README
|
|||||||
------
|
------
|
||||||
|
|
||||||
Scripts in this directory can be used to load or purge data of a database instance.
|
Scripts in this directory can be used to load or purge data of a database instance.
|
||||||
WARNING: This may erase data.
|
WARNING: Some of this script may delete definitely data.
|
||||||
|
|||||||
@ -31,8 +31,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Recupere root dolibarr
|
// Recupere root dolibarr
|
||||||
$path=preg_replace('/generate-facture.php/i','',$_SERVER["PHP_SELF"]);
|
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
|
||||||
require ($path."../../htdocs/master.inc.php");
|
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
|
||||||
|
|
||||||
|
|||||||
@ -32,8 +32,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Recupere root dolibarr
|
// Recupere root dolibarr
|
||||||
$path=preg_replace('/generate-commande.php/i','',$_SERVER["PHP_SELF"]);
|
//$path=preg_replace('/generate-commande.php/i','',$_SERVER["PHP_SELF"]);
|
||||||
require ($path."../../htdocs/master.inc.php");
|
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
|||||||
@ -32,8 +32,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Recupere root dolibarr
|
// Recupere root dolibarr
|
||||||
$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
|
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
|
||||||
require ($path."../../htdocs/master.inc.php");
|
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
|||||||
@ -32,8 +32,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Recupere root dolibarr
|
// Recupere root dolibarr
|
||||||
$path=preg_replace('/generate-propale.php/i','',$_SERVER["PHP_SELF"]);
|
//$path=preg_replace('/generate-propale.php/i','',$_SERVER["PHP_SELF"]);
|
||||||
require ($path."../../htdocs/master.inc.php");
|
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||||
|
|||||||
@ -32,8 +32,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Recupere root dolibarr
|
// Recupere root dolibarr
|
||||||
$path=preg_replace('/generate-societe.php/i','',$_SERVER["PHP_SELF"]);
|
//$path=preg_replace('/generate-societe.php/i','',$_SERVER["PHP_SELF"]);
|
||||||
require ($path."../../htdocs/master.inc.php");
|
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -56,7 +57,7 @@ $error=0;
|
|||||||
|
|
||||||
@set_time_limit(0);
|
@set_time_limit(0);
|
||||||
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
||||||
dol_syslog($script_file." launched with arg ".join(',',$argv));
|
dol_syslog($script_file." launched with arg ".implode(',',$argv));
|
||||||
|
|
||||||
$mode = $argv[1];
|
$mode = $argv[1];
|
||||||
$filepath = $argv[2];
|
$filepath = $argv[2];
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -56,7 +57,7 @@ $error=0;
|
|||||||
|
|
||||||
@set_time_limit(0);
|
@set_time_limit(0);
|
||||||
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
||||||
dol_syslog($script_file." launched with arg ".join(',',$argv));
|
dol_syslog($script_file." launched with arg ".implode(',',$argv));
|
||||||
|
|
||||||
$mode = $argv[1];
|
$mode = $argv[1];
|
||||||
$filepath = $argv[2];
|
$filepath = $argv[2];
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -56,7 +57,7 @@ $error=0;
|
|||||||
|
|
||||||
@set_time_limit(0);
|
@set_time_limit(0);
|
||||||
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
||||||
dol_syslog($script_file." launched with arg ".join(',',$argv));
|
dol_syslog($script_file." launched with arg ".implode(',',$argv));
|
||||||
|
|
||||||
$mode = $argv[1];
|
$mode = $argv[1];
|
||||||
$filepath = $argv[2];
|
$filepath = $argv[2];
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
@ -146,7 +146,7 @@ $sqls=array(
|
|||||||
|
|
||||||
@set_time_limit(0);
|
@set_time_limit(0);
|
||||||
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
||||||
dol_syslog($script_file." launched with arg ".join(',',$argv));
|
dol_syslog($script_file." launched with arg ".implode(',',$argv));
|
||||||
|
|
||||||
$mode = $argv[1];
|
$mode = $argv[1];
|
||||||
$option = $argv[2];
|
$option = $argv[2];
|
||||||
@ -154,14 +154,14 @@ $option = $argv[2];
|
|||||||
if (empty($mode) || ! in_array($mode,array('test','confirm'))) {
|
if (empty($mode) || ! in_array($mode,array('test','confirm'))) {
|
||||||
print "Usage: $script_file (test|confirm) (all|option)\n";
|
print "Usage: $script_file (test|confirm) (all|option)\n";
|
||||||
print "\n";
|
print "\n";
|
||||||
print "option can be ".join(',',array_keys($sqls))."\n";
|
print "option can be ".implode(',',array_keys($sqls))."\n";
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($option) || ! in_array($option, array_merge(array('all'),array_keys($sqls))) ) {
|
if (empty($option) || ! in_array($option, array_merge(array('all'),array_keys($sqls))) ) {
|
||||||
print "Usage: $script_file (test|confirm) (all|option)\n";
|
print "Usage: $script_file (test|confirm) (all|option)\n";
|
||||||
print "\n";
|
print "\n";
|
||||||
print "option can be ".join(',',array_keys($sqls))."\n";
|
print "option can be ".implode(',',array_keys($sqls))."\n";
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
|
After Width: | Height: | Size: 33 KiB |
BIN
dev/initdemo/documents_demo/produit/DOLICLOUD/dolicloud_logo.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 17 KiB |
BIN
dev/initdemo/documents_demo/societe/contact/10/eldy_php.jpg
Normal file
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
BIN
dev/initdemo/documents_demo/users/9/1/eldy_php.jpg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
dev/initdemo/documents_demo/users/9/1/thumbs/eldy_php_mini.jpg
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
dev/initdemo/documents_demo/users/9/1/thumbs/eldy_php_small.jpg
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
|
|
||||||
export mydir=`echo "$0" | sed -e 's/initdemo.sh//'`;
|
export mydir=`echo "$0" | sed -e 's/initdemo.sh//'`;
|
||||||
if [ "x$mydir" = "x" ]
|
if [ "x$mydir" = 'x' -o "x$mydir" = 'x./' ]
|
||||||
then
|
then
|
||||||
export mydir="."
|
export mydir="."
|
||||||
fi
|
fi
|
||||||
@ -132,23 +132,6 @@ then
|
|||||||
exit;;
|
exit;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# ---------------------------- chemin d'acces du repertoire documents
|
|
||||||
#DIALOG=${DIALOG=dialog}
|
|
||||||
#fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
|
||||||
#trap "rm -f $fichtemp" 0 1 2 5 15
|
|
||||||
#$DIALOG --title "Init Dolibarr with demo values" --clear \
|
|
||||||
# --inputbox "Full path to documents directory (ex: /var/www/dolibarr/documents)- no / at end :" 16 55 2> $fichtemp
|
|
||||||
|
|
||||||
#valret=$?
|
|
||||||
|
|
||||||
#case $valret in
|
|
||||||
# 0)
|
|
||||||
#docs=`cat $fichtemp`;;
|
|
||||||
# 1)
|
|
||||||
#exit;;
|
|
||||||
# 255)
|
|
||||||
#exit;;
|
|
||||||
#esac
|
|
||||||
|
|
||||||
# ---------------------------- confirmation
|
# ---------------------------- confirmation
|
||||||
DIALOG=${DIALOG=dialog}
|
DIALOG=${DIALOG=dialog}
|
||||||
@ -177,6 +160,25 @@ echo "mysql -P$port -u$admin -p***** $base < $mydir/$dumpfile"
|
|||||||
mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
|
mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
|
||||||
export res=$?
|
export res=$?
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------- copy demo files
|
||||||
|
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" `
|
||||||
|
if [ "x$documentdir" != "x" ]
|
||||||
|
then
|
||||||
|
echo cp -pr $mydir/documents_demo/* "$documentdir/"
|
||||||
|
cp -pr $mydir/documents_demo/* "$documentdir/"
|
||||||
|
echo cp -pr $mydir/../../htdocs/install/doctemplates/* "$documentdir/doctemplates/"
|
||||||
|
cp -pr $mydir/../../htdocs/install/doctemplates/* "$documentdir/doctemplates/"
|
||||||
|
mkdir -p "$documentdir/ecm/Administrative documents"
|
||||||
|
mkdir -p "$documentdir/ecm/Images"
|
||||||
|
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||||
|
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||||
|
else
|
||||||
|
echo Detection of documents directory failed so demo files were not copied.
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ "x$res" = "x0" ]
|
if [ "x$res" = "x0" ]
|
||||||
then
|
then
|
||||||
echo "Success, file successfully loaded."
|
echo "Success, file successfully loaded."
|
||||||
|
|||||||
8576
dev/initdemo/mysqldump_dolibarr_4.0.0.sql
Normal file
@ -187,7 +187,6 @@ export list="
|
|||||||
--ignore-table=$base.llx_bt_webseedfiles
|
--ignore-table=$base.llx_bt_webseedfiles
|
||||||
--ignore-table=$base.llx_c_civilite
|
--ignore-table=$base.llx_c_civilite
|
||||||
--ignore-table=$base.llx_c_dolicloud_plans
|
--ignore-table=$base.llx_c_dolicloud_plans
|
||||||
--ignore-table=$base.llx_c_lead_status
|
|
||||||
--ignore-table=$base.llx_c_source
|
--ignore-table=$base.llx_c_source
|
||||||
--ignore-table=$base.llx_cabinetmed_c_banques
|
--ignore-table=$base.llx_cabinetmed_c_banques
|
||||||
--ignore-table=$base.llx_cabinetmed_c_ccam
|
--ignore-table=$base.llx_cabinetmed_c_ccam
|
||||||
|
|||||||
126
dev/initdemo/updatedemo.php
Executable file
@ -0,0 +1,126 @@
|
|||||||
|
#!/usr/bin/env php
|
||||||
|
<?php
|
||||||
|
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
* or see http://www.gnu.org/
|
||||||
|
*
|
||||||
|
* Get a distant dump file and load it into a mysql database
|
||||||
|
*/
|
||||||
|
|
||||||
|
$sapi_type = php_sapi_name();
|
||||||
|
$script_file = basename(__FILE__);
|
||||||
|
$path=dirname(__FILE__).'/';
|
||||||
|
|
||||||
|
// Test if batch mode
|
||||||
|
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||||
|
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Global variables
|
||||||
|
$error=0;
|
||||||
|
|
||||||
|
$confirm=isset($argv[1])?$argv[1]:'';
|
||||||
|
|
||||||
|
// Include Dolibarr environment
|
||||||
|
$res=0;
|
||||||
|
if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php");
|
||||||
|
if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include($path."../../htdocs/master.inc.php");
|
||||||
|
if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php");
|
||||||
|
if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php");
|
||||||
|
if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php");
|
||||||
|
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include($path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
|
||||||
|
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include("../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
|
||||||
|
if (! $res) die ("Failed to include master.inc.php file\n");
|
||||||
|
include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Main
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (empty($confirm))
|
||||||
|
{
|
||||||
|
print "Usage: $script_file confirm\n";
|
||||||
|
print "Return code: 0 if success, <>0 if error\n";
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$tmp=dol_getdate(dol_now());
|
||||||
|
|
||||||
|
|
||||||
|
$tables=array(
|
||||||
|
'propal'=>array(0=>'datep', 1=>'fin_validite', 2=>'date_valid', 3=>'date_cloture'),
|
||||||
|
'commande'=>array(0=>'date_commande', 1=>'date_valid', 2=>'date_cloture'),
|
||||||
|
'facture'=>array(0=>'datef', 1=>'date_valid', 2=>'date_lim_reglement'),
|
||||||
|
'paiement'=>array(0=>'datep'),
|
||||||
|
'bank'=>array(0=>'datev', 1=>'dateo'),
|
||||||
|
'commande_fournisseur'=>array(0=>'date_commande', 1=>'date_valid', 3=>'date_creation', 4=>'date_approve', 5=>'date_approve2', 6=>'date_livraison'),
|
||||||
|
'supplier_proposal'=>array(0=>'datec', 1=>'date_valid', 2=>'date_cloture')
|
||||||
|
);
|
||||||
|
|
||||||
|
$year=2010;
|
||||||
|
$currentyear=$tmp['year'];
|
||||||
|
while ($year <= $currentyear)
|
||||||
|
{
|
||||||
|
//$year=2021;
|
||||||
|
$delta=($currentyear - $year);
|
||||||
|
//$delta=-1;
|
||||||
|
|
||||||
|
if ($delta)
|
||||||
|
{
|
||||||
|
foreach($tables as $tablekey => $tableval)
|
||||||
|
{
|
||||||
|
print "\nCorrect ".$tablekey." for year ".$year." and move them to current year ".$currentyear." ";
|
||||||
|
$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." < DATE_ADD(NOW(), INTERVAL -1 YEAR)";
|
||||||
|
//$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." > NOW()";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i=0;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$obj=$db->fetch_object($resql);
|
||||||
|
if ($obj)
|
||||||
|
{
|
||||||
|
print ".";
|
||||||
|
$sql2="UPDATE ".MAIN_DB_PREFIX.$tablekey." set ";
|
||||||
|
$j=0;
|
||||||
|
foreach($tableval as $field)
|
||||||
|
{
|
||||||
|
if ($j) $sql2.=", ";
|
||||||
|
$sql2.= $field." = DATE_ADD(".$field.", INTERVAL ".$delta." YEAR)";
|
||||||
|
$j++;
|
||||||
|
}
|
||||||
|
$sql2.=" WHERE rowid = ".$obj->rowid;
|
||||||
|
//print $sql2."\n";
|
||||||
|
$resql2 = $db->query($sql2);
|
||||||
|
if (! $resql2) dol_print_error($db);
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$year++;
|
||||||
|
}
|
||||||
|
|
||||||
|
print "\n";
|
||||||
|
|
||||||
|
exit(0);
|
||||||
@ -587,11 +587,10 @@ foreach ($skeletonfiles as $skeletonfile => $outfile)
|
|||||||
{
|
{
|
||||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||||
{
|
{
|
||||||
$varprop.="if (! empty(\$arrayfields['t.".$prop['field']."']['checked'])) print_liste_field_titre(\$arrayfields['t.".$prop['field']."']['label'],\$_SERVER['PHP_SELF'],'t.".$prop['field']."','',\$param,'',\$sortfield,\$sortorder);\n";
|
$varprop.="if (! empty(\$arrayfields['t.".$prop['field']."']['checked'])) print_liste_field_titre(\$arrayfields['t.".$prop['field']."']['label'],\$_SERVER['PHP_SELF'],'t.".$prop['field']."','',\$params,'',\$sortfield,\$sortorder);\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field1']['checked'])) print_liste_field_titre(\$langs->trans('field1'),\$_SERVER['PHP_SELF'],'t.field1','',\$param,'',\$sortfield,\$sortorder);",'/').'/', $varprop, $targetcontent);
|
$targetcontent=preg_replace('/LIST_OF_TD_TITLE_FIELDS/', $varprop, $targetcontent);
|
||||||
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field2']['checked'])) print_liste_field_titre(\$langs->trans('field2'),\$_SERVER['PHP_SELF'],'t.field2','',\$param,'',\$sortfield,\$sortorder);",'/').'/', '', $targetcontent);
|
|
||||||
|
|
||||||
// Substitute fields title search
|
// Substitute fields title search
|
||||||
$varprop="\n";
|
$varprop="\n";
|
||||||
@ -603,8 +602,7 @@ foreach ($skeletonfiles as $skeletonfile => $outfile)
|
|||||||
$varprop.="if (! empty(\$arrayfields['t.".$prop['field']."']['checked'])) print '<td class=\"liste_titre\"><input type=\"text\" class=\"flat\" name=\"search_".$prop['field']."\" value=\"'.\$search_".$prop['field'].".'\" size=\"10\"></td>';\n";
|
$varprop.="if (! empty(\$arrayfields['t.".$prop['field']."']['checked'])) print '<td class=\"liste_titre\"><input type=\"text\" class=\"flat\" name=\"search_".$prop['field']."\" value=\"'.\$search_".$prop['field'].".'\" size=\"10\"></td>';\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field1']['checked'])) print '<td class=\"liste_titre\"><input type=\"text\" class=\"flat\" name=\"search_field1\" value=\"'.\$search_field1.'\" size=\"10\"></td>';",'/').'/', $varprop, $targetcontent);
|
$targetcontent=preg_replace('/LIST_OF_TD_TITLE_SEARCH/', $varprop, $targetcontent);
|
||||||
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field2']['checked'])) print '<td class=\"liste_titre\"><input type=\"text\" class=\"flat\" name=\"search_field2\" value=\"'.\$search_field2.'\" size=\"10\"></td>';",'/').'/', '', $targetcontent);
|
|
||||||
|
|
||||||
// Substitute where for <td>.fieldx.</td>
|
// Substitute where for <td>.fieldx.</td>
|
||||||
$varprop="\n";
|
$varprop="\n";
|
||||||
@ -656,6 +654,10 @@ foreach ($skeletonfiles as $skeletonfile => $outfile)
|
|||||||
$targetcontent=preg_replace('/LIST_OF_TD_LABEL_FIELDS_VIEW/', $varprop, $targetcontent);
|
$targetcontent=preg_replace('/LIST_OF_TD_LABEL_FIELDS_VIEW/', $varprop, $targetcontent);
|
||||||
|
|
||||||
|
|
||||||
|
// LIST_OF_TD_FIELDS_LIST
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Build file
|
// Build file
|
||||||
$fp=fopen($outfile,"w");
|
$fp=fopen($outfile,"w");
|
||||||
if ($fp)
|
if ($fp)
|
||||||
|
|||||||
@ -322,9 +322,9 @@ if ($id && (empty($action) || $action == 'view' || $action == 'delete'))
|
|||||||
|
|
||||||
|
|
||||||
// Example 2 : Adding links to objects
|
// Example 2 : Adding links to objects
|
||||||
//$somethingshown=$form->showLinkedObjectBlock($object);
|
// Show links to link elements
|
||||||
//$linktoelem = $form->showLinkToObjectBlock($object);
|
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('skeleton'));
|
||||||
//if ($linktoelem) print '<br>'.$linktoelem;
|
//$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
* Copyright (C) ---Put here your own copyright and developer email---
|
* Copyright (C) ---Put here your own copyright and developer email---
|
||||||
@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php';
|
|||||||
* Class Skeleton_Class
|
* Class Skeleton_Class
|
||||||
*
|
*
|
||||||
* Put here description of your class
|
* Put here description of your class
|
||||||
|
*
|
||||||
* @see CommonObject
|
* @see CommonObject
|
||||||
*/
|
*/
|
||||||
class Skeleton_Class extends CommonObject
|
class Skeleton_Class extends CommonObject
|
||||||
@ -116,7 +117,7 @@ class Skeleton_Class extends CommonObject
|
|||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$error ++;
|
$error ++;
|
||||||
$this->errors[] = 'Error ' . $this->db->lasterror();
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
@ -189,7 +190,7 @@ class Skeleton_Class extends CommonObject
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->errors[] = 'Error ' . $this->db->lasterror();
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
|
||||||
|
|
||||||
return - 1;
|
return - 1;
|
||||||
}
|
}
|
||||||
@ -256,7 +257,7 @@ class Skeleton_Class extends CommonObject
|
|||||||
return $num;
|
return $num;
|
||||||
} else {
|
} else {
|
||||||
$this->errors[] = 'Error ' . $this->db->lasterror();
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
|
||||||
|
|
||||||
return - 1;
|
return - 1;
|
||||||
}
|
}
|
||||||
@ -301,7 +302,7 @@ class Skeleton_Class extends CommonObject
|
|||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$error ++;
|
$error ++;
|
||||||
$this->errors[] = 'Error ' . $this->db->lasterror();
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && !$notrigger) {
|
if (!$error && !$notrigger) {
|
||||||
@ -362,7 +363,7 @@ class Skeleton_Class extends CommonObject
|
|||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$error ++;
|
$error ++;
|
||||||
$this->errors[] = 'Error ' . $this->db->lasterror();
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,7 +411,7 @@ class Skeleton_Class extends CommonObject
|
|||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
$this->errors = $object->errors;
|
$this->errors = $object->errors;
|
||||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// End
|
// End
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) ---Put here your own copyright and developer email---
|
* Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -91,30 +91,38 @@ $extrafields = new ExtraFields($db);
|
|||||||
$extralabels = $extrafields->fetch_name_optionals_label('mymodule');
|
$extralabels = $extrafields->fetch_name_optionals_label('mymodule');
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||||
|
|
||||||
// Load object if id or ref is provided as parameter
|
// List of fields to search into when doing a "search in all"
|
||||||
$object=new Skeleton_Class($db);
|
$fieldstosearchall = array(
|
||||||
if (($id > 0 || ! empty($ref)) && $action != 'add')
|
't.ref'=>'Ref',
|
||||||
{
|
't.note_public'=>'NotePublic',
|
||||||
$result=$object->fetch($id,$ref);
|
);
|
||||||
if ($result < 0) dol_print_error($db);
|
if (empty($user->socid)) $fieldstosearchall["t.note_private"]="NotePrivate";
|
||||||
}
|
|
||||||
|
|
||||||
// Definition of fields for list
|
// Definition of fields for list
|
||||||
$arrayfields=array(
|
$arrayfields=array(
|
||||||
't.field1'=>array('label'=>$langs->trans("Field1"), 'checked'=>1),
|
't.field1'=>array('label'=>$langs->trans("Field1"), 'checked'=>1),
|
||||||
't.field2'=>array('label'=>$langs->trans("Field2"), 'checked'=>1),
|
't.field2'=>array('label'=>$langs->trans("Field2"), 'checked'=>1),
|
||||||
//'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))),
|
//'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))),
|
||||||
't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
't.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500),
|
||||||
't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
||||||
//'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
//'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
||||||
);
|
);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Load object if id or ref is provided as parameter
|
||||||
|
$object=new Skeleton_Class($db);
|
||||||
|
if (($id > 0 || ! empty($ref)) && $action != 'add')
|
||||||
|
{
|
||||||
|
$result=$object->fetch($id,$ref);
|
||||||
|
if ($result < 0) dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -127,7 +135,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
||||||
if (! GETPOST('confirmmassaction')) { $massaction=''; }
|
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||||
|
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
@ -135,65 +143,46 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
|
// Purge search criteria
|
||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
$search_field1='';
|
$search_field1='';
|
||||||
$search_field2='';
|
$search_field2='';
|
||||||
$search_date_creation='';
|
$search_date_creation='';
|
||||||
$search_date_update='';
|
$search_date_update='';
|
||||||
$search_array_options=array();
|
$toselect='';
|
||||||
|
$search_array_options=array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
// Mass actions. Controls on number of lines checked
|
$objectclass='Skeleton';
|
||||||
$maxformassaction=1000;
|
$objectlabel='Skeleton';
|
||||||
if (! empty($massaction) && count($toselect) < 1)
|
$permtoread = $user->rights->skeleton->read;
|
||||||
{
|
$permtodelete = $user->rights->skeleton->delete;
|
||||||
$error++;
|
$uploaddir = $conf->skeleton->dir_output;
|
||||||
setEventMessages($langs->trans("NoLineChecked"), null, "warnings");
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
}
|
|
||||||
if (! $error && count($toselect) > $maxformassaction)
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans('TooManyRecordForMassAction',$maxformassaction), null, 'errors');
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action to delete
|
|
||||||
if ($action == 'confirm_delete')
|
|
||||||
{
|
|
||||||
$result=$object->delete($user);
|
|
||||||
if ($result > 0)
|
|
||||||
{
|
|
||||||
// Delete OK
|
|
||||||
setEventMessages("RecordDeleted", null, 'mesgs');
|
|
||||||
header("Location: ".dol_buildpath('/mymodule/list.php',1));
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (! empty($object->errors)) setEventMessages(null,$object->errors,'errors');
|
|
||||||
else setEventMessages($object->error,null,'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************
|
/***************************************************
|
||||||
* VIEW
|
* VIEW
|
||||||
*
|
*
|
||||||
* Put here all code to build page
|
* Put here all code to build page
|
||||||
****************************************************/
|
****************************************************/
|
||||||
|
|
||||||
llxHeader('','MyPageName','');
|
$now=dol_now();
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
// Put here content of your page
|
//$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
|
||||||
|
$help_url='';
|
||||||
$title = $langs->trans('MyModuleListTitle');
|
$title = $langs->trans('MyModuleListTitle');
|
||||||
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
// Put here content of your page
|
||||||
|
|
||||||
// Example : Adding jquery code
|
// Example : Adding jquery code
|
||||||
print '<script type="text/javascript" language="javascript">
|
print '<script type="text/javascript" language="javascript">
|
||||||
@ -215,8 +204,8 @@ $sql = "SELECT";
|
|||||||
$sql.= " t.rowid,";
|
$sql.= " t.rowid,";
|
||||||
$sql.= " t.field1,";
|
$sql.= " t.field1,";
|
||||||
$sql.= " t.field2";
|
$sql.= " t.field2";
|
||||||
// Add fields for extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
@ -265,7 +254,10 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||||
|
|
||||||
$params='';
|
$params='';
|
||||||
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
if ($search_field1 != '') $params.= '&search_field1='.urlencode($search_field1);
|
if ($search_field1 != '') $params.= '&search_field1='.urlencode($search_field1);
|
||||||
if ($search_field2 != '') $params.= '&search_field2='.urlencode($search_field2);
|
if ($search_field2 != '') $params.= '&search_field2='.urlencode($search_field2);
|
||||||
@ -278,8 +270,13 @@ if ($resql)
|
|||||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
|
$arrayofmassactions = array(
|
||||||
|
'presend'=>$langs->trans("SendByMail"),
|
||||||
|
'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
|
);
|
||||||
|
if ($user->rights->mymodule->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||||
|
if ($massaction == 'presend') $arrayofmassactions=array();
|
||||||
|
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
@ -289,10 +286,12 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
if ($sall)
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
|
||||||
|
|
||||||
|
if ($sall)
|
||||||
{
|
{
|
||||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
print $langs->trans("FilterOnInto", $all) . join(', ',$fieldstosearchall);
|
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||||
}
|
}
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
@ -300,25 +299,28 @@ if ($resql)
|
|||||||
$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escpae_htmltag($search_myfield).'">';
|
$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escpae_htmltag($search_myfield).'">';
|
||||||
$moreforfilter.= '</div>';
|
$moreforfilter.= '</div>';
|
||||||
|
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
||||||
|
else $moreforfilter = $hookmanager->resPrint;
|
||||||
|
|
||||||
if (! empty($moreforfilter))
|
if (! empty($moreforfilter))
|
||||||
{
|
{
|
||||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||||
print $moreforfilter;
|
print $moreforfilter;
|
||||||
$parameters=array();
|
|
||||||
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
|
||||||
print $hookmanager->resPrint;
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$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 '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
// Fields title
|
// Fields title
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (! empty($arrayfields['t.field1']['checked'])) print_liste_field_titre($arrayfields['t.field1']['label'],$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder);
|
// LIST_OF_TD_TITLE_FIELDS
|
||||||
if (! empty($arrayfields['t.field2']['checked'])) print_liste_field_titre($arrayfields['t.field2']['label'],$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
|
//if (! empty($arrayfields['t.field1']['checked'])) print_liste_field_titre($arrayfields['t.field1']['label'],$_SERVER['PHP_SELF'],'t.field1','',$params,'',$sortfield,$sortorder);
|
||||||
|
//if (! empty($arrayfields['t.field2']['checked'])) print_liste_field_titre($arrayfields['t.field2']['label'],$_SERVER['PHP_SELF'],'t.field2','',$params,'',$sortfield,$sortorder);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
@ -343,8 +345,9 @@ if ($resql)
|
|||||||
|
|
||||||
// Fields title search
|
// Fields title search
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (! empty($arrayfields['t.field1']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" name="search_field1" value="'.$search_field1.'" size="10"></td>';
|
// LIST_OF_TD_TITLE_SEARCH
|
||||||
if (! empty($arrayfields['t.field2']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" name="search_field2" value="'.$search_field2.'" size="10"></td>';
|
//if (! empty($arrayfields['t.field1']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" name="search_field1" value="'.$search_field1.'" size="10"></td>';
|
||||||
|
//if (! empty($arrayfields['t.field2']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" name="search_field2" value="'.$search_field2.'" size="10"></td>';
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
@ -393,7 +396,7 @@ if ($resql)
|
|||||||
}*/
|
}*/
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="right">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
@ -407,8 +410,12 @@ if ($resql)
|
|||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj)
|
if ($obj)
|
||||||
{
|
{
|
||||||
// You can use here results
|
$var = !$var;
|
||||||
print '<tr>';
|
|
||||||
|
// Show here line of result
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
// LIST_OF_TD_FIELDS_LIST
|
||||||
|
/*
|
||||||
if (! empty($arrayfields['t.field1']['checked']))
|
if (! empty($arrayfields['t.field1']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->field1.'</td>';
|
print '<td>'.$obj->field1.'</td>';
|
||||||
@ -418,7 +425,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
print '<td>'.$obj->field2.'</td>';
|
print '<td>'.$obj->field2.'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}*/
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
@ -466,7 +473,14 @@ if ($resql)
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
print '<td></td>';
|
print '<td class="nowrap" align="center">';
|
||||||
|
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
{
|
||||||
|
$selected=0;
|
||||||
|
if (in_array($obj->rowid, $arrayofselected)) $selected=1;
|
||||||
|
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -474,16 +488,59 @@ if ($resql)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
// Show total line
|
||||||
|
if (isset($totalarray['totalhtfield']))
|
||||||
|
{
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
$i=0;
|
||||||
|
while ($i < $totalarray['nbfield'])
|
||||||
|
{
|
||||||
|
$i++;
|
||||||
|
if ($i == 1)
|
||||||
|
{
|
||||||
|
if ($num < $limit) print '<td align="left">'.$langs->trans("Total").'</td>';
|
||||||
|
else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||||
|
}
|
||||||
|
elseif ($totalarray['totalhtfield'] == $i) print '<td align="right">'.price($totalarray['totalht']).'</td>';
|
||||||
|
elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>';
|
||||||
|
elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>';
|
||||||
|
else print '<td></td>';
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
$parameters=array('sql' => $sql);
|
$db->free($resql);
|
||||||
|
|
||||||
|
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
print "</table>\n";
|
print '</table>'."\n";
|
||||||
print "</form>\n";
|
|
||||||
|
print '</form>'."\n";
|
||||||
|
|
||||||
|
|
||||||
|
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
|
||||||
|
{
|
||||||
|
// Show list of available documents
|
||||||
|
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||||
|
$urlsource.=str_replace('&','&',$param);
|
||||||
|
|
||||||
|
$filedir=$diroutputmassaction;
|
||||||
|
$genallowed=$user->rights->facture->lire;
|
||||||
|
$delallowed=$user->rights->facture->lire;
|
||||||
|
|
||||||
|
print '<br><a name="show_files"></a>';
|
||||||
|
$paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
|
||||||
|
$title=$langs->trans("MassFilesArea").' <a href="'.$_SERVER["PHP_SELF"].'?'.$paramwithoutshowfiles.'">('.$langs->trans("Hide").')</a>';
|
||||||
|
|
||||||
|
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
$db->free($result);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -300,7 +300,7 @@ class autoTranslator
|
|||||||
//setting language pair
|
//setting language pair
|
||||||
$lang_pair = $src_lang.'|'.$dest_lang;
|
$lang_pair = $src_lang.'|'.$dest_lang;
|
||||||
|
|
||||||
$src_text_to_translate=preg_replace('/%s/','SSSSS',join('',$src_texts));
|
$src_text_to_translate=preg_replace('/%s/','SSSSS',implode('',$src_texts));
|
||||||
$src_text_to_translate=preg_replace('/'.preg_quote('\n\n').'/',' NNNNN ',$src_text_to_translate);
|
$src_text_to_translate=preg_replace('/'.preg_quote('\n\n').'/',' NNNNN ',$src_text_to_translate);
|
||||||
|
|
||||||
// Define GET URL v1
|
// Define GET URL v1
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
/* Copyright (c) 2015 Tommaso Basilici <t.basilici@19.coop>
|
/* Copyright (c) 2015 Tommaso Basilici <t.basilici@19.coop>
|
||||||
* Copyright (c) 2015 Laurent Destailleur <eldy@destailleur.fr>
|
* Copyright (c) 2015 Laurent Destailleur <eldy@destailleur.fr>
|
||||||
|
* Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -294,7 +295,11 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
|
|||||||
if (preg_match('/^DescADHERENT_/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^DescADHERENT_/', $value)) $qualifiedforclean=0;
|
||||||
if (preg_match('/^SubmitTranslation/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^SubmitTranslation/', $value)) $qualifiedforclean=0;
|
||||||
if (preg_match('/^ModuleCompanyCode/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^ModuleCompanyCode/', $value)) $qualifiedforclean=0;
|
||||||
|
// boxes.lang
|
||||||
|
if (preg_match('/^BoxTitleLast/', $value)) $qualifiedforclean=0;
|
||||||
|
if (preg_match('/^BoxTitleLatest/', $value)) $qualifiedforclean=0;
|
||||||
|
// install.lang
|
||||||
|
if (preg_match('/^KeepDefaultValues/', $value)) $qualifiedforclean=0;
|
||||||
// main.lang
|
// main.lang
|
||||||
if (preg_match('/^Duration/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^Duration/', $value)) $qualifiedforclean=0;
|
||||||
if (preg_match('/^FormatDate/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^FormatDate/', $value)) $qualifiedforclean=0;
|
||||||
@ -339,7 +344,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
|
|||||||
}
|
}
|
||||||
|
|
||||||
//$search = '\'trans("'.$value.'")\'';
|
//$search = '\'trans("'.$value.'")\'';
|
||||||
$search = '-e "\''.$value.'\'" -e \'"'.$value.'"\' -e "('.$value.')"';
|
$search = '-e "\''.$value.'\'" -e \'"'.$value.'"\' -e "('.$value.')" -e "('.$value.',"';
|
||||||
$string = 'grep -R -m 1 -F --exclude=includes/* --include=*.php '.$search.' '.$htdocs.'* '.$scripts.'*';
|
$string = 'grep -R -m 1 -F --exclude=includes/* --include=*.php '.$search.' '.$htdocs.'* '.$scripts.'*';
|
||||||
//print $string."<br>\n";
|
//print $string."<br>\n";
|
||||||
exec($string,$output);
|
exec($string,$output);
|
||||||
@ -359,7 +364,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
|
|||||||
{
|
{
|
||||||
$filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang';
|
$filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang';
|
||||||
print "Strings in en_US that are never used are saved into file ".$filetosave.":\n";
|
print "Strings in en_US that are never used are saved into file ".$filetosave.":\n";
|
||||||
file_put_contents($filetosave, join("",$unused));
|
file_put_contents($filetosave, implode("",$unused));
|
||||||
print "To remove from original file, run command :\n";
|
print "To remove from original file, run command :\n";
|
||||||
if (($argv[2]?$argv[2]:"")) print 'cd htdocs/langs/en_US; mv '.($argv[2]?$argv[2]:"")." ".($argv[2]?$argv[2]:"").".tmp; ";
|
if (($argv[2]?$argv[2]:"")) print 'cd htdocs/langs/en_US; mv '.($argv[2]?$argv[2]:"")." ".($argv[2]?$argv[2]:"").".tmp; ";
|
||||||
print "diff ".($argv[2]?$argv[2]:"").".tmp ".$filetosave." | grep \< | cut -b 3- > ".($argv[2]?$argv[2]:"");
|
print "diff ".($argv[2]?$argv[2]:"").".tmp ".$filetosave." | grep \< | cut -b 3- > ".($argv[2]?$argv[2]:"");
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 212 KiB |
|
Before Width: | Height: | Size: 149 KiB After Width: | Height: | Size: 228 KiB |
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 159 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 57 KiB |
BIN
doc/images/dolibarr_screenshot6_1280x800.png
Normal file
|
After Width: | Height: | Size: 175 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 232 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 171 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 2.2 KiB |
@ -58,7 +58,17 @@ if ($action == 'add') {
|
|||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
// Clean code
|
// Clean code
|
||||||
$account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right
|
|
||||||
|
// To manage zero or not at the end of the accounting account
|
||||||
|
if($conf->global->ACCOUNTING_MANAGE_ZERO == 1)
|
||||||
|
{
|
||||||
|
$account_number = GETPOST('account_number');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$account_number = clean_account(GETPOST('account_number'));
|
||||||
|
}
|
||||||
|
|
||||||
if (GETPOST('account_category') <= 0) {
|
if (GETPOST('account_category') <= 0) {
|
||||||
$account_parent = '';
|
$account_parent = '';
|
||||||
} else {
|
} else {
|
||||||
@ -98,7 +108,17 @@ if ($action == 'add') {
|
|||||||
$obj = $db->fetch_object($result2);
|
$obj = $db->fetch_object($result2);
|
||||||
|
|
||||||
// Clean code
|
// Clean code
|
||||||
$account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right
|
|
||||||
|
// To manage zero or not at the end of the accounting account
|
||||||
|
if($conf->global->ACCOUNTING_MANAGE_ZERO == 1)
|
||||||
|
{
|
||||||
|
$account_number = GETPOST('account_number');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$account_number = clean_account(GETPOST('account_number'));
|
||||||
|
}
|
||||||
|
|
||||||
if (GETPOST('account_category') <= 0) {
|
if (GETPOST('account_category') <= 0) {
|
||||||
$account_parent = '';
|
$account_parent = '';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -130,6 +130,7 @@ if ($action == 'update') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TO DO Mutualize code for yes/no constants
|
||||||
if ($action == 'setlistsorttodo') {
|
if ($action == 'setlistsorttodo') {
|
||||||
$setlistsorttodo = GETPOST('value', 'int');
|
$setlistsorttodo = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity);
|
||||||
@ -155,6 +156,18 @@ if ($action == 'setlistsortdone') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'setmanagezero') {
|
||||||
|
$setmanagezero = GETPOST('value', 'int');
|
||||||
|
$res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity);
|
||||||
|
if (! $res > 0)
|
||||||
|
$error ++;
|
||||||
|
if (! $error) {
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -286,6 +299,7 @@ foreach ( $list_account as $key ) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TO DO Mutualize code for yes/no constants
|
||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
print "<tr " . $bc[$var] . ">";
|
print "<tr " . $bc[$var] . ">";
|
||||||
print '<td width="80%">' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
|
print '<td width="80%">' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
|
||||||
@ -314,6 +328,20 @@ if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
$var = ! $var;
|
||||||
|
print "<tr " . $bc[$var] . ">";
|
||||||
|
print '<td width="80%">' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
|
||||||
|
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
||||||
|
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=0">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a></td>';
|
||||||
|
} else {
|
||||||
|
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=1">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a></td>';
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
* \ingroup Advanced accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief Balance of book keeping
|
* \brief Balance of book keeping
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
// Class
|
// Class
|
||||||
@ -184,7 +185,7 @@ else {
|
|||||||
print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Solde"), $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Solde"), $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Action"), $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Action"), $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -213,6 +214,9 @@ else {
|
|||||||
|
|
||||||
$total_debit = 0;
|
$total_debit = 0;
|
||||||
$total_credit = 0;
|
$total_credit = 0;
|
||||||
|
$sous_total_debit = 0;
|
||||||
|
$sous_total_credit = 0;
|
||||||
|
$displayed_account = "";
|
||||||
|
|
||||||
foreach ( $object->lines as $line ) {
|
foreach ( $object->lines as $line ) {
|
||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
@ -220,33 +224,59 @@ else {
|
|||||||
$total_debit += $line->debit;
|
$total_debit += $line->debit;
|
||||||
$total_credit += $line->credit;
|
$total_credit += $line->credit;
|
||||||
$description = $object->get_compte_desc($line->numero_compte); // Search description of the account
|
$description = $object->get_compte_desc($line->numero_compte); // Search description of the account
|
||||||
|
$root_account_description = $object->get_compte_racine($line->numero_compte);
|
||||||
if(empty($description)){
|
if(empty($description)){
|
||||||
$link = '<a href="../admin/card.php?action=create&compte=' . length_accountg($line->numero_compte) . '">' . img_edit_add() .'</a>';
|
$link = '<a href="../admin/card.php?action=create&compte=' . length_accountg($line->numero_compte) . '">' . img_edit_add() .'</a>';
|
||||||
}
|
}
|
||||||
print '<tr'. $bc[$var].'>';
|
print '<tr'. $bc[$var].'>';
|
||||||
|
|
||||||
|
|
||||||
|
// Permet d'afficher le compte comptable
|
||||||
|
if ($root_account_description != $displayed_account) {
|
||||||
|
|
||||||
|
// Affiche un Sous-Total par compte comptable
|
||||||
|
if ($displayed_account != "") {
|
||||||
|
print '<tr class="liste_total"><td align="right" colspan="2">'.$langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">'.price($sous_total_debit).'</td><td class="nowrap" align="right">'.price($sous_total_credit).'</td><td class="nowrap" align="right">'.price($sous_total_credit-$sous_total_debit).'</td>';
|
||||||
|
print "<td> </td>\n";
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Affiche le compte comptable en début de ligne
|
||||||
|
print "<tr>";
|
||||||
|
print '<td colspan="6" style="font-weight:bold; border-bottom: 1pt solid black;">'. $root_account_description .'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$displayed_account = $root_account_description;
|
||||||
|
$sous_total_debit = 0;
|
||||||
|
$sous_total_credit = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// $object->get_compte_racine($line->numero_compte);
|
||||||
|
|
||||||
|
|
||||||
print '<td>' . length_accountg($line->numero_compte) . '</td>';
|
print '<td>' . length_accountg($line->numero_compte) . '</td>';
|
||||||
print '<td>' . $description . '</td>';
|
print '<td>' . $description . '</td>';
|
||||||
print '<td align="right">' . number_format($line->debit, 2, ',', ' ') . '</td>';
|
print '<td align="right">' . number_format($line->debit, 2, ',', ' ') . '</td>';
|
||||||
print '<td align="right">' . number_format($line->credit, 2, ',', ' ') . '</td>';
|
print '<td align="right">' . number_format($line->credit, 2, ',', ' ') . '</td>';
|
||||||
print '<td align="right">' . number_format($line->credit - $line->debit, 2, ',', ' ') . '</td>';
|
print '<td align="right">' . number_format($line->credit - $line->debit, 2, ',', ' ') . '</td>';
|
||||||
print '<td align="center">' . $link;
|
print '<td align="center">' . $link;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Comptabilise le sous-total
|
||||||
|
$sous_total_debit += $line->debit;
|
||||||
|
$sous_total_credit += $line->credit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total"><td align="right" colspan="2">'.$langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">'.price($sous_total_debit).'</td><td class="nowrap" align="right">'.price($sous_total_credit).'</td><td class="nowrap" align="right">'.price($sous_total_credit-$sous_total_debit).'</td>';
|
||||||
print '<td></td>';
|
print "<td> </td>\n";
|
||||||
print '<td></td>';
|
print '</tr>';
|
||||||
print '<td align="right">';
|
|
||||||
print price($total_debit);
|
print '<tr class="liste_total"><td align="right" colspan="2">'.$langs->trans("AccountBalance") . ':</td><td class="nowrap" align="right">'.price($total_debit).'</td><td class="nowrap" align="right">'.price($total_credit).'</td><td class="nowrap" align="right">'.price($total_credit-$total_debit).'</td>';
|
||||||
print '</td>';
|
print "<td> </td>\n";
|
||||||
print '<td align="right">';
|
print '</tr>';
|
||||||
print price($total_credit);
|
|
||||||
print '</td>';
|
|
||||||
print '<td align="right">' . price($total_credit - $total_debit) . '</td>';
|
|
||||||
print '<td align="right"></td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -258,7 +258,6 @@ if ($action == 'export_csv') {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$title_page = $langs->trans("Bookkeeping") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end);
|
$title_page = $langs->trans("Bookkeeping") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end);
|
||||||
|
|
||||||
llxHeader('', $title_page);
|
llxHeader('', $title_page);
|
||||||
|
|
||||||
// List
|
// List
|
||||||
@ -315,6 +314,7 @@ print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield
|
|||||||
|
|
||||||
print '<form method="GET" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
print '<form method="GET" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||||
print '<div class="tabsAction">' . "\n";
|
print '<div class="tabsAction">' . "\n";
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction" href="./listbyaccount.php">' . $langs->trans("Bookkeeping") . ' ' . strtolower($langs->trans("By")) . ' ' . strtolower($langs->trans("AccountAccounting")) . '</a></div>';
|
||||||
print '<div class="inline-block divButAction"><input type="submit" name="button_delmvt" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
|
print '<div class="inline-block divButAction"><input type="submit" name="button_delmvt" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt") . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt") . '</a></div>';
|
||||||
print '<div class="inline-block divButAction"><input type="submit" name="button_export_csv" class="butAction" value="' . $langs->trans("Export") . '" /></div>';
|
print '<div class="inline-block divButAction"><input type="submit" name="button_export_csv" class="butAction" value="' . $langs->trans("Export") . '" /></div>';
|
||||||
|
|||||||
348
htdocs/accountancy/bookkeeping/listbyaccount.php
Normal file
@ -0,0 +1,348 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr>
|
||||||
|
* largely based on the great work of :
|
||||||
|
* - Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
|
* - Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* - Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/accountancy/bookkeeping/listbyaccount.php
|
||||||
|
* \ingroup Advanced accountancy
|
||||||
|
* \brief List operation of book keeping ordered by account number
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../../main.inc.php';
|
||||||
|
|
||||||
|
// Class
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||||
|
|
||||||
|
// Langs
|
||||||
|
$langs->load("accountancy");
|
||||||
|
|
||||||
|
$page = GETPOST("page");
|
||||||
|
$sortorder = GETPOST("sortorder");
|
||||||
|
$sortfield = GETPOST("sortfield");
|
||||||
|
$action = GETPOST('action', 'alpha');
|
||||||
|
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
||||||
|
$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
|
||||||
|
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$search_accountancy_code = GETPOST("search_accountancy_code");
|
||||||
|
|
||||||
|
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
||||||
|
if ($search_accountancy_code_start == - 1) {
|
||||||
|
$search_accountancy_code_start = '';
|
||||||
|
}
|
||||||
|
$search_label_account = GETPOST('search_label_account', 'alpha');
|
||||||
|
|
||||||
|
$search_mvt_label = GETPOST('search_mvt_label', 'alpha');
|
||||||
|
$search_direction = GETPOST('search_direction', 'alpha');
|
||||||
|
$search_ledger_code = GETPOST('search_ledger_code', 'alpha');
|
||||||
|
|
||||||
|
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
|
if ($page == -1) { $page = 0 ; }
|
||||||
|
$offset = $limit * $page ;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
|
||||||
|
$object = new BookKeeping($db);
|
||||||
|
|
||||||
|
$formventilation = new FormVentilation($db);
|
||||||
|
$formother = new FormOther($db);
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (empty($search_date_start)) {
|
||||||
|
$search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y'));
|
||||||
|
$search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y'));
|
||||||
|
}
|
||||||
|
if ($sortorder == "")
|
||||||
|
$sortorder = "ASC";
|
||||||
|
if ($sortfield == "")
|
||||||
|
$sortfield = "t.rowid";
|
||||||
|
|
||||||
|
|
||||||
|
$options = '';
|
||||||
|
$filter = array ();
|
||||||
|
|
||||||
|
if (! empty($search_date_start)) {
|
||||||
|
$filter['t.doc_date>='] = $search_date_start;
|
||||||
|
$options .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int');
|
||||||
|
}
|
||||||
|
if (! empty($search_date_end)) {
|
||||||
|
$filter['t.doc_date<='] = $search_date_end;
|
||||||
|
$options .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int');
|
||||||
|
}
|
||||||
|
if (! empty($search_doc_date)) {
|
||||||
|
$filter['t.doc_date'] = $search_doc_date;
|
||||||
|
$options .= '&doc_datemonth=' . GETPOST('doc_datemonth', 'int') . '&doc_dateday=' . GETPOST('doc_dateday', 'int') . '&doc_dateyear=' . GETPOST('doc_dateyear', 'int');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!GETPOST("button_removefilter_x") && !GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||||
|
{
|
||||||
|
if (! empty($search_accountancy_code_start)) {
|
||||||
|
$filter['t.numero_compte'] = $search_accountancy_code_start;
|
||||||
|
$options .= '&search_accountancy_code_start=' . $search_accountancy_code_start;
|
||||||
|
}
|
||||||
|
if (! empty($search_label_account)) {
|
||||||
|
$filter['t.label_compte'] = $search_label_account;
|
||||||
|
$options .= '&search_label_account=' . $search_label_account;
|
||||||
|
}
|
||||||
|
if (! empty($search_mvt_label)) {
|
||||||
|
$filter['t.label_compte'] = $search_mvt_label;
|
||||||
|
$options .= '&search_mvt_label=' . $search_mvt_label;
|
||||||
|
}
|
||||||
|
if (! empty($search_direction)) {
|
||||||
|
$filter['t.sens'] = $search_direction;
|
||||||
|
$options .= '&search_direction=' . $search_direction;
|
||||||
|
}
|
||||||
|
if (! empty($search_ledger_code)) {
|
||||||
|
$filter['t.code_journal'] = $search_ledger_code;
|
||||||
|
$options .= '&search_ledger_code=' . $search_ledger_code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Action
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||||
|
{
|
||||||
|
$search_doc_date = '';
|
||||||
|
$search_accountancy_code = '';
|
||||||
|
$search_accountancy_code_start = '';
|
||||||
|
$search_label_account = '';
|
||||||
|
$search_mvt_label = '';
|
||||||
|
$search_direction = '';
|
||||||
|
$search_ledger_code = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($action == 'delmouvconfirm') {
|
||||||
|
|
||||||
|
$mvt_num = GETPOST('mvt_num', 'int');
|
||||||
|
|
||||||
|
if (! empty($mvt_num)) {
|
||||||
|
$result = $object->deleteMvtNum($mvt_num);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
Header("Location: listbyaccount.php");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$title_page = $langs->trans("Bookkeeping") . ' ' . strtolower($langs->trans("By")) . ' ' . $langs->trans("AccountAccounting") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end);
|
||||||
|
|
||||||
|
llxHeader('', $title_page);
|
||||||
|
|
||||||
|
// List
|
||||||
|
|
||||||
|
$nbtotalofrecords = 0;
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
|
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
|
||||||
|
if ($nbtotalofrecords < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
$nbtotalofrecords = $result;
|
||||||
|
|
||||||
|
if ($action == 'delmouv') {
|
||||||
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?mvt_num=' . GETPOST('mvt_num'), $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delmouvconfirm', '', 0, 1);
|
||||||
|
print $formconfirm;
|
||||||
|
}
|
||||||
|
if ($action == 'delbookkeepingyear') {
|
||||||
|
|
||||||
|
$form_question = array ();
|
||||||
|
$delyear = GETPOST('delyear');
|
||||||
|
|
||||||
|
if (empty($delyear)) {
|
||||||
|
$delyear = dol_print_date(dol_now(), '%Y');
|
||||||
|
}
|
||||||
|
$year_array = $formventilation->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array');
|
||||||
|
|
||||||
|
$form_question['delyear'] = array (
|
||||||
|
'name' => 'delyear',
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => $langs->trans('DelYear'),
|
||||||
|
'values' => $year_array,
|
||||||
|
'default' => $delyear
|
||||||
|
);
|
||||||
|
|
||||||
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1);
|
||||||
|
print $formconfirm;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print '<form method="GET" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||||
|
|
||||||
|
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $nbtotalofrecords,'',0,'','',$limit);
|
||||||
|
|
||||||
|
// Reverse sort order
|
||||||
|
if ( preg_match('/^asc/i', $sortorder) )
|
||||||
|
$sortorder = "asc";
|
||||||
|
else
|
||||||
|
$sortorder = "desc";
|
||||||
|
|
||||||
|
print '<div class="tabsAction">' . "\n";
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt") . '</a></div>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>' . $langs->trans("AccountAccounting") . '</td>';
|
||||||
|
print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "t.doc_date", "", $options, "", $sortfield, $sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $options, "", $sortfield, $sortorder);
|
||||||
|
print '<td>' . $langs->trans("SuppliersInvoices") . ' / ' . $langs->trans("CustomersInvoices") . '</td>';
|
||||||
|
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Action"), $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="GET">';
|
||||||
|
print '<td width >' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . '</td>';
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print $langs->trans('From') . ': ';
|
||||||
|
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
||||||
|
print '<br>';
|
||||||
|
print $langs->trans('to') . ': ';
|
||||||
|
print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_mvt_label" value="' . $search_mvt_label . '"/></td>';
|
||||||
|
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_account" value="' . $search_label_account . '"/></td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||||
|
print '<td align="right" colspan="2" class="liste_titre">';
|
||||||
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
|
print $searchpitco;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$var = True;
|
||||||
|
|
||||||
|
$total_debit = 0;
|
||||||
|
$total_credit = 0;
|
||||||
|
$sous_total_debit = 0;
|
||||||
|
$sous_total_credit = 0;
|
||||||
|
$displayed_account_number = "";
|
||||||
|
|
||||||
|
foreach ( $object->lines as $line ) {
|
||||||
|
$var = ! $var;
|
||||||
|
|
||||||
|
$total_debit += $line->debit;
|
||||||
|
$total_credit += $line->credit;
|
||||||
|
|
||||||
|
// Permet d'afficher le compte comptable
|
||||||
|
if (length_accountg($line->numero_compte) != $displayed_account_number) {
|
||||||
|
|
||||||
|
// Affiche un Sous-Total par compte comptable
|
||||||
|
if ($displayed_account_number != "") {
|
||||||
|
print '<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("SubTotal").':</td><td class="nowrap" align="right">'.price($sous_total_debit).'</td><td class="nowrap" align="right">'.price($sous_total_credit).'</td>';
|
||||||
|
print "<td> </td>\n";
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Affiche le compte comptable en début de ligne
|
||||||
|
print "<tr>";
|
||||||
|
print '<td colspan="7" style="font-weight:bold; border-bottom: 1pt solid black;">'.length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$displayed_account_number = length_accountg($line->numero_compte);
|
||||||
|
$sous_total_debit = 0;
|
||||||
|
$sous_total_credit = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<tr'. $bc[$var].'>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td align="center">' . dol_print_date($line->doc_date, 'day') . '</td>';
|
||||||
|
print '<td><a href="./card.php?piece_num=' . $line->piece_num . '">' . $line->doc_ref . '</a></td>';
|
||||||
|
|
||||||
|
// Affiche un lien vers la facture client/fournisseur
|
||||||
|
$doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref);
|
||||||
|
if ($line->doc_type == 'supplier_invoice')
|
||||||
|
print strlen(length_accounta($line->code_tiers)) == 0 ? '<td><a href="/fourn/facture/list.php?search_ref_supplier=' . $doc_ref . '">' . $line->label_compte . '</a></td>' : '<td><a href="/fourn/facture/list.php?search_ref_supplier=' . $doc_ref . '">' . $line->label_compte . '</a><br /><span style="font-size:0.8em">(' . length_accounta($line->code_tiers) . ')</span></td>';
|
||||||
|
elseif ($line->doc_type == 'customer_invoice')
|
||||||
|
print strlen(length_accounta($line->code_tiers)) == 0 ? '<td><a href="/compta/facture/list.php?search_ref=' . $doc_ref . '">' . $line->label_compte . '</a></td>' : '<td><a href="/compta/facture/list.php?search_ref=' . $doc_ref . '">' . $line->label_compte . '</a><br /><span style="font-size:0.8em">(' . length_accounta($line->code_tiers) . ')</span></td>';
|
||||||
|
else
|
||||||
|
print strlen(length_accounta($line->code_tiers)) == 0 ? '<td>' . $line->label_compte . '</td>' : '<td>' . $line->label_compte . '<br /><span style="font-size:0.8em">(' . length_accounta($line->code_tiers) . ')</span></td>';
|
||||||
|
|
||||||
|
|
||||||
|
print '<td align="right">' . price($line->debit) . '</td>';
|
||||||
|
print '<td align="right">' . price($line->credit) . '</td>';
|
||||||
|
print '<td align="center">' . $line->code_journal . '</td>';
|
||||||
|
print '<td align="center">';
|
||||||
|
print '<a href="./card.php?piece_num=' . $line->piece_num . '">' . img_edit() . '</a> ';
|
||||||
|
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $options . '&page=' . $page . '">' . img_delete() . '</a>';
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Comptabilise le sous-total
|
||||||
|
$sous_total_debit += $line->debit;
|
||||||
|
$sous_total_credit += $line->credit;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Affiche un Sous-Total du dernier compte comptable affiché
|
||||||
|
print '<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("SubTotal").':</td><td class="nowrap" align="right">'.price($sous_total_debit).'</td><td class="nowrap" align="right">'.price($sous_total_credit).'</td>';
|
||||||
|
print "<td> </td>\n";
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
|
// Affiche le Total
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td align="right" colspan="4">'.$langs->trans("Total").':</td>';
|
||||||
|
print '<td align="right">';
|
||||||
|
print price($total_debit);
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right">';
|
||||||
|
print price($total_credit);
|
||||||
|
print '</td>';
|
||||||
|
print '<td colspan="2"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@ -109,8 +109,6 @@ class BookKeeping extends CommonObject
|
|||||||
public function create(User $user, $notrigger = false) {
|
public function create(User $user, $notrigger = false) {
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
@ -168,11 +166,11 @@ class BookKeeping extends CommonObject
|
|||||||
// first check if line not yet in bookkeeping
|
// first check if line not yet in bookkeeping
|
||||||
$sql = "SELECT count(*) as nb";
|
$sql = "SELECT count(*) as nb";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
||||||
$sql .= " WHERE doc_type = '" . $this->db->escape($this->doc_type) . "'";
|
$sql .= " WHERE doc_type = '" . $this->doc_type . "'";
|
||||||
$sql .= " AND fk_docdet = " . $this->fk_docdet;
|
$sql .= " AND fk_docdet = " . $this->fk_docdet;
|
||||||
$sql .= " AND numero_compte = '" . $this->db->escape($this->numero_compte) . "'";
|
$sql .= " AND numero_compte = '" . $this->numero_compte . "'";
|
||||||
|
|
||||||
dol_syslog(get_class($this) . ":: create ", LOG_DEBUG);
|
dol_syslog(get_class($this) . ":: create sql=" . $sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
@ -204,12 +202,11 @@ class BookKeeping extends CommonObject
|
|||||||
$this->piece_num = $objnum->maxpiecenum;
|
$this->piece_num = $objnum->maxpiecenum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dol_syslog(get_class($this) . ":: create this->piece_num=" . $this->piece_num, LOG_DEBUG);
|
||||||
if (empty($this->piece_num)) {
|
if (empty($this->piece_num)) {
|
||||||
$this->piece_num = 1;
|
$this->piece_num = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this) . ":: create this->piece_num=" . $this->piece_num, LOG_DEBUG);
|
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
if (empty($this->date_create)) {
|
if (empty($this->date_create)) {
|
||||||
$this->date_create = $now;
|
$this->date_create = $now;
|
||||||
@ -236,26 +233,26 @@ class BookKeeping extends CommonObject
|
|||||||
|
|
||||||
$sql .= ") VALUES (";
|
$sql .= ") VALUES (";
|
||||||
|
|
||||||
$sql .= "'" . $this->db->idate($this->doc_date) . "'";
|
$sql .= "'" . $this->doc_date . "'";
|
||||||
$sql .= ",'" . $this->db->escape($this->doc_type) . "'";
|
$sql .= ",'" . $this->doc_type . "'";
|
||||||
$sql .= ",'" . $this->db->escape($this->doc_ref) . "'";
|
$sql .= ",'" . $this->doc_ref . "'";
|
||||||
$sql .= "," . $this->fk_doc;
|
$sql .= "," . $this->fk_doc;
|
||||||
$sql .= "," . $this->fk_docdet;
|
$sql .= "," . $this->fk_docdet;
|
||||||
$sql .= ",'" . $this->db->escape($this->code_tiers) . "'";
|
$sql .= ",'" . $this->code_tiers . "'";
|
||||||
$sql .= ",'" . $this->db->escape($this->numero_compte) . "'";
|
$sql .= ",'" . $this->numero_compte . "'";
|
||||||
$sql .= ",'" . $this->db->escape($this->label_compte) . "'";
|
$sql .= ",'" . $this->db->escape($this->label_compte) . "'";
|
||||||
$sql .= "," . $this->debit;
|
$sql .= "," . $this->debit;
|
||||||
$sql .= "," . $this->credit;
|
$sql .= "," . $this->credit;
|
||||||
$sql .= "," . $this->montant;
|
$sql .= "," . $this->montant;
|
||||||
$sql .= ",'" . $this->db->escape($this->sens) . "'";
|
$sql .= ",'" . $this->sens . "'";
|
||||||
$sql .= ",'" . $this->fk_user_author . "'";
|
$sql .= ",'" . $this->fk_user_author . "'";
|
||||||
$sql .= ",'" . $this->date_create . "'";
|
$sql .= ",'" . $this->date_create . "'";
|
||||||
$sql .= ",'" . $this->db->escape($this->code_journal) . "'";
|
$sql .= ",'" . $this->code_journal . "'";
|
||||||
$sql .= "," . $this->piece_num;
|
$sql .= "," . $this->piece_num;
|
||||||
|
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this) . ":: create", LOG_DEBUG);
|
dol_syslog(get_class($this) . ":: create sql=" . $sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
$id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
||||||
@ -267,25 +264,25 @@ class BookKeeping extends CommonObject
|
|||||||
$result = - 2;
|
$result = - 2;
|
||||||
$error ++;
|
$error ++;
|
||||||
$this->errors[] = 'Error Create Error ' . $result . ' lecture ID';
|
$this->errors[] = 'Error Create Error ' . $result . ' lecture ID';
|
||||||
dol_syslog(__METHOD__ . ' $result='.$result.' ' . implode(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$result = - 1;
|
$result = - 1;
|
||||||
$error ++;
|
$error ++;
|
||||||
$this->errors[] = 'Error ' . $this->db->lasterror();
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
dol_syslog(__METHOD__ . ' $result='.$result.' ' . implode(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$result = - 3;
|
$result = - 3;
|
||||||
$error ++;
|
$error ++;
|
||||||
$this->errors[] = $langs->trans('BookeppingLineAlreayExists');
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
dol_syslog(__METHOD__ . ' $result='.$result.' ' . implode(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$result = - 5;
|
$result = - 5;
|
||||||
$error ++;
|
$error ++;
|
||||||
$this->errors[] = 'Error ' . $this->db->lasterror();
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
dol_syslog(__METHOD__ . ' $result='.$result.' '. implode(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
@ -531,6 +528,118 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load object in memory from the database
|
||||||
|
*
|
||||||
|
* @param string $sortorder Sort Order
|
||||||
|
* @param string $sortfield Sort field
|
||||||
|
* @param int $limit offset limit
|
||||||
|
* @param int $offset offset limit
|
||||||
|
* @param array $filter filter array
|
||||||
|
* @param string $filtermode filter mode (AND or OR)
|
||||||
|
*
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
public function fetchAllByAccount($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') {
|
||||||
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
|
$sql = 'SELECT';
|
||||||
|
$sql .= ' t.rowid,';
|
||||||
|
|
||||||
|
$sql .= " t.doc_date,";
|
||||||
|
$sql .= " t.doc_type,";
|
||||||
|
$sql .= " t.doc_ref,";
|
||||||
|
$sql .= " t.fk_doc,";
|
||||||
|
$sql .= " t.fk_docdet,";
|
||||||
|
$sql .= " t.code_tiers,";
|
||||||
|
$sql .= " t.numero_compte,";
|
||||||
|
$sql .= " t.label_compte,";
|
||||||
|
$sql .= " t.debit,";
|
||||||
|
$sql .= " t.credit,";
|
||||||
|
$sql .= " t.montant,";
|
||||||
|
$sql .= " t.sens,";
|
||||||
|
$sql .= " t.fk_user_author,";
|
||||||
|
$sql .= " t.import_key,";
|
||||||
|
$sql .= " t.code_journal,";
|
||||||
|
$sql .= " t.piece_num";
|
||||||
|
|
||||||
|
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
|
||||||
|
|
||||||
|
// Manage filter
|
||||||
|
$sqlwhere = array ();
|
||||||
|
if (count($filter) > 0) {
|
||||||
|
foreach ( $filter as $key => $value ) {
|
||||||
|
if ($key == 't.doc_date') {
|
||||||
|
$sqlwhere[] = $key . '=\'' . $this->db->idate($value) . '\'';
|
||||||
|
} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') {
|
||||||
|
$sqlwhere[] = $key . '\'' . $this->db->idate($value) . '\'';
|
||||||
|
} elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.code_tiers>=' || $key == 't.code_tiers<=') {
|
||||||
|
$sqlwhere[] = $key . '\'' . $this->db->escape($value) . '\'';
|
||||||
|
} elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') {
|
||||||
|
$sqlwhere[] = $key . '=' . $value;
|
||||||
|
} elseif ($key == 't.code_tiers' || $key == 't.numero_compte') {
|
||||||
|
$sqlwhere[] = $key . ' LIKE \'' . $this->db->escape($value) . '%\'';
|
||||||
|
} elseif ($key == 't.label_compte') {
|
||||||
|
$sqlwhere[] = $key . ' LIKE \'' . $this->db->escape($value) . '%\'';
|
||||||
|
}else {
|
||||||
|
$sqlwhere[] = $key . ' LIKE \'%' . $this->db->escape($value) . '%\'';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($sqlwhere) > 0) {
|
||||||
|
$sql .= ' WHERE ' . implode(' ' . $filtermode . ' ', $sqlwhere);
|
||||||
|
}
|
||||||
|
// Affichage par compte comptable
|
||||||
|
$sql .= ' ORDER BY t.numero_compte ASC';
|
||||||
|
if (! empty($sortfield)) {
|
||||||
|
$sql .= ', ' . $sortfield . ' ' .$sortorder;
|
||||||
|
}
|
||||||
|
if (! empty($limit)) {
|
||||||
|
$sql .= ' ' . $this->db->plimit($limit + 1, $offset);
|
||||||
|
}
|
||||||
|
$this->lines = array ();
|
||||||
|
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $this->db->num_rows($resql);
|
||||||
|
|
||||||
|
while ( $obj = $this->db->fetch_object($resql) ) {
|
||||||
|
$line = new BookKeepingLine();
|
||||||
|
|
||||||
|
$line->id = $obj->rowid;
|
||||||
|
|
||||||
|
$line->doc_date = $this->db->jdate($obj->doc_date);
|
||||||
|
$line->doc_type = $obj->doc_type;
|
||||||
|
$line->doc_ref = $obj->doc_ref;
|
||||||
|
$line->fk_doc = $obj->fk_doc;
|
||||||
|
$line->fk_docdet = $obj->fk_docdet;
|
||||||
|
$line->code_tiers = $obj->code_tiers;
|
||||||
|
$line->numero_compte = $obj->numero_compte;
|
||||||
|
$line->label_compte = $obj->label_compte;
|
||||||
|
$line->debit = $obj->debit;
|
||||||
|
$line->credit = $obj->credit;
|
||||||
|
$line->montant = $obj->montant;
|
||||||
|
$line->sens = $obj->sens;
|
||||||
|
$line->fk_user_author = $obj->fk_user_author;
|
||||||
|
$line->import_key = $obj->import_key;
|
||||||
|
$line->code_journal = $obj->code_journal;
|
||||||
|
$line->piece_num = $obj->piece_num;
|
||||||
|
|
||||||
|
$this->lines[] = $line;
|
||||||
|
}
|
||||||
|
$this->db->free($resql);
|
||||||
|
|
||||||
|
return $num;
|
||||||
|
} else {
|
||||||
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
|
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||||
|
|
||||||
|
return - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load object in memory from the database
|
* Load object in memory from the database
|
||||||
*
|
*
|
||||||
@ -947,49 +1056,6 @@ class BookKeeping extends CommonObject
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete bookkepping by year
|
|
||||||
*
|
|
||||||
* @param string $delyear year to delete
|
|
||||||
* @param string $deljournal journal to delete
|
|
||||||
* @return int Result
|
|
||||||
*/
|
|
||||||
function deleteByYearAndJournal($delyear,$deljournal) {
|
|
||||||
$this->db->begin();
|
|
||||||
|
|
||||||
$sqlwhere=array();
|
|
||||||
|
|
||||||
// first check if line not yet in bookkeeping
|
|
||||||
$sql = "DELETE";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
|
||||||
if (!empty($delyear)) {
|
|
||||||
$sqlwhere[] .= " YEAR(doc_date) = " . $delyear;
|
|
||||||
}
|
|
||||||
if (!empty($deljournal)) {
|
|
||||||
$sqlwhere[] .= " code_journal = '" . $this->db->escape($deljournal)."'";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count($sqlwhere)>0) {
|
|
||||||
$sql.=" WHERE ".implode(' AND ', $sqlwhere);
|
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
|
||||||
|
|
||||||
if (! $resql) {
|
|
||||||
$this->errors[] = "Error " . $this->db->lasterror();
|
|
||||||
foreach ( $this->errors as $errmsg ) {
|
|
||||||
dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR);
|
|
||||||
$this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
|
|
||||||
}
|
|
||||||
$this->db->rollback();
|
|
||||||
return - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->db->commit();
|
|
||||||
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete bookkepping by piece number
|
* Delete bookkepping by piece number
|
||||||
*
|
*
|
||||||
@ -1248,7 +1314,123 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return list of accounts with label by chart of accounts
|
||||||
|
*
|
||||||
|
* @param string $selectid Preselected chart of accounts
|
||||||
|
* @param string $htmlname Name of field in html form
|
||||||
|
* @param int $showempty Add an empty field
|
||||||
|
* @param array $event Event options
|
||||||
|
* @param int $select_in $selectid value is a aa.rowid (0 default) or aa.account_number (1)
|
||||||
|
* @param int $select_out set value returned by select 0=rowid (default), 1=account_number
|
||||||
|
* @param int $aabase set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
|
||||||
|
*
|
||||||
|
* @return string String with HTML select
|
||||||
|
*/
|
||||||
|
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '') {
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
|
||||||
|
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||||
|
|
||||||
|
$sql = "SELECT DISTINCT ab.numero_compte as account_number, aa.label as label, aa.rowid as rowid, aa.fk_pcg_version";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.account_number = ab.numero_compte";
|
||||||
|
$sql .= " AND aa.active = 1";
|
||||||
|
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||||
|
$sql .= " AND asy.rowid = " . $pcgver;
|
||||||
|
$sql .= " ORDER BY account_number ASC";
|
||||||
|
|
||||||
|
dol_syslog(get_class($this) . "::select_account", LOG_DEBUG);
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
|
if (!$resql) {
|
||||||
|
$this->error = "Error " . $this->db->lasterror();
|
||||||
|
dol_syslog(get_class($this) . "::select_account " . $this->error, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$out = ajax_combobox($htmlname, $event);
|
||||||
|
|
||||||
|
$options = array();
|
||||||
|
$selected = null;
|
||||||
|
|
||||||
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
$label = length_accountg($obj->account_number) . ' - ' . $obj->label;
|
||||||
|
$label = dol_trunc($label, $trunclength);
|
||||||
|
|
||||||
|
$select_value_in = $obj->rowid;
|
||||||
|
$select_value_out = $obj->rowid;
|
||||||
|
|
||||||
|
if ($select_in == 1) {
|
||||||
|
$select_value_in = $obj->account_number;
|
||||||
|
}
|
||||||
|
if ($select_out == 1) {
|
||||||
|
$select_value_out = $obj->account_number;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remember guy's we store in database llx_facturedet the rowid of accounting_account and not the account_number
|
||||||
|
// Because same account_number can be share between different accounting_system and do have the same meaning
|
||||||
|
if (($selectid != '') && $selectid == $select_value_in) {
|
||||||
|
$selected = $select_value_out;
|
||||||
|
}
|
||||||
|
|
||||||
|
$options[$select_value_out] = $label;
|
||||||
|
}
|
||||||
|
|
||||||
|
$out .= Form::selectarray($htmlname, $options, $selected, $showempty, 0, 0, '', 0, 0, 0, '', 'maxwidth300');
|
||||||
|
$this->db->free($resql);
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Description of a root accounting account
|
||||||
|
*
|
||||||
|
* @param string $account Accounting account
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function get_compte_racine($account = null)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||||
|
|
||||||
|
|
||||||
|
$sql = "SELECT root.account_number, root.label as label";
|
||||||
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||||
|
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||||
|
$sql .= " AND asy.rowid = " . $pcgver;
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as parent ON aa.account_parent = parent.rowid";
|
||||||
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as root ON parent.account_parent = root.rowid";
|
||||||
|
$sql .= " WHERE aa.account_number = '" . $account . "'";
|
||||||
|
$sql .= " AND parent.active = 1";
|
||||||
|
$sql .= " AND root.active = 1";
|
||||||
|
|
||||||
|
|
||||||
|
dol_syslog(get_class($this) . "::select_account sql=" . $sql, LOG_DEBUG);
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$obj = '';
|
||||||
|
if ($this->db->num_rows($resql)) {
|
||||||
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $obj->label;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$this->error = "Error " . $this->db->lasterror();
|
||||||
|
dol_syslog(__METHOD__ . " " . $this->error, LOG_ERR);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* Description of accounting account
|
* Description of accounting account
|
||||||
*
|
*
|
||||||
* @param string $account Accounting account
|
* @param string $account Accounting account
|
||||||
@ -1258,7 +1440,6 @@ class BookKeeping extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||||
|
|
||||||
$sql = "SELECT aa.account_number, aa.label, aa.rowid, aa.fk_pcg_version, cat.label as category";
|
$sql = "SELECT aa.account_number, aa.label, aa.rowid, aa.fk_pcg_version, cat.label as category";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa ";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa ";
|
||||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||||
@ -1266,7 +1447,6 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= " AND asy.rowid = " . $pcgver;
|
$sql .= " AND asy.rowid = " . $pcgver;
|
||||||
$sql .= " AND aa.active = 1";
|
$sql .= " AND aa.active = 1";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_accounting_category as cat ON aa.fk_accounting_category = cat.rowid";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_accounting_category as cat ON aa.fk_accounting_category = cat.rowid";
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::select_account sql=" . $sql, LOG_DEBUG);
|
dol_syslog(get_class($this) . "::select_account sql=" . $sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
@ -1284,7 +1464,6 @@ class BookKeeping extends CommonObject
|
|||||||
} else {
|
} else {
|
||||||
$this->error = "Error " . $this->db->lasterror();
|
$this->error = "Error " . $this->db->lasterror();
|
||||||
dol_syslog(__METHOD__ . " " . $this->error, LOG_ERR);
|
dol_syslog(__METHOD__ . " " . $this->error, LOG_ERR);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,12 +17,12 @@
|
|||||||
*/
|
*/
|
||||||
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
|
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
|
||||||
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
|
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
|
||||||
|
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME;
|
||||||
|
|
||||||
$date_export = dol_print_date($now, '%Y%m%d%H%M%S');
|
$date_export = dol_print_date($now, '%Y%m%d%H%M%S');
|
||||||
|
|
||||||
header('Content-Type: text/csv');
|
header('Content-Type: text/csv');
|
||||||
if ($prefix)
|
|
||||||
$filename = $prefix . "_" . "journal_" . $journal . $date_export . "." . $format;
|
$filename = ($prefix?$prefix . "_":""). "journal_" . $journal . ($nodateexport?"":$date_export) . "." . $format;
|
||||||
else
|
|
||||||
$filename = "journal_" . $journal . $date_export . "." . $format;
|
|
||||||
header('Content-Disposition: attachment;filename=' . $filename);
|
header('Content-Disposition: attachment;filename=' . $filename);
|
||||||
@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2012-2016 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2012-2016 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -1418,11 +1418,11 @@ else
|
|||||||
// Login
|
// Login
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
||||||
|
|
||||||
// Morphy
|
// Morphy
|
||||||
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
||||||
@ -1463,7 +1463,7 @@ else
|
|||||||
print '<table class="border tableforfield" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Birthday
|
// Birthday
|
||||||
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
|
||||||
|
|
||||||
// Public
|
// Public
|
||||||
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
||||||
|
|||||||
@ -591,11 +591,11 @@ if ($rowid > 0)
|
|||||||
// Login
|
// Login
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
||||||
|
|
||||||
// Morphy
|
// Morphy
|
||||||
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
||||||
@ -630,7 +630,7 @@ if ($rowid > 0)
|
|||||||
print '<table class="border tableforfield" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Birthday
|
// Birthday
|
||||||
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
|
||||||
|
|
||||||
// Public
|
// Public
|
||||||
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -353,7 +354,7 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
if (count($this->errors))
|
if (count($this->errors))
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::create ".join(',',$this->errors), LOG_ERR);
|
dol_syslog(get_class($this)."::create ".implode(',',$this->errors), LOG_ERR);
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -419,14 +419,16 @@ if ($rowid && $action != 'edit')
|
|||||||
print $formfile->showdocuments('facture', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
print $formfile->showdocuments('facture', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
||||||
$somethingshown = $formfile->numoffiles;
|
$somethingshown = $formfile->numoffiles;
|
||||||
*/
|
*/
|
||||||
// Linked object block
|
// Show links to link elements
|
||||||
$somethingshown = $form->showLinkedObjectBlock($object);
|
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('subscription'));
|
||||||
|
$somethingshown = $form->showLinkedObjectBlock($object, '');
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
|
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
|
||||||
if ($linktoelem) print '<br>'.$linktoelem;
|
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
|
|
||||||
// Link for paypal payment
|
// Link for paypal payment
|
||||||
|
/*
|
||||||
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
|
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
|
||||||
include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
|
include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
|
||||||
print showPaypalPaymentUrl('invoice', $object->ref);
|
print showPaypalPaymentUrl('invoice', $object->ref);
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -83,7 +84,7 @@ $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search
|
|||||||
// List of fields to search into when doing a "search in all"
|
// List of fields to search into when doing a "search in all"
|
||||||
$fieldstosearchall = array(
|
$fieldstosearchall = array(
|
||||||
'd.rowid'=>'Ref',
|
'd.rowid'=>'Ref',
|
||||||
//'d.ref'=>'Ref',
|
'd.login'=>'Login',
|
||||||
'd.lastname'=>'Lastname',
|
'd.lastname'=>'Lastname',
|
||||||
'd.firstname'=>'Firstname',
|
'd.firstname'=>'Firstname',
|
||||||
'd.login'=>'Login',
|
'd.login'=>'Login',
|
||||||
@ -328,7 +329,7 @@ if ($resql)
|
|||||||
if ($sall)
|
if ($sall)
|
||||||
{
|
{
|
||||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
print $langs->trans("FilterOnInto", $sall) . implode(', ',$fieldstosearchall);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter on categories
|
// Filter on categories
|
||||||
|
|||||||
@ -54,7 +54,7 @@ $langs->load("companies");
|
|||||||
|
|
||||||
$memberstatic=new Adherent($db);
|
$memberstatic=new Adherent($db);
|
||||||
|
|
||||||
llxHeader('',$langs->trans("MembersStatisticsByProperties"),'','',0,0,array('http://www.google.com/jsapi'));
|
llxHeader('',$langs->trans("MembersStatisticsByProperties"),'','',0,0,array('https://www.google.com/jsapi'));
|
||||||
|
|
||||||
$title=$langs->trans("MembersStatisticsByProperties");
|
$title=$langs->trans("MembersStatisticsByProperties");
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ $langs->load("companies");
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$arrayjs=array('http://www.google.com/jsapi');
|
$arrayjs=array('https://www.google.com/jsapi');
|
||||||
if (! empty($conf->dol_use_jmobile)) $arrayjs=array();
|
if (! empty($conf->dol_use_jmobile)) $arrayjs=array();
|
||||||
|
|
||||||
$title=$langs->trans("Statistics");
|
$title=$langs->trans("Statistics");
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2015 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-2013 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>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -36,7 +37,11 @@ $langs->load("admin");
|
|||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
|
$value = GETPOST('value','alpha');
|
||||||
|
$param = GETPOST('param','alpha');
|
||||||
$cancel = GETPOST('cancel','alpha');
|
$cancel = GETPOST('cancel','alpha');
|
||||||
|
$scandir = GETPOST('scandir','alpha');
|
||||||
|
$type = 'action';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -71,7 +76,21 @@ if (preg_match('/del_(.*)/',$action,$reg))
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
|
||||||
|
if ($action == 'setModuleOptions')
|
||||||
|
{
|
||||||
|
|
||||||
|
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($action == 'set')
|
if ($action == 'set')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, 'AGENDA_USE_EVENT_TYPE_DEFAULT', GETPOST('AGENDA_USE_EVENT_TYPE_DEFAULT'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, 'AGENDA_USE_EVENT_TYPE_DEFAULT', GETPOST('AGENDA_USE_EVENT_TYPE_DEFAULT'), 'chaine', 0, '', $conf->entity);
|
||||||
@ -79,6 +98,85 @@ if ($action == 'set')
|
|||||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
|
||||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
|
else if ($action == 'specimen') // For orders
|
||||||
|
{
|
||||||
|
$modele=GETPOST('module','alpha');
|
||||||
|
|
||||||
|
$commande = new CommandeFournisseur($db);
|
||||||
|
$commande->initAsSpecimen();
|
||||||
|
$commande->thirdparty=$specimenthirdparty;
|
||||||
|
|
||||||
|
// Search template files
|
||||||
|
$file=''; $classname=''; $filefound=0;
|
||||||
|
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||||
|
foreach($dirmodels as $reldir)
|
||||||
|
{
|
||||||
|
$file=dol_buildpath($reldir."core/modules/action/doc/pdf_".$modele.".modules.php",0);
|
||||||
|
if (file_exists($file))
|
||||||
|
{
|
||||||
|
$filefound=1;
|
||||||
|
$classname = "pdf_".$modele;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($filefound)
|
||||||
|
{
|
||||||
|
require_once $file;
|
||||||
|
|
||||||
|
$module = new $classname($db,$commande);
|
||||||
|
|
||||||
|
if ($module->write_file($commande,$langs) > 0)
|
||||||
|
{
|
||||||
|
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($module->error, $module->errors, 'errors');
|
||||||
|
dol_syslog($module->error, LOG_ERR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Activate a model
|
||||||
|
else if ($action == 'setmodel')
|
||||||
|
{
|
||||||
|
print "sssd".$value;
|
||||||
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ($action == 'del')
|
||||||
|
{
|
||||||
|
$ret = delDocumentModel($value, $type);
|
||||||
|
if ($ret > 0)
|
||||||
|
{
|
||||||
|
if ($conf->global->ACTION_EVENT_ADDON_PDF == "$value") dolibarr_del_const($db, 'ACTION_EVENT_ADDON_PDF',$conf->entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set default model
|
||||||
|
else if ($action == 'setdoc')
|
||||||
|
{
|
||||||
|
if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
|
{
|
||||||
|
// La constante qui a ete lue en avant du nouveau set
|
||||||
|
// on passe donc par une variable pour avoir un affichage coherent
|
||||||
|
$conf->global->ACTION_EVENT_ADDON_PDF = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// On active le modele
|
||||||
|
$ret = delDocumentModel($value, $type);
|
||||||
|
if ($ret > 0)
|
||||||
|
{
|
||||||
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,7 +184,7 @@ if ($action == 'set')
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$formactions=new FormActions($db);
|
$formactions=new FormActions($db);
|
||||||
|
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
@ -95,14 +193,151 @@ print "<br>\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
|
|
||||||
print '<input type="hidden" name="action" value="set">';
|
|
||||||
|
|
||||||
$head=agenda_prepare_head();
|
$head=agenda_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'other', $langs->trans("Agenda"), 0, 'action');
|
dol_fiche_head($head, 'other', $langs->trans("Agenda"), 0, 'action');
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documents models for supplier orders
|
||||||
|
*/
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("AgendaModelModule"),'','');
|
||||||
|
|
||||||
|
// Define array def of models
|
||||||
|
$def = array();
|
||||||
|
|
||||||
|
$sql = "SELECT nom";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql.= " WHERE type = 'action'";
|
||||||
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
|
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
$num_rows=$db->num_rows($resql);
|
||||||
|
while ($i < $num_rows)
|
||||||
|
{
|
||||||
|
$array = $db->fetch_array($resql);
|
||||||
|
array_push($def, $array[0]);
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">'."\n";
|
||||||
|
print '<tr class="liste_titre">'."\n";
|
||||||
|
print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
|
||||||
|
print '<td>'.$langs->trans("Description").'</td>'."\n";
|
||||||
|
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
|
||||||
|
print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
|
||||||
|
print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
|
||||||
|
print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
clearstatcache();
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
foreach ($dirmodels as $reldir)
|
||||||
|
{
|
||||||
|
$dir = dol_buildpath($reldir."core/modules/action/doc/");
|
||||||
|
|
||||||
|
if (is_dir($dir))
|
||||||
|
{
|
||||||
|
$handle=opendir($dir);
|
||||||
|
if (is_resource($handle))
|
||||||
|
{
|
||||||
|
while (($file = readdir($handle))!==false)
|
||||||
|
{
|
||||||
|
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
|
||||||
|
{
|
||||||
|
$name = substr($file, 4, dol_strlen($file) -16);
|
||||||
|
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||||
|
|
||||||
|
require_once $dir.'/'.$file;
|
||||||
|
$module = new $classname($db, new ActionComm($db));
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">\n";
|
||||||
|
print "<td>";
|
||||||
|
print (empty($module->name)?$name:$module->name);
|
||||||
|
print "</td>\n";
|
||||||
|
print "<td>\n";
|
||||||
|
require_once $dir.$file;
|
||||||
|
$module = new $classname($db,$specimenthirdparty);
|
||||||
|
if (method_exists($module,'info'))
|
||||||
|
print $module->info($langs);
|
||||||
|
else
|
||||||
|
print $module->description;
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
|
// Active
|
||||||
|
if (in_array($name, $def))
|
||||||
|
{
|
||||||
|
|
||||||
|
print '<td align="center">'."\n";
|
||||||
|
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
|
||||||
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
|
}
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="center">'."\n";
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default
|
||||||
|
print '<td align="center">';
|
||||||
|
if ($conf->global->ACTION_EVENT_ADDON_PDF == "$name")
|
||||||
|
{
|
||||||
|
print img_picto($langs->trans("Default"),'on');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Info
|
||||||
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
|
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||||
|
print '<td align="center">';
|
||||||
|
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="center">';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</table><br>';
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
|
||||||
|
print '<input type="hidden" name="action" value="set">';
|
||||||
|
|
||||||
print '<table class="noborder allwidth">'."\n";
|
print '<table class="noborder allwidth">'."\n";
|
||||||
print '<tr class="liste_titre">'."\n";
|
print '<tr class="liste_titre">'."\n";
|
||||||
|
|||||||
@ -602,6 +602,8 @@ print "</td></tr>\n";
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
// Shippable Icon in List
|
// Shippable Icon in List
|
||||||
|
/* Kept as hidden feature for the moment, result seems bugged.
|
||||||
|
Whet is definition of "shippable" according to all different STOCK_CALCULATE_... options ?
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td>'.$langs->trans("ShippableOrderIconInList").'</td>';
|
print '<td>'.$langs->trans("ShippableOrderIconInList").'</td>';
|
||||||
@ -617,6 +619,8 @@ if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) {
|
|||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
/* Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation.
|
||||||
|
/*
|
||||||
// Ask for payment bank during order
|
// Ask for payment bank during order
|
||||||
if ($conf->banque->enabled)
|
if ($conf->banque->enabled)
|
||||||
{
|
{
|
||||||
@ -676,6 +680,7 @@ else
|
|||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td> </td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
|
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td> </td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
||||||
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
||||||
@ -596,7 +596,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
if ($value == 'color' && empty($_POST['color'])) continue;
|
if ($value == 'color' && empty($_POST['color'])) continue;
|
||||||
if ($value == 'formula' && empty($_POST['formula'])) continue;
|
if ($value == 'formula' && empty($_POST['formula'])) continue;
|
||||||
if ((! isset($_POST[$value]) || $_POST[$value]=='')
|
if ((! isset($_POST[$value]) || $_POST[$value]=='')
|
||||||
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy'))) // Fields that are not mandatory
|
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory
|
||||||
|
&& (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
|
||||||
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$ok=0;
|
$ok=0;
|
||||||
@ -1085,7 +1087,7 @@ if ($id)
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail=new FormMail($db);
|
$formmail=new FormMail($db);
|
||||||
$tmp=$formmail->getAvailableSubstitKey('form');
|
$tmp=$formmail->getAvailableSubstitKey('form');
|
||||||
print join(', ', $tmp);
|
print implode(', ', $tmp);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -372,7 +372,6 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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>';
|
||||||
|
|||||||
@ -56,7 +56,7 @@ $conditions = array(
|
|||||||
'SOCIETE' => 1,
|
'SOCIETE' => 1,
|
||||||
'PRODUCTDESC' => (! empty($conf->product->enabled) || ! empty($conf->service->enabled)),
|
'PRODUCTDESC' => (! empty($conf->product->enabled) || ! empty($conf->service->enabled)),
|
||||||
'MAILING' => ! empty($conf->mailing->enabled),
|
'MAILING' => ! empty($conf->mailing->enabled),
|
||||||
'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)),
|
'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->supplier_proposal->enabled) || ! empty($conf->fournisseur->enabled)),
|
||||||
'USERSIGN' => 1,
|
'USERSIGN' => 1,
|
||||||
'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled))
|
'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled))
|
||||||
);
|
);
|
||||||
|
|||||||
@ -232,6 +232,20 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
|
|||||||
{
|
{
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
} elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
|
||||||
|
$val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha');
|
||||||
|
$res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '',
|
||||||
|
$conf->entity);
|
||||||
|
|
||||||
|
if (!$res > 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -568,7 +582,22 @@ print '/>';
|
|||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
// Use services duration
|
||||||
|
$var = !$var;
|
||||||
|
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||||
|
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
|
print '<input type="hidden" name="action" value="set_FICHINTER_USE_SERVICE_DURATION">';
|
||||||
|
print '<tr ' . $bc[$var] . '>';
|
||||||
|
print '<td>';
|
||||||
|
print $langs->trans("UseServicesDurationOnFichinter");
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="center">';
|
||||||
|
print '<input type="checkbox" name="FICHINTER_USE_SERVICE_DURATION"' . ($conf->global->FICHINTER_USE_SERVICE_DURATION?' checked':'') . '>';
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right">';
|
||||||
|
print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -75,28 +76,32 @@ if ($action == 'update')
|
|||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array()))));
|
$val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array()))));
|
||||||
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity);
|
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity);
|
||||||
else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())),'chaine',0,'',$conf->entity);
|
else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', implode(',',colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())),'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
|
$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
|
||||||
|
if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity);
|
||||||
|
else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'),'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
|
$val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
|
||||||
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
|
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
|
||||||
else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', join(',',colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())),'chaine',0,'',$conf->entity);
|
else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', implode(',',colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())),'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array()))));
|
$val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array()))));
|
||||||
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
|
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
|
||||||
else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity);
|
else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', implode(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array()))));
|
$val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array()))));
|
||||||
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity);
|
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity);
|
||||||
else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', join(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array())),'chaine',0,'',$conf->entity);
|
else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', implode(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array())),'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_del_const($db, "THEME_ELDY_USE_HOVER", $conf->entity);
|
if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_del_const($db, "THEME_ELDY_USE_HOVER", $conf->entity);
|
||||||
else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
|
else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array()))));
|
$val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array()))));
|
||||||
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity);
|
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity);
|
||||||
else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', join(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())),'chaine',0,'',$conf->entity);
|
else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', implode(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())),'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
|
||||||
|
|||||||
@ -237,7 +237,7 @@ else
|
|||||||
{
|
{
|
||||||
print '<input size="25" type="text" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';
|
print '<input size="25" type="text" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';
|
||||||
}
|
}
|
||||||
print '</td><td>secret</td></tr>';
|
print '</td><td>'.$langs->trans('Password').' (ex: secret)</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -437,7 +437,7 @@ if (function_exists("ldap_connect"))
|
|||||||
print "search: *<br>\n";
|
print "search: *<br>\n";
|
||||||
print "userDN: ".$conf->global->LDAP_USER_DN."<br>\n";
|
print "userDN: ".$conf->global->LDAP_USER_DN."<br>\n";
|
||||||
print "useridentifier: ".$conf->global->LDAP_KEY_USERS."<br>\n";
|
print "useridentifier: ".$conf->global->LDAP_KEY_USERS."<br>\n";
|
||||||
print "required_fields: ".join(',',$required_fields)."<br>\n";
|
print "required_fields: ".implode(',',$required_fields)."<br>\n";
|
||||||
print "=> ".count($liste)." records<br>\n";
|
print "=> ".count($liste)." records<br>\n";
|
||||||
print "\n<br>";
|
print "\n<br>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -243,7 +243,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes')
|
|||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."menu WHERE rowid = ".$_GET['menuId'];
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."menu WHERE rowid = ".GETPOST('menuId', 'int');
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
|
|
||||||
if ($result == 0)
|
if ($result == 0)
|
||||||
@ -312,7 +312,7 @@ if ($action == 'create')
|
|||||||
$parent_rowid = $_GET['menuId'];
|
$parent_rowid = $_GET['menuId'];
|
||||||
if ($_GET['menuId'])
|
if ($_GET['menuId'])
|
||||||
{
|
{
|
||||||
$sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs FROM ".MAIN_DB_PREFIX."menu as m WHERE m.rowid = ".$_GET['menuId'];
|
$sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs FROM ".MAIN_DB_PREFIX."menu as m WHERE m.rowid = ".GETPOST('menuId', 'int');
|
||||||
$res = $db->query($sql);
|
$res = $db->query($sql);
|
||||||
if ($res)
|
if ($res)
|
||||||
{
|
{
|
||||||
@ -370,7 +370,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td><input type="text" size="40" id="menuId" name="menuId" value="'.($_POST["menuId"]?$_POST["menuId"]:'').'"></td>';
|
print '<td><input type="text" size="48" id="menuId" name="menuId" value="'.($_POST["menuId"]?$_POST["menuId"]:'').'"></td>';
|
||||||
}
|
}
|
||||||
print '<td>'.$langs->trans('DetailMenuIdParent');
|
print '<td>'.$langs->trans('DetailMenuIdParent');
|
||||||
print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
|
print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
|
||||||
@ -458,7 +458,7 @@ elseif ($action == 'edit')
|
|||||||
$valtouse=$menu->fk_menu;
|
$valtouse=$menu->fk_menu;
|
||||||
if ($menu->fk_mainmenu) $valtouse='fk_mainmenu='.$menu->fk_mainmenu;
|
if ($menu->fk_mainmenu) $valtouse='fk_mainmenu='.$menu->fk_mainmenu;
|
||||||
if ($menu->fk_leftmenu) $valtouse.='&fk_leftmenu='.$menu->fk_leftmenu;
|
if ($menu->fk_leftmenu) $valtouse.='&fk_leftmenu='.$menu->fk_leftmenu;
|
||||||
print '<td><input type="text" name="menuIdParent" value="'.$valtouse.'" size="40"></td>';
|
print '<td><input type="text" name="menuIdParent" value="'.$valtouse.'" size="48"></td>';
|
||||||
print '<td>'.$langs->trans('DetailMenuIdParent');
|
print '<td>'.$langs->trans('DetailMenuIdParent');
|
||||||
print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
|
print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -470,7 +470,7 @@ elseif ($action == 'edit')
|
|||||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" size="30" name="titre" value="'.$menu->titre.'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" size="30" name="titre" value="'.$menu->titre.'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||||
|
|
||||||
// Url
|
// Url
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" size="60" name="url" value="'.$menu->url.'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" class="quatrevingtpercent" name="url" value="'.$menu->url.'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
|
||||||
|
|
||||||
// Langs
|
// Langs
|
||||||
print '<tr><td>'.$langs->trans('LangFile').'</td><td><input type="text" size="30" name="langs" value="'.$menu->langs.'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
|
print '<tr><td>'.$langs->trans('LangFile').'</td><td><input type="text" size="30" name="langs" value="'.$menu->langs.'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
|
||||||
|
|||||||