Merge remote-tracking branch 'upstream/develop' into 3.7-webservices-fix

Conflicts:
	test/phpunit/WebservicesInvoicesTest.php
This commit is contained in:
Arnaud Aujon 2015-05-21 13:11:41 +02:00
commit 6d5555948e
2318 changed files with 154149 additions and 51052 deletions

17
.editorconfig Normal file
View File

@ -0,0 +1,17 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
[*.php]
indent_style = tab
[*.js]
indent_style = tab
[*.css]
indent_style = tab
[*.xml]
indent_style = tab

1
.gitignore vendored
View File

@ -9,6 +9,7 @@ default.properties
.buildpath
.gitmodules
dolibarr_install.log
upgrade.log
doxygen_warnings.log
/.project
.DS_Store

91
.mailmap Normal file
View File

@ -0,0 +1,91 @@
# This is mapping list between real user name/email and entry into sources files
# If you don't want to have your real email appears here, just send a Pull Request to
# replace the second field between <> with <secret>
Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <eldy@users.sourceforge.net>
Laurent Destailleur <eldy@destailleur.fr> eldy <eldy@destailleur.fr>
Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <ldestailleur@teclib.com>
Laurent Destailleur <eldy@destailleur.fr> eldy10 <eldy10@master8.(none)>
Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <ephpcsdy@destailleur.fr>
Regis Houssin <regis.houssin@capnetworks.com> Regis Houssin <regis@dolibarr.fr>
Regis Houssin <regis.houssin@capnetworks.com> Régis Houssin <regishoussin@device5.home>
Juanjo Menent <jmenent@2byte.es> simnandez <jmenent@2byte.es>
Juanjo Menent <jmenent@2byte.es> Juanjo Menent <simnandez@gmail.com>
Juanjo Menent <jmenent@2byte.es> Simnandez <jmenent@2byte.es>
Juanjo Menent <jmenent@2byte.es> juanjo <juanjo@samsung>
Juanjo Menent <jmenent@2byte.es> juanjo <juanjo@alienware>
Marcos García de La Fuente <marcosgdf@gmail.com> Marcos García <marcosgdf@gmail.com>
Marcos García de La Fuente <marcosgdf@gmail.com> Marcos García <marcosgdf@gmail.com>
Florian Henry <florian.henry@open-concept.pro> fhenry <florian.henry@open-concept.pro>
Florian Henry <florian.henry@open-concept.pro> Florian HENRY <florian.henry@open-concept.pro>
Florian Henry <florian.henry@open-concept.pro> FHenry <florian.henry.mail@gmail.com>
Florian Henry <florian.henry@open-concept.pro> Florian HENRY <florian.henry@open-conept.pro>
Florian Henry <florian.henry@open-concept.pro> FHenry <florian.henry@open-concept.pro>
Florian Henry <florian.henry@open-concept.pro> HENRY Florian <florian.henry@open-concept.pro>
Alexandre Spangaro <alexandre.spangaro@gmail.com> aspangaro <alexandre.spangaro@gmail.com>
Alexandre Spangaro <alexandre.spangaro@gmail.com> Spangaro Alexandre <alexandre.spangaro@gmail.com>
Alexandre Spangaro <alexandre.spangaro@gmail.com> Alexandre SPANGARO <alexandre.spangaro@gmail.com>
Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> Raphaël Doursenaud <rdoursenaud@free.fr>
Philippe Grand <philippe.grand@atoo-net.com> Grand Philippe <contact@atoo-net.com>
Philippe Grand <philippe.grand@atoo-net.com> Philippe GRAND <philippe.grand@atoo-net.com>
Philippe Grand <philippe.grand@atoo-net.com> philippe grand <philippe.grand@atoo-net.com>
Philippe Grand <philippe.grand@atoo-net.com> philippe <philippe.grand@atoo-net.com>
Philippe Grand <philippe.grand@atoo-net.com> unknown <Philippe@grandoc.(none)>
Philippe Grand <philippe.grand@atoo-net.com> philippe <philippe@PC-de-philippe>
Philippe Grand <philippe.grand@atoo-net.com> Philippe Grand <contact@atoo-net.com>
Jean-François Ferry <jfefe@aternatik.fr> jfefe <jfefe@aternatik.fr>
Jean-François Ferry <jfefe@aternatik.fr> jfefe <jf.ferry@aternatik.fr>
Jean-François Ferry <jfefe@aternatik.fr> JF FERRY <jfefe@aternatik.fr>
Jean-François Ferry <jfefe@aternatik.fr> JF FERRY <meos@devmachine.(none)>
Charles Benke <charles.fr@benke.fr> BENKE Charles <charles.fr@benke.fr>
Charles Benke <charles.fr@benke.fr> BENKE Charlie <charles.fr@benke.fr>
Charles Benke <charles.fr@benke.fr> defrance69 <charles.fr@benke.fr>
Maxime Kohlhaas <mko@atm-consulting.fr> MAxime Kohlhaas <maxime@atm-consulting.fr>
Frédéric France <frederic.france@free.fr> Frédéric FRANCE <frederic.france@free.fr>
Frédéric France <frederic.france@free.fr> frederic34 <frederic.france@free.fr>
Frédéric France <frederic.france@free.fr> FRANCE Frédéric <frederic.france@free.fr>
Frédéric France <frederic.france@free.fr> frederic34 <fred@ubuntuserver.(none)>
Cyrille de Lambert <cyrille.delambert@auguria.net> cdelambert <cdelambert>
Cédric Gross <c.gross@kreiz-it.fr> KreizIT <KreizIT@users.noreply.github.com>
Cédric Gross <c.gross@kreiz-it.fr> Cedric <c.gross@kreiz-it.fr>
Cédric Gross <c.gross@kreiz-it.fr> Cedric GROSS <c.gross@kreiz-it.fr>
Jean Heimburger <jean@tiaris.info> jean <jean@tiaris.info>
Jean Heimburger <jean@tiaris.info> tiaris <tiaris>
Benoit Mortier <benoit.mortier@opensides.be> opensides <opensides>
Eric Seigne <contact@ryxeo.com> erics <erics>
Jean-Louis Bergamo <jl@bergamo.fr> jlb <jlb>
Remco Gerbrands <remco@artoge.nl> r2gnl <r2gnl>
Phf <phf@atm-consulting.fr> phf <phf@atm-consulting.fr>
Yannick Warnier <ywarnier@beeznest.org> ywarnier <ywarnier>
Jerome Warnier <jwarnier@beeznest.org> jwarnier <jwarnier>
Franky Van Liedekerke <liedekef@telenet.be> liedekef <liedekef>
Lalaina Rasamoelina <lalaina.rasamoelina@biblibre.com> lalaina rasamoelina <lalaina.rasamoelina@biblibre.com>
Marc Ocebo <marc_ocebo> marc_ocebo <marc_ocebo>
Unknown <secret> box7890 <box7890>
Unknown <secret> beedauchon <beedauchon>
Loic <secret> loic <loic>
Christophe Combelle <ccomb>
Unknown <secret> activdev <activdev>
Unknown <secret> bouba <bouba>
Unknown <secret> bcroq <bcroq>
Unknown <secret> dutoit <dutoit>
Unknown <secret> bureau2crea <bureau2crea>
Unknown <secret> unknown <mne02@.modula71.local>
Simon Tosser <secret> simontosser <simontosser>
Unknown <secret> tipaul <tipaul>
Raphaël Bertrand <secret> raphael_bertrand <raphael_bertrand>
Claudio Aschieri <c.aschieri@19.coop> cla <c.aschieri@19.coop>
Tommaso Basilici <t.basilici@19.coop> kaos <t.basilici@19.coop>
Tommaso Basilici <t.basilici@19.coop> Tommaso Basilici <t.basilici@19.coop>
Faust <faust@19.coop> faust <faust@19.coop>
Ferran Marcet <secret> fmarcet <fmarcet@imedia>
Geoffrey Girard <geoffre.girard@atm-consulting.fr> geoffrey.girard <geoffre.girard@atm-consulting.fr>
Bernard Paquier <eshop.bpaquier@gmail.com> BadPixxel <eshop.bpaquier@gmail.com>
Patrick Delcroix <delcroip@gmail.com> delcroix Patrick <delcroip@gmail.com>
Damien Clochard <damien@dalibo.com> damien clochard <damien@dalibo.info>
Damien Clochard <damien@dalibo.com> damien clochard <damien@dalibo.com>
Grégory David <groolot@groolot.net> Grégory DAVID <groolot@groolot.net>
Grégory David <groolot@groolot.net> Gregory DAVID <groolot@groolot.net>
Baffir Abbes <bafbes@users.noreply.github.com> bafbes <bafbes@users.noreply.github.com>
Kevin Guerrier <guerrier.k@gmail.com> GUERRIER Kevin <guerrier.k@gmail.com>
Remy Younes <ryounes@gmail.com> remy <ryounes@gmail.com>
Estephe Loridan <github@estephe.me> Estephe L. <github@estephe.me>

View File

@ -5,12 +5,13 @@ imports:
filter:
excluded_paths:
- 'build/*'
- 'dev/*'
- 'doc/*'
- 'test/*'
- 'htdocs/includes/*'
paths: { }
- build/*
- dev/*
- doc/*
- test/*
paths:
- htdocs/*
- scripts/*
tools:
# php_analyzer. Doc on https://scrutinizer-ci.com/docs/tools/php/php-analyzer/
@ -18,15 +19,18 @@ tools:
enabled: true
extensions:
- php
dependency_paths: { }
dependency_paths:
- htdocs/includes/
filter:
excluded_paths:
- 'build/*'
- 'dev/*'
- 'doc/*'
- 'test/*'
- 'htdocs/includes/*'
paths: { }
- build/*
- dev/*
- doc/*
- test/*
- htdocs/includes/*
paths:
- htdocs/
- scripts/
config:
parameter_reference_check:
enabled: true

View File

@ -8,6 +8,9 @@ notifications:
on_success: never # [always|never|change] default: change
on_failure: change # [always|never|change] default: always
addons:
postgresql: "9.3"
services:
- memcached # will start memcached
@ -15,9 +18,15 @@ services:
language: php
php:
# - "5.2" is not supported because pyrus to install PHP_Codesniffer is not available
- "5.3"
- "5.4"
- "5.5"
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
matrix:
allow_failures:
- php: 7.0
env:
- DB=mysql
@ -32,10 +41,12 @@ before_script:
# - echo Update composer
# - ~/.phpenv/versions/$(phpenv version-name)/bin/composer.phar self-update
- echo PHPUnit version
- which phpunit
- phpunit --version
- echo Install phpcs then show installed rules
- pyrus install pear/PHP_CodeSniffer
- phpenv rehash
- which phpcs
- phpcs --version
- phpcs -i
- echo Create dir $(pwd)/htdocs/documents
@ -55,7 +66,24 @@ before_script:
- sh -c "if [ '$PHPV' = '5.4' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- cat ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo Mysql version
# INSTALL MYSQL 5.6
# (https://github.com/piwik/piwik/commit/20bd2e1c24e5d673dce3feb256204ad48c29f160)
# TODO: Remove when mysql 5.6 is provided by travis.
# Otherwise, our migrations will raise a syntax error.
- "sudo apt-get remove mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5"
- "sudo apt-get autoremove"
- "sudo apt-get install libaio1"
- "wget -O mysql-5.6.14.deb http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-debian6.0-x86_64.deb/from/http://cdn.mysql.com/"
- "sudo dpkg -i mysql-5.6.14.deb"
- "sudo cp /opt/mysql/server-5.6/support-files/mysql.server /etc/init.d/mysql.server"
- "sudo ln -s /opt/mysql/server-5.6/bin/* /usr/bin/"
- "sudo sed -i'' 's/table_cache/table_open_cache/' /etc/mysql/my.cnf"
- "sudo sed -i'' 's/log_slow_queries/slow_query_log/' /etc/mysql/my.cnf"
- "sudo sed -i'' 's/basedir[^=]\\+=.*$/basedir = \\/opt\\/mysql\\/server-5.6/' /etc/mysql/my.cnf"
- "sudo /etc/init.d/mysql.server start"
- mysql --version
- mysql -e "SELECT VERSION();"
# /END MYSQL 5.6- mysql --version
- echo Init database
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS myapp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE myapp_test;' -U postgres; fi"
@ -84,6 +112,8 @@ before_script:
- sudo cat /etc/apache2/sites-available/default
- sudo /etc/init.d/apache2 restart
- wget http://localhost/
- sudo cat /etc/apache2/envvars
- sudo cat /var/log/apache2/error.log
- cat index.html
@ -91,14 +121,16 @@ before_script:
script:
- cd htdocs/install
- date
# - php upgrade.php 3.4.0 3.5.0 ignoredbversion > upgrade.log
# - php upgrade2.php 3.4.0 3.5.0 ignoredbversion > upgrade2.log
- php upgrade.php 3.5.0 3.6.0 ignoredbversion >> upgrade.log
- php upgrade2.php 3.5.0 3.6.0 ignoredbversion >> upgrade2.log
- php upgrade.php 3.6.0 3.7.0 ignoredbversion >> upgrade.log
# - cat upgrade360370.log
- php upgrade2.php 3.6.0 3.7.0 ignoredbversion >> upgrade2.log
# - cat upgrade2.log
# - php upgrade.php 3.4.0 3.5.0 ignoredbversion > upgrade340350.log
# - php upgrade2.php 3.4.0 3.5.0 ignoredbversion > upgrade340350-2.log
- php upgrade.php 3.5.0 3.6.0 ignoredbversion > upgrade350360.log
- php upgrade2.php 3.5.0 3.6.0 ignoredbversion > upgrade350360-2.log
- php upgrade.php 3.6.0 3.7.0 ignoredbversion > upgrade360370.log
- php upgrade2.php 3.6.0 3.7.0 ignoredbversion > upgrade360370-2.log
- php upgrade.php 3.7.0 3.8.0 ignoredbversion > upgrade370380.log
- cat upgrade370380.log
- php upgrade2.php 3.7.0 3.8.0 ignoredbversion > upgrade370380-2.log
# - cat upgrade370380-2.log
- cd ../..
- date
- phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php

View File

@ -146,6 +146,12 @@ source_file = htdocs/langs/en_US/holiday.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.incoterm]
file_filter = htdocs/langs/<lang>/incoterm.lang
source_file = htdocs/langs/en_US/incoterm.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.install]
file_filter = htdocs/langs/<lang>/install.lang
source_file = htdocs/langs/en_US/install.lang
@ -176,6 +182,12 @@ source_file = htdocs/langs/en_US/link.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.loan]
file_filter = htdocs/langs/<lang>/loan.lang
source_file = htdocs/langs/en_US/loan.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.mailmanspip]
file_filter = htdocs/langs/<lang>/mailmanspip.lang
source_file = htdocs/langs/en_US/mailmanspip.lang
@ -236,9 +248,9 @@ source_file = htdocs/langs/en_US/paypal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.printipp]
file_filter = htdocs/langs/<lang>/printipp.lang
source_file = htdocs/langs/en_US/printipp.lang
[dolibarr.printing]
file_filter = htdocs/langs/<lang>/printing.lang
source_file = htdocs/langs/en_US/printing.lang
source_lang = en_US
type = MOZILLAPROPERTIES

84
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,84 @@
How to contribute to Dolibarr
=============================
Bug reports and feature requests
--------------------------------
*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum).
**NEW**
Issues are now managed on [GitHub](https://github.com/Dolibarr/dolibarr/Issues).
1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem.
2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request.
3. Report with as much detail as possible ([Use screenshots or even screencasts whenever possible](https://help.github.com/articles/issue-attachments)).
We're still figuring out how to migrate old issues to GitHub. In the meantime, they are still available at [Doliforge](https://doliforge.org/projects/dolibarr).
<a name=code></a>Code
---------------------
### Basic workflow
1. [Fork](https://help.github.com/articles/fork-a-repo) the [GitHub repository](https://github.com/Dolibarr/dolibarr).
2. Clone your fork.
3. Choose a branch(See the [Branches](#branches) section below).
4. Commit and push your changes.
5. [Make a pull request](https://help.github.com/articles/creating-a-pull-request).
### <a name=branches></a>Branches
Unless you're fixing a bug, all pull requests should be made against the *develop* branch.
If you're fixing a bug, it is preferred that you cook your fix and pull request it
against the oldest version affected that's still supported.
We officially support versions N, N 1 and N 2 for N the latest version available.
Choose your base branch accordingly.
### General rules
Please don't edit the ChangeLog file. A project manager will update it from your commit messages.
### Commits
Use clear commit messages with the following structure:
<pre>
FIX|Fix #456 Short description (where #456 is number of bug fix, if it exists. In upper case to appear into ChangeLog)
or
CLOSE|Close #456 Short description (where #456 is number of feature request, if it exists. In upper case to appear into ChangeLog)
or
NEW|New Short description (In upper case to appear into ChangeLog, use this if you add a feature not tracked, otherwise use CLOSE #456)
or
Short description (when the commit is not introducing feature nor closing a bug)
Long description (Can span accross multiple lines).
</pre>
### Pull Requests
When submitting a pull request, use same rule than Commits. With upper case keyword to appear into ChangeLog.
### Resources
[Developer documentation](http://wiki.dolibarr.org/index.php/Developer_documentation)
Translations
------------
The source language (en_US) is maintained in the repository. See the [Code](#code) section above.
All other translations are managed online at [Transifex](https://www.transifex.com/projects/p/dolibarr).
Join an existing translation team or create your own and translate into the interface.
Your translations will be available in the next major release.
### Resources
[Translator documentation](http://wiki.dolibarr.org/index.php/Developer_documentation)
Documentation
-------------
The project's documentation is maintained on the [Wiki](http://wiki.dolibarr.org/index.php).
*You need to create an account before being able to edit.*

View File

@ -12,17 +12,19 @@ Dolibarr uses some external libraries released under different licenses. This is
Component Version License GPL Compatible Usage
-------------------------------------------------------------------------------------
PHP libraries:
AdoDb-Date 0.32 Modified BSD License Yes Date convertion (not into rpm package)
AdoDb-Date 0.33 Modified BSD License Yes Date convertion (not into rpm package)
ChromePHP 4.3.3 Apache Software License 2.0 Yes Return server log to chrome browser console
CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG
FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management
FPDF_TPL 1.2 Apache Software License 2.0 Yes PDF templates management
FPDI 1.5.2 Apache Software License 2.0 Yes PDF templates management
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
Mobiledetect 2.8.3 MIT License Yes Detect mobile devices browsers
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files
PHPExcel 1.7.8 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
PHPExcel 1.8.0 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
php-iban 1.4.6 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
TCPDF 6.0.093 LGPL-3+ Yes PDF generation
TCPDF 6.2.6 LGPL-3+ Yes PDF generation
JS libraries:
jQuery 1.8.2 MIT License Yes JS library
@ -54,7 +56,10 @@ Copyright
---------
Copyright (C) 2015
- Laurent Destailleur <eldy@users.sourceforge.net>
- Marcos García <marcosgdf@gmail.com>
- Alexandre Spangaro <alexandre.spangaro@gmail.com>
- Frederic France <frederic.france@free.fr>
Copyright (C) 2014
- Laurent Destailleur <eldy@users.sourceforge.net>
@ -67,6 +72,7 @@ Copyright (C) 2014
- Maxime Kohlhaas <mko@atm-consulting.fr>
- Juanjo Menent <jmenent@2byte.es>
- Alexandre Spangaro <alexandre.spangaro@gmail.com>
- Frederic France <frederic.france@free.fr>
Copyright (C) 2013
- Christophe Battarel <christophe.battarel@altairis.fr>

View File

@ -5,10 +5,61 @@ English Dolibarr ChangeLog
WARNING: Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
You may also experience troubles with Mysql 5.5.41 with error "Lost connection" during migration.
Upgrading to any other version or database system is abolutely required BEFORE trying to
make a migration.
Upgrading to any other version or any other database system is abolutely required BEFORE trying
make a Dolibarr upgrade.
***** ChangeLog for 3.8 compared to 3.7.* *****
For users:
- New: Add Option to not change date on cloning project
- New: Add check list from table for extrafield type
- New: Use new combobox.
- New: Add hidden option MAXTABS_IN_CARD.
- New: A default label is suggested for stock correction and transfer instead of empty string.
- Fix / Improve : [ bug #1747 ] Remove creation of batch 'Undefined'
- Add Weighted average price as default price for buying price for margin calculation. Add option
MARGIN_PMP_AS_DEFAULT_BUY_PRICE to replace with first supplier price.
- Introduce option MAIN_HTML_TITLE to start to control format of html title content.
- Add extrafields on bank account cards.
- Added delay between mails in Newsletter module.
- [ task #1793 ] Create new permission to restrict commercial agent margin to logged user.
- Add experimental module ask supplier price to request supplier quotation.
- Add experimental module batch management.
For translators:
- Update language files.
- New: When a translation is not available we always jump to en_US and only en_US.
For developers:
- New: Function yn can show a visual checkbox.
- New: Introduced select2 jquery plugin.
WARNING: Following changes may create regression for some external modules, but was necessary to make
Dolibarr better:
- Removed hoo supplierorderdao into supplier order creation. This is a business event, so we must use the
trigger ORDER_SUPPLIER_CREATE instead.
- Hooks 'printLeftBlock' and 'formConfirm' are now compliant with hook development rules. They are
"addreplace" hooks, so you must return content with "->resprints='mycontent'" and not with "return 'mycontent'"
- All fields "fk_societe" were renamed into "fk_soc".
***** ChangeLog for 3.7.1 compared to 3.7.* *****
- Fix: Bug in the new photo system
- Fix: Error management
- Fix: [ Bug #2714 ] Members -> Memberxy-> Agenda -> technical Error
- Fix: [ Bug #2713 ] 3.7.0 mailing-unsubscribe.php not unsubscribe
- Path to save photos of products was moved in 3.7.0 to match path of other attached files. If you had loose
your photo on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to
restore old path.
WARNING:
Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
You may also experience troubles with Mysql 5.5.41 with error "Lost connection" during migration.
Upgrading to any other version or database system is abolutely required BEFORE trying to
make a Dolibarr upgrade.
***** ChangeLog for 3.7 compared to 3.6.* *****
For users:
- New: Match other auth system: Login can be done entering login or user
@ -114,6 +165,7 @@ For users:
- Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown
- Fix: datepicker first day of week can be monday by setting into display setup
- Fix: [ bug #575 ] GED doesn't works if there is "/" in a mask
- Fix: [ task #1728 ] Deactivate RIB suggest in proposals / invoices / orders
For users, new experimental module (need to set feature level of instance to experimental to see them):
- New: Module Accounting Expert to manage accountancy
@ -163,9 +215,19 @@ For developers:
- Qual: Replace all constants ACCOUNTINGEX_* by ACCOUNTING_* to simplify migration of the module
- Fix: [ bug #1724 ] Can't add a submenu to projects
WARNING:
Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
You may also experience troubles with Mysql 5.5.41 with error "Lost connection" during migration.
Upgrading to any other version or database system is abolutely required BEFORE trying to
make a Dolibarr upgrade.
WARNING: Following changes may create regression for some external modules, but was necessary to make
Dolibarr better:
- Path to save photos of products was moved to match path of other attached files. If you had loose your photo
on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to restore old path.
- If you can't see trips and expenses records, check that you have the new permission "read all
trips and expenses".
- Deprecated module "oscommerce" were removed.
@ -177,8 +239,9 @@ Dolibarr better:
- A lot of pages called fiche.php were renamed into card.php
- A lot of pages called liste.php were renamed into list.php
- If you used warehouse/stock module, recheck setup of stock increase/decrease rules of the
warehouse module and your Point Of Sale module if you use one.
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook
warehouse module and your Point Of Sale module setup if you use one.
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
***** ChangeLog for 3.6.3 compared to 3.6.2 *****
- Fix: ref_ext was not saved when recording a customer order from web service
@ -388,6 +451,8 @@ Fix: [ bug #1905 ] Custom deplacement types do not get translated in deplacement
Fix: [ bug #2583 ] Unable to create a bank transfer with localized numbers
Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a project
Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref
Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null
Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973

229
README.md
View File

@ -1,151 +1,166 @@
# DOLIBARR ERP & CRM
Dolibarr ERP & CRM is a modern software to manage your company or foundation activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).It's an opensource software (wrote with PHP language) designed for small and medium companies, foundation and freelances. You can freely install, use and distribute it as a standalone application or as a web application to use it from every internet access and media.
Dolibarr ERP & CRM is a modern software 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.
You can freely use, study, modify or distribute it according to it's 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.
![ScreenShot](http://www.dolibarr.org/images/dolibarr_screenshot1_640x400.png)
## LICENSE
Dolibarr is released 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 (GPL-3+).
See the [COPYING](COPYING) file for a full copy of the license.
Other licenses apply for some included dependencies. See [COPYRIGHT](COPYRIGHT) for a full list.
## INSTALL
## INSTALLING
If you have no technical knowledge, and you are looking for an autoinstaller to install Dolibarr ERP/CRM in few clicks, you must download DoliWamp (the all-in-one package of Dolibarr for Windows), DoliDeb (the all-in-one package of Dolibarr for Debian or Ubuntu) or DoliRpm (the all-in-one package of Dolibarr for Fedora, Redhat, Opensuse, Mandriva or Mageia).
### Download
You can download this from the download area of [Official website] (<http://www.dolibarr.org/>)
Releases can be downloaded from [official website](http://www.dolibarr.org/).
If you already have installed a Web server and a Mysql database, you can install the standard version like this:
### Simple setup
- Uncompress the downloaded archive.
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in few clicks, you can use one of the packaged versions:
- Copy directory "dolibarr" and all its files inside your web server root, or copy directory anywhere and set up your web server to use "dolibarr/htdocs" as root for a new web server virtual host (second choice need to be server administrator).
- Create an empty file "htdocs/conf/conf.php" and set permissions for your web server user (write permissions will be removed once install is finished).
- From your browser, call the dolibarr "install/" page.
- DoliWamp for Windows
- DoliDeb for Debian or Ubuntu
- DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia
Url depends on choice made on first step:
### Advanced setup
http://localhost/dolibarr/htdocs/install/
or
You can use a Web server and a supported database (MySQL recommended) to install the standard version.
http://localhost/dolibarr/install/
or
- Uncompress the downloaded archive
- Copy directory "dolibarr" and all its files inside your web server root, or copy directory anywhere and set up your web server to use "dolibarr/htdocs" as root for a new web server virtual host (second choice need to be server administrator)
- Create an empty file "htdocs/conf/conf.php" and set permissions for your web server user (write permissions will be removed once install is finished)
- From your browser, go to the dolibarr "install/" page
http://yourdolibarrvirtualhost/install/
The URL will depends on choices made in the first step:
http://localhost/dolibarr/htdocs/install/
or
http://localhost/dolibarr/install/
or
http://yourdolibarrvirtualhost/install/
- Follow instructions provided by installer...
- Follow the installer instructions
## UPGRADING
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
- If you're upgrading from version x.y.z to x.y.w (only third number differs), there is no need to run any migration process.
- If you're upgrading from a beta version or from any version x.y.z to any other where x or y number differs, you must call the Dolibarr "install/" page in your browser (this should be done automatically at first dolibarr access) and follow the upgrade process.
## UPGRADE
*Note: migration process can safely be done multiple times.*
To upgrade Dolibarr from an old version to this one:
## NEWS
- Overwrite all old files inside old 'dolibarr' directory by files provided into new version package.
- If you came from version x.y.z to x.y.w (only third number differ), there is no need to run any migrate process.
- If you came from a beta version or from any version x.y.z to any other where x or y number differs, you must call the Dolibarr "install/" page in your browser (this should be done automatically at first dolibarr access).
See the [ChangeLog](ChangeLog) file.
This URL should looks like:
## FEATURES
http://localhost/dolibarr/htdocs/install/
or
### General features
- Users and groups with finely grained rights
- Localization in most major languages
- Very user friendly and easy to use
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
- Works with PHP 5.3+ and MySQL 4.1+ or PostgreSQL 8.1. (See requirements on the [Wiki](http://wiki.dolibarr.org/index.php/Prerequisite))
- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites.
- An easy to understand, maintain and code interfaces with your own information system (PHP with no heavy framework; trigger and hook architecture)
- Support for country specific features:
- Spanish Tax RE and ISPF
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
- Canadian double taxes (federal/province) and other countries using cumulative VAT
- Tunisian tax stamp
- Compatible with [European directives](http://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE)
- ...
http://localhost/dolibarr/install/
or
### Main modules
http://yourdolibarrhost/install/
Then choose the "update" option according to your case.
Note: Migrate process can be ran safely several times.
## WHAT'S NEW
See ChangeLog file found into package.
## WHAT DOLIBARR CAN DO
### Main modules/features:
- Customers, Prospects or Suppliers directory.
- Products and services catalog.
- Bank accounts management.
- Orders management.
- Commercial proposals management.
- Contracts management.
- Invoices management.
- Payments management.
- Standing orders management.
- Stock management.
- Shipping management.
- Customers, Prospects and/or Suppliers directory
- Products and/or Services catalog
- Bank accounts management
- Customer and Supplier Orders management
- Commercial proposals management
- Contracts management
- Invoices management
- Projects management
- Events management
- Payments management
- Standing orders management
- Stock management
- Shipping management
- Interventions management
- PDF or ODT generation for invoice, proposals, orders...
- Agenda with ical,vcal export for third tools integration.
- EDM (Electronic Document Management).
- Foundations members management.
- Employee's holidays management.
- Mass Emailing.
- Realize surveys.
- Point of Sale.
- Agenda with ical and vcal export for third party tools integration
- Electronic Document Management (EDM)
- Foundations members management
- Employee's holidays management
- Mass emailing
- Surveys
- Point of Sale
- …
### Other modules:
### Other modules
- Bookmarks management.
- Donations management.
- Reporting.
- Data export/import.
- Third parties or products categories.
- LDAP connectivity.
- ClickToDial integration.
- RSS integration.
- Can be extended with a lot of other external modules available onto DoliStore.com.
- Bookmarks management
- Donations management
- Reporting
- Data export/import
- Thirdparties and/or products categories
- Barcodes support
- Margin calculations
- LDAP connectivity
- ClickToDial integration
- RSS integration
- Skype integration
- Payment platforms integration (PayBox, PayPal)
- …
### Miscellaneous:
### Extending
- Multi-user, with several permissions levels for each feature.
- Very user friendly and easy to use.
- Highly customizable: Enable only modules you need, user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one).
- Works with PHP 5.3+, MySql 4.1 or PostgreSQL 8.1.
- Require PHP and Mysql or Postgresql (See exatc versions on http://wiki.dolibarr.org/index.php/Prerequisite).
- Compatible with all Cloud solutions that match MySql, PHP or PostgreSQL prerequisites.
- An easy to understand, maintain and code interfaces with your own system information (PHP with no heavy frameworks, trigger and hook architecture).
- Support countries specific features:
Spanish Tax RE and ISPF.
French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM).
Canadian double taxes (federal/province) and other countries using cumulative VAT.
Tunisian tax stamp.
Compatible with European directives (2006/112/CE ... 2010/45/UE) (http://europa.eu/legislation_summaries/taxation/l31057_en.htm)
...
Dolibarr can be extended with a lot of other external modules from third party developers available at the [DoliStore](http://www.dolistore.com).
## FUTURE
## WHAT DOLIBARR CAN'T DO YET (TODO LIST)
These are features that Dolibarr does **not** yet fully support:
This is features that Dolibarr does not support completely yet:
- Double-entry bookkeeping (only bank and treasury management)
- Multiple currencies
- Multiple companies
If you want to manage several companies or foundations, you must install the software several times (on same server or not) or use the MultiCompany addon module that allows to manage several companies in one Dolibarr instance (one database but with a logical isolation of datas)
- Tasks dependencies in projects
- Payroll module
- Webmail
- Dolibarr can't do coffee (yet)
- No double party accountancy (only bank and treasury management).
- Dolibarr manage one currency at once (mono-currency).
- Dolibarr manage one master activity (mono-company). If you want to manage several companies or foundations, you must install several time the software (on same server or not). Another solution is to extend Dolibarr with the addon Module MultiCompany that allows to manage several companies in one Dolibarr instance (one database but with a logical isolation of datas).
- Tasks on module project can't have dependencies between each other.
- Dolibarr does not contains Payroll module.
- Dolibarr does not include any Webmail.
- Dolibarr can't do coffee (not yet).
## DOCUMENTATION
Administrator, user, developer and translator's documentations are available along with other community resources on the [Wiki](http://wiki.dolibarr.org).
## CREDITS
Dolibarr is the work of many contributors over the years and uses some fine libraries.
See [COPYRIGHT](COPYRIGHT) file.
## SOCIAL NETWORKS
Follow Dolibarr project on
Facebook: <https://www.facebook.com/dolibarr>
Google+: <https://plus.google.com/+DolibarrOrg>
Twitter: <http://www.twitter.com/dolibarr>
Follow Dolibarr project on:
- [Facebook](https://www.facebook.com/dolibarr)
- [Google+](https://plus.google.com/+DolibarrOrg)
- [Twitter](http://www.twitter.com/dolibarr)
- [LinkedIn](https://www.linkedin.com/company/association-dolibarr)
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
- [GitHub](https://github.com/Dolibarr/dolibarr)

View File

@ -101,14 +101,38 @@ http://packages.qa.debian.org/package.html
http://bugs.debian.org/package
##### Modify severity of a bug ticket
- Send this email to control@bugs.debian.org and wait 10 minutes
severity 123 xxx
##### Update but tracker system
To set status of a bug to "pending"
> bts tag 999999 +pending
or replay to email 999999@bugs.debian.org + submitter of bug
With a message starting with:
Control: tag -1 +pending
Thanks. Fixed into git.
or replay to email control@bugs.debian.org
With only message
tag 729538 +pending
##### Testing a package into unstable env
Check you have a mysql server available from another interface than localhost
Check you have a mysql server available from another interface than "localhost".
Comment line in /etc/mysql/my.cnf if required and restart mysql
#bind-address = 127.0.0.1
Create a chroot called "unstable-amd64-sbuild"
Create a chroot called "unstable-amd64-sbuild".
Chroot env is stored into /srv/chroot directory.
> sudo sbuild-createchroot --keyring= unstable /srv/chroot/unstable http://ftp.uk.debian.org/debian
Pour lister les env chroot
@ -116,6 +140,7 @@ Pour lister les env chroot
Puis pour se connecter et préparer l'environnement
> schroot -c name_of_chroot
> cat /etc/debian_chroot to check which debian branch we are into
> vi /usr/sbin/policy-rc.d and replace return code 101 (not allowed) into 0 (ok)
> apt-get install links mysql-client
@ -129,7 +154,10 @@ Pour tester un package
> dpkg -i dolibarr*.deb ou pour avoir des traces: dpkg -D77777 -i dolibarr*.deb
> apt-get install -f
Puis http://localhost/dolibarr/ (cela peut etre appeler depuis le hote).
If there is a problem launching apache, because port is already used, change it into your chroot install with
> vi /etc/apache2/ports.conf
Then restart.
Then you can call/test dolibarr with http://localhost:port/dolibarr/ (It can be also called from host).
@ -196,26 +224,9 @@ http://packages.qa.debian.org/t/tcpdf.html
* Package will be into release when test will be moved as stable.
##### Update but tracker system
To set status of a bug to pending
> bts tag 999999 +pending
or replay to email 999999@bugs.debian.org + submitter of bug
With a message starting with:
Control: tag -1 +pending
and then a text like:
Thanks. Fixed into git.
or replay to email control@bugs.debian.org
With only message
tag 729538 +pending
##### Create/Maintain dolibarr package
To update dolibarr debian package
To update dolibarr debian package when upstream version has changed
* You can git clone debian git repo
> git clone git.debian.org:/git/collab-maint/dolibarr.git [dolibarr-debian]
@ -250,15 +261,25 @@ x.y.z+dfsgw
Note: If there was errors solved manually after get-orig-sources.sh, you may need to make a git commit
* Add an entry into debian/changelog
> dch -v x.y.z+dfsg-w "My comment" will add entry.
* Fix debian/* files used to build package.
Add an entry into debian/changelog
> dch -v x.y.z+dfsgw-v "My comment" will add entry.
For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increaed for each new import)
Then modify changelog to replace "version" or "unstable" with "UNRELEASED".
Then check/modify also the user/date signature:
- Date must have format reported by "date -R"
- Name and email must match value into debian/control file (Entry added here is used by next step).
* We try to build package
To update dolibarr debian package when only files into debian has changed
* Change files and commit.
* Add a tag debian/x.y.z+dfsgw-2 (increase the last 1 into 2)
Once files has been prepared, it's time to test:
* Try to build package
> rm -fr ../build-area; git-buildpackage -us -uc
Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file
@ -276,6 +297,7 @@ Note: If there was errors managed manually, you may need to make a git commit bu
> git-buildpackage --git-tag-only --git-retag
> git push --tags
* Compilation is then done by a debian developer and sent
> sbuild ...
> dput ...
@ -288,3 +310,17 @@ http://packages.qa.debian.org
* Package will be into release when test will be moved as stable.
##### Send an unblock request
Use this to move from unstable to testing.
reportbug -B debian
Choose package "release.debian.org"
Then "unblock"
Then name of package "dolibarr"
Fill message, for example:
"Please unblock package dolibarr
A security error CVE-2014-7137 was reported and is fixed into package 3.5.5.
Note that package 3.5.5 was prepared before the CVE was reported and include other fixes, but they are all related to stability or security (other se$
After discussion with ..., it appears that security holes are enough to request this unblock request."

View File

@ -1,6 +1,6 @@
dolibarr (3.7.0-3) UNRELEASED; urgency=low
dolibarr (3.8.0-3) UNRELEASED; urgency=low
[ Laurent Destailleur (eldy) ]
* New upstream release.
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Sun, 21 March 2015 12:00:00 +0100
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Tue, 12 May 2015 12:00:00 +0100

View File

@ -26,7 +26,7 @@ for <a href="http://www.dolibarr.org">$projectname</a> by Doxygen $doxygenversio
<!-- Google AdSense -->
<center>
<div class="center">
<script type="text/javascript"><!--
google_ad_client = "pub-1071905880519467";
/* PUBBANDEAUDOLIBARR */
@ -36,7 +36,7 @@ google_ad_height = 60;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</center>
</div>
<!-- End google adsense -->
<br>

View File

@ -24,7 +24,7 @@ File added into doxygen generated documentation
</div>
<div id="logodol">
<center>
<div class="center">
<table width="100%">
<tr>
<td><div id="projectname">$projectname</div> - <span id="projectnumber">$projectnumber</span></td>
@ -54,7 +54,7 @@ File added into doxygen generated documentation
<!-- banner end --></td>
</tr>
</table>
</center>
</div>
</div>

View File

@ -32,7 +32,7 @@ AppPublisherURL=http://www.nltechno.com
AppSupportURL=http://www.dolibarr.org
AppUpdatesURL=http://www.dolibarr.org
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
AppCopyright=Copyright (C) 2008-2014 Laurent Destailleur, NLTechno
AppCopyright=Copyright (C) 2008-2015 Laurent Destailleur, NLTechno
DefaultDirName=c:\dolibarr
DefaultGroupName=Dolibarr
;LicenseFile=COPYING
@ -108,7 +108,7 @@ Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\m
; Mysql data files (does not overwrite if exists)
Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
; Dolibarr
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,nltechno*\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*"
Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"

View File

@ -0,0 +1,70 @@
#!/usr/bin/php
<?php
/* Copyright (C) 2015 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 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 build/generate_filecheck_xml.php
* \ingroup dev
* \brief This script create a xml checksum file
*/
$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;
}
// Main
parse_str($argv[1]);
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
$outputfile=dirname(__FILE__).'/../htdocs/install/filelist.xml';
$fp = fopen($outputfile,'w');
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
fputs($fp, '<checksum_list>'."\n");
fputs($fp, '<dolibarr_root_dir version="'.$release.'">'."\n");
$dir_iterator = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
$iterator = new RecursiveIteratorIterator($dir_iterator);
// need to ignore document custom etc
$files = new RegexIterator($iterator, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install|nltechno))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
$dir='';
$needtoclose=0;
foreach ($files as $file) {
$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file));
if ($newdir!=$dir) {
if ($needtoclose)
fputs($fp, '</dir>'."\n");
fputs($fp, '<dir name="'.$newdir.'" >'."\n");
$dir = $newdir;
$needtoclose=1;
}
if (filetype($file)=="file") {
fputs($fp, '<md5file name="'.basename($file).'">'.md5_file($file).'</md5file>'."\n");
}
}
fputs($fp, '</dir>'."\n");
fputs($fp, '</dolibarr_root_dir>'."\n");
fputs($fp, '</checksum_list>'."\n");
fclose($fp);
print "File ".$outputfile." generated\n";
exit(0);

View File

@ -207,7 +207,10 @@ else {
my $NUM_SCRIPT;
my $cpt=0;
while (! $found) {
printf(" %2d - %-14s (%s)\n",$cpt,"ALL (1..9)","Need ".join(",",values %REQUIREMENTTARGET));
$cpt=0;
printf(" %2d - %-14s (%s)\n",$cpt,"ALL (1..10)","Need ".join(",",values %REQUIREMENTTARGET));
$cpt++;
printf(" %2d - %-14s\n",$cpt,"Generate check file");
foreach my $target (@LISTETARGET) {
$cpt++;
printf(" %2d - %-14s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target});
@ -218,7 +221,7 @@ else {
printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".$REQUIREMENTPUBLISH{"SF"});
# Ask which target to build
print "Choose one package number or several separated with space (0 - ".$cpt."): ";
print "Choose one target number or several separated with space (0 - ".$cpt."): ";
$NUM_SCRIPT=<STDIN>;
chomp($NUM_SCRIPT);
if ($NUM_SCRIPT !~ /^[0-9\s]+$/)
@ -235,30 +238,30 @@ else {
if ($NUM_SCRIPT eq "98") {
$CHOOSEDPUBLISH{"ASSO"}=1;
}
else
{
if ($NUM_SCRIPT eq "99") {
$CHOOSEDPUBLISH{"SF"}=1;
elsif ($NUM_SCRIPT eq "99") {
$CHOOSEDPUBLISH{"SF"}=1;
}
elsif ($NUM_SCRIPT eq "0") {
$CHOOSEDTARGET{"-CHKSUM"}=1;
foreach my $key (@LISTETARGET) {
if ($key ne 'SNAPSHOT' && $key ne 'ASSO' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; }
}
else {
if ($NUM_SCRIPT eq "0") {
foreach my $key (@LISTETARGET) {
if ($key ne 'SNAPSHOT' && $key ne 'ASSO' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; }
}
}
else {
foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
$CHOOSEDTARGET{$LISTETARGET[$num-1]}=1;
}
}
}
elsif ($NUM_SCRIPT eq "1") {
$CHOOSEDTARGET{"-CHKSUM"}=1
}
else {
foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
$CHOOSEDTARGET{$LISTETARGET[$num-2]}=1;
}
}
}
# Test if requirement is ok
#--------------------------
$atleastonerpm=0;
foreach my $target (keys %CHOOSEDTARGET) {
foreach my $target (sort keys %CHOOSEDTARGET) {
if ($target =~ /RPM/i)
{
if ($atleastonerpm && ($DESTI eq "$SOURCE/build"))
@ -300,20 +303,32 @@ foreach my $target (keys %CHOOSEDTARGET) {
print "\n";
# Check if there is at least on target to build
# Build xml check file
#-----------------------
if ($CHOOSEDTARGET{'-CHKSUM'})
{
print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filecheck_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n";
$ret=`php $SOURCE/build/generate_filecheck_xml.php release=$MAJOR.$MINOR.$BUILD`;
print $ret."\n";
}
#print join(',',sort keys %CHOOSEDTARGET)."\n";
# Check if there is at least one target to build
#----------------------------------------------
$nboftargetok=0;
$nboftargetneedbuildroot=0;
$nbofpublishneedtag=0;
foreach my $target (keys %CHOOSEDTARGET) {
foreach my $target (sort keys %CHOOSEDTARGET) {
if ($CHOOSEDTARGET{$target} < 0) { next; }
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP')
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP' && $target ne '-CHKSUM')
{
$nboftargetneedbuildroot++;
}
$nboftargetok++;
}
foreach my $target (keys %CHOOSEDPUBLISH) {
foreach my $target (sort keys %CHOOSEDPUBLISH) {
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
if ($target eq 'ASSO') { $nbofpublishneedtag++; }
if ($target eq 'SF') { $nbofpublishneedtag++; }
@ -368,6 +383,7 @@ if ($nboftargetok) {
print "Clean $BUILDROOT\n";
$ret=`rm -f $BUILDROOT/$PROJECT/.buildpath`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.editorconfig`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.externalToolBuilders`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.git*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
@ -376,7 +392,6 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.tx`;
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/quickbuild.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
@ -435,52 +450,61 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot11.png`;
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`;
# Security to avoid to package data files
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
# Removed known external modules to avoir any error when packaging on test env
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ancotec*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/calling*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/oscim*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
# Removed other test files
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems.
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems.
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/adapters`; # Keep this removal in case we embed libraries
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball due to debian policies
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/datatables/extras/TableTools/swf`; # Source of this flash is not available
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems.
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems.
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/adapters`; # Keep this removal in case we embed libraries
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/datatables/extras/TableTools/swf`; # Source of this flash is not available
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
}
# Build package for each target
#------------------------------
foreach my $target (keys %CHOOSEDTARGET)
foreach my $target (sort keys %CHOOSEDTARGET)
{
if ($CHOOSEDTARGET{$target} < 0) { next; }
if ($target eq '-CHKSUM') { next; }
print "\nBuild package for target $target\n";
if ($target eq 'SNAPSHOT')
@ -652,6 +676,11 @@ if ($nboftargetok) {
if ($target =~ /MAND/i) { $BUILDFICSRC="${FILENAME}_mandriva.spec"; }
if ($target =~ /OPEN/i) { $BUILDFICSRC="${FILENAME}_opensuse.spec"; }
use Date::Language;
$lang=Date::Language->new('English');
$datestring = $lang->time2str("%a %b %e %Y", time);
$changelogstring="* ".$datestring." Laurent Destailleur $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n- Upstream release\n";
print "Generate file $BUILDROOT/$BUILDFIC from $SOURCE/build/rpm/${BUILDFICSRC}\n";
open (SPECFROM,"<$SOURCE/build/rpm/${BUILDFICSRC}") || die "Error";
open (SPECTO,">$BUILDROOT/$BUILDFIC") || die "Error";
@ -659,6 +688,7 @@ if ($nboftargetok) {
$_ =~ s/__FILENAMETGZ__/$FILENAMETGZ/;
$_ =~ s/__VERSION__/$MAJOR.$MINOR.$REL1/;
$_ =~ s/__RELEASE__/$RPMSUBVERSION/;
$_ =~ s/__CHANGELOGSTRING__/$changelogstring/;
print SPECTO $_;
}
close SPECFROM;
@ -982,7 +1012,7 @@ if ($nboftargetok) {
# Publish package for each target
#--------------------------------
foreach my $target (keys %CHOOSEDPUBLISH)
foreach my $target (sort keys %CHOOSEDPUBLISH)
{
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
@ -1072,7 +1102,8 @@ if ($nboftargetok) {
}
print "\n----- Summary -----\n";
foreach my $target (keys %CHOOSEDTARGET) {
foreach my $target (sort keys %CHOOSEDTARGET) {
if ($target eq '-CHKSUM') { print "Checksum was generated"; next; }
if ($CHOOSEDTARGET{$target} < 0) {
print "Package $target not built (bad requirement).\n";
} else {

View File

@ -8,10 +8,9 @@ This files describe steps made by Dolibarr packaging team to make a
beta version of Dolibarr, step by step.
- Check all files are commited.
- Update version/info in ChangeLog. To generate a changelog, you can do "git log x.y.z..HEAD --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIXED\|NEW'"
- Update version/info in ChangeLog. To generate a changelog, you can do "git log `git merge-base x.y origin/develop`..x.y --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -i -e '^FIX\|NEW'"
- Update version number with x.y.z-w in htdocs/filefunc.inc.php
- Update version number with x.y.z-w in build/debian/changelog
- Update version number with x.y.z-w in build/rpm/*.spec
- Commit all changes.
- Add a Tag (x.y.betaz_YYYYMMDD) and push it: git push --tags
- Create a branch (x.y).
@ -30,10 +29,9 @@ This files describe steps made by Dolibarr packaging team to make a
complete release of Dolibarr, step by step.
- Check all files are commited.
- Update version/info in ChangeLog. To generate a changelog, you can do "git log x.y.z..HEAD --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^Fix\|New\|Sec'"
- Update version/info in ChangeLog. To generate a changelog, you can do "git log `git merge-base x.y origin/develop`..x.y --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -i -e '^FIX\|NEW'"
- Update version number with x.y.z in htdocs/filefunc.inc.php
- Update version number with x.y.z in build/debian/changelog
- Update version number with x.y.z in build/rpm/*.spec
- Commit all changes.
- Run makepack-dolibarr.pl to generate all packages.

View File

@ -14,7 +14,7 @@ https://build.opensuse.org
Packaging rules: http://en.opensuse.org/Portal:Packaging
Add attributes:
OBS:Screenshots URL of screenshot
OBS:Screenshots URL of screenshot http://www.dolibarr.org/images/dolibarr_screenshot1.png
OBS:QualityCategory Development|Testing|Stable|Private
OBS:Maintained 1

View File

@ -172,8 +172,10 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/contrat
%_datadir/dolibarr/htdocs/core
%_datadir/dolibarr/htdocs/cron
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/expedition
%_datadir/dolibarr/htdocs/expensereport
%_datadir/dolibarr/htdocs/exports
%_datadir/dolibarr/htdocs/externalsite
%_datadir/dolibarr/htdocs/fichinter
@ -185,12 +187,13 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/install
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
%_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/loan
%_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/printing
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public
@ -332,5 +335,4 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Wed Oct 29 2014 Laurent Destailleur 3.7.0-0.3
- Upstream release
__CHANGELOGSTRING__

View File

@ -252,8 +252,10 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/contrat
%_datadir/dolibarr/htdocs/core
%_datadir/dolibarr/htdocs/cron
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/expedition
%_datadir/dolibarr/htdocs/expensereport
%_datadir/dolibarr/htdocs/exports
%_datadir/dolibarr/htdocs/externalsite
%_datadir/dolibarr/htdocs/fichinter
@ -265,12 +267,13 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/install
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
%_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/loan
%_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/printing
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public
@ -568,7 +571,4 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Wed Oct 29 2014 Laurent Destailleur 3.7.0-0.3
- Upstream release
__CHANGELOGSTRING__

View File

@ -169,8 +169,10 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/contrat
%_datadir/dolibarr/htdocs/core
%_datadir/dolibarr/htdocs/cron
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/expedition
%_datadir/dolibarr/htdocs/expensereport
%_datadir/dolibarr/htdocs/exports
%_datadir/dolibarr/htdocs/externalsite
%_datadir/dolibarr/htdocs/fichinter
@ -182,12 +184,13 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/install
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
%_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/loan
%_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/printing
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public
@ -337,7 +340,4 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Wed Oct 29 2014 Laurent Destailleur 3.7.0-0.3
- Upstream release
__CHANGELOGSTRING__

View File

@ -180,8 +180,10 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/contrat
%_datadir/dolibarr/htdocs/core
%_datadir/dolibarr/htdocs/cron
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/expedition
%_datadir/dolibarr/htdocs/expensereport
%_datadir/dolibarr/htdocs/exports
%_datadir/dolibarr/htdocs/externalsite
%_datadir/dolibarr/htdocs/fichinter
@ -193,12 +195,13 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/install
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
%_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/loan
%_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/printing
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public
@ -348,7 +351,4 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Wed Oct 29 2014 Laurent Destailleur 3.7.0-0.3
- Upstream release
__CHANGELOGSTRING__

View File

@ -13,7 +13,8 @@
"require": {
"php": ">=5.3.0",
"ext-gd": "*",
"ext-curl": "*"
"ext-curl": "*",
"restler/framework": "3.0.*"
},
"suggest": {
"ext-mysqli": "*",

14
dev/ansible/README.md Normal file
View File

@ -0,0 +1,14 @@
# This directory contains script example to use ansible to deploy or maitains dolibarr instances
This is a quick tutorial:
* Install ansible:
> apt-get install
* Add ip of server to manage into
/etc/ansible/hosts
* Deploy public key to managed servers
- authorized_key: user=charlie key="{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"

View File

@ -0,0 +1,24 @@
#!/usr/bin/env ansible-playbook
# Run script with ansible-playbook deploydev.yml
# or ./deploydev.yml
- name: Configure webserver with apache
hosts: webservers
sudo: True
tasks:
- name: install apache
apt: name=apache update_cache=yes
- name: copy apache config file
copy: src=files/apachealias.conf dest=/etc/apache/conf.d/dolibarr_dev
#- name: enable configuration
# file: >
# dest=/etc/apache/sites-enabled/default
# src=/etc/apache/sites-available/default
# state=link
- name: copy info.html
template: src=templates/info.html.j2 dest=/var/www/dolibarr_dev/info.html
mode=0644
- name: restart apache
service: name=apache state=restarted

View File

@ -0,0 +1,2 @@
Alias /dolibarr_dev /var/www/dolibarr

View File

@ -0,0 +1,2 @@
[webservers]
testserver ansible_ssh_host=127.0.0.1 ansible_ssh_port=22

View File

@ -0,0 +1,10 @@
<html>
<head>
<title>Page info ansible</title>
</head>
<body>
<h1>Apache, configured by Ansible</h1>
<p>If you can see this, Ansible successfully installed apache.</p>
<p>{{ ansible_managed }}</p>
</body>
</html>

View File

@ -1,9 +1,12 @@
README (English)
--------------------------------
This directory contains ruleset files to use to
develop Dolibarr EPR & CRM with Eclipse.
This directory contains ruleset files to use to develop Dolibarr EPR & CRM.
Note: You must setup the PTI plugin of Eclipse into PHPCodeSniffer menu with:
To install/upgrade phpcs:
> sudo pear upgrade PHP_CodeSniffer
Note with Eclipse: You must setup the PTI plugin of Eclipse into PHPCodeSniffer menu with:
* tab value to 4
* path of code sniffer standard to dev/codesniffer
* path of code sniffer standard to dev/codesniffer

View File

@ -173,138 +173,44 @@
<!-- Rules from PEAR Standard -->
<!-- Rules from PEAR Standard -->
<rule ref="PEAR.Classes.ClassDeclaration" />
<rule ref="PEAR.Classes.ClassDeclaration" />
<!-- Check for duplicate class names -->
<!-- <rule ref="Generic.Classes.DuplicateClassName" /> -->
<rule ref="PEAR.Commenting.ClassComment" />
<rule ref="PEAR.Commenting.ClassComment.MissingTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@authorTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@categoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@licenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@linkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@packageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<!-- TODO Remove this and fix reported errors -->
<rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@authorTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@categoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@licenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@linkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@packageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<!-- TODO Remove this and fix reported errors -->
<rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@authorTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@categoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@licenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@linkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@packageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingTag" />
<rule ref="PEAR.Commenting.ClassComment.MissingAuthorTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingCategoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingLicenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingLinkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingPackageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<!-- TODO Remove this and fix reported errors -->
<rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
<!--
<rule ref="PEAR.Commenting.FileComment" />
<rule ref="PEAR.Commenting.FileComment.WrongStyle">
@ -317,15 +223,40 @@
<severity>0</severity>
</rule>
-->
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment" />
<rule ref="PEAR.Commenting.FunctionComment.Empty">
<severity>5</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment" />
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName" />
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType">
<severity>0</severity>
</rule>

View File

@ -23,6 +23,21 @@ Replace call to serialize_val with no bugged value
FPDI:
-----
Replace:
$this->_readXref($this->_xref, $this->_findXref());
with:
try {
$this->_readXref($this->_xref, $this->_findXref());
}
catch(Exception $e)
{
print $e->getMessage();
exit;
}
TCPDF:
------
* Removed all fonts except
@ -47,6 +62,19 @@ In htdocs/includes/tcpdf/tcpdf.php
* Renamed getmypid into dol_getmypid().
TCPDI:
------
Add fpdf_tpl.php 1.2
Add tcpdi.php
Add tcpdi_parser.php and replace:
require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
with:
require_once(dirname(__FILE__).'/../tcpdf/include/tcpdf_filters.php');
JSGANTT:
--------
* Replace in function JSGantt.taskLink

View File

@ -66,11 +66,11 @@ $myproduct=new Product($db);
// Definition of product instance properties
$myproduct->ref = '1234';
$myproduct->libelle = 'libelle';
$myproduct->label = 'label';
$myproduct->price = '10';
$myproduct->price_base_type = 'HT';
$myproduct->tva_tx = '19.6';
$myproduct->type = 0;
$myproduct->type = Product::TYPE_PRODUCT;
$myproduct->status = 1;
$myproduct->description = 'Description';
$myproduct->note = 'Note';

View File

@ -10,21 +10,21 @@
# Syntax
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
then
echo "Detect and fix files ending with bad ending chars (must be LF)"
echo "This script detect or clean files with CR+LF into files with LF only. All source files are included, also files into includes."
echo "Usage: fixdosfiles.sh [list|fix]"
fi
# To detec
if [ "x$1" = "xlist" ]
then
find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" \) -exec file "{}" + | grep CRLF
# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF
find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF
# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF
fi
# To convert
if [ "x$1" = "xfix" ]
then
for fic in `find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" \) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
for fic in `find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml"\) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
do
echo "Fix file $fic"
dos2unix $fic

57
dev/ical/event_recu.txt Normal file
View File

@ -0,0 +1,57 @@
Example fo recurring event, 1 week, no end, exported by Google
# The recurring event were recorded every monday the 20150518. This is the Recurrence-id, but then
# first occurence was moved on tuesday. So this record were added.
BEGIN:VEVENT
DTSTART;TZID=Europe/Paris:20150519T100000
DTEND;TZID=Europe/Paris:20150519T110000
DTSTAMP:20150517T175754Z
UID:9026chuafli29ns5soshvckamc@google.com
RECURRENCE-ID;TZID=Europe/Paris:20150518T100000
CREATED:20150517T174404Z
DESCRIPTION:
LAST-MODIFIED:20150517T175008Z
LOCATION:
SEQUENCE:1
STATUS:CONFIRMED
SUMMARY:aaa
TRANSP:OPAQUE
END:VEVENT
# The recurring event were recorded every monday the 20150518.
BEGIN:VEVENT
DTSTART;TZID=Europe/Paris:20150518T100000
DTEND;TZID=Europe/Paris:20150518T110000
RRULE:FREQ=WEEKLY;BYDAY=MO
DTSTAMP:20150517T175754Z
UID:9026chuafli29ns5soshvckamc@google.com
CREATED:20150517T174404Z
DESCRIPTION:
LAST-MODIFIED:20150517T174404Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:aaa
TRANSP:OPAQUE
END:VEVENT
Example fo recurring event, every 2 month, no end, exported by Google
BEGIN:VEVENT
DTSTART;TZID=Europe/Paris:20150519T080000
DTEND;TZID=Europe/Paris:20150519T090000
RRULE:FREQ=MONTHLY;INTERVAL=2;BYMONTHDAY=19
DTSTAMP:20150517T175754Z
UID:urkq3ih1mlaqeu4dbkpdh4i61s@google.com
CREATED:20150517T175658Z
DESCRIPTION:
LAST-MODIFIED:20150517T175658Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:bbbbb
TRANSP:OPAQUE
END:VEVENT

View File

@ -20,7 +20,7 @@
*/
/**
* \file htdocs/dev/generate-commande.php
* \file dev/initdata/generate-commande.php
* \brief Script de generation de donnees aleatoires pour les commandes
*/

View File

@ -19,7 +19,7 @@
*/
/**
* \file htdocs/dev/generate-facture.php
* \file dev/intdata/generate-facture.php
* \brief Script de generation de donnees aleatoires pour les factures
*/

View File

@ -20,7 +20,7 @@
*/
/**
* \file htdocs/dev/generate-produit.php
* \file dev/initdata/generate-produit.php
* \brief Script de generation de donnees aleatoires pour les produits
*/
@ -88,7 +88,7 @@ for ($s = 0 ; $s < GEN_NUMBER_PRODUIT ; $s++)
$produit->type = rand(0,1);
$produit->status = 1;
$produit->ref = ($produit->type?'S':'P').time().$s;
$produit->libelle = 'Label '.time().$s;
$produit->label = 'Label '.time().$s;
$produit->description = 'Description '.time().$s;
$produit->price = rand(1,1000);
$produit->tva_tx = "19.6";

View File

@ -20,7 +20,7 @@
*/
/**
* \file htdocs/dev/generate-propale.php
* \file dev/initdata/generate-propale.php
* \brief Script de generation de donnees aleatoires pour les propales
*/
@ -103,7 +103,8 @@ if ($resql)
}
}
$user->rights->propale->valider=1;
$user->rights->propal->creer=1;
$user->rights->propal->propal_advance->validate=1;
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))

View File

@ -20,8 +20,8 @@
*/
/**
* \file htdocs/dev/generate-societe.php
* \brief Script de generation de donnees aleatoires pour les societes
* \file dev/initdata/generate-societe.php
* \brief Script de generation de donnees aleatoires pour les societes
*/
// Test si mode batch
@ -89,7 +89,7 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++)
{
print "Company $s\n";
$soc = new Societe($db);
$soc->nom = "Company num ".time()."$s";
$soc->name = "Company num ".time()."$s";
$soc->town = $listoftown[rand(0, count($listoftown)-1)];
$soc->client = rand(1,2); // Une societe sur 2 est prospect, l'autre client
$soc->fournisseur = rand(0,1); // Une societe sur 2 est fournisseur
@ -101,7 +101,7 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++)
// Un client sur 3 a une remise de 5%
$user_remise=rand(1,3); if ($user_remise==3) $soc->remise_percent=5;
print "> client=".$soc->client.", fournisseur=".$soc->fournisseur.", remise=".$soc->remise_percent."\n";
$soc->note='Company created by the script generate-societe.php';
$soc->note_private = 'Company created by the script generate-societe.php';
$socid = $soc->create();
if ($socid >= 0)
@ -120,7 +120,7 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++)
}
}
print "Company ".$s." created nom=".$soc->nom."\n";
print "Company ".$s." created nom=".$soc->name."\n";
}
else
{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,5 @@
# ldapadd_sample1.txt
# ldapadd is into package ldap-utils on debian.
#
# Use this sample to add a dc "my-domain".
# This is the first thing to create

View File

@ -1,4 +1,5 @@
# ldapadd_sample2.txt
# ldapadd is into package ldap-utils on debian.
#
# Use this sample to add a ou "contacts"
# This is the second thing to create after creating the root my-domain

View File

@ -1,4 +1,5 @@
# ldapadd_sample3.txt
# ldapadd is into package ldap-utils on debian.
#
# Use this sample to add cn records
# This is the step to create records inside tree ou=contacts,dc=my-domain,dc=com

View File

@ -1,4 +1,5 @@
# ldapdelete_sample1.txt
# ldapdelete is into package ldap-utils on debian.
#
# Use this sample to delete a dc "my-domain"
# This delete the first level of LDAP tree.

View File

@ -1,4 +1,5 @@
# ldapdelete_sample3.txt
# ldapdelete is into package ldap-utils on debian.
#
# Use this sample to delete cn records
# This is the step to delete a cn record stored inside tree ou=contacts,dc=my-domain,dc=com

View File

@ -1,4 +1,5 @@
# ldapmodify_sample1.txt
# ldapmodify is into package ldap-utils on debian.
#
# Use this sample to modify a dc "my-domain"
#

View File

@ -0,0 +1,9 @@
# ldapsearch_sample1.txt
# ldapsearch is into package ldap-utils on debian.
#
# Use this sample to search into a ldap
#
# ldapsearch -h hostname -x
# ldapsearch -h hostname -x -b "ou=people,dc=teclib,dc=infra"
# ldapsearch -h hostname -x -z 0 -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -W "(objectclass=*)"
# ldapsearch -h hostname -x -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -W "(objectclass=*)"

123
dev/skeletons/build_api_class.php Executable file
View File

@ -0,0 +1,123 @@
#!/usr/bin/php
<?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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 dev/skeletons/build_api_class.php
* \ingroup core
* \brief Create a complete API class file from existant class file
*/
$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;
}
// Include Dolibarr environment
require_once($path."../../htdocs/master.inc.php");
// After this $db is a defined handler to database.
// Main
$version='1';
@set_time_limit(0);
$error=0;
$langs->load("main");
print "***** $script_file ($version) *****\n";
// -------------------- START OF BUILD_API_FROM_CLASS --------------------
// Check parameters
if (! isset($argv[1]) && ! isset($argv[2]))
{
print "Usage: $script_file phpClassFile phpClassName\n";
exit;
}
// Show parameters
print 'Classfile='.$argv[1]."\n";
print 'Classname='.$argv[2]."\n";
$classfile=$argv[1];
$classname=$argv[2];
$classmin=strtolower($classname);
$classnameApi = $classname.'Api';
$property=array();
$targetcontent='';
// Load the class and read properties
require_once($classfile);
$property=array();
$class = new $classname($db);
$values=get_class_vars($classname);
unset($values['db']);
unset($values['error']);
unset($values['errors']);
unset($values['element']);
unset($values['table_element']);
unset($values['table_element_line']);
unset($values['fk_element']);
unset($values['ismultientitymanaged']);
// Read skeleton_api_class.class.php file
$skeletonfile=$path.'skeleton_api_class.class.php';
$sourcecontent=file_get_contents($skeletonfile);
if (! $sourcecontent)
{
print "\n";
print "Error: Failed to read skeleton sample '".$skeletonfile."'\n";
print "Try to run script from skeletons directory.\n";
exit;
}
// Define output variables
$outfile='out.api_'.$classmin.'.class.php';
$targetcontent=$sourcecontent;
// Substitute class name
$targetcontent=preg_replace('/skeleton_api_class\.class\.php/', 'api_'.$classmin.'.class.php', $targetcontent);
$targetcontent=preg_replace('/skeleton/', $classmin, $targetcontent);
//$targetcontent=preg_replace('/\$table_element=\'skeleton\'/', '\$table_element=\''.$tablenoprefix.'\'', $targetcontent);
$targetcontent=preg_replace('/SkeletonApi/', $classnameApi, $targetcontent);
$targetcontent=preg_replace('/Skeleton/', $classname, $targetcontent);
// Build file
$fp=fopen($outfile,"w");
if ($fp)
{
fputs($fp, $targetcontent);
fclose($fp);
print "\n";
print "File '".$outfile."' has been built in current directory.\n";
}
else $error++;
// -------------------- END OF BUILD_CLASS_FROM_TABLE SCRIPT --------------------
print "You can now rename generated files by removing the 'out.' prefix in their name and store them into directory /module/class.\n";
return $error;

View File

@ -174,7 +174,7 @@ $targetcontent=$sourcecontent;
// Substitute class name
$targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.php', $targetcontent);
$targetcontent=preg_replace('/\$element=\'skeleton\'/', '\$element=\''.$classmin.'\'', $targetcontent);
$targetcontent=preg_replace('/\$table_element=\'skeleton\'/', '\$table_element=\''.$classmin.'\'', $targetcontent);
$targetcontent=preg_replace('/\$table_element=\'skeleton\'/', '\$table_element=\''.$tablenoprefix.'\'', $targetcontent);
$targetcontent=preg_replace('/Skeleton_Class/', $classname, $targetcontent);
// Substitute comments
@ -252,7 +252,13 @@ foreach($property as $key => $prop)
if ($addfield)
{
$varprop.="\t\t\$sql.= \" ";
if ($prop['istime'])
if ($prop['field']=='datec')
{
$varprop.='"."\'".$this->db->idate(dol_now())."\'"."';
if ($i < count($property)) $varprop.=",";
$varprop.='";';
}
elseif ($prop['istime'])
{
$varprop.='".(! isset($this->'.$prop['field'].') || dol_strlen($this->'.$prop['field'].')==0?\'NULL\':"\'".$this->db->idate(';
$varprop.="\$this->".$prop['field']."";
@ -268,6 +274,12 @@ foreach($property as $key => $prop)
if ($i < count($property)) $varprop.=",";
$varprop.='";';
}
elseif ($prop['field']=='fk_user_mod' || $prop['field']=='fk_user_author')
{
$varprop.='".$user->id."';
if ($i < count($property)) $varprop.=",";
$varprop.='";';
}
else
{
$varprop.='".(! isset($this->'.$prop['field'].')?\'NULL\':"\'".';
@ -289,11 +301,17 @@ $i=0;
foreach($property as $key => $prop)
{
$i++;
if ($prop['field'] != 'rowid' && $prop['field'] != 'id')
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && $prop['field'] != 'datec' && $prop['field'] != 'fk_user_author')
{
$varprop.="\t\t\$sql.= \" ";
$varprop.=$prop['field'].'=';
if ($prop['istime'])
if ($prop['field']=='tms') {
$varprop.='".(dol_strlen($this->'.$prop['field'].')!=0 ? "\'".$this->db->idate(';
$varprop.='$this->'.$prop['field'];
$varprop.=')."\'" : "\'".$this->db->idate(dol_now())."\'").';
$varprop.='"';
}
elseif ($prop['istime'])
{
// (dol_strlen($this->datep)!=0 ? "'".$this->db->idate($this->datep)."'" : 'null')
$varprop.='".(dol_strlen($this->'.$prop['field'].')!=0 ? "\'".$this->db->idate(';
@ -301,6 +319,9 @@ foreach($property as $key => $prop)
$varprop.=')."\'" : \'null\').';
$varprop.='"';
}
elseif ($prop['field']=='fk_user_mod') {
$varprop.='".$user->id."';
}
else
{
$varprop.="\".";
@ -325,6 +346,7 @@ $targetcontent=preg_replace('/\$sql\.= " t\.field2";/', '', $targetcontent);
// Substitute select set parameters
$varprop="\n";
$varpropline="\n";
$cleanparam='';
$i=0;
foreach($property as $key => $prop)
@ -338,11 +360,22 @@ foreach($property as $key => $prop)
if ($prop['istime']) $varprop.=')';
$varprop.=";";
$varprop.="\n";
$varpropline.="\t\t\t\t\$line->".$prop['field']." = ";
if ($prop['istime']) $varpropline.='$this->db->jdate(';
$varpropline.='$obj->'.$prop['field'];
if ($prop['istime']) $varpropline.=')';
$varpropline.=";";
$varpropline.="\n";
}
}
$targetcontent=preg_replace('/\$this->prop1 = \$obj->field1;/', $varprop, $targetcontent);
$targetcontent=preg_replace('/\$this->prop2 = \$obj->field2;/', '', $targetcontent);
//Substirute fetchAll
$targetcontent=preg_replace('/\$line->prop1 = \$obj->field1;/', $varpropline, $targetcontent);
$targetcontent=preg_replace('/\$line->prop2 = \$obj->field2;/', '', $targetcontent);
// Substitute initasspecimen parameters
$varprop="\n";

View File

@ -57,7 +57,7 @@ class modMyModule extends DolibarrModules
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this->description = "Description of module MyModule";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
$this->version = '1.0';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);

View File

@ -0,0 +1,288 @@
<?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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/>.
*/
use Luracast\Restler\RestException;
/**
* API class for skeleton object
*
* @smart-auto-routing false
* @access protected
* @class DolibarrApiAccess {@requires user,external}
*
*
*/
class SkeletonApi extends DolibarrApi
{
/**
* @var array $FIELDS Mandatory fields, checked when create and update object
*/
static $FIELDS = array(
'name'
);
/**
* @var Skeleton $skeleton {@type Skeleton}
*/
public $skeleton;
/**
* Constructor
*
* @url GET skeleton/
*
*/
function __construct()
{
global $db, $conf;
$this->db = $db;
$this->skeleton = new Skeleton($this->db);
}
/**
* Get properties of a skeleton object
*
* Return an array with skeleton informations
*
* @param int $id ID of skeleton
* @return array|mixed data without useless information
*
* @url GET skeleton/{id}
* @throws RestException
*/
function get($id)
{
if(! DolibarrApiAccess::$user->rights->skeleton->read) {
throw new RestException(401);
}
$result = $this->skeleton->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Skeleton not found');
}
if( ! DolibarrApi::_checkAccessToResource('skeleton',$this->skeleton->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
return $this->_cleanObjectDatas($this->skeleton);
}
/**
* List skeletons
*
* Get a list of skeletons
*
* @param int $mode Use this param to filter list
* @param string $sortfield Sort field
* @param string $sortorder Sort order
* @param int $limit Limit for list
* @param int $page Page number
*
* @return array Array of skeleton objects
*
* @url GET /skeletons/
*/
function getList($mode, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
global $db, $conf;
$obj_ret = array();
$socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : '';
// If the internal user must only see his customers, force searching by him
if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) $search_sale = DolibarrApiAccess::$user->id;
$sql = "SELECT s.rowid";
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
$sql.= " FROM ".MAIN_DB_PREFIX."skeleton as s";
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st";
$sql.= " WHERE s.fk_stcomm = st.id";
// Example of use $mode
//if ($mode == 1) $sql.= " AND s.client IN (1, 3)";
//if ($mode == 2) $sql.= " AND s.client IN (2, 3)";
$sql.= ' AND s.entity IN ('.getEntity('skeleton', 1).')';
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.fk_soc = sc.fk_soc";
if ($socid) $sql.= " AND s.fk_soc = ".$socid;
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
// Insert sale filter
if ($search_sale > 0)
{
$sql .= " AND sc.fk_user = ".$search_sale;
}
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
}
$sql.= $db->order($sortfield, $sortorder);
if ($limit) {
if ($page < 0)
{
$page = 0;
}
$offset = $limit * $page;
$sql.= $db->plimit($limit + 1, $offset);
}
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
while ($i < $num)
{
$obj = $db->fetch_object($result);
$skeleton_static = new Skeleton($db);
if($skeleton_static->fetch($obj->rowid)) {
$obj_ret[] = parent::_cleanObjectDatas($skeleton_static);
}
$i++;
}
}
else {
throw new RestException(503, 'Error when retrieve skeleton list');
}
if( ! count($obj_ret)) {
throw new RestException(404, 'No skeleton found');
}
return $obj_ret;
}
/**
* Create skeleton object
*
* @param array $request_data Request datas
* @return int ID of skeleton
*
* @url POST skeleton/
*/
function post($request_data = NULL)
{
if(! DolibarrApiAccess::$user->rights->skeleton->create) {
throw new RestException(401);
}
// Check mandatory fields
$result = $this->_validate($request_data);
foreach($request_data as $field => $value) {
$this->skeleton->$field = $value;
}
if( ! $this->skeleton->create(DolibarrApiAccess::$user)) {
throw new RestException(500);
}
return $this->skeleton->id;
}
/**
* Update skeleton
*
* @param int $id Id of skeleton to update
* @param array $request_data Datas
* @return int
*
* @url PUT skeleton/{id}
*/
function put($id, $request_data = NULL)
{
if(! DolibarrApiAccess::$user->rights->skeleton->create) {
throw new RestException(401);
}
$result = $this->skeleton->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Skeleton not found');
}
if( ! DolibarrApi::_checkAccessToResource('skeleton',$this->skeleton->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
foreach($request_data as $field => $value) {
$this->skeleton->$field = $value;
}
if($this->skeleton->update($id, DolibarrApiAccess::$user))
return $this->get ($id);
return false;
}
/**
* Delete skeleton
*
* @param int $id Skeleton ID
* @return array
*
* @url DELETE skeleton/{id}
*/
function delete($id)
{
if(! DolibarrApiAccess::$user->rights->skeleton->supprimer) {
throw new RestException(401);
}
$result = $this->skeleton->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Skeleton not found');
}
if( ! DolibarrApi::_checkAccessToResource('skeleton',$this->skeleton->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if( !$this->skeleton->delete($id))
{
throw new RestException(500);
}
return array(
'success' => array(
'code' => 200,
'message' => 'Skeleton deleted'
)
);
}
/**
* Validate fields before create or update object
*
* @param array $data Data to validate
* @return array
*
* @throws RestException
*/
function _validate($data)
{
$skeleton = array();
foreach (SkeletonApi::$FIELDS as $field) {
if (!isset($data[$field]))
throw new RestException(400, "$field field missing");
$skeleton[$field] = $data[$field];
}
return $skeleton;
}
}

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) ---Put here your own copyright and developer email---
*
* This program is free software; you can redistribute it and/or modify
@ -41,6 +42,8 @@ class Skeleton_Class extends CommonObject
var $element='skeleton'; //!< Id that identify managed objects
var $table_element='skeleton'; //!< Name of table without prefix where object is stored
var $lines=array();
var $id;
var $prop1;
var $prop2;
@ -103,11 +106,11 @@ class Skeleton_Class extends CommonObject
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
// want this action to call a trigger.
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//if ($result < 0) $error++;
//// End call triggers
}
}
@ -115,11 +118,6 @@ class Skeleton_Class extends CommonObject
// Commit or rollback
if ($error)
{
foreach($this->errors as $errmsg)
{
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
@ -136,7 +134,7 @@ class Skeleton_Class extends CommonObject
*
* @param int $id Id object
* @param string $ref Ref
* @return int <0 if KO, >0 if OK
* @return int <0 if KO, 0 if not found, >0 if OK
*/
function fetch($id,$ref='')
{
@ -154,7 +152,8 @@ class Skeleton_Class extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
if ($this->db->num_rows($resql))
$numrows = $this->db->num_rows($resql);
if ($numrows)
{
$obj = $this->db->fetch_object($resql);
@ -165,7 +164,7 @@ class Skeleton_Class extends CommonObject
}
$this->db->free($resql);
return 1;
return ($numrows?1:0);
}
else
{
@ -174,6 +173,69 @@ class Skeleton_Class 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
* @return int <0 if KO, >0 if OK
*/
function fetchAll($sortorder, $sortfield, $limit, $offset, $filter = array())
{
global $langs;
$sql = "SELECT";
$sql.= " t.rowid,";
$sql.= " t.field1,";
$sql.= " t.field2";
//...
$sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";
// Manage filter
$sqlwhere=array();
if (count($filter)>0) {
foreach ( $filter as $key => $value ) {
//$sqlwhere []= ' AND '. $key . ' LIKE \'%' . $this->db->escape($value) . '%\'';
}
}
if (count($sqlwhere)>0) {
$sql.= ' WHERE '.implode(' AND ', $sqlwhere);
}
$sql .= " ORDER BY " . $sortfield . " " . $sortorder . " " . $this->db->plimit($limit + 1, $offset);
$this->lines = array ();
dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
while ($obj = $this->db->fetch_object($resql))
{
$line=new Skeleton_ClassLine();
$line->id = $obj->rowid;
$line->prop1 = $obj->field1;
$line->prop2 = $obj->field2;
$this->lines[]=$line;
//...
}
$this->db->free($resql);
return $num;
}
else
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::fetchAll ".$this->error, LOG_ERR);
return -1;
}
}
/**
* Update object into database
@ -208,28 +270,20 @@ class Skeleton_Class extends CommonObject
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error)
if (! $error && ! $notrigger)
{
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
// Commit or rollback
if ($error)
{
foreach($this->errors as $errmsg)
{
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
@ -282,11 +336,6 @@ class Skeleton_Class extends CommonObject
// Commit or rollback
if ($error)
{
foreach($this->errors as $errmsg)
{
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
@ -367,3 +416,10 @@ class Skeleton_Class extends CommonObject
}
}
class Skeleton_ClassLine
{
var $id;
var $prop1;
var $prop2;
}

View File

@ -282,7 +282,7 @@ if ($action == 'create')
print '<br>';
print '<center><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"> &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
print '<div class="center"><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"> &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
print '</form>';
@ -304,7 +304,7 @@ if (($id || $ref) && $action == 'edit')
print '<br>';
print '<center><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"></center>';
print '<div class="center"><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"></div>';
print '</form>';

View File

@ -19,14 +19,14 @@
</head>
<body class="body">
<center>
<div class="center">
<div class="login_table" align="center">
<!-- <tr><td colspan="2" valign="middle"> -->
<div id="login_line1" align="center">
<div id="login_left" style="display: inline-block; min-width: 250px; margin: 0 auto;"><center>
<div id="login_left" style="display: inline-block; min-width: 250px; margin: 0 auto;"><div class="center">
<table class="none" summary="Login pass" cellpadding="2" align="center">
@ -46,7 +46,7 @@
</table>
</center>
</div>
</div> <!-- end div left -->
<!-- </td>
@ -64,7 +64,7 @@
</div>
</center>
</div>
</body>
</html>

View File

@ -40,8 +40,18 @@ class autoTranslator
const DIR_SEPARATOR = '/';
function __construct($_destlang,$_refLang,$_langDir,$_limittofile,$_apikey)
{
/**
* Constructor
*
* @param string $_destlang Destination lang
* @param string $_refLang Ref lang
* @param string $_langDir Dir lang
* @param string $_limittofile Limit to file
* @param string $_apikey Api key
* @return void
*/
function __construct($_destlang,$_refLang,$_langDir,$_limittofile,$_apikey)
{
// Set enviorment variables
$this->_destlang = $_destlang;

View File

@ -0,0 +1,179 @@
<?php
/* Copyright (c) 2015 Tommaso Basilici <t.basilici@19.coop>
*
* 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/>.
*/
echo "<html>";
echo "<head>";
echo "<STYLE type=\"text/css\">
table {
background: #f5f5f5;
border-collapse: separate;
box-shadow: inset 0 1px 0 #fff;
font-size: 12px;
line-height: 24px;
margin: 30px auto;
text-align: left;
width: 800px;
}
th {
background-color: #777;
border-left: 1px solid #555;
border-right: 1px solid #777;
border-top: 1px solid #555;
border-bottom: 1px solid #333;
color: #fff;
font-weight: bold;
padding: 10px 15px;
position: relative;
text-shadow: 0 1px 0 #000;
}
td {
border-right: 1px solid #fff;
border-left: 1px solid #e8e8e8;
border-top: 1px solid #fff;
border-bottom: 1px solid #e8e8e8;
padding: 10px 15px;
position: relative;
}
tr {
background-color: #f1f1f1;
}
tr:nth-child(odd) td {
background-color: #f1f1f1;
}
</STYLE>";
echo "<body>";
echo "If you call this file with the argument \"?unused=true\" it searches for the translation strings that exist in en_US but are never used.<br>";
echo "IMPORTANT: that can take quite a lot of time (up to 10 minutes), you need to tune the max_execution_time on your php.ini accordingly.<br>";
echo "Happy translating :)<br>";
// STEP 1 - Search duplicates keys
// directory containing the php and lang files
$htdocs = "../../htdocs/";
// directory containing the english lang files
$workdir = $htdocs."langs/en_US/";
$files = scandir($workdir);
if (empty($files))
{
echo "Can't scan workdir = ".$workdir;
exit;
}
$exludefiles = array('.','..','README');
$files = array_diff($files,$exludefiles);
$langstrings_3d = array();
$langstrings_full = array();
foreach ($files AS $file) {
$path_file = pathinfo($file);
// we're only interested in .lang files
if ($path_file['extension']=='lang') {
$content = file($workdir.$file);
foreach ($content AS $line => $row) {
// don't want comment lines
if (substr($row,0,1) !== '#') {
// don't want lines without the separator (why should those even be here, anyway...)
if (strpos($row,'=')!==false) {
$row_array = explode('=',$row); // $row_array[0] = key
$langstrings_3d[$path_file['basename']][$line+1]=$row_array[0];
$langstrings_3dtrans[$path_file['basename']][$line+1]=$row_array[1];
$langstrings_full[]=$row_array[0];
$langstrings_dist[$row_array[0]]=$row_array[0];
}
}
}
}
}
foreach ($langstrings_3d AS $filename => $file) {
foreach ($file AS $linenum => $value) {
$keys = array_keys($langstrings_full, $value);
if (count($keys)>1)
{
foreach ($keys AS $key) {
$dups[$value][$filename][$linenum] = trim($langstrings_3dtrans[$filename][$linenum]);
}
}
}
}
echo "<h2>Duplicate strings in lang files in $workdir - ".count($dups)." found</h2>";
echo "<table border_bottom=1> ";
echo "<thead><tr><th align=\"center\">#</th><th>String</th><th>File and lines</th></thead>";
echo "<tbody>";
$count = 0;
foreach ($dups as $string => $pages) {
$count++;
echo "<tr>";
echo "<td align=\"center\">$count</td>";
echo "<td>$string</td>";
echo "<td>";
foreach ($pages AS $page => $lines ) {
echo "$page ";
foreach ($lines as $line => $translatedvalue) {
//echo "($line - ".(substr($translatedvalue,0,20)).") ";
echo "($line - ".htmlentities($translatedvalue).") ";
}
echo "<br>";
}
echo "</td></tr>\n";
}
echo "</tbody>";
echo "</table>";
// STEP 2 - Search key not used
if (! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true')
{
foreach ($langstrings_dist AS $value)
{
$search = '\'trans("'.$value.'")\'';
$string = 'grep -R -m 1 -F --exclude=includes/* --include=*.php '.$search.' '.$htdocs.'*';
exec($string,$output);
if (empty($output)) {
$unused[$value] = true;
echo $value.'<br>';
}
}
echo "<h2>Strings in en_US that are never used</h2>";
echo "<pre>";
print_r($unused);
echo "</pre>";
}
echo "\n";
echo "</body>";
echo "</html>";

View File

@ -1,6 +1,6 @@
<?PHP
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
*
* This program is free software; you can redistribute it and/or modify
@ -128,7 +128,6 @@ else if ($action == 'delete')
/*
* View
*
*/
llxheader('', $langs->trans('AccountAccounting'));
@ -142,7 +141,9 @@ if ($action == 'create')
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="add">';
dol_fiche_head();
print '<table class="border" width="100%">';
print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>';
@ -163,9 +164,14 @@ if ($action == 'create')
print '</td></tr>';
print '</table>';
print '<br><center><input class="button" type="submit" value="' . $langs->trans("Save") . '"> &nbsp; &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '"></center';
dol_fiche_end();
print '<div class="center">';
print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
print '</div>';
print '</form>';
}
@ -213,14 +219,16 @@ else if ($id)
print '</td></tr>';
print '</table>';
print '<br><center><input type="submit" class="button" value="' . $langs->trans("Save") . '"> &nbsp; ';
dol_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button" value="' . $langs->trans("Cancel") . '">';
print '</center>';
print '</div>';
print '</form>';
print '</div>';
}
else
{
@ -263,8 +271,8 @@ else if ($id)
print '</td></tr>';
print '</table>';
print '</div>';
dol_fiche_end();
/*
* Barre d'actions
@ -292,6 +300,6 @@ else if ($id)
dol_print_error($db);
}
}
$db->close();
llxFooter();
$db->close();
llxFooter();

View File

@ -4,6 +4,7 @@
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -94,7 +95,7 @@ llxHeader();
$form = new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'setup');
print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup');
$head = admin_accounting_prepare_head();
@ -142,33 +143,35 @@ print "<br>\n";
*/
$num = count($list);
if ($num) {
if ($num)
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">' . $langs->trans('OtherOptions') . '</td>';
print "</tr>\n";
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV > 1) print '<tr><td colspan="2" bgcolor="red"><b>' . $langs->trans('OptionsDeactivatedForThisExportModel') . '</b></td></tr>';
foreach ( $list as $key ) {
$var = ! $var;
print '<tr ' . $bc[$var] . ' class="value">';
// Param
$label = $langs->trans($key);
print '<td width="50%">' . $label . '</td>';
// Value
print '<td>';
print '<input type="text" size="20" name="' . $key . '" value="' . $conf->global->$key . '">';
print '</td></tr>';
}
print "</table>\n";
}
foreach ( $list as $key ) {
$var = ! $var;
print '<tr ' . $bc[$var] . ' class="value">';
// Param
$label = $langs->trans($key);
print '<td width="50%">' . $label . '</td>';
// Value
print '<td>';
print '<input type="text" size="20" name="' . $key . '" value="' . $conf->global->$key . '">';
print '</td></tr>';
}
print '<br><div style="text-align:center"><input type="submit" class="button" value="' . dol_escape_htmltag($langs->trans('Modify')) . '" name="button"></div>';
print '</form>';
print "</table>\n";
print '<br /><div align="center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="button"></div>';
llxFooter();
$db->close();
$db->close();

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
/* Copyright (C) 2014-2015 Alexandre Spangaro <alexandre.spangaro@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
@ -176,6 +176,8 @@ if ($action == 'create')
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
dol_fiche_head();
print '<table class="border" width="100%">';
// Label
@ -199,9 +201,14 @@ if ($action == 'create')
print '</td></tr>';
print '</table>';
dol_fiche_end();
print '<br><center><input class="button" type="submit" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></center';
print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>';
}
@ -251,9 +258,11 @@ else if ($id)
print '</table>';
print '<br><center><input type="submit" class="button" value="'.$langs->trans("Save").'"> &nbsp; ';
print '<br><div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
print '</center>';
print '</div>';
print '</form>';

View File

@ -120,6 +120,9 @@ if ($result) {
$i = 0;
print_barre_liste($langs->trans("ImportAccount"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
print '<input type="hidden" name="action" value="import">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>' . $langs->trans("accountingaccount") . '</td>';
print '<td>' . $langs->trans("label") . '</td>';
@ -132,9 +135,6 @@ if ($result) {
$form = new Form($db);
$htmlacc = new FormVentilation($db);
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
print '<input type="hidden" name="action" value="import">';
$var = true;
while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result);
@ -164,7 +164,7 @@ if ($result) {
// Colonne choix ligne a ventiler
$checked = ('label' == 'O') ? ' checked=checked' : '';
$checked = ('label' == 'O') ? ' checked' : '';
print '<td align="center">';
print '<input type="checkbox" name="mesCasesCochees[]" ' . $checked . ' value="' . $objp->accounting . '"/>';
@ -183,4 +183,4 @@ if ($result) {
}
llxFooter();
$db->close();
$db->close();

View File

@ -5,6 +5,7 @@
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -148,7 +149,7 @@ llxHeader();
$form = new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'setup');
print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup');
$head = admin_accounting_prepare_head($accounting);
@ -181,7 +182,6 @@ print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
print "</td></tr>\n";
print '<tr '.$bc[true].'><td width="200"><input type="radio" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionModeVirtualDesc'))."</td></tr>\n";
print '</form>';
print "</table>\n";
@ -221,7 +221,7 @@ if ($resql) {
$row = $db->fetch_row($resql);
print '<option value="' . $row[0] . '"';
print $conf->global->CHARTOFACCOUNTS == $row[0] ? ' selected="selected"' : '';
print $conf->global->CHARTOFACCOUNTS == $row[0] ? ' selected' : '';
print '>' . $row[1] . ' - ' . $row[3] . '</option>';
$i ++;
@ -285,10 +285,10 @@ if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
}
print '</tr>';
print '</form>';
print "</table>\n";
print '<br /><br /><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
print '</form>';
llxFooter();
$db->close();
$db->close();

View File

@ -1,9 +1,10 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -47,8 +48,8 @@ $list = array (
'ACCOUNTING_SELL_JOURNAL',
'ACCOUNTING_PURCHASE_JOURNAL',
'ACCOUNTING_SOCIAL_JOURNAL',
'ACCOUNTING_CASH_JOURNAL',
'ACCOUNTING_MISCELLANEOUS_JOURNAL'
'ACCOUNTING_MISCELLANEOUS_JOURNAL',
'ACCOUNTING_EXPENSEREPORT_JOURNAL'
);
/*
@ -82,7 +83,7 @@ llxHeader();
$form = new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'setup');
print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup');
$head = admin_accounting_prepare_head(null);
@ -112,10 +113,10 @@ foreach ( $list as $key ) {
print '</td></tr>';
}
print '</form>';
print "</table>\n";
print '<br /><div style="text-align:center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="button"></div>';
print '</form>';
print '<br />';
@ -163,7 +164,6 @@ $db->free($resql);
print "</table>\n";
print '</table>';
print '</div>';
print '<br>';

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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

View File

@ -358,7 +358,8 @@ else
print '<td><input type="submit" class="button" value="' . $langs->trans("Save") . '"></td>';
print '</tr>';
}
print "</table>";
print '</table>';
print '</form>';
}
}
}

View File

@ -27,7 +27,7 @@
/**
* Class to manage accounting accounts
*/
class AccountingAccount
class AccountingAccount extends CommonObject
{
var $db;
var $error;
@ -125,6 +125,7 @@ class AccountingAccount
{
global $conf;
$error = 0;
$now = dol_now();
$now=dol_now();
@ -439,4 +440,4 @@ class AccountingAccount
return - 1;
}
}
}
}

View File

@ -27,7 +27,7 @@
/**
* Class to manage accountancy book keeping
*/
class BookKeeping
class BookKeeping extends CommonObject
{
var $db;
var $error;
@ -701,4 +701,4 @@ class BookKeepingLine
var $fk_user_author;
var $code_journal;
var $piece_num;
}
}

View File

@ -66,7 +66,7 @@ class FormVentilation extends Form
$selected = '';
if ($selectedkey == $obj->import_key) {
$selected = ' selected="selected" ';
$selected = ' selected ';
}
$out .= '<OPTION value="' . $obj->import_key . '"' . $selected . '>' . $obj->import_key . '</OPTION>';
@ -126,8 +126,8 @@ class FormVentilation extends Form
// Remember guy's we store in database llx_facturedet the rowid of accountingaccount 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 == $obj->rowid) {
// $out .= '<option value="' . $obj->account_number . '" selected="selected">' . $label . '</option>';
$out .= '<option value="' . $obj->rowid . '" selected="selected">' . $label . '</option>';
// $out .= '<option value="' . $obj->account_number . '" selected>' . $label . '</option>';
$out .= '<option value="' . $obj->rowid . '" selected>' . $label . '</option>';
} else {
// $out .= '<option value="' . $obj->account_number . '">' . $label . '</option>';
$out .= '<option value="' . $obj->rowid . '">' . $label . '</option>';
@ -184,7 +184,7 @@ class FormVentilation extends Form
$label = $obj->pcg_type;
if (($selectid != '') && $selectid == $obj->pcg_type) {
$out .= '<option value="' . $obj->pcg_type . '" selected="selected">' . $label . '</option>';
$out .= '<option value="' . $obj->pcg_type . '" selected>' . $label . '</option>';
} else {
$out .= '<option value="' . $obj->pcg_type . '">' . $label . '</option>';
}
@ -240,7 +240,7 @@ class FormVentilation extends Form
$label = $obj->pcg_subtype;
if (($selectid != '') && $selectid == $obj->pcg_subtype) {
$out .= '<option value="' . $obj->pcg_subtype . '" selected="selected">' . $label . '</option>';
$out .= '<option value="' . $obj->pcg_subtype . '" selected>' . $label . '</option>';
} else {
$out .= '<option value="' . $obj->pcg_subtype . '">' . $label . '</option>';
}

View File

@ -24,7 +24,7 @@
*/
require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
@ -40,7 +40,7 @@ $id = GETPOST('id');
// Security check
if ($user->societe_id > 0)
accessforbidden();
/*
* Actions
*/
@ -51,7 +51,7 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
$sql .= " SET fk_code_ventilation = " . $codeventil;
$sql .= " WHERE rowid = " . $id;
dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG);
$resql = $db->query($sql);
if (! $resql) {
@ -60,7 +60,7 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
} else {
header("Location: ./lines.php");
exit();
}
}
}
llxHeader("", "", "FicheVentilation");
@ -85,38 +85,38 @@ if (! empty($id)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$num_lines = $db->num_rows($result);
$i = 0;
if ($num_lines) {
$objp = $db->fetch_object($result);
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '" method="post">' . "\n";
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="ventil">';
$linkback='<a href="'.DOL_URL_ROOT.'/accountancy/customer/lines.php">'.$langs->trans("Back").'</a>';
print_fiche_titre($langs->trans('CustomersVentilation'),$linkback,'setup');
print_fiche_titre($langs->trans('CustomersVentilation'),$linkback,'title_setup');
print '<table class="border" width="100%">';
// Ref facture
print '<tr><td>' . $langs->trans("Invoice") . '</td>';
$facture_static->ref = $objp->facnumber;
$facture_static->id = $objp->facid;
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
print '</tr>';
print '<tr><td width="20%">' . $langs->trans("Line") . '</td>';
print '<td>' . nl2br($objp->description) . '</td></tr>';
print '<tr><td width="20%">' . $langs->trans("Account") . '</td><td>';
@ -125,10 +125,13 @@ if (! empty($id)) {
print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1);
print '</td></tr>';
print '</table>';
print '<br><div align="center"><input class="button" type="submit" value="' . $langs->trans("Save") . '">&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
print '<br><div class="center">';
print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
print '</div>';
print '</form>';
} else {
print "Error";
@ -141,4 +144,4 @@ if (! empty($id)) {
}
llxFooter();
$db->close();
$db->close();

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -158,7 +159,7 @@ $sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
$sql .= " GROUP BY fd.fk_code_ventilation";
@ -233,7 +234,7 @@ $sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
@ -306,7 +307,7 @@ if (! empty($conf->margin->enabled)) {
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@ -27,19 +27,23 @@
*/
require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
// langs
$langs->load("bills");
$langs->load("compta");
$langs->load("main");
$langs->load("accountancy");
$account_parent = GETPOST('account_parent');
$changeaccount = GETPOST('changeaccount');
$search_ref = GETPOST('search_ref','alpha');
$search_facture = GETPOST('search_facture','alpha');
$search_label = GETPOST('search_label','alpha');
$search_desc = GETPOST('search_desc','alpha');
$search_amount = GETPOST('search_amount','alpha');
$search_acount = GETPOST('search_account','alpha');
// Security check
if ($user->societe_id > 0)
@ -49,13 +53,18 @@ if (! $user->rights->accounting->ventilation->dispatch)
$formventilation = new FormVentilation($db);
// change account
// Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$search_ref='';
$search_facture='';
$search_label='';
$search_desc='';
$search_amount='';
$search_account='';
}
$changeaccount = GETPOST('changeaccount');
$is_search = GETPOST('button_search_x');
if (is_array($changeaccount) && count($changeaccount) > 0 && empty($is_search)) {
if (is_array($changeaccount) && count($changeaccount) > 0) {
$error = 0;
$db->begin();
@ -110,21 +119,24 @@ $sql .= " AND aa.rowid = l.fk_code_ventilation";
if (strlen(trim(GETPOST("search_facture")))) {
$sql .= " AND f.facnumber like '%" . GETPOST("search_facture") . "%'";
}
if (strlen(trim(GETPOST("search_ref")))) {
$sql .= " AND p.ref like '%" . GETPOST("search_ref") . "%'";
if (strlen(trim($search_ref))) {
$sql .= " AND p.ref like '%" . $search_ref . "%'";
}
if (strlen(trim(GETPOST("search_label")))) {
$sql .= " AND p.label like '%" . GETPOST("search_label") . "%'";
if (strlen(trim($search_label))) {
$sql .= " AND p.label like '%" . $search_label . "%'";
}
if (strlen(trim(GETPOST("search_desc")))) {
$sql .= " AND l.description like '%" . GETPOST("search_desc") . "%'";
if (strlen(trim($search_desc))) {
$sql .= " AND l.description like '%" . $search_desc . "%'";
}
if (strlen(trim(GETPOST("search_account")))) {
$sql .= " AND aa.account_number like '%" . GETPOST("search_account") . "%'";
if (strlen(trim($search_amount))) {
$sql .= " AND l.total_ht like '%" . $search_amount . "%'";
}
if (strlen(trim($search_account))) {
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
}
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
$sql .= " ORDER BY l.rowid";
@ -161,18 +173,17 @@ if ($result) {
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="' . GETPOST("search_facture") . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . GETPOST("search_ref") . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . GETPOST("search_label") . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . GETPOST("search_desc") . '"></td>';
print '<td align="right">&nbsp;</td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . GETPOST("search_account") . '"></td>';
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="' . $search_facture . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="8" name="search_amount" value="' . $search_amount. '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
print '<td align="center">&nbsp;</td>';
print '<td align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" alt="' . $langs->trans("Search") . '">';
print '</td>';
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print "</td></tr>\n";
$facture_static = new Facture($db);
$product_static = new Product($db);
@ -180,7 +191,7 @@ if ($result) {
$var = True;
while ( $objp = $db->fetch_object($result) ) {
$var = ! $var;
$codeCompta = $objp->account_number . ' ' . $objp->label;
$codecompta = $objp->account_number . ' ' . $objp->label;
print "<tr $bc[$var]>";
@ -202,8 +213,8 @@ if ($result) {
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
print '<td align="left">' . price($objp->total_ht) . '</td>';
print '<td align="left">' . $codeCompta . '</td>';
print '<td align="right">' . price($objp->total_ht) . '</td>';
print '<td align="left">' . $codecompta . '</td>';
print '<td>' . $objp->rowid . '</td>';
print '<td><a href="./card.php?id=' . $objp->rowid . '">';
print img_edit();

View File

@ -132,7 +132,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
$sql .= " ORDER BY l.rowid";
@ -251,4 +251,4 @@ if ($result) {
}
$db->close();
llxFooter();
llxFooter();

View File

@ -167,7 +167,10 @@ if ($result) {
}
$links = $object->get_url($obj->rowid);
// get_url may return -1 which is not traversable
if (is_array($links))
{
foreach ( $links as $key => $val )
{
$tabtype[$obj->rowid] = $links[$key]['type'];
@ -249,11 +252,14 @@ if ($result) {
$tabtp [$obj->rowid] [$accountancy_account_salary] += $obj->amount;
}*/
}
}
$tabbq[$obj->rowid][$compta_bank] += $obj->amount;
// if($obj->socid)$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
$i ++;
$i++;
}
} else {
dol_print_error($db);
@ -417,7 +423,7 @@ if ($action == 'export_csv')
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
{
$sep = ";";
foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
@ -502,7 +508,7 @@ if ($action == 'export_csv')
// Third party
if (is_array ( $tabtp[$key]))
{
foreach ( $tabtp[$key] as $k => $mt )
foreach ( $tabtp[$key] as $k => $mt )
{
if ($mt) {
print '"' . $date . '"' . $sep;
@ -516,7 +522,7 @@ if ($action == 'export_csv')
}
}
else
{
{
foreach ( $tabbq[$key] as $k => $mt )
{
if (1)
@ -589,7 +595,7 @@ else
print '</div>';
// End report
print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writeBookKeeping();" />';

View File

@ -96,7 +96,7 @@ $sql .= " JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = fd.fk_factu
$sql .= " JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
$sql .= " WHERE f.fk_statut > 0 ";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = " . $conf->entity;
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")";
}
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
$sql .= " AND f.type IN (0,1,2)";
@ -240,7 +240,7 @@ if ($action == 'writebookkeeping') {
* View
*/
$companystatic = new Societe($db);
$companystatic = new Fournisseur($db);
// Export
if ($action == 'export_csv')
@ -249,7 +249,11 @@ if ($action == 'export_csv')
$purchase_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_achats.csv');
if ($conf->global->EXPORT_PREFIX_SPEC)
$filename=$conf->global->EXPORT_PREFIX_SPEC."_"."journal_achats.csv";
else
$filename="journal_achats.csv";
header('Content-Disposition: attachment;filename='.$filename);
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
{
@ -408,7 +412,6 @@ if ($action == 'export_csv')
$r = '';
$invoicestatic = new FactureFournisseur($db);
$companystatic = new Fournisseur($db);
foreach ( $tabfac as $key => $val ) {
$invoicestatic->id = $key;
@ -471,4 +474,4 @@ if ($action == 'export_csv')
// End of page
llxFooter();
}
$db->close();
$db->close();

View File

@ -7,6 +7,7 @@
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -59,6 +60,8 @@ if ($user->societe_id > 0)
$action = GETPOST('action');
/*
* View
*/
@ -96,13 +99,13 @@ $sql .= " JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva as ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'";
$sql .= " WHERE fd.fk_code_ventilation > 0 ";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = " . $conf->entity;
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
$sql .= " AND f.fk_statut > 0";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
$sql .= " AND f.type IN (0,1,2)";
$sql .= " AND f.type IN (0,1,2,5)";
else
$sql .= " AND f.type IN (0,1,2,3)";
$sql .= " AND f.type IN (0,1,2,3,5)";
$sql .= " AND fd.product_type IN (0,1)";
if ($date_start && $date_end)
$sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
@ -136,6 +139,16 @@ if ($result) {
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_ACCOUNT : $langs->trans("CodeNotDef");
$compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva);
// Situation invoices handling
$line = new FactureLigne($db);
$line->fetch($obj->id);
$prev_progress = $line->get_prev_progress();
if ($obj->situation_percent == 0) { // Avoid divide by 0
$situation_ratio = 0;
} else {
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
}
// Invoice lines
$tabfac[$obj->rowid]["date"] = $obj->df;
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
@ -148,9 +161,9 @@ if ($result) {
$tabht[$obj->rowid][$compta_prod] = 0;
if (! isset($tabtva[$obj->rowid][$compta_tva]))
$tabtva[$obj->rowid][$compta_tva] = 0;
$tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc;
$tabht[$obj->rowid][$compta_prod] += $obj->total_ht;
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva;
$tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc * $situation_ratio;
$tabht[$obj->rowid][$compta_prod] += $obj->total_ht * $situation_ratio;
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva * $situation_ratio;
$tabcompany[$obj->rowid] = array (
'id' => $obj->socid,
'name' => $obj->name,
@ -165,14 +178,18 @@ if ($result) {
/*
* Action
* FIXME Action must be set before any view part to respect MVC
*/
// Bookkeeping Write
if ($action == 'writebookkeeping') {
if ($action == 'writebookkeeping')
{
$now = dol_now();
foreach ( $tabfac as $key => $val ) {
foreach ( $tabttc[$key] as $k => $mt ) {
foreach ($tabfac as $key => $val)
{
foreach ($tabttc[$key] as $k => $mt)
{
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"];
@ -193,7 +210,7 @@ if ($action == 'writebookkeeping') {
}
// Product / Service
foreach ( $tabht[$key] as $k => $mt ) {
foreach ($tabht[$key] as $k => $mt) {
if ($mt) {
// get compte id and label
$accountingaccount = new AccountingAccount($db);
@ -221,8 +238,10 @@ if ($action == 'writebookkeeping') {
// VAT
// var_dump($tabtva);
foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) {
foreach ($tabtva[$key] as $k => $mt)
{
if ($mt)
{
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"];
@ -244,20 +263,26 @@ if ($action == 'writebookkeeping') {
}
}
}
// Export
if ($action == 'export_csv') {
if ($action == 'export_csv')
{
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_ventes.csv');
if ($conf->global->EXPORT_PREFIX_SPEC)
$filename=$conf->global->EXPORT_PREFIX_SPEC."_"."journal_ventes.csv";
else
$filename="journal_ventes.csv";
header('Content-Disposition: attachment;filename='.$filename);
$companystatic = new Client($db);
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
{
$sep = ";";
foreach ( $tabfac as $key => $val ) {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
@ -307,9 +332,11 @@ if ($action == 'export_csv') {
}
}
}
} else // Model Classic Export
}
else // Model Classic Export
{
foreach ( $tabfac as $key => $val ) {
foreach ($tabfac as $key => $val)
{
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$companystatic->client = $tabcompany[$key]['code_client'];
@ -327,10 +354,11 @@ if ($action == 'export_csv') {
}
// Product / Service
foreach ( $tabht[$key] as $k => $mt ) {
foreach ($tabht[$key] as $k => $mt)
{
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k);
if ($mt) {
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
@ -343,7 +371,8 @@ if ($action == 'export_csv') {
}
// VAT
foreach ( $tabtva[$key] as $k => $mt ) {
foreach ($tabtva[$key] as $k => $mt)
{
if ($mt) {
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
@ -415,7 +444,8 @@ if ($action == 'export_csv') {
$invoicestatic = new Facture($db);
$companystatic = new Client($db);
foreach ( $tabfac as $key => $val ) {
foreach ($tabfac as $key => $val)
{
$invoicestatic->id = $key;
$invoicestatic->ref = $val["ref"];
$invoicestatic->type = $val["type"];
@ -423,7 +453,8 @@ if ($action == 'export_csv') {
$date = dol_print_date($db->jdate($val["date"]), 'day');
// Third party
foreach ( $tabttc[$key] as $k => $mt ) {
foreach ($tabttc[$key] as $k => $mt)
{
print "<tr " . $bc[$var] . ">";
print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
@ -439,10 +470,11 @@ if ($action == 'export_csv') {
print "</tr>";
// Product / Service
foreach ( $tabht[$key] as $k => $mt ) {
foreach ($tabht[$key] as $k => $mt)
{
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k);
if ($mt) {
print "<tr " . $bc[$var] . ">";
print "<td>" . $date . "</td>";
@ -456,7 +488,8 @@ if ($action == 'export_csv') {
}
// VAT
foreach ( $tabtva[$key] as $k => $mt ) {
foreach ($tabtva[$key] as $k => $mt)
{
if ($mt) {
print "<tr " . $bc[$var] . ">";
print "<td>" . $date . "</td>";
@ -477,4 +510,5 @@ if ($action == 'export_csv') {
// End of page
llxFooter();
}
$db->close();
$db->close();

View File

@ -5,6 +5,7 @@
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -87,7 +88,7 @@ if ($_GET["id"]) {
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn ";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")";
}
$result = $db->query($sql);

View File

@ -144,7 +144,7 @@ $sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'
$sql .= " AND ff.fk_statut > 0 ";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND ff.entity = '" . $conf->entity . "'";
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 1) . ")";
}
$sql .= " GROUP BY ffd.fk_code_ventilation";
@ -221,7 +221,7 @@ $sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'
$sql .= " AND ff.fk_statut > 0 ";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND ff.entity = '" . $conf->entity . "'";
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 1) . ")";
}
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@ -26,34 +26,46 @@
*/
require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
// Langs
$langs->load("compta");
$langs->load("bills");
$langs->load("other");
$langs->load("main");
$langs->load("accountancy");
$account_parent = GETPOST('account_parent');
$changeaccount = GETPOST('changeaccount');
$search_ref = GETPOST('search_ref','alpha');
$search_facture = GETPOST('search_facture','alpha');
$search_label = GETPOST('search_label','alpha');
$search_desc = GETPOST('search_desc','alpha');
$search_amount = GETPOST('search_amount','alpha');
$search_acount = GETPOST('search_account','alpha');
// Security check
if ($user->societe_id > 0)
accessforbidden();
if (! $user->rights->accounting->ventilation->dispatch)
accessforbidden();
$formventilation = new FormVentilation($db);
$changeaccount = GETPOST('changeaccount');
// Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$search_ref='';
$search_facture='';
$search_label='';
$search_desc='';
$search_amount='';
$search_account='';
}
$is_search = GETPOST('button_search_x');
if (is_array($changeaccount) && count($changeaccount) > 0 && empty($is_search)) {
if (is_array($changeaccount) && count($changeaccount) > 0) {
$error = 0;
$db->begin();
@ -83,7 +95,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && empty($is_search))
llxHeader('', $langs->trans("SuppliersVentilation") . ' - ' . $langs->trans("Dispatched"));
$page = $_GET["page"];
$page = GETPOST("page");
if ($page < 0)
$page = 0;
@ -105,23 +117,26 @@ $sql .= " , " . MAIN_DB_PREFIX . "facture_fourn_det as l";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
$sql .= " AND aa.rowid = l.fk_code_ventilation";
if (strlen(trim($_GET["search_facture"]))) {
$sql .= " AND f.ref like '%" . $_GET["search_facture"] . "%'";
if (strlen(trim($search_facture))) {
$sql .= " AND f.ref like '%" . $search_facture . "%'";
}
if (strlen(trim($_GET["search_ref"]))) {
$sql .= " AND p.ref like '%" . $_GET["search_ref"] . "%'";
if (strlen(trim($search_ref))) {
$sql .= " AND p.ref like '%" . $search_ref . "%'";
}
if (strlen(trim($_GET["search_label"]))) {
$sql .= " AND p.label like '%" . $_GET["search_label"] . "%'";
if (strlen(trim($search_label))) {
$sql .= " AND p.label like '%" . $search_label . "%'";
}
if (strlen(trim($_GET["search_desc"]))) {
$sql .= " AND l.description like '%" . $_GET["search_desc"] . "%'";
if (strlen(trim($search_desc))) {
$sql .= " AND l.description like '%" . $search_desc . "%'";
}
if (strlen(trim($_GET["search_account"]))) {
$sql .= " AND aa.account_number like '%" . $_GET["search_account"] . "%'";
if (strlen(trim($search_amount))) {
$sql .= " AND l.total_ht like '%" . $search_amount . "%'";
}
if (strlen(trim($search_account))) {
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
}
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")";
}
$sql .= " ORDER BY l.rowid";
@ -159,18 +174,17 @@ if ($result) {
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="' . $_GET["search_facture"] . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . GETPOST("search_ref") . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . GETPOST("search_label") . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . GETPOST("search_desc") . '"></td>';
print '<td align="right">&nbsp;</td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . GETPOST("search_account") . '"></td>';
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="' . $search_facture . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_amount" value="' . $search_amount . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
print '<td align="center">&nbsp;</td>';
print '<td align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" alt="' . $langs->trans("Search") . '">';
print '</td>';
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print "</td></tr>\n";
$facturefournisseur_static = new FactureFournisseur($db);
$product_static = new Product($db);

View File

@ -135,7 +135,7 @@ $sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")";
}
$sql .= " ORDER BY l.rowid";

View File

@ -7,6 +7,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -110,7 +111,7 @@ llxHeader('',$langs->trans("MembersSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
$head = member_admin_prepare_head();

View File

@ -58,54 +58,21 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
* View
*/
$textobject = $langs->transnoentitiesnoconv("Members");
$help_url='EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('',$langs->trans("MembersSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
$head = member_admin_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("Members"), 0, 'user');
print $langs->trans("DefineHereComplementaryAttributes", $langs->transnoentitiesnoconv("Members")).'<br>'."\n";
print '<br>';
// Load attribute_label
$extrafields->fetch_name_optionals_label($elementtype);
print "<table summary=\"listofattributes\" class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("AttributeCode").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td align="center">'.$langs->trans("Unique").'</td>';
print '<td align="center">'.$langs->trans("Required").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
$var=True;
foreach($extrafields->attribute_type as $key => $value)
{
$var=!$var;
print "<tr ".$bc[$var].">";
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
print "<td>".$key."</td>\n";
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
print "&nbsp; <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=".$key."\">".img_delete()."</a></td>\n";
print "</tr>";
}
print "</table>";
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end();

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -67,49 +68,14 @@ llxHeader('',$langs->trans("MembersSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
$head = member_admin_prepare_head();
dol_fiche_head($head, 'attributes_type', $langs->trans("Members"), 0, 'user');
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
print '<br>';
// Load attribute_label
$extrafields->fetch_name_optionals_label($elementtype);
print "<table summary=\"listofattributes\" class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("AttributeCode").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td align="center">'.$langs->trans("Unique").'</td>';
print '<td align="center">'.$langs->trans("Required").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
$var=True;
foreach($extrafields->attribute_type as $key => $value)
{
$var=!$var;
print "<tr ".$bc[$var].">";
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
print "<td>".$key."</td>\n";
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
print "&nbsp; <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=".$key."\">".img_delete()."</a></td>\n";
print "</tr>";
}
print "</table>";
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end();

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
@ -80,10 +80,15 @@ llxHeader('',$langs->trans("MembersSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
$head = member_admin_prepare_head();
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="update">';
dol_fiche_head($head, 'public', $langs->trans("Members"), 0, 'user');
if ($conf->use_javascript_ajax)
@ -129,8 +134,6 @@ if ($conf->use_javascript_ajax)
print $langs->trans("BlankSubscriptionFormDesc").'<br><br>';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder" width="100%">';
@ -164,7 +167,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bc[$var].' id="tramount"><td>';
print $langs->trans("DefaultAmount");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(! empty($conf->global->MEMBER_NEWFORM_AMOUNT)?$conf->global->MEMBER_NEWFORM_AMOUNT:'').'">';;
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(! empty($conf->global->MEMBER_NEWFORM_AMOUNT)?$conf->global->MEMBER_NEWFORM_AMOUNT:'').'">';
print "</td></tr>\n";
// Can edit
@ -203,13 +206,14 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
print '</table>';
dol_fiche_end();
print '<center>';
print '<br><input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</center>';
print '</form>';
dol_fiche_end();
print '<br>';

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@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
@ -45,6 +46,7 @@ $langs->load("users");
$langs->load('other');
$action=GETPOST('action','alpha');
$cancel=GETPOST('cancel');
$backtopage=GETPOST('backtopage','alpha');
$confirm=GETPOST('confirm','alpha');
$rowid=GETPOST('rowid','int');
@ -113,7 +115,8 @@ $hookmanager->initHooks(array('membercard','globalcard'));
/*
* Actions
*/
*/
if ($cancel) $action='';
$parameters=array('rowid'=>$rowid, 'objcanvas'=>$objcanvas);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
@ -236,7 +239,7 @@ if (empty($reshook))
}
}
if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
if ($action == 'update' && $cancel='' && $user->rights->adherent->creer)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -249,7 +252,7 @@ if (empty($reshook))
}
$lastname=$_POST["lastname"];
$firstname=$_POST["firstname"];
$morphy=$morphy=$_POST["morphy"];;
$morphy=$morphy=$_POST["morphy"];
if ($morphy != 'mor' && empty($lastname)) {
$error++;
$langs->load("errors");
@ -322,15 +325,15 @@ if (empty($reshook))
if ($result >= 0 && ! count($object->errors))
{
// Logo/Photo save
$dir= $conf->adherent->dir_output . '/' . get_exdir($object->id,2,0,1).'/photos';
$dir= $conf->adherent->dir_output . '/' . get_exdir($object->id,2,0,1,$object,'member').'/photos';
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
if ($file_OK)
{
if (GETPOST('deletephoto'))
{
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$fileimg=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1).'/photos/'.$object->photo;
$dirthumbs=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1).'/photos/thumbs';
$fileimg=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1,$object,'member').'/photos/'.$object->photo;
$dirthumbs=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1,$object,'member').'/photos/thumbs';
dol_delete_file($fileimg);
dol_delete_dir_recursive($dirthumbs);
}
@ -725,7 +728,7 @@ else
{
/* ************************************************************************** */
/* */
/* Creation card */
/* Creation mode */
/* */
/* ************************************************************************** */
$object->canvas=$canvas;
@ -779,7 +782,10 @@ else
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
dol_fiche_head('');
print '<table class="border" width="100%">';
print '<tbody>';
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
@ -868,13 +874,13 @@ else
print '</td></tr>';
}
// Tel pro
// Pro phone
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(GETPOST('phone','alpha')?GETPOST('phone','alpha'):$object->phone).'"></td></tr>';
// Tel perso
// Personal phone
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(GETPOST('phone_perso','alpha')?GETPOST('phone_perso','alpha'):$object->phone_perso).'"></td></tr>';
// Tel mobile
// Mobile phone
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile','alpha')?GETPOST('phone_mobile','alpha'):$object->phone_mobile).'"></td></tr>';
// Skype
@ -888,7 +894,7 @@ else
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
print "</td></tr>\n";
// Profil public
// Public profil
print "<tr><td>".$langs->trans("Public")."</td><td>\n";
print $form->selectyesno("public",$object->public,1);
print "</td></tr>\n";
@ -915,21 +921,25 @@ else
print $form->select_dolusers($object->user_id,'userid',1);
print '</td></tr>';
*/
print '<tbody>';
print "</table>\n";
print '<br>';
print '<center><input type="submit" class="button" value="'.$langs->trans("AddMember").'"></center>';
dol_fiche_end();
print '<div class="center">';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("AddMember").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'" onclick="history.go(-1)" />';
print '</div>';
print "</form>\n";
}
if ($action == 'edit')
{
/********************************************
*
* Fiche en mode edition
*
* Edition mode
*
********************************************/
@ -1027,6 +1037,7 @@ else
print '<tr><td><span class="fieldrequired">'.$langs->trans("Nature").'</span></td><td>';
print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy);
print "</td>";
// Photo
print '<td align="center" class="hideonsmartphone" valign="middle" width="25%" rowspan="'.$rowspan.'">';
print $form->showphoto('memberphoto',$object)."\n";
@ -1107,13 +1118,13 @@ else
print '</td></tr>';
}
// Tel
// Pro phone
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(isset($_POST["phone"])?$_POST["phone"]:$object->phone).'"></td></tr>';
// Tel perso
// Personal phone
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
// Tel mobile
// Mobile phone
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td></tr>';
// Skype
@ -1127,7 +1138,7 @@ else
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
print "</td></tr>\n";
// Profil public
// Public profil
print "<tr><td>".$langs->trans("Public")."</td><td>\n";
print $form->selectyesno("public",(isset($_POST["public"])?$_POST["public"]:$object->public),1);
print "</td></tr>\n";
@ -1168,11 +1179,11 @@ else
print '</table>';
print '<br><center>';
print '<br><div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; &nbsp; &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</center';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'" onclick="history.go(-1)" />';
print '</div>';
print '</form>';
@ -1183,7 +1194,7 @@ else
{
/* ************************************************************************** */
/* */
/* Mode affichage */
/* View mode */
/* */
/* ************************************************************************** */
@ -1204,8 +1215,8 @@ else
/*
* Affichage onglets
*/
* Show tabs
*/
$head = member_prepare_head($object);
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
@ -1296,7 +1307,7 @@ else
print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail",$object->email),"confirm_sendinfo",'',0,1);
}
// Confirm resiliate
// Confirm terminate
if ($action == 'resign')
{
$langs->load("mails");
@ -1536,9 +1547,8 @@ else
/*
* Barre d'actions
*
*/
* Hotbar
*/
print '<div class="tabsAction">';
if ($action != 'valid' && $action != 'editlogin' && $action != 'editthirdparty')
@ -1553,7 +1563,7 @@ else
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</font></div>';
}
// Valider
// Validate
if ($object->statut == -1)
{
if ($user->rights->adherent->creer)
@ -1566,7 +1576,7 @@ else
}
}
// Reactiver
// Reactivate
if ($object->statut == 0)
{
if ($user->rights->adherent->creer)
@ -1597,7 +1607,7 @@ else
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendCardByMail")."</font></div>";
}
// Resilier
// Terminate
if ($object->statut >= 1)
{
if ($user->rights->adherent->supprimer)

View File

@ -3,6 +3,7 @@
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@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
@ -53,6 +54,7 @@ $object = new Adherent($db);
$extrafields = new ExtraFields($db);
$adht = new AdherentType($db);
$errmsg='';
$errmsgs=array();
$defaultdelay=1;
$defaultdelayunit='y';
@ -282,7 +284,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
{
$error++;
$errmsg=$object->error;
setEventMessage($object->errors, 'errors');
setEventMessages($object->error,$object->errors, 'errors');
}
if (! $error)
@ -319,12 +321,14 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
{
$error++;
$errmsg=$acct->error;
$errmsgs=$acct->errors;
}
}
else
{
$error++;
$errmsg=$acct->error;
$errmsgs=$acct->errors;
}
}
@ -352,6 +356,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
if ($result <= 0)
{
$errmsg=$customer->error;
$errmsgs=$acct->errors;
$error++;
}
}
@ -378,6 +383,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
if ($result <= 0)
{
$errmsg=$invoice->error;
$errmsgs=$invoice->errors;
$error++;
}
}
@ -409,6 +415,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
if ($result <= 0)
{
$errmsg=$invoice->error;
$errmsgs=$invoice->errors;
$error++;
}
}
@ -435,6 +442,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
if (! $paiement_id > 0)
{
$errmsg=$paiement->error;
$errmsgs=$paiement->errors;
$error++;
}
}
@ -446,7 +454,8 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
if (! ($bank_line_id > 0))
{
$errmsg=$paiement->error;
setEventMessage($paiement->errors, 'errors');
$errmsgs=$paiement->errors;
setEventMessages($paiement->error, $paiement->errors, 'errors');
$error++;
}
}
@ -487,8 +496,6 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
//if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
$invoice->generateDocument($invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
}
@ -514,7 +521,10 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
$texttosend=$object->makeSubstitution($adht->getMailOnSubscription());
$result=$object->send_an_email($texttosend,$subjecttosend,array(),array(),array(),"","",0,-1);
if ($result < 0) $errmsg=$object->error;
if ($result < 0)
{
$errmsg=$object->error;
}
}
$_POST["cotisation"]='';
@ -538,7 +548,7 @@ $now=dol_now();
llxHeader('',$langs->trans("Subscriptions"),'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros');
if ($rowid)
if ($rowid > 0)
{
$res=$object->fetch($rowid);
if ($res < 0) { dol_print_error($db,$object->error); exit; }
@ -547,8 +557,6 @@ if ($rowid)
$head = member_prepare_head($object);
dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user');
$rowspan=10;
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++;
if (! empty($conf->societe->enabled)) $rowspan++;
@ -556,6 +564,9 @@ if ($rowid)
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="rowid" value="'.$object->id.'">';
dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user');
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
@ -687,16 +698,17 @@ if ($rowid)
print '</td></tr>';
print "</table>\n";
print '</form>';
dol_fiche_end();
print '</form>';
dol_htmloutput_errors($errmsg);
dol_htmloutput_errors($errmsg,$errmsgs);
/*
* Barre d'actions
* Hotbar
*/
// Lien nouvelle cotisation si non brouillon et non resilie
@ -864,7 +876,7 @@ if ($rowid)
}
});
';
if (GETPOST('paymentsave')) print '$("#'.GETPOST('paymentsave').'").attr("checked",true);';
if (GETPOST('paymentsave')) print '$("#'.GETPOST('paymentsave').'").prop("checked",true);';
print '});';
print '</script>'."\n";
}
@ -897,9 +909,13 @@ if ($rowid)
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="memberlabel" id="memberlabel" value="'.dol_escape_htmltag($object->getFullName($langs)).'">';
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($object->societe).'">';
print "<table class=\"border\" width=\"100%\">\n";
$today=dol_now();
dol_fiche_head('');
print "<table class=\"border\" width=\"100%\">\n";
print '<tbody>';
$today=dol_now();
$datefrom=0;
$dateto=0;
$paymentdate=-1;
@ -971,18 +987,18 @@ if ($rowid)
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('MoreActions');
print '</td>';
print '<td>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice)?' checked="checked"':'').'> '.$langs->trans("None").'<br>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice)?' checked':'').'> '.$langs->trans("None").'<br>';
// Add entry into bank accoun
if (! empty($conf->banque->enabled))
{
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(! empty($bankdirect)?' checked="checked"':'');
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(! empty($bankdirect)?' checked':'');
print '> '.$langs->trans("MoreActionBankDirect").'<br>';
}
// Add invoice with no payments
if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
{
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(! empty($invoiceonly)?' checked="checked"':'');
//if (empty($object->fk_soc)) print ' disabled="disabled"';
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(! empty($invoiceonly)?' checked':'');
//if (empty($object->fk_soc)) print ' disabled';
print '> '.$langs->trans("MoreActionInvoiceOnly");
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
else
@ -999,15 +1015,15 @@ if ($rowid)
{
$prodtmp=new Product($db);
$prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
print '. '.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(0));
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
}
print '<br>';
}
// Add invoice with payments
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
{
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(! empty($bankviainvoice)?' checked="checked"':'');
//if (empty($object->fk_soc)) print ' disabled="disabled"';
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(! empty($bankviainvoice)?' checked':'');
//if (empty($object->fk_soc)) print ' disabled';
print '> '.$langs->trans("MoreActionBankViaInvoice");
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
else
@ -1024,7 +1040,7 @@ if ($rowid)
{
$prodtmp=new Product($db);
$prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
print '. '.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(0));
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
}
print '<br>';
}
@ -1078,7 +1094,7 @@ if ($rowid)
$subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT);
$texttosend=$object->makeSubstitution($adht->getMailOnSubscription());
$tmp='<input name="sendmail" type="checkbox"'.(GETPOST('sendmail')?GETPOST('sendmail'):(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked="checked"':'')).'>';
$tmp='<input name="sendmail" type="checkbox"'.(GETPOST('sendmail')?GETPOST('sendmail'):(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked':'')).'>';
$helpcontent='';
$helpcontent.='<b>'.$langs->trans("MailFrom").'</b>: '.$conf->global->ADHERENT_MAIL_FROM.'<br>'."\n";
$helpcontent.='<b>'.$langs->trans("MailRecipient").'</b>: '.$object->email.'<br>'."\n";
@ -1091,14 +1107,16 @@ if ($rowid)
print $form->textwithpicto($tmp,$helpcontent,1,'help');
}
print '</td></tr>';
print '</tbody>';
print '</table>';
print '<br>';
print '<center>';
dol_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button" name="add" value="'.$langs->trans("AddSubscription").'">';
print ' &nbsp; &nbsp; ';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</center>';
print '</div>';
print '</form>';

View File

@ -5,7 +5,9 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* 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
@ -76,7 +78,8 @@ class Adherent extends CommonObject
var $morphy;
var $public;
var $note; // Private note
var $note_private; // Private note
var $note_public; // Public note
var $statut; // -1:brouillon, 0:resilie, >=1:valide,paye
var $photo;
@ -309,7 +312,7 @@ class Adherent extends CommonObject
$sql.= " VALUES (";
$sql.= " '".$this->db->idate($this->datec)."'";
$sql.= ", ".($this->login?"'".$this->db->escape($this->login)."'":"null");
$sql.= ", ".($user->id>0?$user->id:"null"); // Can be null because member can be createb by a guest or a script
$sql.= ", ".($user->id>0?$user->id:"null"); // Can be null because member can be created by a guest or a script
$sql.= ", null, null, '".$this->morphy."'";
$sql.= ", '".$this->typeid."'";
$sql.= ", ".$conf->entity;
@ -444,9 +447,10 @@ class Adherent extends CommonObject
$sql.= ", email='".$this->email."'";
$sql.= ", skype='".$this->skype."'";
$sql.= ", phone=" .($this->phone?"'".$this->db->escape($this->phone)."'":"null");
$sql.= ", phone_perso=" .($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null");
$sql.= ", phone_perso=" .($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null");
$sql.= ", phone_mobile=" .($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null");
$sql.= ", note=" .($this->note?"'".$this->db->escape($this->note)."'":"null");
$sql.= ", note_private=" .($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
$sql.= ", note_public=" .($this->note_private?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= ", photo=" .($this->photo?"'".$this->photo."'":"null");
$sql.= ", public='".$this->public."'";
$sql.= ", statut=" .$this->statut;
@ -472,7 +476,7 @@ class Adherent extends CommonObject
$action='update';
// Actions on extra fields (by external module)
// FIXME le hook fait double emploi avec le trigger !!
// TODO le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('memberdao'));
$parameters=array('id'=>$this->id);
$action='';
@ -1052,7 +1056,8 @@ class Adherent extends CommonObject
{
global $langs;
$sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_id, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,";
$sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_id, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note_private,";
$sql.= " d.note_public,";
$sql.= " d.email, d.skype, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,";
$sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
$sql.= " d.datec as datec,";
@ -1133,7 +1138,8 @@ class Adherent extends CommonObject
$this->datevalid = $this->db->jdate($obj->datev);
$this->birth = $this->db->jdate($obj->birthday);
$this->note = $obj->note;
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
$this->morphy = $obj->morphy;
$this->typeid = $obj->fk_adherent_type;
@ -1547,9 +1553,9 @@ class Adherent extends CommonObject
}
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $maxlen length max libelle
* @param string $option Page lien
* @return string Chaine avec URL
@ -1559,29 +1565,34 @@ class Adherent extends CommonObject
global $langs;
$result='';
$label = '<u>' . $langs->trans("ShowMember") . '</u>';
if (! empty($this->ref))
$label.= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
if (! empty($this->firstname) || ! empty($this->lastname))
$label.= '<br><b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs);
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == 'card')
{
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.'">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.$linkclose;
$linkend='</a>';
}
if ($option == 'subscription')
{
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$this->id.'">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$this->id.$linkclose;
$linkend='</a>';
}
if ($option == 'category')
{
$lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=3">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=3'.$linkclose;
$linkend='</a>';
}
$picto='user';
$label=$langs->trans("ShowMember");
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$lienfin;
$result.=$link.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$linkend;
return $result;
}
@ -1692,7 +1703,7 @@ class Adherent extends CommonObject
$sql = "SELECT count(a.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
$sql.= " WHERE a.statut > 0";
$sql.= " AND a.entity = ".$conf->entity;
$sql.= " AND a.entity IN (".getEntity('adherent', 1).")";
$resql=$this->db->query($sql);
if ($resql)
@ -1716,34 +1727,44 @@ class Adherent extends CommonObject
/**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Objet user
* @return int <0 if KO, >0 if OK
* @param User $user Objet user
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
function load_board($user)
{
global $conf;
$now=dol_now();
global $conf, $langs;
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
$this->nbtodo=$this->nbtodolate=0;
$now=dol_now();
$sql = "SELECT a.rowid, a.datefin";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
$sql.= " WHERE a.statut = 1";
$sql.= " AND a.entity = ".$conf->entity;
$sql.= " AND a.entity IN (".getEntity('adherent', 1).")";
$sql.= " AND (a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."')";
$resql=$this->db->query($sql);
if ($resql)
{
$langs->load("members");
$response = new WorkboardResponse();
$response->warning_delay=$conf->adherent->cotisation->warning_delay/60/60/24;
$response->label=$langs->trans("MembersWithSubscriptionToReceive");
$response->url=DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&amp;statut=1';
$response->img=img_object($langs->trans("Members"),"user");
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
if ($this->db->jdate($obj->datefin) < ($now - $conf->adherent->cotisation->warning_delay)) $this->nbtodolate++;
$response->nbtodo++;
if ($this->db->jdate($obj->datefin) < ($now - $conf->adherent->cotisation->warning_delay)) {
$response->nbtodolate++;
}
}
return 1;
return $response;
}
else
{
@ -1786,7 +1807,7 @@ class Adherent extends CommonObject
$this->phone = '0999999999';
$this->phone_perso = '0999999998';
$this->phone_mobile = '0999999997';
$this->note='No comment';
$this->note_private='No comment';
$this->birth=time();
$this->photo='';
$this->public=1;
@ -1859,7 +1880,8 @@ class Adherent extends CommonObject
if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso;
if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile;
if ($this->fax && ! empty($conf->global->LDAP_MEMBER_FIELD_FAX)) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax;
if ($this->note && ! empty($conf->global->LDAP_MEMBER_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note;
if ($this->note_private && ! empty($conf->global->LDAP_MEMBER_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note_private;
if ($this->note_public && ! empty($conf->global->LDAP_MEMBER_FIELD_NOTE_PUBLIC)) $info[$conf->global->LDAP_MEMBER_FIELD_NOTE_PUBLIC] = $this->note_public;
if ($this->birth && ! empty($conf->global->LDAP_MEMBER_FIELD_BIRTHDATE)) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->birth,'dayhourldap');
if (isset($this->statut) && ! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut;
if ($this->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap');
@ -1932,4 +1954,21 @@ class Adherent extends CommonObject
}
}
/**
* Function used to replace a thirdparty id with another one.
*
* @param DoliDB $db Database handler
* @param int $origin_id Old thirdparty id
* @param int $dest_id New thirdparty id
* @return bool
*/
public static function replaceThirdparty($db, $origin_id, $dest_id)
{
$tables = array(
'adherent'
);
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
}
}

View File

@ -73,7 +73,7 @@ class AdherentType extends CommonObject
{
global $conf;
$this->statut=trim($this->statut);
$this->statut=(int) $this->statut;
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type (";
$sql.= "libelle";
@ -266,9 +266,9 @@ class AdherentType extends CommonObject
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $maxlen length max libelle
* @return string String with URL
*/
@ -277,16 +277,16 @@ class AdherentType extends CommonObject
global $langs;
$result='';
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?rowid='.$this->id.'">';
$lienfin='</a>';
$picto='group';
$label=$langs->trans("ShowTypeCard",$this->libelle);
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
$link = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='group';
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.($maxlen?dol_trunc($this->libelle,$maxlen):$this->libelle).$lienfin;
$result.=$link.($maxlen?dol_trunc($this->libelle,$maxlen):$this->libelle).$linkend;
return $result;
}

View File

@ -65,7 +65,7 @@ class AdherentStats extends Stats
$this->field='cotisation';
$this->where.= " m.statut != 0";
$this->where.= " AND p.fk_adherent = m.rowid AND m.entity = ".$conf->entity;
$this->where.= " AND p.fk_adherent = m.rowid AND m.entity IN (".getEntity('adherent', 1).")";
//if (!$user->rights->societe->client->voir && !$user->societe_id) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
if($this->memberid)
{

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2015 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
@ -90,7 +90,7 @@ class Cotisation extends CommonObject
}
else
{
$this->error=$this->db->error();
$this->error=$this->db->lasterror();
return -1;
}
}
@ -140,7 +140,7 @@ class Cotisation extends CommonObject
}
else
{
$this->error=$this->db->error();
$this->error=$this->db->lasterror();
return -1;
}
}
@ -181,7 +181,7 @@ class Cotisation extends CommonObject
else
{
$this->db->rollback();
$this->error=$this->db->error();
$this->error=$this->db->lasterror();
return -1;
}
}
@ -217,7 +217,7 @@ class Cotisation extends CommonObject
$result=$member->fetch($this->fk_adherent);
$result=$member->update_end_date($user);
if ($accountline->rowid > 0) // If we found bank account line (this means this->fk_bank defined)
if ($accountline->id > 0) // If we found bank account line (this means this->fk_bank defined)
{
$result=$accountline->delete($user); // Return false if refused because line is conciliated
if ($result > 0)
@ -254,9 +254,9 @@ class Cotisation extends CommonObject
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @return string Chaine avec URL
*/
function getNomUrl($withpicto=0)
@ -264,16 +264,16 @@ class Cotisation extends CommonObject
global $langs;
$result='';
$label=$langs->trans("ShowSubscription").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/fiche_subscription.php?rowid='.$this->id.'">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/adherents/fiche_subscription.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='payment';
$label=$langs->trans("ShowSubscription");
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.$this->ref.$lienfin;
$result.=$link.$this->ref.$linkend;
return $result;
}

View File

@ -32,6 +32,12 @@ $langs->load("members");
$filter=$_GET["filter"];
$statut=isset($_GET["statut"])?$_GET["statut"]:1;
$search_ref=GETPOST('search_ref');
$search_lastname=GETPOST('search_lastname');
$search_login=GETPOST('search_login');
$search_note=GETPOST('search_note');
$search_account=GETPOST('search_account','int');
$search_amount=GETPOST('search_amount','int');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@ -43,7 +49,6 @@ $pagenext = $page + 1;
if (! $sortorder) { $sortorder="DESC"; }
if (! $sortfield) { $sortfield="c.dateadh"; }
$msg='';
$date_select=isset($_GET["date_select"])?$_GET["date_select"]:$_POST["date_select"];
// Security check
@ -54,14 +59,27 @@ $result=restrictedArea($user,'adherent','','','cotisation');
* Actions
*/
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$search="";
$search_ref="";
$search_lastname="";
$search_firstname="";
$search_login="";
$search_note="";
$search_amount="";
$search_account="";
}
/*
* View
*/
$form=new Form($db);
llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros');
if ($msg) print $msg.'<br>';
// List of subscriptions
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe,";
@ -77,6 +95,31 @@ if (isset($date_select) && $date_select != '')
{
$sql.= " AND c.dateadh LIKE '".$date_select."%'";
}
if ($search_ref)
{
if (is_numeric($search_ref)) $sql.= " AND (c.rowid = ".$db->escape($search_ref).")";
else $sql.=" AND 1 = 2"; // Always wrong
}
if ($search_lastname)
{
$sql.= " AND (d.firstname LIKE '%".$db->escape($search_lastname)."%' OR d.lastname LIKE '%".$db->escape($search_lastname)."%' OR d.societe LIKE '%".$db->escape($search_lastname)."%')";
}
if ($search_login)
{
$sql.= " AND d.login LIKE '%".$db->escape($search_login)."%'";
}
if ($search_note)
{
$sql.= " AND c.note LIKE '%".$db->escape($search_note)."%'";
}
if ($search_account > 0)
{
$sql.= " AND b.fk_account = ".$search_account;
}
if ($search_amount)
{
$sql.=" AND c.cotisation = ".$db->escape($search_amount);
}
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit+1, $offset);
@ -90,10 +133,23 @@ if ($result)
if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')';
$param="";
$param.="&amp;statut=$statut&amp;date_select=$date_select";
$param.="&statut=$statut&date_select=$date_select";
if ($search_lastname) $param.="&search_lastname=".$search_lastname;
if ($search_login) $param.="&search_login=".$search_login;
if ($search_acount) $param.="&search_account=".$search_account;
if ($search_amount) $param.="&search_amount=".$search_amount;
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);
if ($sall)
{
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
}
$param="";
$param.="&statut=$statut&date_select=$date_select";
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].($param?'?'.$param:'').'">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@ -107,9 +163,47 @@ if ($result)
}
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"c.dateadh",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"c.datef",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"c.cotisation",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"c.cotisation",$param,"",'colspan="2" align="right"',$sortfield,$sortorder);
print "</tr>\n";
// Line for filters fields
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_ref" value="'.$search_ref.'" size="4"></td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_lastname" value="'.$search_lastname.'" size="12"></td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_login" value="'.$search_login.'" size="7"></td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_note" value="'.$search_note.'" size="7"></td>';
if (! empty($conf->banque->enabled))
{
print '<td class="liste_titre">';
print $form->select_comptes($search_account, 'search_account', 0, '', 1);
print '</td>';
}
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td align="right" class="liste_titre">';
print '<input class="flat" type="text" name="search_amount" value="'.$search_amount.'" size="4">';
print '</td><td align="right" class="liste_titre" width="60px">';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print ' ';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
print "</tr>\n";
// Static objects
$cotisation=new Cotisation($db);
$adherent=new Adherent($db);
@ -133,11 +227,6 @@ if ($result)
$var=!$var;
if ($allowinsertbankafter && ! $objp->fk_account && ! empty($conf->banque->enabled) && $objp->cotisation)
{
print "<form method=\"post\" action=\"cotisations.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
}
print "<tr ".$bc[$var].">";
// Ref
@ -167,19 +256,6 @@ if ($result)
else
{
print "<td>";
if ($allowinsertbankafter && $objp->cotisation)
{
print '<input type="hidden" name="action" value="2bank">';
print '<input type="hidden" name="rowid" value="'.$objp->crowid.'">';
$form->select_comptes('','accountid',0,'',1);
print '<br>';
$form->select_types_paiements('','paymenttypeid');
print '<input name="num_chq" type="text" class="flat" size="5">';
}
else
{
print '&nbsp;';
}
print "</td>\n";
}
}
@ -191,13 +267,10 @@ if ($result)
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
// Price
print '<td align="right">'.price($objp->cotisation).'</td>';
print '<td align="right" colspan="2">'.price($objp->cotisation).'</td>';
print "</tr>";
if ($allowinsertbankafter && ! $objp->fk_account && ! empty($conf->banque->enabled) && $objp->cotisation)
{
print "</form>\n";
}
$i++;
}
@ -214,13 +287,11 @@ if ($result)
}
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print "<td align=\"right\">".price($total)."</td>\n";
print '<td align="right" colspan="2">'.price($total)."</td>\n";
print "</tr>\n";
print "</table>";
print "<br>\n";
print '</form>';
}
else
{
@ -228,6 +299,5 @@ else
}
$db->close();
llxFooter();
$db->close();

View File

@ -60,7 +60,6 @@ if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name";
$upload_dir = $conf->adherent->dir_output . "/" . get_exdir($id,2,0,1) . '/' . $id;
$form = new Form($db);
$object=new Adherent($db);
$membert=new AdherentType($db);
@ -70,6 +69,9 @@ if ($result < 0)
dol_print_error($db);
exit;
}
$upload_dir = $conf->adherent->dir_output . "/" . get_exdir($object->id,2,0,1,$object,'member') . '/' . dol_sanitizeFileName($object->ref);
/*
* Actions
*/

View File

@ -99,7 +99,7 @@ if ($catid > 0) $sql.= " AND cm.fk_categorie = ".$db->escape($catid);
if ($catid == -2) $sql.= " AND cm.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cm.fk_categorie = ".$db->escape($search_categ);
if ($search_categ == -2) $sql.= " AND cm.fk_categorie IS NULL";
$sql.= " AND d.entity = ".$conf->entity;
$sql.= " AND d.entity IN (".getEntity('adherent', 1).")";
if ($sall)
{
// For natural search
@ -110,7 +110,7 @@ if ($sall)
if (is_numeric($sall)) $sql.= "d.rowid = ".$sall." OR ";
$sql.=" d.firstname LIKE '%".$db->escape($sall)."%' OR d.lastname LIKE '%".$db->escape($sall)."%' OR d.societe LIKE '%".$db->escape($sall)."%'";
$sql.=" OR d.email LIKE '%".$db->escape($sall)."%' OR d.login LIKE '%".$db->escape($sall)."%' OR d.address LIKE '%".$db->escape($sall)."%'";
$sql.=" OR d.town LIKE '%".$db->escape($sall)."%' OR d.note LIKE '%".$db->escape($sall)."%')";
$sql.=" OR d.town LIKE '%".$db->escape($sall)."%' OR d.note_public LIKE '%".$db->escape($sall)."%' OR d.note_private LIKE '%".$db->escape($sall)."%')";
}
}
if ($type > 0)
@ -233,7 +233,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
print "</tr>\n";
// Lignes des champs de filtre
// Line for filters fields
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="left">';
@ -264,7 +264,6 @@ if ($resql)
print '</td>';
print "</tr>\n";
print '</form>';
$var=True;
while ($i < $num && $i < $conf->liste_limit)
@ -366,6 +365,7 @@ if ($resql)
}
print "</table>\n";
print '</form>';
if ($num > $conf->liste_limit)
{

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* 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
@ -19,7 +20,7 @@
/**
* \file htdocs/adherents/note.php
* \ingroup member
* \brief Tabe for note of a member
* \brief Tab for note of a member
*/
require '../main.inc.php';
@ -45,26 +46,13 @@ if ($result > 0)
$result=$adht->fetch($object->typeid);
}
$permissionnote=$user->rights->adherent->creer; // Used by the include of actions_setnotes.inc.php
/*
* Actions
*/
if ($action == 'update' && $user->rights->adherent->creer && ! $_POST["cancel"])
{
$db->begin();
$res=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($res < 0)
{
setEventMessage($object->error, 'errors');
$db->rollback();
}
else
{
$db->commit();
}
}
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
@ -82,7 +70,7 @@ if ($id)
dol_fiche_head($head, 'note', $langs->trans("Member"), 0, 'user');
print "<form method=\"post\" action=\"note.php\">";
print "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">';
@ -129,49 +117,16 @@ if ($id)
// Status
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$object->getLibStatut(4).'</td></tr>';
// Note
print '<tr><td valign="top">'.$langs->trans("Note").'</td>';
print '<td valign="top" colspan="3">';
if ($action == 'edit' && $user->rights->adherent->creer)
{
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
print "<input type=\"hidden\" name=\"id\" value=\"".$object->id."\">";
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('note',$object->note,'',280,'dolibarr_notes','',true,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,80);
$doleditor->Create();
}
else
{
print nl2br($object->note);
}
print "</td></tr>";
if ($action == 'edit')
{
print '<tr><td colspan="4" align="center">';
print '<input type="submit" class="button" name="update" value="'.$langs->trans("Save").'">';
print '&nbsp; &nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td></tr>';
}
print "</table>";
print "</form>\n";
print '<br>';
/*
* Actions
*/
print '</div>';
print '<div class="tabsAction">';
$colwidth='20';
$permission = $user->rights->adherent->creer; // Used by the include of notes.tpl.php
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
if ($user->rights->adherent->creer && $action != 'edit')
{
print '<div class="inline-block divButAction"><a class="butAction" href="note.php?id='.$object->id.'&amp;action=edit">'.$langs->trans('Modify')."</a></div>";
}
print "</div>";
dol_fiche_end();
}

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@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
@ -26,6 +27,7 @@
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
@ -59,7 +61,7 @@ $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('adherent_type');
if (GETPOST('button_removefilter'))
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$search_lastname="";
$search_login="";
@ -79,21 +81,21 @@ if ($action == 'add' && $user->rights->adherent->configurer)
{
if ($_POST["button"] != $langs->trans("Cancel"))
{
$adht = new AdherentType($db);
$object = new AdherentType($db);
$adht->libelle = trim($_POST["libelle"]);
$adht->cotisation = trim($_POST["cotisation"]);
$adht->note = trim($_POST["comment"]);
$adht->mail_valid = trim($_POST["mail_valid"]);
$adht->vote = trim($_POST["vote"]);
$object->libelle = trim($_POST["libelle"]);
$object->cotisation = trim($_POST["cotisation"]);
$object->note = trim($_POST["comment"]);
$object->mail_valid = trim($_POST["mail_valid"]);
$object->vote = trim($_POST["vote"]);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$adht);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if ($ret < 0) $error++;
if ($adht->libelle)
if ($object->libelle)
{
$id=$adht->create($user);
$id=$object->create($user);
if ($id > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
@ -101,7 +103,7 @@ if ($action == 'add' && $user->rights->adherent->configurer)
}
else
{
$mesg=$adht->error;
$mesg=$object->error;
$action = 'create';
}
}
@ -117,19 +119,19 @@ if ($action == 'update' && $user->rights->adherent->configurer)
{
if ($_POST["button"] != $langs->trans("Cancel"))
{
$adht = new AdherentType($db);
$adht->id = $_POST["rowid"];
$adht->libelle = trim($_POST["libelle"]);
$adht->cotisation = trim($_POST["cotisation"]);
$adht->note = trim($_POST["comment"]);
$adht->mail_valid = trim($_POST["mail_valid"]);
$adht->vote = trim($_POST["vote"]);
$object = new AdherentType($db);
$object->id = $_POST["rowid"];
$object->libelle = trim($_POST["libelle"]);
$object->cotisation = trim($_POST["cotisation"]);
$object->note = trim($_POST["comment"]);
$object->mail_valid = trim($_POST["mail_valid"]);
$object->vote = trim($_POST["vote"]);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$adht);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if ($ret < 0) $error++;
$adht->update($user);
$object->update($user);
header("Location: ".$_SERVER["PHP_SELF"]."?rowid=".$_POST["rowid"]);
exit;
@ -138,8 +140,8 @@ if ($action == 'update' && $user->rights->adherent->configurer)
if ($action == 'delete' && $user->rights->adherent->configurer)
{
$adht = new AdherentType($db);
$adht->delete($rowid);
$object = new AdherentType($db);
$object->delete($rowid);
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
@ -161,8 +163,7 @@ llxHeader('',$langs->trans("MembersTypeSetup"),'EN:Module_Foundations|FR:Module_
$form=new Form($db);
// Liste of members type
// List of members type
if (! $rowid && $action != 'create' && $action != 'edit')
{
@ -212,8 +213,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
/*
* Barre d'actions
*
* Hotbar
*/
print '<div class="tabsAction">';
@ -230,19 +230,23 @@ if (! $rowid && $action != 'create' && $action != 'edit')
/* ************************************************************************** */
/* */
/* Creation d'un type adherent */
/* Creation mode */
/* */
/* ************************************************************************** */
if ($action == 'create')
{
$adht = new AdherentType($db);
$object = new AdherentType($db);
print_fiche_titre($langs->trans("NewMemberType"));
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">';
dol_fiche_head('');
print '<table class="border" width="100%">';
print '<tbody>';
print '<input type="hidden" name="action" value="add">';
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40"></td></tr>';
@ -260,7 +264,7 @@ if ($action == 'create')
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('mail_valid',$adht->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,90);
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,90);
$doleditor->Create();
print '</td></tr>';
@ -269,40 +273,39 @@ if ($action == 'create')
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
print $adht->showOptionals($extrafields,'edit');
print $object->showOptionals($extrafields,'edit');
}
print '<tbody>';
print "</table>\n";
dol_fiche_end();
print '<br>';
print '<center><input type="submit" name="button" class="button" value="'.$langs->trans("Add").'"> &nbsp; &nbsp; ';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';
print '<div class="center">';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Add").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'">';
print '</div>';
print "</form>\n";
}
/* ************************************************************************** */
/* */
/* Edition de la fiche */
/* View mode */
/* */
/* ************************************************************************** */
if ($rowid > 0)
{
if ($action != 'edit')
{
$adht = new AdherentType($db);
$adht->fetch($rowid);
$adht->fetch_optionals($rowid,$extralabels);
$object = new AdherentType($db);
$object->fetch($rowid);
$object->fetch_optionals($rowid,$extralabels);
$h=0;
$head[$h][0] = $_SERVER["PHP_SELF"].'?rowid='.$adht->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
$head = member_type_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/type.php">'.$langs->trans("BackToList").'</a>';
@ -310,25 +313,25 @@ if ($rowid > 0)
// Ref
print '<tr><td width="15%">'.$langs->trans("Ref").'</td>';
print '<td>';
print $form->showrefnav($adht, 'rowid', $linkback);
print $form->showrefnav($object, 'rowid', $linkback);
print '</td></tr>';
// Label
print '<tr><td width="15%">'.$langs->trans("Label").'</td><td>'.$adht->libelle.'</td></tr>';
print '<tr><td width="15%">'.$langs->trans("Label").'</td><td>'.$object->libelle.'</td></tr>';
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
print yn($adht->cotisation);
print yn($object->cotisation);
print '</tr>';
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
print yn($adht->vote);
print yn($object->vote);
print '</tr>';
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
print nl2br($adht->note)."</td></tr>";
print nl2br($object->note)."</td></tr>";
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
print nl2br($adht->mail_valid)."</td></tr>";
print nl2br($object->mail_valid)."</td></tr>";
// Other attributes
$parameters=array();
@ -336,31 +339,30 @@ if ($rowid > 0)
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
// View extrafields
print $adht->showOptionals($extrafields);
print $object->showOptionals($extrafields);
}
print '</table>';
print '</div>';
/*
* Barre d'actions
*
* Hotbar
*/
print '<div class="tabsAction">';
// Edit
if ($user->rights->adherent->configurer)
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&amp;rowid='.$adht->id.'">'.$langs->trans("Modify").'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&amp;rowid='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
}
// Add
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&typeid='.$adht->id.'">'.$langs->trans("AddMember").'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&typeid='.$object->id.'">'.$langs->trans("AddMember").'</a></div>';
// Delete
if ($user->rights->adherent->configurer)
{
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$adht->id.'">'.$langs->trans("DeleteType").'</a></div>';
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$object->id.'">'.$langs->trans("DeleteType").'</a></div>';
}
print "</div>";
@ -379,12 +381,12 @@ if ($rowid > 0)
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
$sql.= " WHERE d.fk_adherent_type = t.rowid ";
$sql.= " AND d.entity IN (".getEntity().")";
$sql.= " AND t.rowid = ".$adht->id;
$sql.= " AND t.rowid = ".$object->id;
if ($sall)
{
$sql.= " AND (d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
$sql.= " OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.address LIKE '%".$sall."%'";
$sql.= " OR d.town LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
$sql.= " OR d.town LIKE '%".$sall."%' OR d.note_public LIKE '%".$sall."%' OR d.note_private LIKE '%".$sall."%')";
}
if ($status != '')
{
@ -477,7 +479,7 @@ if ($rowid > 0)
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Nature"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
@ -617,19 +619,20 @@ if ($rowid > 0)
}
/* ************************************************************************** */
/* */
/* Edition mode */
/* */
/* ************************************************************************** */
if ($action == 'edit')
{
$adht = new AdherentType($db);
$adht->id = $rowid;
$adht->fetch($rowid);
$adht->fetch_optionals($rowid,$extralabels);
$object = new AdherentType($db);
$object->id = $rowid;
$object->fetch($rowid);
$object->fetch_optionals($rowid,$extralabels);
$h=0;
$head[$h][0] = $_SERVER["PHP_SELF"].'?rowid='.$adht->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
$head = member_type_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
@ -639,24 +642,24 @@ if ($rowid > 0)
print '<input type="hidden" name="action" value="update">';
print '<table class="border" width="100%">';
print '<tr><td width="15%">'.$langs->trans("Ref").'</td><td>'.$adht->id.'</td></tr>';
print '<tr><td width="15%">'.$langs->trans("Ref").'</td><td>'.$object->id.'</td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40" value="'.$adht->libelle.'"></td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40" value="'.$object->libelle.'"></td></tr>';
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
print $form->selectyesno("cotisation",$adht->cotisation,1);
print $form->selectyesno("cotisation",$object->cotisation,1);
print '</td></tr>';
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
print $form->selectyesno("vote",$adht->vote,1);
print $form->selectyesno("vote",$object->vote,1);
print '</td></tr>';
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
print '<textarea name="comment" wrap="soft" cols="90" rows="3">'.$adht->note.'</textarea></td></tr>';
print '<textarea name="comment" wrap="soft" cols="90" rows="3">'.$object->note.'</textarea></td></tr>';
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('mail_valid',$adht->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,90);
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,90);
$doleditor->Create();
print "</td></tr>";
@ -666,13 +669,13 @@ if ($rowid > 0)
print '</table>';
//Extra field
// Extra field
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
print '<br><br><table class="border" width="100%">';
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($adht->array_options['options_'.$key])?$adht->array_options['options_'.$key]:''));
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:''));
print '<tr><td width="30%">'.$label.'</td><td>';
print $extrafields->showInputField($key,$value);
print "</td></tr>\n";
@ -680,8 +683,11 @@ if ($rowid > 0)
print '</table><br><br>';
}
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"> &nbsp; &nbsp;';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'">';
print '</div>';
print "</form>";
}

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -132,7 +133,7 @@ if (preg_match('/del_(.*)/',$action,$reg))
llxHeader();
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup');
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
print "<br>\n";
@ -177,16 +178,16 @@ if (! empty($triggers))
print '<td align="right" width="40">';
$key='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code'];
$value=$conf->global->$key;
print '<input '.$bc[$var].' type="checkbox" name="'.$key.'" value="1"'.((($action=='selectall'||$value) && $action!="selectnone")?' checked="checked"':'').'>';
print '<input '.$bc[$var].' type="checkbox" name="'.$key.'" value="1"'.((($action=='selectall'||$value) && $action!="selectnone")?' checked':'').'>';
print '</td></tr>'."\n";
}
}
}
print '</table>';
print '<br><center>';
print '<br><div class="center">';
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Save").'">';
print "</center>";
print "</div>";
print "</form>\n";

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -69,48 +70,14 @@ $textobject=$langs->transnoentitiesnoconv("Agenda");
llxHeader('',$langs->trans("AgendaSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup');
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
print "<br>\n";
$head=agenda_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("Agenda"), 0, 'action');
print $langs->trans("DefineHereComplementaryAttributes", $langs->transnoentitiesnoconv("Agenda")).'<br>'."\n";
print '<br>';
// Load attribute_label
$extrafields->fetch_name_optionals_label($elementtype);
print "<table summary=\"listofattributes\" class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("AttributeCode").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td align="center">'.$langs->trans("Unique").'</td>';
print '<td align="center">'.$langs->trans("Required").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
$var=True;
foreach($extrafields->attribute_type as $key => $value)
{
$var=!$var;
print "<tr ".$bc[$var].">";
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
print "<td>".$key."</td>\n";
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
print "&nbsp; <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
print "</tr>";
}
print "</table>";
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end();

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -123,7 +124,7 @@ $arrayofcss=array();
llxHeader('',$langs->trans("AgendaSetup"),'','',0,0,$arrayofjs,$arrayofcss);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup');
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
print '<br>';
$head=agenda_prepare_head();
@ -157,7 +158,7 @@ if ($conf->use_javascript_ajax)
}
else
{
if($conf->global->AGENDA_DISABLE_EXT == 0)
if (empty($conf->global->AGENDA_DISABLE_EXT))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?save=1&AGENDA_DISABLE_EXT=1">'.img_picto($langs->trans("Enabled"),'on').'</a>';
}
@ -220,9 +221,9 @@ while ($i <= $MAXAGENDA)
print '</table>';
print '<br>';
print '<center>';
print "<input type=\"submit\" id=\"save\" name=\"save\" class=\"button hideifnotset\" value=\"".$langs->trans("Save")."\">";
print "</center>";
print '<div class="center">';
print '<input type="submit" id="save" name="save" class="button hideifnotset" value="'.$langs->trans("Save").'">';
print '</div>';
print "</form>\n";

View File

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -88,7 +89,7 @@ $formactions=new FormActions($db);
llxHeader();
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup');
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
print "<br>\n";
@ -157,7 +158,7 @@ print '</td></tr>'."\n";
print '</table>';
print '<center><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></center>';
print '<div class="center"><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
print '</form>';

Some files were not shown because too many files have changed in this diff Show More